the Arrhenius equation

In the Arrhenius equation the activation energy has a subscript but is itself a superscript:

The best way to write it in Arial font size 11 is to have the exponential factor raised by 2 points but the small ‘a’ in size 8 and raised by only 1 point. The first code below will write the above with just 3 clicks – one to call up the list of macros, one to select the Arrhenius equation and one to run it.

The second code below will write the natural log version of the Arrhenius equation:

Sub ArrheniusEquation()
Selection.TypeText Text:="k = Ae"
    Selection.Font.Superscript = wdToggle
    With Selection.Font
        .Name = "Arial"
        .Size = 11
        .Bold = False
        .Italic = False
        .Underline = wdUnderlineNone
        .UnderlineColor = wdColorAutomatic
        .StrikeThrough = False
        .DoubleStrikeThrough = False
        .Outline = False
        .Emboss = False
        .Shadow = False
        .Hidden = False
        .SmallCaps = False
        .AllCaps = False
        .Color = wdColorAutomatic
        .Engrave = False
        .Superscript = True
        .Subscript = False
        .Spacing = 0
        .Scaling = 100
        .Position = 2
        .Kerning = 0
        .Animation = wdAnimationNone
        .Ligatures = wdLigaturesNone
        .NumberSpacing = wdNumberSpacingDefault
        .NumberForm = wdNumberFormDefault
        .StylisticSet = wdStylisticSetDefault
        .ContextualAlternates = 0
    End With
    Selection.TypeText Text:=ChrW(8211) & "E"
    With Selection.Font
        .Name = "Arial"
        .Size = 11
        .Bold = False
        .Italic = False
        .Underline = wdUnderlineNone
        .UnderlineColor = wdColorAutomatic
        .StrikeThrough = False
        .DoubleStrikeThrough = False
        .Outline = False
        .Emboss = False
        .Shadow = False
        .Hidden = False
        .SmallCaps = False
        .AllCaps = False
        .Color = wdColorAutomatic
        .Engrave = False
        .Superscript = True
        .Subscript = False
        .Spacing = 0
        .Scaling = 100
        .Position = 1
        .Kerning = 0
        .Animation = wdAnimationNone
        .Ligatures = wdLigaturesNone
        .NumberSpacing = wdNumberSpacingDefault
        .NumberForm = wdNumberFormDefault
        .StylisticSet = wdStylisticSetDefault
        .ContextualAlternates = 0
    End With
    Selection.Font.Size = 8
    Selection.TypeText Text:="a"
    Selection.Font.Size = 11
    With Selection.Font
        .Name = "Arial"
        .Size = 11
        .Bold = False
        .Italic = False
        .Underline = wdUnderlineNone
        .UnderlineColor = wdColorAutomatic
        .StrikeThrough = False
        .DoubleStrikeThrough = False
        .Outline = False
        .Emboss = False
        .Shadow = False
        .Hidden = False
        .SmallCaps = False
        .AllCaps = False
        .Color = wdColorAutomatic
        .Engrave = False
        .Superscript = True
        .Subscript = False
        .Spacing = 0
        .Scaling = 100
        .Position = 2
        .Kerning = 0
        .Animation = wdAnimationNone
        .Ligatures = wdLigaturesNone
        .NumberSpacing = wdNumberSpacingDefault
        .NumberForm = wdNumberFormDefault
        .StylisticSet = wdStylisticSetDefault
        .ContextualAlternates = 0
    End With
    
      
    With Selection.Font
        .Name = "Arial"
        .Size = 16
        .Bold = False
        .Italic = False
        .Underline = wdUnderlineNone
        .UnderlineColor = wdColorAutomatic
        .StrikeThrough = False
        .DoubleStrikeThrough = False
        .Outline = False
        .Emboss = False
        .Shadow = False
        .Hidden = False
        .SmallCaps = False
        .AllCaps = False
        .Color = wdColorAutomatic
        .Engrave = False
        .Superscript = True
        .Subscript = False
        .Spacing = -1
        .Scaling = 100
        .Position = -1
        .Kerning = 0
        .Animation = wdAnimationNone
        .Ligatures = wdLigaturesNone
        .NumberSpacing = wdNumberSpacingDefault
        .NumberForm = wdNumberFormDefault
        .StylisticSet = wdStylisticSetDefault
        .ContextualAlternates = 0
    End With
    
    Selection.TypeText Text:=" /"
    Selection.Font.Superscript = wdToggle
    
    
    With Selection.Font
        .Name = "Arial"
        .Size = 11
        .Bold = False
        .Italic = False
        .Underline = wdUnderlineNone
        .UnderlineColor = wdColorAutomatic
        .StrikeThrough = False
        .DoubleStrikeThrough = False
        .Outline = False
        .Emboss = False
        .Shadow = False
        .Hidden = False
        .SmallCaps = False
        .AllCaps = False
        .Color = wdColorAutomatic
        .Engrave = False
        .Superscript = True
        .Subscript = False
        .Spacing = 0
        .Scaling = 100
        .Position = 2
        .Kerning = 0
        .Animation = wdAnimationNone
        .Ligatures = wdLigaturesNone
        .NumberSpacing = wdNumberSpacingDefault
        .NumberForm = wdNumberFormDefault
        .StylisticSet = wdStylisticSetDefault
        .ContextualAlternates = 0
    End With
    
    Selection.TypeText Text:=" RT"
    'Selection.Font.Superscript = wdToggle
    
    With Selection.Font
        .Name = "Arial"
        .Size = 11
        .Bold = False
        .Italic = False
        .Underline = wdUnderlineNone
        .UnderlineColor = wdColorAutomatic
        .StrikeThrough = False
        .DoubleStrikeThrough = False
        .Outline = False
        .Emboss = False
        .Shadow = False
        .Hidden = False
        .SmallCaps = False
        .AllCaps = False
        .Color = wdColorAutomatic
        .Engrave = False
        .Superscript = False
        .Subscript = False
        .Spacing = 0
        .Scaling = 100
        .Position = 0
        .Kerning = 0
        .Animation = wdAnimationNone
        .Ligatures = wdLigaturesNone
        .NumberSpacing = wdNumberSpacingDefault
        .NumberForm = wdNumberFormDefault
        .StylisticSet = wdStylisticSetDefault
        .ContextualAlternates = 0
    End With
    
    Selection.TypeText Text:=" "
