I'm using Word for making index cards for my studies and often I need to use the Equation feature. There's no hotkey for the subscripts and always opening the menu and chosing the desired one is pretty annoying. I found out the text representing the formulars on word and I just have to paste them to get the desired effect.

Example for X_y:

<mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math"><mml:msub><mml:mrow><mml:mi>X</mml:mi></mml:mrow><mml:mrow><mml:mi>y</mml:mi></mml:mrow></mml:msub></mml:math>

I've already tried the send feature on Autohotkey but this text has to be pasted via the Paste-Feature, so I tried this:

   temp := clipboardall
   clipboard := " <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:m="http://schemas.openxmlformats.org/officeDocument/2006/math"><mml:msub><mml:mrow></mml:mrow><mml:mrow></mml:mrow></mml:msub></mml:math> "
   sendinput, ^v
   clipboard := temp

However, now I'm getting an error:

Error at line 4,

The following variable name contains an illegal character:

The program will exit.

Obviously there's a problem with the quatation marks but how do I fix this?


Variable names in an expression are not enclosed in percent signs and

literal text must be quoted to distinguish it from variables.

To include an quote-character inside a literal string, specify two consecutive quotes:

clipboard := " <mml:math xmlns:mml=""http://www.w3.org/1998/Math/MathML"" xmlns:m=""http://schemas.openxmlformats.org/officeDocument/2006/math""><mml:msub><mml:mrow></mml:mrow><mml:mrow></mml:mrow></mml:msub></mml:math> "
  • Thank you! That does the trick – Lurkee Aug 8 at 14:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.