# Tag Info

## New answers tagged amsmath

5

There is no need for align here as a single equation will do: \documentclass{article} \usepackage{amsmath}% http://ctan.org/pkg/amsmath \begin{document} $$x(\alpha) = \lim_{x \to a^{+}} x(t) \qquad \text{and} \qquad x(\beta) = \lim_{x \to \beta^{-}} x(t).$$ \end{document} You may also be interested in this version: ...

4

If you're attempting to condition between whether or not the optional argument is empty, the following is a better approach: \documentclass{article} \usepackage{amsmath}% http://ctan.org/pkg/amsmath \makeatletter \def\ifemptyarg#1{% \if\relax\detokenize{#1}\relax % http://tex.stackexchange.com/q/308/5764 \expandafter\@firstoftwo \else ...

5

I believe that neutralizing \@getsmartref when \iffirstchoice@ is false can solve the problem. The command \text must build four copies of the same text, one of which will be eventually used. So, in order not to do the wrong thing, it introduces a conditional \iffirstchoice@ and patches \addtocounter so it does nothing when typesetting the final three boxes. ...

8

A tikz-cd attempt \documentclass{article} \usepackage{tikz-cd} \begin{document} \begin{tikzcd} \sigma\colon\hspace*{-4.5em} & F(\alpha) \arrow{r}{\sim} \arrow[dash]{d} & F'(\beta) \arrow[dash]{d} \\ \varphi\colon\hspace*{-4.5em} & F \arrow{r}{\sim} & F' \end{tikzcd} \end{document} Surely the code can be improved, I'm not a tikz expert ...

5

For such a simple construction you can use the good old CD environment: \documentclass{article} \usepackage{amsmath,amscd} \begin{document} $\begin{CD} \sigma\colon @. F(\alpha) @>\sim>> F'(\beta) \\ @. @| @| \\ \varphi\colon @. F @>\sim>> F' \end{CD}$ \end{document} However, it's better to switch to modern packages such as tikz-cd ...

6


2

Thanks to @Herbert I was able to tap into the amsmath package documentation and come up with a modified version of the \frac command definition. The documentation has the following: Bury the generalized fraction primitives \over, \atop, etc., because of their bizarre syntax, which is decidedly out of place in a LaTX document. ...

0

With a different alignment, you can also use this: \documentclass[11pt, a4paper]{article} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage{amsmath} \begin{document} \begin{align*} \mathcal{H} &= \mathcal{H}^{(0)} + \mathcal{H}^{(1)} &\mathcal{H}^{(0)}& = -\frac{\hbar^2}{2m}(\nabla_{1}^{2} + \nabla_{2}^{2}) - \frac {e^2} {r_1} - ...

5

From the comment to Werner's solution I understand, that you want even easier to obtain variant: \documentclass{article} \usepackage{amsmath} \begin{document} \mathcal{H} = \mathcal{H}^{(0)} + \mathcal{H}^{(1)} \qquad \begin{aligned} &\mathcal{H}^{(0)} = -\frac{\hbar^2}{2m}(\nabla_{1}^{2} + \nabla_{2}^{2}) - \frac{e^2}{r_1} - \frac{e^2}{r_2}\\ ... 3 I would personally prefer the alignment offered by a direct use of array: \documentclass{article} \usepackage{amsmath} \begin{document} \[ \begin{array}{@{}r@{\;}c@{\;}c@{\;}l@{}} f: & X & \rightarrow & Y, \\ & x & \mapsto & f(x). \end{array} \end{document} The first argument of array (i.e. ...

6

\begin{equation*} \begin{split} f: & X\rightarrow Y ,\\ & x\mapsto f(x). \end{split} \end{equation*}

0

The immediate cause of the error you're getting would appear to be the \\* snippet; I can't tell what it's for. LaTeX will also choke on \inX, \subseteqX, and \subseteqY; there needs to a be a gap between the control sequence and the subsequent material. The use of \item statements while not in a list environment (such as itemize or enumerate) is also going ...

1

Your code snippet says nothing about used packages, hence definition is commented. This is only a suggestion, but the general type of errors is: omitting space between macro name and next X or Y. Please observe also that f and $f$ are different objects. Probably also im should be as \sin, i.e. upright, with some spacing. \documentclass{article} ...

2

