4
$\begingroup$

I have noticed that, if I type \$100%\times x\$, I get $100%\times x$ and not $100\%\times x$.

Does % mean to ignore the following text or something like that?

I didn't find an explanation for the action of % in the MathJax Tutorial.

$\endgroup$
  • 1
    $\begingroup$ Note that as with the dollar sign and certain other symbols that have special meaning in MathJax or $\LaTeX$, the literal symbol is most easily produced by "escaping" it, that is prefixing it with a backslash. $\%$ appears as $\%$. $\endgroup$ – hardmath Aug 9 at 21:36
4
$\begingroup$

A % in this context will denote a comment. Similar to HTTP which marks comments using <!-- a comment can go here --> or several programming languages which use slashes such as //a comment can go here or /*a very long comment spanning several lines can go here*/, the percent sign can be used in LaTeX and related typesetting languages such as MathJax to denote that what follows on the same line should not be rendered or executed. Comments can be helpful to help organize or explain certain code to yourself or others who come behind to read the source.

See this related question from tex.stackexchange.com.

Note that what follows on the same line is what is ignored up until an actual newline character, even in the event that you include \\ which would otherwise be interpreted as beginning a new line.

For example

$$a%b c d \\ e f g h i j\\k l m$$

will render as $$a%b c d \\ e f g h i j\\k l m$$

$\endgroup$
  • $\begingroup$ Thank you (+1). I understand the concept; I just didn't realize that % is the character to denote a comment $\endgroup$ – J. W. Tanner Aug 7 at 13:32
  • $\begingroup$ I don't understand why they allow it here. $\endgroup$ – Roddy MacPhee Aug 7 at 17:26
  • $\begingroup$ @RoddyMacPhee MathJax is used by more than just stackexchange. Are you saying you would rather have a custom version of MathJax that disables that feature, making code harder to maintain, rather than just use the same version of MathJax that everywhere else uses for the sake of disabling a single feature? $\endgroup$ – JMoravitz Aug 7 at 17:29
  • $\begingroup$ I just don't see much use to the comments except swearing on a site based system. $\endgroup$ – Roddy MacPhee Aug 7 at 17:31
  • 3
    $\begingroup$ @RoddyMacPhee Why did you delete your post? $\endgroup$ – TheSimpliFire Aug 7 at 18:42
  • $\begingroup$ I left my last math forum due to being edited to reframe my wording. if they didn't like it I could be downvoted. question asker took it upon themselves to edit my answer. They are a frequent editor of my posts. My only reason for being on this site, at all, come down to social pressure not to give up on math. $\endgroup$ – Roddy MacPhee Aug 7 at 19:08
  • 3
    $\begingroup$ @RoddyMacPhee that may be deserving of its own meta post, but my opinion is that an edit can (and should) be suggested whenever it actively improves the readability (e.g. formatting, typesetting, grammar,...) while not causing harm or conflicting with the original author's intent. Such an edit should not be taken as an insult and should be taken graciously by the author. If the author disagrees with the edit, they may choose to roll it back as they see fit. $\endgroup$ – JMoravitz Aug 7 at 19:12
4
$\begingroup$

It's the symbol for a comment. It's used in VerbTeX LaTeX editor, that's how I know. it can be escaped, put a slash before it like a command $\%$. Just like any other character normally used for control $$\%$$

$\endgroup$
  • $\begingroup$ That makes sense. Thank you. +1 $\endgroup$ – J. W. Tanner Aug 6 at 14:23
  • $\begingroup$ @The, I thought J.W. made some improvements by editing. I'm not sure why you rolled back. $\endgroup$ – Gerry Myerson Aug 7 at 9:26
  • $\begingroup$ @GerryMyerson I overlooked the fact that J.W. provided the actual code in the edit, so I thought there wasn't much gained from it - now added. $\endgroup$ – TheSimpliFire Aug 7 at 9:29

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .