Subscripts - relative size

S

Sluggo

Hi,

I give a lot of powerpoint presentations and I'm a chemist, which means
I use a *lot* of superscripts and subscripts. My audiences often
complain that they can read everything just fine but they have trouble
making out the subscripts. I don't have room to make the whole font
larger. Therefore, I'd like to be able to have my subscripts be
*larger* in proportion to the normal font. Is there some way to set the
sizes of superscripts and subscripts relative to the normal?

Thanks,
 
T

TAJ Simmons

Sluggo,

How are you adding your superscripts/subscripts.

I know one way is to enter the text....e.g. e=mc2, then just highlight the 2, right click the 2, then choose
"font"...then tick superscript....then you can also select the font size (so allowing you to make it bigger) and/or make
it bold.

Cheers
TAJ Simmons
microsoft powerpoint mvp

awesome - powerpoint backgrounds,
free powerpoint templates, tutorials, hints and tips etc
http://www.powerpointbackgrounds.com
 
S

Sluggo

TAJ,

Yeah I realize there are probably numerous ways to manually change each
character that I subscript to a different font size, but I've got to
write things like chemical formulas all the time, so what I'm after is a
global setting for the size of the subscript so that I can use the
CTRL-= keyboard shortcut and get, for example, a full-size subscript.

Any other ideas out there?
 
B

Bill Dilworth

You could either write or contract for a macro to be written that would
search the text for super/sub scripts and alter the font size. You would
need to run the macro manually, I would think, after the text has been
entered.

Obviously, this is a custom solution since PowerPoint is not able to do this
out of the box, which I suspect was your original question.

--
Bill Dilworth, Microsoft PPT MVP
===============
Please spend a few minutes checking vestprog2@
out www.pptfaq.com This link will yahoo.
answer most of our questions, before com
you think to ask them.

Change org to com to defuse anti-spam,
ant-virus, anti-nuisance misdirection.
..
..
 
S

Steve Rindsberg

You could either write or contract for a macro to be written that would
search the text for super/sub scripts and alter the font size. You would
need to run the macro manually, I would think, after the text has been
entered.

Probably so. If it's reasonable to assume that any sub/superscript will always
follow a normally formatted bit of text, it's not too hard to whompup.

This, in the right context, would do it:

' With a reference to the TextRange of the shape:
For x = 1 to .Runs.Count
If .Runs(x).Characters.Font.BaselineOffset <> 0 Then
' it's a sub/super; make it four points
' bigger than the text immediately prior:
.Runs(x).Characters.Font.Size = _
.Runs(x-1).Characters.Font.Size + 4
End if
Next x

--
Steve Rindsberg, PPT MVP
PPT FAQ: www.pptfaq.com
PPTools: www.pptools.com
================================================
Featured Presenter, PowerPoint Live 2004
October 10-13, San Diego, CA www.PowerPointLive.com
================================================
 
S

Sluggo

Steve,

I can pretty much make out what that code would do, and I'd love to try
it, but but I have no idea how ...

Thanks!
 
S

Steve Rindsberg

Steve,

I can pretty much make out what that code would do, and I'd love to try
it, but but I have no idea how ...

Here's a good place to start:

How do I USE this VBA stuff in PowerPoint?
http://www.rdpslides.com/pptfaq/FAQ00033.htm

Then try this:

' CODE BEGINS HERE ===============================

Sub BumpTheSubsAndSupers()

Dim oSl As Slide
Dim oSh As Shape
Dim x As Long
Dim dBumpBy As Double

dBumpBy = 4 ' number of points to bump sub/superscript by
' Check each slide
For Each oSl In ActivePresentation.Slides
' Check each shape on the slide
For Each oSh In oSl.Shapes
' Make sure it's got text
If oSh.HasTextFrame Then
If oSh.TextFrame.HasText Then
With oSh.TextFrame.TextRange
For x = 1 To .Runs.Count
If .Runs(x).Characters.Font.BaselineOffset <> 0 Then
' it's a sub/super; make it four points
' bigger than the text immediately prior:
.Runs(x).Characters.Font.Size = _
.Runs(x - 1).Characters.Font.Size + dBumpBy
End If ' it's a sub/superscript
Next x
End With ' textframe.textrange
End If ' .HasText
End If ' .HasTextFrame
Next oSh '
Next oSl