\genfrac refers to \over or \above which are primitives. But you can define an own \frac which uses \above: \documentclass[letterpaper]{article} \usepackage{amsmath,amssymb} \usepackage{xcolor} \newcommand\Frac[3][]{ #1 #2\color{red}\above 0.4pt \normalcolor #1#3} \begin{document} $\Frac{n+1}{n-1}$$\Frac[\displaystyle]{n+1}{n-1}$ \end{document}

4

Please always post complete documents, not just fragments. You can locally define \theequation to be your label, but you need to get into the right place first. \documentclass{IEEEtran} \makeatletter \newcommand\ztag[1]{% \def\@currentlabel{#1}% \gdef\tmp{% \addtocounter{equation}{-1}% \def\theequation{#1}}% ...

2

The last thing that amsmath (or mathtools) does is to set $...$ to be \begin{equation*}...\end{equation*}. Now thmtools patches equation* to work with thmmarks, but it also redefines $...$. So the simplest solution is to reassert the ams aliasing: \documentclass[a4paper,10pt]{scrartcl} \usepackage[utf8]{inputenc} \usepackage{mathtools} ...

1

Issue \makeatletter \renewcommand{\thetheorem}{\thesubsection.\arabic{theorem}}% Update counter printing \@addtoreset{theorem}{subsection}% Reset theorem counter with every new subsection \makeatother before starting the new \subsection from where you want to have the renumbering occur. \documentclass{article} \newtheorem{theorem}{Theorem}[section] ...

1

I don't think this is a good idea. I hope you don't want to go back to the first enumeration style. \documentclass{article} \usepackage{chngcntr} \begin{document} \newtheorem{theorem}{Theorem}[section] \newtheorem{lemma}[theorem]{Lemma} \newtheorem{corollary}[theorem]{Corollary} \section{First} \subsection{first} \begin{lemma} $1+1=2$. \end{lemma} ...

0

If you don't need continuous numbering of the last part, as in your example, probably a new newtheorem will be the simplest solution. \documentclass{article} \begin{document} \newtheorem{theorem}{Theorem}[section] \newtheorem{lemma}[theorem]{Lemma} \newtheorem{corollary}[theorem]{Corollary} \section{First} \subsection{first} \begin{theorem} 2+2=4. ...

4

Using the titlesec package should do it. Just try this code: \documentclass[12pt]{amsproc}% http://ctan.org/pkg/amsproc \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage{lmodern} \usepackage{titlesec} \usepackage[dotinlabels]{titletoc} \titleformat{\section}[block]{\bfseries\large\filcenter}{Section \thesection.}{0.4em}{} ...

5

You could update the way the section counter is formatted/printed. This is done by the macro \@seccntformat: \documentclass[12pt]{amsproc}% http://ctan.org/pkg/amsproc \makeatletter \def\@seccntformat#1{% Section~\protect\textup{\protect\@secnumfont \csname the#1\endcsname \protect\@secnumpunct }% } \makeatother \begin{document} ...

1

why not try something like this, "hiding" the width of the first line and putting the equals signs after the &, and, in the case of the multline components, within the scope of multline? the input: \documentclass{report} \usepackage{mathtools} \begin{document} \begin{align} \rlap{\framebox[0.8\linewidth]{\strut}}\quad \\ ...

5

I tried to look for other questions with the same problem and found none. So here's an answer: load cleveref last. From the documentation: The cleveref package is loaded in the usual way, by putting the line \usepackage{cleveref} in your document’s preamble. However, care must be taken when using cleveref in conjunction with other packages that ...

6

In order for the automatic resizing of delimiters to work, nath redefines a lot of TeX internals. amsmath also defines a lot of TeX internals. Neither nath nor amsmath take into consideration that some other package might redefine the internal macros, and hence the error. By default, \log is defined as follows: > \log=macro: ->\mathop {\operator@font ...

0

As you say in comments that you want all your mathematics bold for printing clarity then I suggest you switch to \mathversion{bold}. As the others have said, the three vectors are separate entities so should be written $$a$$, $$b$$, $$c$$ rather than $$a,b,c$$. Note if you introduce grouping {...} in mathematics you create entities that do not ...

1

The MnSymbol package provides a \udots macro, which does exactly what you want. When you're looking for some symbol, consult the Com­pre­hen­sive LaTeX Sym­bol List; you stand a good chance to find it in there. \documentclass{article} \usepackage{amsmath} \usepackage{MnSymbol} \begin{document} \begin{tabular}{ll} diagonal dots ($\text{slope} = -1$) ...

0

It depends on tools. If the package graphicx is acceptable, the solution may be as follows \documentclass{article} \usepackage[demo]{graphicx} \begin{document} $A\ddots B \scalebox{-1}[1]{\ddots} C$ \end{document}

0

How about using \iddots? It requires the mathdots package though. EDIT: There is a discussion on your problem here

5

I wouldn't use flalign* for this. Here's a way with tabularx, I show two alternative version (I like the second better). \documentclass{article} \usepackage{amsmath,tabularx,array} \usepackage{lipsum} % just for the example \begin{document} \lipsum*[2] \begin{flushleft} \begin{tabularx}{\textwidth}{@{}>{$}r<{{}$}@{}X@{}} \hat{x}_k = & (n\times ... 6 Inside different math environments, it is highly impossible to do that alignment. But in the same environment (align here) it is possible with some manual intervention. \documentclass[a4paper,11pt]{report} \usepackage{amsmath} \begin{document} \noindent Some text follows \begin{enumerate} \item Form2n+1sample points (also known as sigma ... 6 The package can't support typing | somewhere like in arrays. But we can emulate it: \documentclass{article} \usepackage{amsmath} \usepackage{gauss} % patch gauss macros for doing their work in `align' % and other amsmath environments; see % http://tex.stackexchange.com/questions/146532/ \usepackage{etoolbox} \makeatletter \patchcmd\g@matrix {\vbox\bgroup} ... 7 The gauss package directly uses \halign for building the matrix. This uses the current baselineskip, which, in align is enlarged. \documentclass{scrartcl} \usepackage{lmodern} \usepackage{amsmath} \usepackage{gauss} \usepackage{etoolbox} \makeatletter \patchcmd\g@matrix {\vbox\bgroup} {\vbox\bgroup\normalbaselines}% restore the standard baselineskip {}{} ... 5 With an up-to-date TeX distribution the file runs fine with the article class. With asme2ej it doesn't, but for a very simple reason: the class does \RequirePackage{times} \RequirePackage{mathptm} The times and mathptm packages have been obsolete for at least eight years (probably more; the current version of mathptmx was released in 2005). The correct ... 2 Code (only the problem code in question are provided) \question The points with position vectors\\displaystyle \boldsymbol{61i + 2j}$,$\displaystyle \boldsymbol{10i-9j,\,ai-12j }$\ are collinear, if\$\displaystyle \boldsymbol{a = }\$ \begin{choices} \choice 1 \choice 2 \choice 3 \choice 4 \end{choices}

3

Don't use \boldsymbol but \bm from the bm package. \documentclass{exam} \usepackage[margin=0.7in,headheight=3.5\baselineskip,headsep=1\baselineskip,includehead]{geometry} \usepackage{multicol} \usepackage{amsmath} \usepackage{bm} \setlength\columnsep{46pt} \begin{document} \begin{multicols*}{2} \begin{questions} \question The points with position vectors ...

2

Making the numbers bold does not make sense here. Usually only the vectors (including unit vectors) need bold faces. Instead of making a vector bold, we can also use \vec for vectors in general or \hat for unit vectors. Without bold \documentclass{exam} \usepackage[margin=0.7in,headheight=3.5\baselineskip,headsep=1\baselineskip,includehead]{geometry} ...

4

The problem is that \foreach executes each cycle in a group. So in your case you're basically doing $$\begin{bmatrix} \begingroup\text{--ACC}\\\endgroup \begingroup\text{+PL}\\\endgroup \end{bmatrix}$$ which indeed stops with ! Missing \endgroup inserted. <inserted text> \endgroup You have to build the contents of the matrix ...

5

Enrico Gregorio has already explained the reason in his comment: \foreach puts the body of its loop in a group. That conflicts with the cell grouping of the matrix environment. Another problem, if there is something after the line end that is not expandable (end of group, \relax, ...), then a new (empty) line is created. The following uses the loop to ...

1

For reference, this issue seems to have been fixed in recent versions of cleveref (at least since 0.18.10; not yet in CTAN but available from my web site). The redefinitions in the other answers are no longer be necessary. I haven't tracked down precisely which version of cleveref fixed this bug.

Top 50 recent answers are included