38
Had the same issue. For me it worked after I synchronized manually with the repository using the MikTeX Package Manager (Admin) tool and under the Repository menu using the synchronize.
Then the issue is resolved and the mathtools package appears under the package list.
27
The problem is this: \Longrigtharrow (over which \implies is defined) is built with two characters that come from different fonts.
The equals sign for lengthening the arrow is taken from \textfont0 (the normal text font), while the arrow (\Rightarrow) is taken from \textfont2 (the math symbol font).
When a current font size is 10pt, lmodern defines \...
answered Oct 12 '13 at 12:43
egreg
880k108108 gold badges22552255 silver badges36863686 bronze badges
25
With the usual definition, \setlength{<parameter>}{<value>} is just a wrapper for
<parameter>=<value>\relax
so
\setlength{\medmuskip}{0mu}
is legal, because it translates to
\medmuskip=0mu\relax
which is perfectly legal, as \medmuskip should be assigned values only in mu units (also fil, fill or filll units for the plus and ...
answered Jul 6 '14 at 13:48
egreg
880k108108 gold badges22552255 silver badges36863686 bronze badges
25
First, I have to recall that \bf is a plain TeX macro. It is not bad practice to use it but it isn't needed anymore since \bfseries was intoduced with LaTeX and its syntax is exactly the same as for good old \bf.
Second, don't change your markup! (by exploiting a search and replace routine). If you wrote \vec in your manuscript you did it because the ...
23
You don't need to load any packages to access the four macros \lfloor, \lceil, \rfloor, and \rceil. It is straightforward to use these macros to create two new macros called, say, \floor and \ceil:
\newcommand\floor[1]{\lfloor#1\rfloor}
\newcommand\ceil[1]{\lceil#1\rceil}
Then, write something such as $\floor{x}$ and $\ceil{y}$ in the body of the document.
...
22
Here's a mixture of \ooalign and picture mode.
\documentclass{article}
\usepackage{amsmath,pict2e}
\makeatletter
\newcommand{\barredsum}{%
\DOTSB\mathop{\mathpalette\@barredsum\relax}\slimits@
}
\newcommand{\@barredsum}[2]{%
\begingroup
\sbox\z@{$#1\sum$}%
\setlength{\unitlength}{\dimexpr2pt+\ht\z@+\dp\z@\relax}%
\@barredsumthickness{#1}%
\...
answered Aug 19 '19 at 22:29
egreg
880k108108 gold badges22552255 silver badges36863686 bronze badges
18
You have
\nablaf
which is probably undefined, I guess you wanted
\nabla f
(Please always post a complete document that generates the error, it is much easier to debug then)
answered Dec 18 '16 at 18:37
David Carlisle
588k5151 gold badges13351335 silver badges21252125 bronze badges
18
The problem is that you're trying to use displaystyle limits in text mode. Which is not that good, as I explain below.
I don't know if it's typographically correct but the code is
$\sum\limits_{i=0}^n f(x)$
The \limits command allows the limits to be positioned above and below the symbol.
The fact that inline math has "text style" limits is just that ...
17
You don't really need to use \mathclap, you can just place what you want to center in a box of the appropriate width.
\documentclass{article}
\usepackage{amsmath}
\usepackage{calc}
\newcommand*{\mask}[2]{%
\mathord{\makebox[\widthof{\(#1\)}]{\(#2\)}}%
}
\begin{document}
\begin{gather*}
1 + \mask{ABC}{B} + 2 \\
1 + ABC + 2
\end{gather*}
\end{...
15
The following example defines \xtwoheadrightarrow and \xtwoheadleftarrow similar to the definitions of \xrightarrow and \xleftarrow:
\documentclass{article}
\usepackage{amssymb}
\usepackage{amsmath}
\makeatletter
\providecommand*{\twoheadrightarrowfill@}{%
\arrowfill@\relbar\relbar\twoheadrightarrow
}
\providecommand*{\twoheadleftarrowfill@}{%
\...
answered May 14 '13 at 15:08
Heiko Oberdiek
249k2020 gold badges630630 silver badges989989 bronze badges
15
The problem is caused by package flexisym. Not only \mathbb{R} is affected but also \sup is in an italic font.
Anyway, \underset is not the right command for putting something below the "operator" \sup. This is done by a subscript. Compare:
\documentclass{article}
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{flexisym}
\begin{document}
\[
\...
answered Aug 4 '18 at 21:17
Heiko Oberdiek
249k2020 gold badges630630 silver badges989989 bronze badges
14
AMS matrices use a modified form of lookahead that does not skip white space looking for * and [ this is so that you can have
\begin{matrix}
a & b \\
[x] & y
\end{matrix}
with the [ taken as text to be printed not (as it would in a standard array environment} be equivalent to \\[x] and give an error that x isn't a valid length.
* is similar to [ ...
answered Aug 14 '20 at 8:07
David Carlisle
588k5151 gold badges13351335 silver badges21252125 bronze badges
13
A concise solution in this instance is presented via the tensor package:
$\tensor*[^{14}_2]{\mathbf{C}}{^{5+}_2}$
Not sure about the extent of your usage, but the following also corrects this in your specific case:
\documentclass{article}
\usepackage{mathtools,leftidx}% http://ctan.org/pkg/{mathtools,leftidx}
\begin{document}
$\prescript{14\phantom{+}}{2}{...
13
I continue to believe that one should use \left and \right where really needed and any sort of automatism for this is bad.
However, here's a simple and working implementation of your macro, that I call \xDeclarePairedDelimiter
\documentclass{scrartcl}
\usepackage{mleftright,xparse}
\NewDocumentCommand\xDeclarePairedDelimiter{mmm}
{%
\NewDocumentCommand#...
answered Jan 18 '13 at 22:42
egreg
880k108108 gold badges22552255 silver badges36863686 bronze badges
13
amsthm and mathtools are unrelated. mathtools updates and extends amsmath.
you still need amsthm if you want the proof environment.
answered Nov 7 '14 at 21:56
barbara beeton
80.3k1111 gold badges197197 silver badges456456 bronze badges
13
Yes, your suspicion is right. Simply define:
\newcommand{\vastl}{\mathopen\vast}
\newcommand{\vastm}{\mathrel\vast}
\newcommand{\vastr}{\mathclose\vast}
\newcommand{\Vastl}{\mathopen\Vast}
\newcommand{\Vastm}{\mathrel\Vast}
\newcommand{\Vastr}{\mathclose\Vast}
and you can use \vast and \Vast with \DeclarePairedDelimiter.
MWE:
\documentclass{article}
\...
answered Aug 19 '15 at 5:05
karlkoeller
115k1313 gold badges228228 silver badges405405 bronze badges
13
Let's look at the definition of \underbracket
\providecommand*\underbracket{
\@ifnextchar[
{\MT_underbracket_I:w}
{\MT_underbracket_I:w[\l_MT_bracketheight_fdim]}}
\def\MT_underbracket_I:w[#1]{
\@ifnextchar[
{\MT_underbracket_II:w[#1]}
{\MT_underbracket_II:w[#1][.7\fontdimen5\textfont2]}}
\def\MT_underbracket_II:w[#1][#2]#3{%
\mathop{\...
answered Sep 19 '16 at 8:11
egreg
880k108108 gold badges22552255 silver badges36863686 bronze badges
13
You should not use left and right in the DeclarePairedDelimiter definition. Those are automatically used when you use the command defined there.
You would use the starred version for autoscaling, i.e. \left and \right like
So
\documentclass{article}
\usepackage{mathtools}
\DeclarePairedDelimiter{\eceil}{\lceil}{\rceil}
\begin{document}
$\eceil{\cdot}$\\[...
13
To try to improve one of egreg’s answers is an exercise that is, at the same time, both enjoyable and instructive—plus, it can give bragging rights. (;-) In this case, I deem that the accepted solution is suboptimal in terms of efficiency, for the following two reasons:
While drawing, e.g., a witch requires the full flexibility of the
picture environment, ...
13
Excerpting from p. 14 of the user guide of the mathtools package (highlighting added):
The user guide says that the default width of underbrackets is ca 5/18ex = ca. 0.28ex. The following screenshot shows expressions with underbrackets that involve the default width as well as one half, two thirds, and three quarters of the default width. Choose your ...
12
Edit2: Complete rewrite, with mostly complete explanation of all the intricacies.
This is due to a complication in how XeTeX decides what fontdimen parameter to use, as Heiko notes in his answer to that question. In another answer, Khaled Hosny confirms that the details are buggy.
To center the brace vertically, bytefield sets the \fontdimen22 of \...
answered May 18 '13 at 17:49
Bruno Le Floch
42.7k66 gold badges119119 silver badges217217 bronze badges
12
The definitions of \dddot and \ddddot need some modifications: the dots need to be lowered a bit and to be scaled down so they are at the same height as in \ddot and \dot. I also used a \makebox of 0pt width so as to "hide" the extra width added by the dots, the separation between dots was also a little bit reduced.
Using TikZ I drew some horizontal rules ...
answered Sep 4 '13 at 17:58
Gonzalo Medina
451k5050 gold badges14761476 silver badges16881688 bronze badges
12
You can try with \vline
MWE:
\documentclass[aps]{revtex4}
\usepackage{amsmath,amssymb}
\begin{document}
Your attempt
\[\left|\frac{S}{\sum\limits^{N}_{a=1}T_{a}}\right|\]
With \verb|\vline|
\[\vline\,\frac{S}{\sum\limits^{N}_{a=1}T_{a}}\,\vline\]
\end{document}
Output:
Some remarks:
Use \[...\]\ instead of $$. See Why is \[ ... \] preferable to $$ ....
12
You could change meaning of \vec, but that would be very bad pratice. What I would do:
Define new command with style like: \newcommand{\vectorstyle}[1]{\mathbf{#1}}
Use Find and Replace feature of your text editor/IDE to replace \vec{ for \vectorstyle{
In the event of next chage, just replace the definiton of the \vectorstyle
P.S. Do not use \bf. It's bad ...
12
The proper way of doing this would be to use a search-and-replace command in your text editor in connection with a custom macro, e.g. \myvec.
However, if you insist on having a quick solution inside your document (which I discourage), you could add the following to your document's preamble:
\let\oldvec=\vec
\renewcommand{\vec}[1]{\oldvec{\mathbf{#1}}}
If ...
12
multi-question questions don't really fit the site format but..
Do you think that it is Ok to recommend the mathtools package instead
of amsmath package. The mathtools package calls the amsmath package
and improves it as far as I understand.
Yes
What about the empheq package
It's OK but more of a "contrib" package than mathtools which aims to be ...
answered Jan 31 '16 at 20:35
David Carlisle
588k5151 gold badges13351335 silver badges21252125 bronze badges
12
Analysis
Let's see what physics.sty does. First, the definition of \norm:
\DeclareDocumentCommand\norm{ l m }{\braces#1{\lVert}{\rVert}{#2}} % Norm
The l argument type collects everything up to (and excluding) the first {. Now let's look at \braces:
\DeclareDocumentCommand\braces{}{{\ifnum\z@=`}\fi\@braces}
I see no reason for this \ifnum; anyway, it ...
12
Encouraged by David Carlisle, I eventually resolved to post this answer. I had begun to write a comprehensive one that explained how the solution works, but I soon realized that it would have largely exceeded the 30000 character limit—indeed, only the code amounts to a total of more than 26000 bytes! Maybe I’ll post the explanations as a separate answer, ...
12
A version that works in all styles.
\documentclass{article}
\usepackage{amsmath}
\makeatletter
\newcommand{\mask}[2]{{\mathpalette\mask@{{#1}{#2}}}}
\newcommand{\mask@}[2]{\mask@@{#1}#2}
\newcommand{\mask@@}[3]{%
\settowidth{\dimen@}{$\m@th#1#2$}%
\makebox[\dimen@]{$\m@th#1#3$}%
}
\makeatother
\begin{document}
\begin{gather*}
1 + \mask{ABC}{B} + 2 \\
...
answered Jun 8 '20 at 16:43
egreg
880k108108 gold badges22552255 silver badges36863686 bronze badges
Only top voted, non community-wiki answers of a minimum length are eligible
Related Tags
mathtools × 393math-mode × 107
amsmath × 96
equations × 54
align × 34
spacing × 24
math-operators × 24
delimiters × 23
unicode-math × 20
symbols × 16
cross-referencing × 15
matrices × 15
horizontal-alignment × 12
tikz-pgf × 11
cases × 11
vertical-alignment × 10
brackets × 10
subscripts × 9
multline × 9
macros × 8
xetex × 8
arrows × 8
numbering × 7
packages × 7
miktex × 7