Questions tagged [mathtools]

{mathtools} is an extension package to amsmath. It provides bugfixes and adds useful tools for mathematical typesetting.

Filter by
Sorted by
Tagged with
4
votes
1answer
937 views

\tclap vs. \overset and \underset

MWE \documentclass[12pt]{article} \usepackage{color} \usepackage{amssymb} \usepackage{stackengine} \usepackage{mathtools} \begin{document} a\kern0pt{\color{red}{\tclap[5pt]{$\overset{\text{2}}{\vee}...
2
votes
2answers
93 views

Scalable paired delimiter with subscript as both pre- and postscript

I'm trying to define a command that, given input on the form \mydef{pre}{main}{post}, gives output akin to: (Where the "foo" and "bar" are just for reference, and the fraction inside is to provide a ...
6
votes
4answers
1k views

Putting a matrix over an arrow

I'm wanting to re-use notation used in a paper, but I'm having trouble formatting it in LaTeX. I'm trying to put a small (either a 2x2 or a 2x1 matrix) on top or to the right of an arrow. I want ...
1
vote
2answers
113 views

Spacing before a `lgathered` and other `*ed` environments

I have the following situation: \documentclass[fleqn]{article} \usepackage{amsmath} \usepackage{mathtools} \begin{document} \begin{gather*} [a,b]=c, \\ [c,d]=f, \\ \left. \begin{lgathered} ...
3
votes
1answer
7k views

What are all the math packages about?

I have counted 48 packages in MikTeX Package Manager which have math as a part of their names. What are all those packages about? Who could provide a short or not-so-short review of these packages? ...
10
votes
3answers
2k views

How can I define a big plus operator that works like \bigcup?

I want to define a "\bigplus" operator that is a big + symbol that changes size according to environment and has limits, just like \bigcup works. I've read about defining a "\bigtimes" (How can I get ...
3
votes
1answer
235 views

\mathcal gives different output where it should not

I have multiple occurences of mathcal in my document and they do not use the same style. Consider this MWE: \documentclass{standalone} \usepackage{mathtools} \usepackage{unicode-math} \setmainfont[...
1
vote
0answers
43 views

Box around an equation with multiple align marks

Here is the MWE: \documentclass[preview, border&=5bp]{standalone} \usepackage{tfrupee, amsmath, amssymb, mathtools} \begin{document} \begin{alignat*}{5} \Aboxed{x + y &= 5 &&=15}\\ ...
0
votes
0answers
81 views

mathools' \DeclarePairedDelimiterXPP with left-right default

In the following code: \documentclass{article} \usepackage{mathtools} \DeclarePairedDelimiterXPP\E[1]{\mathbb{E}}[]{}{#1} \begin{document} \[ \E{\sum_{i=1}^N } \] \[ \E*{\sum_{i=1}^N } \] \end{...
1
vote
0answers
93 views

Line breaks in mathtools' paired delimiter

The following code \documentclass{article} \usepackage{mathtools} \DeclarePairedDelimiterXPP\E[1]{E}[]{}{#1} \begin{document} \[\begin{aligned} E\Bigg[A&+B \\ C&+D \Bigg] % \E[\Bigg]{...
2
votes
0answers
65 views

mathtools bug with aligned

The following code does not compile \documentclass{article} \usepackage{mathtools} \DeclarePairedDelimiter\abs{\lvert}{\rvert} \begin{document} \[\aligned &\abs{X} \endaligned\] \end{...
0
votes
1answer
250 views

Defining a new math relation

In group theory, a $p$-normally embedded subgroup $H$ of a group $G$ is denoted by $H$ $p$-ne $G$. I want to define a new command for $p$-ne to work within the math environment but I'm not sure how to ...
0
votes
0answers
77 views

Calc and mathtools : issue

I have an issue when using titlesec with mathttools : l.19 \addtocontents{toc}{\setcounter{tocdepth}{0}} ! Undefined control sequence. Here is an minimal example : Can ...
1
vote
1answer
142 views

White space in writing Long fractional equation usign \splitfrac

I am trying to split a long fractional equation using \splitfrac into three lines. The problem is that the three lines are not aligned properly and there is blank space in the third line. Please help! ...
3
votes
0answers
131 views

Is Latex the only choice, is there any (emerging) alternative? [duplicate]

I’m new to Latex, and I know I must learn Latex, the question: is Latex the only typesetting to write Math ? and it’s quite old, what is its future, is there any new (emerging/trending) typesettings ...
0
votes
1answer
134 views

Switching a paired-delimiter command with an optional argument to \DeclaredPairedDelimiter

I have the command: \newcommand{\norm}[2][]{% \ifx\nosuchcommandipromise#1\nosuchcommandipromise {\lVert #2 \rVert}% \else {\lVert #2 \rVert}_{#1}% \fi } and I want to switch to using \...
1
vote
1answer
140 views

Switching a square-bracket-paired-delimiter command to \DeclaredPairedDelimiter

I'm trying to use \DeclarePairedDelimiter instead of my old roll-your-own commands to the same effect. Well, this: \documentclass{article} \usepackage{mathtools} \DeclarePairedDelimiter\sparen{\left[}...
1
vote
1answer
75 views

Why are some square roots higher then the equation, and some are lower?

I was writing this inequality, which contains two square roots. Why is the second square root lower than the equation? I think it's because of the symbol I used inside it, but i couldn't find a way to ...
4
votes
1answer
89 views

How to automatically make symbols in equations less crowded?

As you can see in the pic above, some parts of the equation seem to be crowded. Here, the problem is fixed by using \thinspace command. Here is my MWE: \documentclass{book} \usepackage{amsmath} \...
0
votes
1answer
36 views

How to code a way of directly writing a sequence of observations

I am trying to code my one notation such that I do not want to repeat every time I need to introduce a new sequence. I thought of coding it this way \documentclass{article} \usepackage{mathtools} \...
2
votes
1answer
1k views

When I try to use `\splitfrac` or `\splitdfrac` in math section, I get an additional 0 or 1 in the result [closed]

\begin{flalign*} z&=\frac{\splitfrac{ab+cd+ef+gh+ij}{+kl+mn+op+qr}}{y}\\ z&=\frac{\splitdfrac{ab+cd+ef+gh+ij}{+kl+mn+op+qr}}{y} \end{flalign*} It can be seen from the figure below ...
7
votes
2answers
306 views

Add parentheses under equations?

How can I put parentheses under equations like this:
2
votes
3answers
154 views

List enumerated with multi-line stuff inside a minipage

I have created a list using enumitem package. The items of the list should be enumerated with multi-line blocks of text, like this As I haven't found a way to pass item more than one argument I just ...
6
votes
2answers
317 views

Vertical spacing inside mathtools's multlined

The code \documentclass{article} \usepackage{mathtools} \begin{document} \begin{align*} f(1) &= g(1) + g(2) + g(3) \\ f(1) &= g(1) + g(2) + g(3) \\ f(1) &= \!\begin{multlined}[t]g(...
5
votes
1answer
917 views

\DeclarePairedDelimiter with \left & \right no longer works

The following MWE worked in December 2015 based on the archived PDF. But, it does not work today. Any idea? \documentclass{article} \usepackage{mathtools} \DeclarePairedDelimiter{\eceil}{\left\lceil}...
9
votes
2answers
384 views

Peculiarities in \norm* from physics.sty

I am a heavy user of the physics package. Unfortunately, the \norm command seems to have some quirks associated with it. According to the documentation the starred version is meant to result in a ...
1
vote
2answers
364 views

“aligned” environment gives too much horizontal space

I am using the aligned environment to typeset some mathematical equations. Background was discussed here: Vertical alignment in lists when using multline. The idea is to typeset equations on the same ...
2
votes
1answer
133 views

Missing middle delimiters when reDeclarePairedDelimiterInnerWrapper is used

I'm using \DeclarePairedDelimiter (from mathtools) to define a \paren macro as follows: \providecommand{\given}{\:\vert\:} \DeclarePairedDelimiterX\paren[1]{(}{)}{% \renewcommand{\given}{\:\...
9
votes
2answers
277 views

Superscripts too high after macros defined with \DeclarePairedDelimiter

I have a macro for absolute value (using \DeclarePairedDelimiter from mathtools): \DeclarePairedDelimiter{\abs}{\lvert}{\rvert} This works great in terms of adjusting the size of fences etc. But the ...
3
votes
1answer
159 views

avoid eq. # on \shortintertext{} from mathtools

Does anyone know of an elegant way to avoid having to manually put an \nonumber at the end of \shortintertext{} when it is at the last line? As illustrated by the parts of the minimal working example ...
4
votes
2answers
3k views

Position the limits of Sum

I want the limits of the sum sign to be placed where I placed the red lines in the photo. This is the line of script I used: $Result = p + \sum_{i=0}^{n} f(x)$ This is what I get and the red lines ...
2
votes
1answer
110 views

How to avoid stretching the equation in multline mode when the width is defined?

I would like to achieve: the multline equation spans horizontally .7\textwidth the first line is aligned to the left side the second line is aligned to the right side So far I have: Could you ...
0
votes
0answers
24 views

How to preserve spacing before + operator in `multlined` environment? [duplicate]

How to keep the space before + operator? Here there is the code to generate the example: \documentclass[a4paper]{article} \usepackage{mathtools} \begin{document} \begin{equation} \begin{...
1
vote
2answers
434 views

Adding brackets above/below and left/right of array matrix

I'm trying to add brackets to portions of a matrix, like so: where the arrowed bars are replaced with brackets, and the red bar would be moved to the bottom. If it helps, here's the portion I have ...
1
vote
2answers
84 views

Vertical alignment in lists when using multline

I have encountered some troubles using multline in lists. The expression inside the environment is too low. This happens to expressions inside flalign also: Here is MWE \documentclass[10pt,twoside,...
2
votes
1answer
744 views

Correctly aligning formula when using \mathclap

I have some formulas where I have big simbols like \sum of \bigvee with indexes. For indexes are too long, the argument moves too far to the right: \item[]\AL \begin{flalign*} % &\bigvee\limits_{\...
2
votes
0answers
98 views

amsmath \intertext works inside the reactions environment but mathtools \shortintertext doesn't [closed]

If I typest a set of chemical equations with the chemmacros reactions environment I can use \intertext{} no problem. If I use \shortintertext{} it's no good. Working MWE \documentclass{article} \...
5
votes
3answers
498 views

Align subscripts in math mode

Is there an easy way (maybe provided by mathtools that aligns normal subscripts)? I know that I can do this manually with \vphantom, but I was looking for a better way. \documentclass{article} \...
1
vote
0answers
43 views

How can I hide the first equation number as in the picture in latex? [duplicate]

How can I hide the first equation number as in the picture in latex \documentclass{article} \begin{document} \begin{align} R=p(S\text{ working})&= p(i\text{ working}) p(S\text{ working}|i\text{ ...
2
votes
1answer
148 views

Fraction inside \xrightarrow is giving error

If I write: $\xrightarrow{\makebox[4cm]{\frac{m}{n}}}$ I'm getting error: Missing $ inserted \end{frame} Extra}, or forgotten $ \end{frame} But replacing \frac{m}{n} with just 1 (...
7
votes
1answer
101 views

Why does the mathtools package define operators only \AtBeginDocument?

What is the rationale behind defining operators like \coloneq in mathtools.sty using \AtBeginDocument? \AtBeginDocument{ ... \providecommand*\coloneq{\vcentcolon\mathrel{\mkern-1.2mu}\mathrel{-}}...
3
votes
2answers
149 views

An alignment problem arose while using `\shortintertext{}` command

Why is the first equation in the code below not centered? I want it to be centered like the second one. Could anyone kindly help me? Here is my code: \begin{align*} f\wedge g = \frac{1}{k!\ell !}A(...
2
votes
1answer
6k views

Using the underset command in AMS

I seem to get an error with the following code and I do not know why. This is the first time I have used the \underset_ command whereas I used to use the \limits_ command. However when I tried to use ...
2
votes
3answers
156 views

Equation does not start at the begining of the second line

\documentclass{article} \usepackage{mathtools} \begin{document} \begin{equation} \label{mutual} \begin{multlined} I(Predicted;Actual)=\sum \limits_{a,b} p(Predicted,Actual)\log \frac{p(Predited,...
1
vote
2answers
166 views

Numbering equations while also using flushleft

I want an equation to be flushed to the left but I want it to be numbered as well. When I use this code it is flushed to the left but does not number my equation: \documentclass[a4paper]{report} \...
3
votes
2answers
2k views

Writing math formula in LaTeX, 'undefined control sequence'

I'm using the amsmath package and writing a report. I am using a LaTeX manual pdf, which has a chapter on writing maths formulas. I have followed what it says and I do not understand why my equation ...
1
vote
1answer
1k views

Coding F1 formula with mathtools

I want to reproduce this formula. Note The 1 in the F should be subindex This is my MWE which is not working for me: %!TEX TS-program = xelatex %!TEX encoding = UTF-8 Unicode \documentclass{report} ...
1
vote
3answers
90 views

Multiple multline equation constructs in one math environment (kinda)

Okay, I have been fiddling with this for too long, hence I decided to ask for help. Here's the problem, I am working with a two-column layout and I have some lengthy equations which I would like to ...
2
votes
1answer
331 views

\sfrac breaks vertical spacing in multlined enviroment

I have found that including a \sfrac from the package xfrac into a multlined environment from mathtools completely breaks the vertical spacing of the multlined. Actually, this affect the spacing ...
2
votes
1answer
415 views

Set description list `labelwidth` based on widest label (with mathtools loaded)

I would like to set the description's width automatically to the widest. The solution at Automatically set description list `labelwidth` based on widest label? works for me, except if I have the ...