Hot answers tagged

9

Not quite elegant but works \documentclass{article} \usepackage{amsmath} \begin{document} \begin{flalign} \rlap{$\displaystyle\overbrace{\phantom{f = \sum_{i\in I} a_i}}^{\text{ my notes }}$} f &= \sum_{i\in I} a_i \\ g &= blabla \\ h &= blabla \end{flalign} \end{document} Basically you put the expression with the \overbrace in a box ...


9

I guess you want to nest aligned: \documentclass{article} \usepackage{amsmath} \begin{document} \begin{align*} H([(1,0,0)], [(1,0,1)]) &= \min\{ \begin{aligned}[t] &|(1 - 0) - (1 - 1)| + |(0 - 0) - (0 - 1)|, \\ &|(1 - 0) - (1 - 0)| + |(0 - 0) - (1 - 0)|, \\ &|(0 - 1) - (0 - 1)| + |(0 - 1) - (1 - 1)| \} \end{...


8

It's best to view the output of certain combinations of \phantoms and \*lapping. Below are all possible overlaps (either \phantom first, followed by \*laps, or \*laps first, followed by \phantom. Column 1 denotes the broad usage, while column 2 shows the actual output. Column 3 shows the \phantom text using a light gray colour, just for clarity. A left rule (...


5

Welcome! You could use eqparbox for that. \documentclass{article} \usepackage{amsmath} \usepackage{eqparbox} \begin{document} \begin{align*} ||Ty - Tz||_w &\stackrel{\text{\eqmakebox[a][c]{Satz 4.3}}}{=} \sup_{t \in I}e^{-2L(t-t_0)}||(Ty)(t) - (Tz)(t)||_\infty \\ &\stackrel{\text{\eqmakebox[a][c]{4.5}}}{\leq} \frac{1}{2}||y - z||_w \end{...


5

With a simple \hphantom: \documentclass{article} \usepackage{mathtools} \usepackage{showframe} \renewcommand{\ShowFrameLinethickness}{0.3pt} \begin{document} \begin{flalign*} & & s_n &= a + ar + ar^2 + \dotsb + ar^{n-1} &\\ & \text{and} & rs_n &= \phantom{a +{}} ar + ar^2 + \dotsb + ar^{n-1} + ar^n & \end{flalign*} \end{...


5

The \fixTABwidth feature of tabstackengine forces all columns to an equal width. While this will not necessarily match matrices generated from another (align* or array) technique, by doing them both in tabstackengine, perfect alignment can be achieved, in this case, without the mess of \phantoms and \llaps. \documentclass{article} \usepackage{amsmath} \...


5

I'd use an array too, but I simplify the header by removing qquad and inserting @{{}={}} instead. Also, I add \renewcommand{\arraystretch}{1.3} for better line spacing. And I agree with @Sebastiano that using text is better. \documentclass{article} \usepackage{amsmath} \begin{document} \[ \renewcommand{\arraystretch}{1.3} \begin{array} {c r @{{}={}} l}...


5

One can play around with the spacing a bit, but this does what you're after without a tikzmark: \documentclass{article} \usepackage{array,amsmath} \renewcommand{\vec}{\mathbf} \newlength{\firstlen} \newlength{\secondlen} \newlength{\thirdlen} \newcolumntype{P}[1]{>{$}p{#1}<{$}} \settowidth{\firstlen}{$\vec{a} + \vec{b}, -2 \vec{a} + 2\vec{b}$}% ...


4

If you also want to align the operators: \documentclass[paper=letter,twoside,fontsize=12pt,leqno]{scrbook} \usepackage{mathtools} \usepackage{showframe} \let\ceilset=\relax \let\ceilf=\relax \begin{document} Define the following two functions: \begin{align*} &\wedge \colon \ceilset \times \ceilset &&\longrightarrow \ceilset && \text{and}...


4

Define \ceilset and \ceilif according to your needs and try the following \documentclass[paper=letter,twoside,fontsize=12pt,leqno]{scrbook} \usepackage{mathtools} \begin{document} \noindent Define the following two functions: \begin{align*} &\wedge \colon \ceilset \times \ceilset \longrightarrow \ceilset & & \text{and} & \vee \colon \...


4

A bit of linear algebra: \documentclass{article} \usepackage[a4paper,margin=1cm]{geometry} \usepackage{xfp} \usepackage{graphicx} \begin{document} \begin{figure}[htp] % measure the x/y ratio of the images \sbox0{\includegraphics{example-image-16x9}} \edef\q{\fpeval{(\ht0)/(\wd0)}} \sbox2{\includegraphics{example-image}} \edef\r{\fpeval{(\ht2)/(\wd2)}} % ...


4

I'd create a bit of vertical distance between "Satz 4.3" and the "=" symbol, by inserting an arrow symbol, and I'd then "squash" the width of the text/arrow combination to zero via a \mathclap directive. Observe that the code uses \tiny for the text material, which corresponds to \scriptscriptstyle for the math material. If you believe that the result isn't ...


4

Here is a different approach that sets the entire collection of vectors in a matrix. You can adjust the column separation (\arraycolsep) to suit your needs, depending on the available space in the text block. \documentclass{article} \usepackage{amsmath,bm} \usepackage[sc,osf]{mathpazo} \setcounter{MaxMatrixCols}{20}% https://tex.stackexchange.com/q/95162/...


4

Welcome! A simple array might do. \documentclass{article} \usepackage{amsmath} \begin{document} \[\begin{array}{cc@{}r@{\,}@{\,}l} \textit{State} && \textit{Rate leave} &= \textit{rate enter} \\ (0,0) && \lambda P_{0,0} &= \sum\limits_{n=1}^{\infty} \mu_n P_{0,n} \\ (0,n), n > 0 && (\lambda + \mu_n)P_{0,n} &= \sum\...


4

Another solution, with a gathered and an aligned environments, together with a couple of \vphantom{\sum...}: \documentclass{article} \usepackage{amsmath} \begin{document} \[ \begin{gathered}[t] \textit{State} \\ \vphantom{\sum\nolimits_{n=1}^{\infty}}(0,0)\\ \vphantom{\sum\nolimits_{n=1}^{\infty}}(0,n), n > 0 \\ (m,n), mn > 0 \end{gathered} \hspace{...


4

Use array, with a small trick to get the spacing right (no, the correct spacing is not \,). \documentclass{article} \usepackage{amsmath,array} \begin{document} \begin{equation*} \begin{array}{@{} c @{\qquad} r @{} >{{}}l @{}} \textit{State} & \textit{Rate leave} &= \textit{rate enter} \\[1ex] (0,0) & \lambda P_{0,0} ...


4

You have no \hfill between minipages. There's a much simpler solution: \documentclass{article} \usepackage{showframe} % to show page boundaries \begin{document} \noindent {\Huge Large text}\hfill \begin{tabular}[b]{@{}r@{}} small text 1 \\ small text 2 \end{tabular} \end{document}


4

Since you use this a lot, that is a good sign for creating a new environment, say numalign, that will do that automatically for you. \documentclass[12pt,a4paper]{article} \usepackage{amsmath} \begin{document} \newenvironment{numalign} {\begin{equation}\begin{aligned}} {\end{aligned}\end{equation}} \begin{numalign} a + b &= c \\ y &= x^2 + ...


4

It is very simple with package bigdelim. I took the opportunity to simplify a bit your code: \documentclass{article} \usepackage{blkarray} \usepackage{amsmath} \usepackage{tikz} \usepackage{xparse} \renewcommand{\vec}[1]{\mathbf{#1}} \usepackage{bigdelim} \begin{document} \begin{equation*} \def\arraystretch{1.1}\setlength{\BAextrarowheight}{\jot} \...


4

Please do not take this answer too seriously. I do not believe that there is an easy solution with tcolorbox and empheq "only", but I may well be wrong. Then there is the very nice package hf-tikz, which will allow you to highlight the parts of the equations that you want to highlight. However, I do not know how to teach it to use copy shadow which I am ...


3

You can define a new column type which reserves the exact space for the infinity symbol. \documentclass{article} \usepackage{amsmath} \usepackage{mathtools} \usepackage{calc} \usepackage{array} \newcolumntype{i}{>{$}w{c}{\widthof{$\infty$}}<{$}} \begin{document} \begin{align*} D_0 &= \left[\begin{array}{@{}iiii@{}} 0 & 7 & 1 & 6 \...


3

A simple solution with eqparbox. Two observations, the bmatrix environment already defines matrices with extensible brackets, and you don't have to load amsmath when you load mathtools: the latter does it for you, and furthermore, it defines \clap and \mathclap commands. \documentclass{article} \usepackage{mathtools} \usepackage{calc} \usepackage{...


3

Your figure layout is roughly given by a 6-column tabular, with the height of the left-most image given by the difference between the vertical position of the top of the first row of images and the bottom of the second row of images. One can use zref's savepos module to capture node positions on the page, together with some box manipulation (storing content ...


3

Use alignat, that makes pairs of “right aligned/left aligned” columns with no intervening space (that you can add yourself). \documentclass{article} \usepackage{amsmath} \newcommand{\ceilset}{\mathsf{Ceil}} \newcommand{\ceilf}[1]{\lceil #1 \rceil} \begin{document} Define the following two functions \begin{alignat*}{3} &\wedge \colon \ceilset \times \...


3

If you are willing to use a slightly altered syntax inside of \note, that is \& instead of &, this might work: \documentclass{article} \usepackage{xcolor} \usepackage{amsmath} \usepackage{etoolbox} \providetoggle{detail} \def\&{&\color{red}} \def\note#1{\iftoggle{detail}{\color{red}#1\color{black}}{}} \begin{document} \settoggle{detail}{...


3

I am not sure if this is an infinitely stable solution, but it seems to work so far. The idea is to change \everymath. With a little help from here, I arrived at \documentclass{article} \usepackage{xcolor} \usepackage{amsmath} \usepackage{etoolbox} \providetoggle{detail} \settoggle{detail}{true} \newcommand{\note}[2]{\iftoggle{detail}{% \gdef\mycolor{red}% \...


3

This is due to column heads being too large. I propose to use tabularx to ensure the table does not overflow into the margin, makecell to allow for line breaks in standard columns and, as the column heads are still a bit too wide, I put them in a box with null width and reduced the intercolumn spacing: \documentclass[12pt]{article} \usepackage{graphicx} \...


3

If I understand your problem right, this happens only because you left a blank line in the code between the text and the align environment. You could add a % on the blank lines, or simply not leave any blank lines. The following code removes much of the spacing. Does it solve your problem? \documentclass{article} \usepackage{amsmath} \begin{document} \...


3

\documentclass{standalone} \begin{document} \noindent \begin{minipage}[t]{0.49\textwidth}\vspace{0pt} {\fontsize{2\baselineskip}{0pt}\selectfont large Text\par} \vspace{2pt}% interlineskip small text 3 \end{minipage} \hfill \begin{minipage}[t]{0.49\textwidth}\vspace{0pt}\raggedleft small text 1\\ small text 2\\ small text 3 \end{minipage} \end{document}


3

A more reasonable test document is \documentclass{article} \usepackage{amsmath} \usepackage{commath} \begin{document} align \begin{align} \pd{f}{x} &= \pd{f}{z} \cdot \pd{z}{x} = \pd{f}{z} \cdot 1 \\ \pd{f}{y} &= \pd{f}{z} \cdot \pd{z}{y} = \pd{f}{z} \cdot i \end{align} equation \begin{equation} \pd{f}{x} = \pd{u}{x} + i \pd{v}{x} \quad \text{and}...


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