[Solved] Superscript and Subscript Size

Discuss the word processor
Post Reply
kanuski
Posts: 10
Joined: Thu Sep 14, 2017 2:49 pm

[Solved] Superscript and Subscript Size

Post by kanuski »

Greetings. I would like to change the superscript and subscript to make them both larger. I can do this with find and replace but I would have to do hundreds of these because they all have different text. Is there a way to adjust this like I can adjust styles and formats?

EDIT: I mean I am typing regular text and use the subscript and superscript buttons to change the size and position of the text.
Last edited by robleyd on Mon Nov 27, 2023 11:23 pm, edited 3 times in total.
Reason: Add green tick
Apache OpenOffice 4.1.1
Windows 8.1
User avatar
Zizi64
Volunteer
Posts: 11505
Joined: Wed May 26, 2010 7:55 am
Location: Budapest, Hungary

Re: Subscript and Subscript Size

Post by Zizi64 »

superscript and subscript
Do you mean the UniCode superscript and subscript characters (A²³ B₀₁₂ C⁵), or do you mean the characters graphically shifted and reduced by the Office suite?

Do you mean the usage of the superscript and subscript characters in the Formula editor or in the normal Writer texts?


You can handle the properties of the custom superscript and subscript characters by the Characer styles feature:
Custom_SubScript_SuperScript.png
Custom_SubScript_SuperScript.png (12.34 KiB) Viewed 3515 times
Tibor Kovacs, Hungary; LO7.5.8/25.8.5.2 /Win7-10-11 x64Prof.
PortableApps: LO3.3.0-25.8.5.2;AOO4.1.14
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
JeJe
Volunteer
Posts: 3132
Joined: Wed Mar 09, 2016 2:40 pm

Re: Superscript and Subscript Size

Post by JeJe »

This extension allows you to search for superscript (Auto) and subscript (Auto). You could see if a find all with that is any better than the native find dialog's format/position options.

https://extensions.openoffice.org/en/pr ... -altsearch
Windows 10, Openoffice 4.1.11, LibreOffice 7.4.0.3 (x64)
JeJe
Volunteer
Posts: 3132
Joined: Wed Mar 09, 2016 2:40 pm

Re: Superscript and Subscript Size

Post by JeJe »

You may need a simple macro. I've slightly modifying ones from a previous similar thread.

To install: If you don't know anything about these, in OO go to

Tools menu/macros/organize Dialogs

Select "Modules" tab from the dialog that opens

Find MyMacros/Standard library/Module1 in the left side listbox

click "edit" and the ide opens

go to the bottom of the module past any existing text and copy and paste the code

Then Assign keyboard shortcuts or a toolbar button to the macros increaseSelFontsize/ReduceSelFontsize

Backup your work before using

The macros should increase or decrease by 1% the CharEscapementHeight of every superscript/subscript in the selected text

Code: Select all




'CharEscapement                   short                          0                                       Maybevoid              6  
'CharEscapementHeight  


sub ReduceSelFontsize
incrementSelFont(-1)
end sub


sub increaseSelFontsize
incrementSelFont(1)
end sub




sub incrementSelFont(increment)
dim sel,tc,en,p, oSectionEnum
on error goto hr
sel = thiscomponent.currentcontroller.selection.getbyindex(0)
tc = sel.text.createtextcursorbyrange(sel)
en = tc.createenumeration
do until en.hasmoreelements =false
p = en.nextelement
if p.supportsService("com.sun.star.text.Paragraph") Then

oSectionEnum = P.createEnumeration()
Do While oSectionEnum.hasMoreElements()
oSection = oSectionEnum.nextElement()
If oSection.TextPortionType = "Text" Then
 
 if osection.CharEscapement <>0 then
  osection.CharEscapementHeight =  osection.CharEscapementHeight +increment
  end if
End If
Loop

end if
loop
hr:
End Sub


Edit: correction to incrementSelFont(1)
if you change the 1 number you can change the percentage increase or decrease
Windows 10, Openoffice 4.1.11, LibreOffice 7.4.0.3 (x64)
kanuski
Posts: 10
Joined: Thu Sep 14, 2017 2:49 pm

Re: Superscript and Subscript Size

Post by kanuski »

Thank you all.
Apache OpenOffice 4.1.1
Windows 8.1
Post Reply