Hot answers tagged

8

Add a pair of brackets around the colon, and put type inside a \text command. Alternatively, you can use \colon which looks better, in my opinion: $ \begin{array}{l} s: \text{type}\\ s{:}\text{type} \\ s\colon \text{type} \end{array} $


7

The colon : is declared by LaTeX as a binary relation, which means it is separated from ordinary symbols by a thick mathematical space. The \colon command makes a punctuation symbol, so no space before it and a medium math space after it. However amsmath slightly changes colon to have some space before it and some more than a punctuation symbol after it. ...


4

The last is wrong, the middle one ${i_0}^p$ has some appeal as being logically closer to the mathematical meaning, however TeX is fundamentally a typesetting system not a semantic math markup, and the conventional setting would be to put the sub and superscript on the same base, to give a tighter horizontal spacing so $i_0^p (or in strictly correct latex ...


3

If you are going to use this for other things, may be the best would be to make a macro \newcommand*\type[1]{#1\mathord{:}\textnormal{type}} $\type{s}$


3

The physics LaTeX package also implements abs and norm: \documentclass{article} \usepackage{physics} \begin{document} \[ c = \abs{-c} \] \[ \vu{a} = \frac{\vb{a}}{\norm{\vb{a}}} \] \end{document}


3

No amsmath needed, using \left[...\right] and an array environment in between, just 'ordinary' math - content from LaTeX: \documentclass{article} \begin{document} $y = \left[\begin{array}{@{}c@{}} x_{1} \\ x_{2} \\ \vdots \\ x_{m} \end{array} \right]$ \end{document}


3

This is one of the reasons why I use mathenv rather than amsmath: More flexible equation arrays. This example is very much like egreg's, but shorter, and with the option that omitting the * gives you numbered equations: \documentclass{article} \usepackage{mathenv} \begin{document} \begin{eqnarray*}[r*{6}{>{{}}l<{{}}r}] e & = & x^5 & &...


3

Boring to type, but effective \documentclass{article} \usepackage{amsmath,array} \begin{document} \begin{equation*} \setlength{\arraycolsep}{0pt} \renewcommand{\arraystretch}{1.2} % like cases \begin{array}{ r >{{}}c<{{}} % equals r % degree 5 >{{}}c<{{}} % plus r % degree 4 >{{}}c<{{}} % plus r % degree 3 >{{}}c<{{}...


2

amsmath's alignat can also do this: \documentclass{article} \usepackage{amsmath} \begin{document} \begin{alignat}{7} e & ={} & x^5 & & & & & & & & & {}+{} & 1 \\ f & ={} & x^5 & {}+{} & x^4 & {}+{} & x^3 & {}+{} & x^2 & {}+{} &...


2

\documentclass{article} \usepackage{amsmath} \usepackage{array} \begin{document} \[ \begin{array}{llllll} x^2 & x^3 & x^4 & x^5 & x^6 & x^7 \\ f''(x)=2 & f'''(x)=6 & f''''(x)=24 & f'''''(x)=120 & f''''''(x)=720 & f'''''''(x)=5040 \end{array} \] \end{document}


2

Some suggestions: Use \mid to denote the conditioning operation Suppress the intercolumn whitespace between the two columns of the array environment Load the amsmath package and use \text instead of \mbox Consider using slightly-enlarged curly braces and outer round parentheses, using \bigl and \bigr. If you choose to do so, you should also use \bigm| ...


2

You can use aligned or alignedat{2}, and take into account or not the widths of the comments: \documentclass{article} \usepackage[showframe]{geometry} \usepackage{amsmath} \begin{document} \begin{equation} \begin{aligned} α& = \alpha₀ & & \text{\footnotesize(a first comment)} \\ & + \beta² (H-√{f/g}) & & \text{\...


2

Related to something I wrote recently, I would use ,\  in math mode, and just “text mode” when text is involved. I put “” because by text mode I don't mean \text. \newcommand*\mathwords{\textnormal} $\{ x \in A : \mathwords{first condition, second condition, third condition} \}$ $\{ x \in A : x > 0 ,\ x^2 \in B ,\ x^3 \notin C \}$ Something should be ...


2

To scale your picture you can just use key scale for tikzpicture environment. To draw half unite circle rather then \draw [shift={(0.,0.)}] plot[domain=-1.5707963267948966:1.5707963267948966,variable=\t]({1.*1.*cos(\t r)+0.*1.*sin(\t r)},{0.*1.*cos(\t r)+1.*1.*sin(\t r)}); You can simply add \draw (0,-1) arc [start angle=-90, end angle=90, radius=...


2

For larger-than-normal delimiters, you can use \left...\right: \documentclass{article} \usepackage{amsmath} \begin{document} \[ \left\{ \begin{tabular}{c} subfields $E$ \\ of $K$ \\ containing $F$ \end{tabular} \begin{array}{c} K \\ \vert \\ E \\ \vert \\ F \end{array} \right\} \quad \longleftrightarrow \quad \...


1

Still simpler with mathtools. I added a command for old style derivatives: \documentclass{article} \usepackage{fourier, erewhon} \usepackage{textcomp} \usepackage{geometry}% \usepackage{mathtools} \newcommand\osder[2]{#2^{\textsc{\scriptsize(\romannumeral #1)}}} \begin{document} \[ \begin{matrix*}[l] x^2 & x^3 & x^4 & x^5 & x^6 & x^...


1

In the 2nd invocation, I use roman numerals to denote higher-order derivatives, which is a common style I have seen. \documentclass{article} \usepackage{stackengine} \renewcommand\stackalignment{l} \renewcommand\stacktype{L} \setstackgap{L}{1.2\baselineskip} \stackMath \begin{document} \[ \stackunder{x^2}{f''(x)=2}\quad \stackunder{x^3}{f'''(x)=6}\quad \...


1

One can make a stack. \documentclass{article} \usepackage{stackengine} \begin{document} \[ \setstackgap{L}{1.2\baselineskip} y = \bracketVectorstack{x_1 x_2 \abovebaseline[-3pt]{\vdots} x_m} \] \end{document}


1

Here I use a tabstackengine approach, on the theory that it allows me to control vertical distances between items precisely. However, the 1.53 in the stackgap setting should, in theory, have been 1.5 exactly. I think the issue is related to how big the \left\{ is made, which in the default LaTeX font, is not purely scalable (see ADDENDUM). The \stackskip ...


1

For multi-rows, you can try this \documentclass{article} \usepackage{array}% \begin{document} \begin{tabular}{c c} $f^{(n)}(x)$ & $f^{(n)}(0)$ \\[1cm] $-2e^{-x^{x^{x}}}$ & 0\\[1cm] $2x&\frac{x}{2}\\[1cm] . . . \end{tabular} \end{document}



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