Faq/Math/106

How do I use a keyword like in as a variable name?
is a keyword in Math, which is a set operation expecting two arguments on the both sides (before and after), so put in the formula as is, it shows you a question mark indicating missing argument.

When you need to put a name that is a keyword in Math, you have several options.

When you want to use it as a text
E.g., a comment inside a formula ... just put all your comment, including what would otherwise be keywords, into quotes:.

When you want to use it as a function name
Functions (e.g., sin) by default have non-italic font. Turning Math keywords into function names also easy and logical. E.g., you wanted a formula like : typed that way, it would give you. To get what you need, you use  keyword explicitly telling that what follows is a function name, and should not be treated otherwise:.

When you want to use it as a variable name
Variables by default have italic font. Using keywords as variables is most tricky: there's no syntax like quotes or a keyword telling that what follows is a variable. So below are workarounds with discussion:


 * 1) Use , like  . This would do the trick in the default configuration, when variables and functions differ only in italics. But (a) it is long, and (b) it will fail if you setup your formula fonts so that function names also use different font face: then italicized function name will still differ visually from variables. A variant of the same approach is  , as in   - but it seems to use the same font as variables, without need to specify   explicitly.
 * 2) Use , like  . The shortest of all workarounds; still has the same problem as #1: if you change font of text in your formula, this workaround will not produce correct result.
 * 3) Use explicit font definition, using  . Most verbose; allows you to match your customized font chosen for variables... but if you later decide to change formula fonts (e.g., using an extension allowing you to do it in all formulas at once), you will need to look through all your formulas with those workarounds and change that manually.
 * 4) Use   keyword, like in  . This takes the following separate elements and joins them - almost as if they are one word. Slightly longer than #2; but IMO, it's the best option, since it gives you the formatting of variables which you choose in the formula. Yes, still a workaround.