7

The widths of the digits are not the same in STIX Two Math at \footnotesize. Why? Ask STIX. \documentclass{scrartcl} \usepackage{fontspec} \usepackage{unicode-math} \setmainfont{STIX Two Text} \setmathfont{STIX Two Math} \usepackage{mathtools} \usepackage{siunitx} \begin{document} \footnotesize \(X = \SI{4.8}{\henry}\) \(X = \hphantom{.} \SI{10}{\...


7

The idea is good. Not so \ensuremath, of course. \documentclass[twocolumn]{article} % twocolumn is just to get a smaller picture \usepackage{amsmath} \ExplSyntaxOn \NewDocumentCommand{\ve}{m} { \mathchoice {\raymo_ve_display:n {#1}} {\raymo_ve_inline:n {#1}} {\raymo_ve_inline:n {#1}} {\raymo_ve_inline:n {#1}} } \cs_new_protected:Nn \...


7

Distinguishing inline and display math is different from distinguishing \displaystyle from \textstyle and can be tricky, since the align-like environments of amsmath use internally $\displaystyle...$. Your definition with \ensuremath will furthermore always use \textstyle if you call the macro outside of math mode. In my (of course questionable) opinion \...


5

You can use a double {} see the code below and the output. All the exponents are to the same height. \documentclass[a4paper]{article} \usepackage{amsmath} \begin{document} \begin{equation} \mathbf{B}^{T} \mathbf{A}^{-1} \mathbf{B} \end{equation} \begin{equation} \mathbf{B}^{T} \widetilde{\mathbf{A}}{}^{-1} \mathbf{B} \end{equation} \begin{equation}...


5

Changing it to use 0.6 in all cases \Si uses text mode ......\hbox(5.814+0.108)x11.475, direction TLT .......\TU/STIXTwoText(1)/m/n/9 0 .......\TU/STIXTwoMath(1)/m/n/9 . .......\TU/STIXTwoText(1)/m/n/9 6 but \hphantom is using math mode .....\hbox(6.021+0.117)x7.785, direction TLT ......\TU/STIXTwoMath(1)/m/n/9 0 ......\TU/STIXTwoMath(1)/m/n/9 . and as ...


4

TeX can measure the object: $$ \def\contentsA{\pmatrix{A^{-1} b(x) \cr -1}} \def\contentsB{\pmatrix{A & b(x) \cr b(x)^T & \Phi(x,x)}} \setbox0=\hbox{$\displaystyle \contentsA^{\!T} {\underbrace{\!\contentsB\!}_{\displaystyle A_{\Phi, X\cup\{x\}}}} \contentsA $} \sqrt{\vphantom{\contentsA^T}\hphantom{\copy0}} \kern-\wd0 \box0 $$ \bye I made a ...


4

You could (a) apply a \smash instruction to the \underbrace{...}_{...} part and (b) insert a \vphantom directive after the \sqrt{...} part. $$ \sqrt{ \pmatrix{A^{-1} \cr -1}^{\!T} \smash{\underbrace{\pmatrix{A & b(x) \cr b(x)^T & \Phi(x,x)}}% _{\textstyle A_{\Phi, X\cup\{x\}}}} \pmatrix{A^{-1} b(x) \...


4

The glue inserted between atoms is expressed in mu units (unless the user manually inserts standard glue). When an inline formula is processed, it is converted to a horizontal list which is then appended to the current horizontal list for later paragraph breaking and the “math glue” is converted to standard glue. So there is no real difference in the ...


4

I can reproduce the picture: what I get is from the following code \documentclass{article} \usepackage{amsmath} \usepackage{times} \begin{document} \[ \begin{aligned} \text{depth: } d &= \alpha^\phi \\ \text{width: } w &= \beta^\phi \\ \text{resolution: } r &= \gamma^\phi \\ &\text{s.t. }\alpha.\beta^2.\gamma^2\approx2 \\ &\alpha\ge1,\...


3

Those are standard euler calligraphic and fraktur fonts \documentclass{article} \usepackage{euscript} \usepackage{eufrak} % you don't need this if you have \usepackage{amssymb} \begin{document} $\EuScript{M}$ $\mathfrak{M}$ \end{document} Loading the package euscript with the mathcal (mathscr) option will replace the \mathcal alphabet (define a new one \...


2

The package cmathbb offers Blackboard Bold characters compatible with the Computer Modern. It is the only package that I found to provide good results for \mathbb{i} for pdflatex.


2

First, allow me a question: why?! :-) I fail to see the point of having a text macro which prints \oplus with the same spacing in math mode (BTW \mathbin, not \mathrel), but that is surely my shortcoming. Your use of \ensuremath kinds of suggests that you want to use the control symbol \+ also in math mode. My personal opinion is not to do that, but I'll ...


2

You can try: \def\+{\leavevmode\unskip\hbox{${}\oplus{}$}\ignorespaces} This ignores space before and after \+ and adds the spaces from math mode.


2

While I agree with the comment that there exist tools for pseudocode, I provide an enumerate approach, in case you are forced into such an approach by circumstance. It makes use of the tabto package to manage the indents. \documentclass{article} \usepackage{enumitem,tabto} \newlength\svloc \newcommand\indentA{\tabto{40pt}} \newcommand\saveloc{\tabto*{0pt}\...


2

Here you have a start: \documentclass{article} \usepackage{amsmath} \begin{document} \begin{equation*} \begin{aligned}[c] \text{depth:}\ d =\alpha^{\phi} \\ \text{width:}\ w = \beta^{\phi} \\ \text{resolution:}\ r = \gamma^{\phi} \\ &\hspace{-1cm} s.t.\alpha.\beta^{2}.\gamma^{2} \approx 2 ...


2

It compiles if (a) you remove the extra } and (b) removes the blank lines (not allowed in math mode) Thus this compiles \documentclass[a4paper]{article} \usepackage{amsmath} \begin{document} \begin{equation*} \begin{split} P(x=k) = \frac{n!}{k!(n-k)!} * (\frac{\lambda}{n})^k * (1-\frac{\lambda}{n})^{n-k} \\ Let n \rightarrow \infty \\ P(x=k) \\ ...


2

The badness computation is not controlled by a primitive but rather hard-coded in the TeX algorithm; TeX sets the box and compares its natural width to the desired width, and then computes the glue set ratio, roughly the difference of natural and desired widths divided by the amount of stretch/shrink. The badness is 100 times the cube of this ratio (but ...


1

Here is a way: \documentclass{article} \usepackage{mathtools} \usepackage{array, sansmath, upgreek} \begin{document} \sansmath \[ \upgamma_1 = \begin{array}{|*{5}{c|}} a & d & c & e & g \\ \hline a & d & c & e & g \end{array} \] \end{document}


1

You can \protect the invocation of \ifmmode. David's comment provides more info on the "why". \documentclass{article} \usepackage{amsmath} \begin{document} \begin{gather} \protect\ifmmode abc\else def\fi \end{gather} \end{document}


1

If you want math-mode typesetting, what you really want is to switch to math mode, but typeset the arguments as text. Both \textup and \texit work in math mode. You could also use \mathrm or \mathit. \documentclass{article} \usepackage{amsmath} \newcommand\plusify[2]{\( \text{#1} \oplus \text{#2} \)} \begin{document} \section{Upright} \( \textup{...


1

In the case shown (the flag is defined) you were inserting \par in math mode which is not allowed. \documentclass{article} \usepackage{amsmath,color} \newbox\zzbox % I've got several environments for conditional rendering, here's one \newenvironment{filled}{\relax\ifdefined\filledflag\else\setbox\zzbox\vbox\fi\bgroup} {\ifdefined\filledflag\else\par\fi\...


1

Use \left.\right| For example $$\mathbb{E}(Y^3) = \left.\frac{d^3 M_Z(t)}{d t^3}\right|_{t=0}$$


1

The package latexalpha2, as it is, requires unix and pdflatex. It was adapted to windows and extended to lualatex. See https://tex.stackexchange.com/a/579254/161015 for a complete answer. Note. Wolfram Engine must be installed and wolframscript must be fully working on the command prompt! WolframScript enables Wolfram Language code to be run from any ...


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