End Sub
' CODE ENDS HERE =================================


--
Steve Rindsberg, PPT MVP
PPT FAQ: www.pptfaq.com
PPTools: www.pptools.com
================================================
Featured Presenter, PowerPoint Live 2004
October 10-13, San Diego, CA www.PowerPointLive.com
================================================
 
S

Sluggo

Steve,

I tried it and it works nicely. Thanks for the code and for pointing me
in the direction of a bit of text that I could read that would teach me
how to use it. I found I could multiply the surrounding font size by a
factor rather than just adding some fixed number too.

Now, one final request, how would I modify the code so that the macro
only operates on something that I have *highlighted* ?

Thanks! This really is educational.
 
S

Steve Rindsberg

Steve,

I tried it and it works nicely. Thanks for the code and for pointing me
in the direction of a bit of text that I could read that would teach me
how to use it. I found I could multiply the surrounding font size by a
factor rather than just adding some fixed number too.

Now, one final request, how would I modify the code so that the macro
only operates on something that I have *highlighted* ?


Try this. Off top of head, but I think it should work

Sub SelectedTextOnly()

' Same Dim stuff as before

With ActiveWindow.Selection.TextRange
For x = 1 To .Runs.Count
If .Runs(x).Characters.Font.BaselineOffset <> 0 Then
' it's a sub/super; make it four points
' bigger than the text immediately prior:
.Runs(x).Characters.Font.Size = _
.Runs(x - 1).Characters.Font.Size + dBumpBy
End If ' it's a sub/superscript
Next x
End With

End Sub


--
Steve Rindsberg, PPT MVP
PPT FAQ: www.pptfaq.com
PPTools: www.pptools.com
================================================
Featured Presenter, PowerPoint Live 2004
October 10-13, San Diego, CA www.PowerPointLive.com
================================================
 
S

Sluggo

Steve:

Thanks so much, it's working really nicely for me now. So great of you
to take the time to help. Probably you can write these codes in your
sleep, and I'm sure I could teach myself to do it, but it would take
some time to learn all the syntax.

Now one thing ... how can I make it so that I can use this macro in all
my presentations without having to "install" it in each one individually?

Thanks again,
 
S

Sluggo

Oh, and it would be sooooo cool if I could assign a key sequence like
"Ctrl-Alt-S" to this macro or any other macros I end up with ...
 
S

Steve Rindsberg

Thanks so much, it's working really nicely for me now. So great of you
to take the time to help.

Great! Thanks for letting me know.
Probably you can write these codes in your
sleep, and I'm sure I could teach myself to do it, but it would take
some time to learn all the syntax.

Writing this stuff in my sleep would have to qualify as a bad dream, wouldn't it? ;-)
Now one thing ... how can I make it so that I can use this macro in all
my presentations without having to "install" it in each one individually?

Here's where you get to do a little homework -- heh heh heh, we'll make a dreamer .. er
... coder out of you yet, Sluggo.

To make the code available to all presentations, you need to put it into an addin.
And re your other question, PPT doesn't enable us to assign shortcuts, but you can
create menus or a toolbar with buttons to do the job.

To learn more, start here and read the next couple of items after it:

Create an ADD-IN with TOOLBARS that run macros
http://www.rdpslides.com/pptfaq/FAQ00031.htm

Give it a shot and if it doesn't fly, post your code back here for tweakage.

Thanks again,

--
Steve Rindsberg, PPT MVP
PPT FAQ: www.pptfaq.com
PPTools: www.pptools.com
================================================
Featured Presenter, PowerPoint Live 2004
October 10-13, San Diego, CA www.PowerPointLive.com
================================================
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top