End Sub
Sub ArrheniusEquationNaturalLog()

 Selection.TypeText Text:="ln k = " & ChrW(8211) & " "
    
    Selection.OMaths.Add Range:=Selection.Range

    Selection.OMaths(1).Functions.Add(Selection.Range, wdOMathFunctionFrac). _
        Frac.Type = wdOMathFracBar
    Selection.MoveLeft Unit:=wdCharacter, Count:=2, Extend:=wdMove
    Selection.Font.Name = "Arial"
    Selection.TypeText Text:="Exxza"
    
    Selection.MoveRight Unit:=wdCharacter, Count:=1, Extend:=wdMove
    Selection.Font.Name = "Arial"
    Selection.TypeText Text:="RT"
    
    Selection.MoveRight Unit:=wdCharacter, Count:=1, Extend:=wdMove
    
    For Each equation In ActiveDocument.OMaths
        equation.Range.Font.Name = "Arial"
    Next equation
    
    For Each equation In ActiveDocument.OMaths
        equation.Range.Font.Italic = False
   Next equation
    
  Selection.Find.ClearFormatting
    Selection.Find.Replacement.ClearFormatting
    With Selection.Find.Replacement.Font
        .Size = 8
        .Superscript = False
        .Subscript = False
        .Position = -1
    End With
    With Selection.Find
        .Text = "(xxz)(a)"
        .Replacement.Text = "\2"
        .Forward = True
        .Wrap = wdFindContinue
        .Format = True
        .MatchCase = False
        .MatchWholeWord = False
        .MatchAllWordForms = False
        .MatchSoundsLike = False
        .MatchWildcards = True
    End With
    Selection.Find.Execute Replace:=wdReplaceAll
    
    Selection.Font.Italic = wdToggle
    Selection.Font.Name = "Arial"
     Selection.TypeText Text:="+ ln A"
     
     For Each equation In ActiveDocument.OMaths
        equation.Range.Font.Name = "Arial"
    Next equation
End Sub

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: