# Tag Info

128

There are many differences. The main one is in the fact that \mathrm{xyz} behaves like an ordinary letter, while \operatorname{xyz} behaves like function names such as \sin. Here's an illustration $\sin x + \sin(x+y) + a\sin z$ $\mathrm{sin} x + \mathrm{sin}(x+y) + a\mathrm{sin}z$ where it's clear that the second line is wrongly typeset. Even if your "...

102

As Pieter says in his comment, \DeclareMathOperator*{\argmin}{arg\,min} is indeed the correct LaTeX way to do that. This requires \usepackage{amsmath} (actually amsopn would be sufficient, it's automatically loaded by amsmath which is recommended for math typesetting anyway). Note: the * that follows \DeclareMathOperator sets the underscored option (the ...

87

There is a standard: it should be upright, not italicized. Read Typesetting mathematics for science and technology according to ISO 31/XI I suggest using the commath package to correctly typeset differentials.

87

\DeclareMathOperator is designed to create commands that should typeset operator names such as sin and lim. Some of these are already defined in base TeX or LaTeX so one writes 2\sin\theta instead of 2sin\theta giving correct spacing and font. If you need an operator of this type that is not predefined, then you create it with \DeclareMathOperator, ...

79

I've found an answer in a usenet post by Heiko Oberdiek and another by Donald Arseneau. Improved code thanks to shiznick. The issue is that \left and \right introduces an inner atom (see The TeXbook, chapter 18, section 4), which has different spacing rules than ordinary atoms, produced by ( and ) (and the other delimiters). To remove this spurious spacing,...

73

\DeclareMathOperator{\foo}{foo} and \DeclareMathOperator*{\hocolim}{hocolim} for sub- and superscripts in the limits position.

62

When is it better to use \operatorname (or its wrapper \DeclareMathOperator) instead of \mathop? The answer is easy: always, unless you know precisely what's the behavior of \mathop. First of all, one must of course recall that \operatorname and \DeclareMathOperator are provided by the amsopn package, which is automatically loaded by amsmath, but is also ...

55

You can use \substack: If this is desired in inline math you can use \limits to obtain the limits underneath the summation symbol: However this is not recommended as it may not look good depending on how much adjacent text there is as it will affect interline spacing. Code: \documentclass{article} \usepackage{amsmath} \begin{document} $\sum_{\... 50 You have been told how to get a curved L. But here's some more general advice, which also applies in this situation: In cases such as this, always create your own shortcut macro, say \newcommand{\Lagr}{\mathcal{L}} This way, if you ever decide that that curly L is not quite the one you like, it is easy to switch. Also, even before you knew the answer to ... 49 I'd say it really depends on the context. As Emre pointed out, there's an ISO standard; according to wikipedia, ISO 31-11 was superseded in 2009 by ISO 80000-2. The latter carries the title "Quantities and units -- Part 2: Mathematical signs and symbols to be used in the natural sciences and technology". As a mathematician I think: Why should I use the same ... 47 You should place the expression in the subscript, as shown below. Most LaTeX books explain this. \documentclass{article} \begin{document} Display mode: \[ \max_{1 \leq j \leq n}$ Inline mode: $\max_{1 \leq j \leq n}$, $\max\limits_{1 \leq j \leq n}$. \end{document} Note how I used \limits to force the subscript under the operator in inline mode (if ...

45

the xlop package does this sort of thing. It does warn that it uses "french conventions", but at least for multiplication it looks fine, to me. disclaimer: i last did multiplication sums in school in the 1950s... \documentclass{article} \usepackage{xlop} \begin{document} \opmul{384}{56}\qquad \end{document}

44

I assume, the replacements should be done in math mode only. Then the starting characters can be made active via a special value "8000 for \mathcode. The characters behave in text mode as usual, but they became special in math mode. The following example document provides parsers for the following shorthands: << : \ll (latexsym/amsmath) <> : \...

38

tl,dr: It's complicated, but be consistent. I believe the answers here tend to miss the point. While Emre mentions that there is an international norm regarding typesetting mathematics that is very explicit about this topic, Hendrik Vogt makes the right argument, but doesn't take it far enough. This question doesn't have an answer as simple as yes or no, ...

33

Operators such as \sum are not defined with \DeclareMathOperator that should be used (with or without a *) for “textual” operators. The definition of \sum is \DeclareMathSymbol{\sum}{\mathop}{largesymbols}{"50} that becomes, internally, \mathchardef\sum="1350 The macro \DeclareMathOperator uses \mathop, which has a strange property: if its argument ...

32

The package mathtools has implemented a general solution for that problem. It defines the command \DeclarePairedDelimiter that you can use as follows: \DeclarePairedDelimiter\parentheses{\lparen}{\rparen}. With this single declaration you have a new powerful command for several cases: \parentheses{x} just replaces $(x)$ \parentheses*{x} will do the right ...

31


30

Solved this for Inline mode by using $\underset{1 \leq j \leq n}{\max}$, however this approach requires the amsmath package.

29

Alternatively, if you are using any of the packages from the AMS (amsart.cls or amsmath.sty) then there is a command \DeclareMathOperator which does what it says on the tin! For example, \DeclareMathOperator{\Det}{Det} I think that it can handle variants, but I don't recall off the top of my head.

29

The scalerel package allows you to scale a symbol to the size (and vertical positioning) of another symbol. So in this case, I define \foo to scale \maltese to the size of \sum. Thus, it piggybacks its sizing off the well defined behavior of \sum. It wasn't clear to me if the questioner wanted to keep the maltese cross the same size in all operations. ...

28

The \sim symbol is classified as a relation symbol. By the rules of TeX, the combination Rel Ord (relation followed by an ordinary symbol) results in a thick space between them. The case of binary operations (Bin) is different: they are treated as binary operations only if preceded and followed by math atoms compatible with binary operations, for instance ...

28

\cdot is defined by \DeclareMathSymbol{\cdot}{\mathbin}{symbols}{"01} So you just need to put this in your preamble \DeclareMathSymbol{*}{\mathbin}{symbols}{"01}

27

In this instance a better approach would be to use mathtools's \mathclap, which provides a centred overlap in math mode. The centred overlap implies a zero-width box containing stuff that overlaps on the left and right: \documentclass{article} \usepackage{mathtools}% http://ctan.org/pkg/mathtools \begin{document} \begin{align*} A &= \sum_{n=-\infty}^...

27

The package cancel can draw a diagonal line. \documentclass[a4paper]{article} \usepackage{amsmath} \usepackage{cancel} \begin{document} $\cancel{\mathcal{R}}$ \end{document}

26


25

mathrm: It is like math mode (no spaces), but in upright mode. The font size isn't changed. \operatorname: The argument is written in upright mode but with some additional space before and behind. The following example shows the differences: \documentclass[]{article} \usepackage{amsmath} \begin{document} $x\operatorname{foo}y$ $x\mathrm{foo}y$ \end{...

25

\mathop is the most primitive command, declaring the class of a character or subformula to be a unary math operator like \sum, for instance. This has consequences for spacing, compared to binary operators declared with \mathbin or binary relations declared with \mathrel, for instance. Most math operators are written out as textual names. Some definitions ...

25

Here's a possibility. Only text and display style, I hope you don't need them in subscripts, superscripts or small fractions. \documentclass{article} \usepackage{amsmath,amssymb,graphicx} \makeatletter \newcommand*{\sumcirclearrowleft}{% \DOTSB \mathop{ \mathchoice {\rlap{\kern.25em\rotatebox[origin=c]{-90}{$\circlearrowleft$}}{\sum}} {\...

24

There are several ways to do it using different programming facilities of different packages. Here's what it looks like using the LaTeX2e kernel command \@for to map over a comma-separated list: \makeatletter \newcommand\MakeMathOperators[1]{% \@for\@ii:=#1\do{% \expandafter\DeclareMathOperator\@ii }% } \makeatother \MakeMathOperators{ \rep {Rep} ...

24

I prefer the following definition: \usepackage{amsmath} \DeclareMathOperator{\Tr}{Tr}

Only top voted, non community-wiki answers of a minimum length are eligible