What is the syntax to use \newcommand
in a post?
I tried
\$\newcommand{\foo}{1+1}\$
But this leave a blank line.
Also, for severals \newcommand
\$\$
\newcomand{\foo}{1+1}
\newcomand{\bar}{2+2}
\$\$
also leaves blank lines in the post
What is the syntax to use \newcommand
in a post?
I tried
\$\newcommand{\foo}{1+1}\$
But this leave a blank line.
Also, for severals \newcommand
\$\$
\newcomand{\foo}{1+1}
\newcomand{\bar}{2+2}
\$\$
also leaves blank lines in the post
I usually use \newcommand
at the end of the first paragraph, which is usually introductory which does not contain much LaTeX. You can use several \newcommand
sequentially within a single $
environment and it works fine.$\newcommand{\example}{\mathsf{For\space example\space as\space in\space this\space post}}$
$$\example$$
\newcommand
.
$\endgroup$
Beware the side-effects of using \newcommand
in a post or in chat. As MathJax is currently implemented, it affects all the subsequent posts on the page; e.g.
$$
\example
$$
This might make sort dependent rendering of answers.
edit
button is not clickable for me. Is there another way to look at the internal of your post? I have the same problem with Asaf post, but there I could click on edited 1 hout ago
.
$\endgroup$
\example
.
$\endgroup$
\newcommand
should behave correctly again, and be particular to a specific post, if I'm not mistaken.
$\endgroup$
Mar 27, 2019 at 13:15