Skip to main content

Questions tagged [newcommand]

For questions related to defining own macros (using \newcommand and similar commands) in MathJax.

-4 votes
1 answer
240 views

Defining common sets for LaTeX mode

When one provides an answer that requires LaTeX, which is almost any answer, every time a set is used, it is necessary to fully type \mathbb{Z}. For example, $\...
Fran Aguayo's user avatar
0 votes
1 answer
135 views

Defining New Commands Renders As Empty Space

How do I define new commands at the top without creating multiple spaces before the first character? Also, is it just my browser, or is the rendering engine on StackExchange much slower than on ...
fweth's user avatar
  • 3,584
2 votes
0 answers
86 views

Custom TeX command doesn't render in search results

In my answer to Collecting Stickers! Evaluate occurrence of duplicates? I defined a custom TeX command \stir, which is rendered correctly on the page itself. When ...
joriki's user avatar
  • 239k
15 votes
2 answers
529 views

Is there some way to include some default text quickly in a post?

Question. Is there something which would make possible to quickly include predefined text in a new post I start writing. (For example, some bookmarklet for this - with a bookmarklet, one click could ...
Martin Sleziak's user avatar
1 vote
1 answer
1k views

Request for Hyperbolic $ \sech \,x $ inclusion in MathJax

MathJax does not work for hyperbolic $ \sech \,x$... Can it be now included? Thanks in advance. EDIT1: From user1729's comment suggestion, they work okay: $$\operatorname{sech}(x) $$ $$ \...
Narasimham's user avatar
  • 41.1k
5 votes
1 answer
120 views

How to define string remap in MathJax

For example if there is a lot of $R^2$ and $C^2$ in a post, how to map the plain text R2 to $R^2$ only in this post like: ...
jw_'s user avatar
  • 513
-7 votes
1 answer
107 views

The \newcommand question is farfetched, but $\LaTeX$ typing still takes ages

Everything is in the title. For now, I stop answering questions, it takes me too much time.
thomasb's user avatar
  • 570
15 votes
1 answer
529 views

Should titles be included in begingroup..endgroup (similarly as posts and comments)?

Not too long ago, a Stack Exchange software was changed in such way that macros defined in a post are valid only inside that post (similarly for comments). It was announced in an answer on this meta: ...
Martin Sleziak's user avatar
9 votes
2 answers
355 views

A possible bug regarding MathJax, previews, and the arctangent/tangent functions?

For context, I was making a tweak to GReyes' answer on this question, just cleaning up some formatting with the trigonometric functions. Specifically, I was turning ...
PrincessEev's user avatar
  • 45.8k
13 votes
2 answers
716 views

Can custom TeX/MathJax commands be defined by default for a site?

Recently SE.QuantumComputing started private beta (bit of a misnomer, as users can join freely), and we started a $\mathrm{\TeX}$-tutorial Meta discussion like the one found here at SE.Math. Since ...
Nat's user avatar
  • 1,504
22 votes
1 answer
532 views

Should I fix my 175 posts that use \newcommand without \begingroup?

A little over 4 years go I discovered that MathJax supports the $\LaTeX$ command \newcommand, and started to use it in my own answers and questions: this makes ...
MarnixKlooster ReinstateMonica's user avatar
2 votes
0 answers
110 views

\newcommand does and does not work in titles

\newcommand within a question has in my experience failed to work in titles. In this question when I hit "reload", I see the backslash and Th in red; i.e. it doesn't work. But when I click on "edit" ...
Michael Hardy's user avatar
45 votes
2 answers
2k views

When is it ok to use \newcommand and \DeclareMathOperator?

As some of you may know, you can use \newcommand and \DeclareMathOperator to create new TeX macros. For example, ...
Sera Gunn's user avatar
  • 27.5k
2 votes
0 answers
167 views

MathJax no longer respects `\newcommand` definitions from questions in other posts

In a question of mine I used e.g. $\newcommand{curl}{\operatorname{curl}}$ to define $\curl$ being rendered as $\newcommand{curl}...
Tobias Kienzler's user avatar
59 votes
5 answers
3k views

The scope of \newcommand is the entire page

LaTeX on this site supports \newcommand and \renewcommand. This is very nice, but I noticed that the scope of these definitions ...
Nate Eldredge's user avatar