As of May 31, 2023, we have updated our Code of Conduct.

New answers tagged

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{...
Mico's user avatar
  • 478k
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.
Nate's user avatar
  • 11
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. \...
egreg's user avatar
  • 1.1m
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}{...
egreg's user avatar
  • 1.1m
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 ...
TimeTravelPenguin's user avatar
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 ...
Mico's user avatar
  • 478k
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)} \...
Willie Wong's user avatar
  • 21.1k
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 ...
Sandy G's user avatar
  • 35.9k
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 ...
Davislor's user avatar
  • 42.2k
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 ...
Simon Dispa's user avatar
  • 36.8k
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 ...
Yellow's user avatar
  • 1
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, ...
Willie Wong's user avatar
  • 21.1k
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}{...
David Carlisle's user avatar
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 ...
egreg's user avatar
  • 1.1m
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 ...
David Carlisle's user avatar
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 ...
wipet's user avatar
  • 65.9k
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 ...
user202729's user avatar
  • 5,779
2 votes
Accepted

Left align a single text line within a block of math equations

Use \shortintertext{and} (from mathtools), with no following \\
David Carlisle's user avatar
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 ...
wipet's user avatar
  • 65.9k
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} ...
CarLaTeX's user avatar
  • 60.5k
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 ...
Mico's user avatar
  • 478k
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 ...
Don Hosek's user avatar
  • 13.5k
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} ...
AndrëZ Rosero's user avatar
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 = {-{...
Zarko's user avatar
  • 283k
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 ...
Qrrbrbirlbel's user avatar
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} ...
Eric Scöerg's user avatar
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}, ...
CarLaTeX's user avatar
  • 60.5k
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\...
Phelype Oleinik's user avatar
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 ...
xFioraMstr18's user avatar
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{...
Sandy G's user avatar
  • 35.9k
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 ...
egreg's user avatar
  • 1.1m
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. ...
egreg's user avatar
  • 1.1m
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} \...
Sebastiano's user avatar
  • 51.3k
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 \...
XCG-2's user avatar
  • 43
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 ...
egreg's user avatar
  • 1.1m
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{...
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} \...
Sandy G's user avatar
  • 35.9k
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 ...
egreg's user avatar
  • 1.1m
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, [...
Siu Zong's user avatar
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.
Jon's user avatar
  • 363
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 ...
giorgio's user avatar
  • 21
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{...
Sandy G's user avatar
  • 35.9k
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 ...
uriyabsc's user avatar
  • 131
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 ...
wipet's user avatar
  • 65.9k
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$. \[ ...
3141592653589793238's user avatar
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]{...
miltos's user avatar
  • 2,310
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{...
egreg's user avatar
  • 1.1m
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$}}...
mrCarnivore's user avatar
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 ...
Sebastiano's user avatar
  • 51.3k
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{...
Nguyen Van Minh Hieu's user avatar

Top 50 recent answers are included