New answers tagged math-mode
0
votes
How to type non-italic text in math mode as in the figure?
How to typeset the (math) word "Prime", using a sans-serif font, depends in part on whether you use pdfLaTeX to compile your document.
If that's the case, then \newcommand\Prime{\mathsf{...
0
votes
How to type non-italic text in math mode as in the figure?
Use \text{} with whatever text you want "normal" inside the curly braces.
2
votes
Incorporating TIPA-symbols into math mode
You can define a math symbol font.
Look in t3enc.def for other glyphs to be used as math symbols. But never use \v or other text accents in math mode; the math accent corresponding to \v is \check.
\...
1
vote
How to set `newpxmath` to use the `pxfonts` integral
You can use the pxfonts integrals with newpxmath.
\documentclass{article}
\usepackage{newpxtext,newpxmath}
\DeclareSymbolFont{largesymbolsPX}{U}{pxexa}{m}{n}
\SetSymbolFont{largesymbolsPX}{bold}{U}{...
1
vote
How do you write "evaluate at" in Latex?
Edit: I may have misunderstood the question. If you want exactly as shown in your post:
(\alpha_t)^{1}_{t=0}
Original answer:
It is by no means the perfect answer and has some issues, but in my ...
10
votes
Typing a specific type of matrix
(updated the answer to address @yarchik's comment)
Here are two solutions. The first uses \mleft(, \middle|, and \mright), where \mleft and \mright are macros provided by the mleftright package. The ...
8
votes
Typing a specific type of matrix
This is a perfect place to use amsmath's \genfrac command.
\documentclass{article}
\usepackage{amsmath}
\newcommand\hypergeom[3]{{}_1F_1\left(\genfrac{}{}{0pt}{}{#1}{#2}\,\middle\vert\,#3\right)}
\...
5
votes
Accepted
Typing a specific type of matrix
There are several ways. You can place the | character inside mathrel for proper spacing. Then adjust its size with \Big or \bigg if you want it bigger. Manually sizing the delimiters ( and ) will ...
2
votes
Putting a word inside a math expression such that it's always typeset in roman
If you literally mean, always in Roman, you probably want \text{\rmfamily\upshape #1} from amsmath (or more precisely, amstext). You can use any text-mode commands inside \text, including selecting ...
2
votes
Accepted
How to locally increase the size of indices?
You can override the default style in which a piece of math is typeset:
\textstyle: apply the style used for mathematics typeset in paragraphs,
\displaystyle: apply the style used for mathematics ...
0
votes
System of equations
For those like me that came here just to know how to represent a system with two lines of equations and don't care about the rest:
\[
A =
\left\{
\begin{array}{l}
a &\\
b
...
2
votes
Accepted
Which package do I have to use to print capdot (⩀) symbol?
In the interest of "teaching a person to fish":
When using the Comprehensive Symbols List, the tables tell you which packages you need to load to use them. \capdot shows up in Table 50, ...
1
vote
Accepted
Bad subscript spacing with `\mathchoice`
If you declare it as \mathop the larger size will be found via the font metrics and you don't need \mathchoice
\documentclass[12pt]{article}
\DeclareFontFamily{U} {MnSymbolF}{}
\DeclareFontShape{U}{...
0
votes
Overfull hbox too wide (how to break lines)?
You have 15 triples, so you can order them five per line (in your order) or lexicographically
\documentclass{article}
\usepackage{amsmath}
\begin{document}
Weak compositions of $4$ into three parts ...
0
votes
Overfull hbox too wide (how to break lines)?
I broke the lines where you indicated but I think breaking after a comma would be more natural
\documentclass{article}
\usepackage{amsmath}
\begin{document}
Weak compositions of $4$ into three ...
2
votes
Check math font
When Unicode Math font is used then it is possible (and it is typical) to have single math font for all characters used in math formulae. This differs from the old concept (with 7bit fonts) where the ...
0
votes
Check math font
This answer covers the case the user uses LaTeX.
Saying "there's no current math font" is half-accurate in that
in the low level of TeX the \textfont etc. are not set in advance,
but
users ...
2
votes
Accepted
Left align a single text line within a block of math equations
Use \shortintertext{and} (from mathtools), with no following \\
1
vote
Left align a single text line within a block of math equations
The align environment opens display math mode and starts it by \halign primitive, which controls the alignment. There is a TeX primitive \noalign{vertical material} which can be used at the end of ...
6
votes
Accepted
Un-italicising entire row of matrix
It is quite simple with tabularray:
\documentclass{article}
\usepackage{tabularray}
\UseTblrLibrary{amsmath}
\begin{document}
It is quite simple with \texttt{+bmatrix} adding \texttt{mode=text} ...
3
votes
Un-italicising entire row of matrix
(simplified the answer a bit)
You may achieve your formatting objective by (a) using a fixed-width column type instead of the c column type that underlies the bmatrix environment and (b) encasing the ...
1
vote
Un-italicising entire row of matrix
You could always write:
$\mathrm{
\begin{bmatrix}
…
\end{bmatrix}
}$
assuming that you don’t have any non-italic inside your matrix.
note: this doesn’t actually work because the math ...
0
votes
Left align a single text line within a block of math equations
Have you tried placing the alignment point on the left of expressions? It will make all lines to be left-aligned
\documentclass{article}
\usepackage{amsmath}
\usepackage{mathtools}
\begin{document} ...
3
votes
Small diagrams in text
Like this:
\documentclass{article}
\usepackage{lipsum}
\usepackage{tikz}
\usetikzlibrary{arrows.meta, positioning}
\tikzset{dot/.style = {circle, fill, inner sep=1pt},
arr/.style = {-{...
7
votes
Accepted
Small diagrams in text
Adjusting the cramped* style from another answer of mine to be even tighter and adding a supercramped style with even smaller distances.
(You don't need to use the width function measuring the size of ...
4
votes
How do I underline capital letters in math-mode
According to this related post: what you are missing is \usepackage{amsmath} then $\underline{X}$ should do the trick, see minimal example:
\documentclass{article}
\usepackage{amsmath}
...
5
votes
Custom environment to create table-like matrix
Quite simple with tabularray:
\documentclass{article}
\usepackage{amsmath}
\usepackage{tabularray}
\NewDocumentEnvironment{tabularmatrix}{+b}{
\begin{tblr}{
hlines, vlines, columns={c},
...
3
votes
Accepted
Adding optional argument (as exponent) to custom math expressions
You can use a flag value to represent “no value”. In this case, since it's for typesetting, it's pretty safe to use an empty default and test for that:
\newcommand\bigO[2][]%
{\mathcal{O}(#2\if\...
2
votes
How to make \left, \right pairs of delimiter work over multiple lines?
The previous "automated" solutions all use certain packages that have compatibility issues with amsmath. Here is a sort-of-automated solution that does not require additional packages.
This ...
4
votes
Custom environment to create table-like matrix
Not exactly a solution since it doesn't use your preferred name for the environment, but you can use nicematrix. You must compile twice.
\documentclass{article}
\usepackage{nicematrix}
\begin{...
4
votes
Custom environment to create table-like matrix
If you don't need to nest arrays or other objects using \\, you can do it as follows. Any number of columns are accepted, as long as they're at most MaxMatrixCols, like for matrix in amsmath; increase ...
3
votes
Font problem with txfonts
Well, you found another of the several reasons for not using txfonts. It was a good attempt at getting Times compatible math symbols, but it's plagued with a lot of inconsistencies and bad kernings.
...
1
vote
Font problem with txfonts
Using \def\ket#1{\lvert\,#1\,\rangle} instead of \def\ket#1{\left\lvert#1\right\rangle} there is not problem. You will not have \lvert higher than the \rangle.
\documentclass[a4paper]{article}
\...
1
vote
How to redefine the \partial command to adjust the kerning (as suggested by Michael Spivak)?
Here's my approach for Latin Modern (and CMU) inspired by @egreg's answer:
\makeatletter
\newcommand\adjustvalue{-2.43mu}
\newcommand\kernadjust{\mkern\adjustvalue}
\let\@oldpartial\partial
\...
3
votes
Accepted
How to redefine the \partial command to adjust the kerning (as suggested by Michael Spivak)?
There is no kerning in Computer Modern and quite likely Spivak was referring to mathtime. Here I use mtpro2 to show the kerning.
You can absorb the function name, compute the standard kerning and ...
2
votes
How to do this double sum with a subscript in the middle?
Not finding a specific duplicate, I'll repeat the code used in https://tex.stackexchange.com/a/649824/4427
\documentclass{article}
\usepackage{amsmath}
\DeclareMathOperator{\cov}{cov}
\begin{...
Community wiki
2
votes
Accepted
Correctly scale and space TikZ symbol in math mode
You can put the symbol in a savebox and use the scalerel package to give it the same size as \odot. Changing the inner sep of the node will make the * larger or smaller.
\documentclass{article}
\...
5
votes
I want to use a specific symbol
The font you're referring to is Euler Script and is provided by the euscript package.
In it we find
\DeclareMathAlphabet\EuScript{U}{eus}{m}{n}
For a single letter it would be a waste of resources to ...
0
votes
Help me input a column vector
for such input you can use package {simples-matrices}
\usepackage{simples-matrices}
\matrice(b)[1]{$z_1, z_2,\dots, z_n$}
y=\matrice(b)[4]{$x_1,x_2,\dots,x_n$}
the (b) provides bracket on matrices, [...
0
votes
I want to use capital Greek letters and less < and greater than in same equation
You can't use packages for multiple fonts. Packages amssymb, mathpazo, and breqn removed. Less than < and greater > can now be put into maths equations along with capital Greek letters.
2
votes
System of equations
A solution with a customized environment in mathematical expression or equation in the preamble
\newenvironment{system}%
{\left\lbrace\begin{array}{@{}l@{}}}%
{\end{array}\right.}
And in the text for ...
2
votes
Accepted
write mathematical definition of functions
I suggest the align* environment. The lines will align on the character after the & symbol. The \mapsto arrow may be used also.
\documentclass{article}
\usepackage{amsmath, amsfonts}
\newcommand{...
3
votes
write mathematical definition of functions
Assuming you're having difficulty coming up with the corresponding LaTex keywords for the symbols in your text, try using this handy tool.
It allows you to draw a symbol, then tells you which LaTex ...
6
votes
Accepted
What was the reason behind using sqrt (square root) to name the nth root command?
Note, that the author of TeX D. Knuth created the macro \sqrt only for square root in the basic plain TeX macro collection. The root with given power is provided by \root number\of {argument} in plain ...
0
votes
Create a command for inline math, and apply color to math output
You can use \everymath{\color{blue}}. Here is a minimimal working example:
\documentclass{amsart}
\usepackage{xcolor}
\everymath{\color{blue}}
\begin{document}
The value of $x = 2 + 3$ is $x=5$.
\[
...
1
vote
Accepted
Create a command for inline math, and apply color to math output
This works for me, I hope for you too:
\documentclass[12pt]{article}
\usepackage{xcolor}
\newcommand*\Mimath[2][black]{{\color{#1} $ #2 $}\color{black} }
\begin{document}
The value of \Mimath[red]{...
6
votes
Accepted
How to make a new command that accepts math parameters?
You should use no explicit dimensions, so the command can work at different sizes and different fonts.
I also add a *-version that copes with the problem of a “deep” function argument.
\documentclass{...
2
votes
How to make a new command that accepts math parameters?
You do not need any $ at all in the command:
\documentclass{article}
\usepackage{amssymb}
\usepackage{graphics}
\DeclareRobustCommand{\rest}[1]{\raisebox{-5.8pt}{\scalebox{1}[2.6]{$\upharpoonright$}}...
0
votes
\xhookrightarrow "undefined" even though I have mathtools loaded
First of all, I would like to inform you that there is no two direct commands in LaTeX, to my memory, such as \Mod and \PU. I don't know if they were declaredin the preamble that you didn't add as ...
0
votes
Absolute Value Symbols
\documentclass[a4paper,12pt]{article}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{esvect,commath}
\author{Nguyễn Văn Minh Hiếu}
\begin{...
Top 50 recent answers are included
Related Tags
math-mode × 9414amsmath × 955
symbols × 910
equations × 868
fonts × 800
spacing × 684
align × 557
macros × 370
math-operators × 366
horizontal-alignment × 318
formatting × 277
matrices × 263
errors × 257
subscripts × 245
tables × 214
tikz-pgf × 195
line-breaking × 193
unicode-math × 184
brackets × 183
xetex × 173
vertical-alignment × 162
beamer × 160
accents × 160
bold × 155
superscripts × 150