gospelvasup.blogg.se

How to use subscript and superscript in word
How to use subscript and superscript in word












how to use subscript and superscript in word

how to use subscript and superscript in word

you need to define the length for each oneĮxamples: let attStr1 = NSMutableAttributedString().characterSubscriptAndSuperscript( you define the length in the length array Range:NSRange(location:scriptedCharaterLocation, NSForegroundColorAttributeName:UIColor.black],

how to use subscript and superscript in word

NSBaselineOffsetAttributeName:baseLineOffset, Now set attributes starting from the character aboveĪtAttributes([NSFontAttributeName:scriptFont, Get to location of the first character enumerated the array of first characters to subscriptįor (theLength,aCharacter) in characters.enumerated() enumerated the main text characters using a for loopįor (i,c) in () Let baseLineOffset = offSet * type.rawValue the enum is used here declaring the required offset Let attString = NSMutableAttributedString(string:string, attributes: ) Define Attributes of the text body, this part can be removed of the function You have to press the CTRL button, the SHIFT. The default keyboard shortcut for superscript is almost the same. You should press two buttons, which are the Ctrl button and the button. The English (US) keyboard is shown in the below picture. Let scriptFont = UIFont.boldSystemFont(ofSize: scriptFontSize) The default keyboard shortcut for inserting a subscript in Word is the CTRL button and the equal sign. In Word, highlight the numbers or letters you want to superscribe. Here you can find a tutorial using Word 2019 as an example. If you want to add subscripts and superscripts at the same level, then you can use Microsoft Equation. Sometimes you may need numbers and letters above the text line. Let stringFont = UIFont.boldSystemFont(ofSize: fontSize) With subscript, you can add numbers or letters below the regular text line, with superscript you can put them above the text line. Define the fonts you want to use and sizes Set The Paragraph aligmnet, you can ignore this part and delet off the function Let paraghraphStyle = NSMutableParagraphStyle() you can modify it by skipping the parts that are not essential to you extension NSMutableAttributedStringįunc characterSubscriptAndSuperscript(string:String,Īlignment:NSTextAlignment)-> NSMutableAttributedString

#HOW TO USE SUBSCRIPT AND SUPERSCRIPT IN WORD PDF#

I wrote the following extension or you can use it as a function, it is working well for me. Once the installation is complete, run the application and follow these simple steps to insert or edit subscripts and superscripts on your PDF document.














How to use subscript and superscript in word