Skip to main content
OverflowAI is here! AI power for your Stack Overflow for Teams knowledge community. Learn more
7 votes

How do I write a repeating decimal in LaTeX?

Just for completeness, here is a possible approach for this macro in the traditional TeX programming: \def\afterfi#1#2\fi{\fi#1} \def\periodfl#1{\pflA#1.} \def\pflA#1#2{\dot#1\ifx.#2\else\afterfi{\...
wipet's user avatar
  • 75.4k
7 votes

Making a character active in a macro

At the time of \def\MakeCommaBreakable's body been scanned, the , in \def, does not yet have catcode set to 13, and after the scanning the catcode would be saved thus won't be affected by catcode ...
LdBeth's user avatar
  • 1,018
7 votes
Accepted

Vertical spacing of argmin subscript

You need to reinstate \operator@font inside \smash, which uses the standard math fonts. \documentclass{article} \usepackage{amsmath} \makeatletter \DeclareMathOperator*{\argmin}{\smash[b]{\operator@...
egreg's user avatar
  • 1.1m
6 votes
Accepted

Definition of \sum -- how does the size selection work

The \sum is big operator which has two sizes implemented in the math font. Each character or control sequence typeset in math mode has its mathcode, which includes the math class (Ord or Op or Bin or ...
wipet's user avatar
  • 75.4k
6 votes

Vertical spacing of argmin subscript

Perhhaps this? Smash just the g and make sure it is presented as text (roman) rather than math (italic). EDITED per the advice of campa to use \mathrm instead of \text and of barbara to \smash only ...
Steven B. Segletes's user avatar
6 votes

Alternative for an exponent's position

You can use \mskip or \mkern to move the exponent right and use \raise to move the exponent up a little. \documentclass{article} \begin{document} \[\frac{\rho gH^4}{R_{E-G}^2} \quad \frac{\rho gH^...
Stephen's user avatar
  • 4,084
5 votes
Accepted

How to break alignment on a row inside the align environment?

Here's a solution that encases an alignedat{3} environment in a gathered environment, itself encased in an equation environment. Compared with aligned, alignedat offers finer control over the spacing ...
Mico's user avatar
  • 510k
5 votes
Accepted

Alternative for an exponent's position

I don't think you should try to “fix” it. If “E-G” are “indexes” (indices), shouldn't they be typeset in upright type with a hyphen rather than a minus sign? Here are a few ways to interpret the issue....
egreg's user avatar
  • 1.1m
4 votes
Accepted

Bold round/first brackets

Confirm that the math font are of mtpro2 (seen the @Stephen' comment): here an example. \documentclass[12pt]{article} \usepackage{newtxtext,amsmath} \usepackage[lite]{mtpro2} \begin{document} A ...
Sebastiano's user avatar
  • 55.2k
4 votes
Accepted

Can't Find Error for the Life of Me

The parameter of \overrightharp is typeset in text mode (see https://mirror.las.iastate.edu/tex-archive/macros/latex/contrib/harpoon/harpoon.pdf), so using $\overrightharp{\lambda}$ doesn't work since ...
invalidsyntax_'s user avatar
4 votes
Accepted

Make zero and plus sign same size inside subscript in math mode

I'm not sure it's a good idea, but you're the judge. \documentclass{article} \usepackage{amsmath} \usepackage{graphicx} \newcommand{\subplus}{{% \resizebox{\fontcharwd\scriptfont0`0}{!}{$\...
egreg's user avatar
  • 1.1m
3 votes
Accepted

Orthogonal direct sum typeset (with hat)

\documentclass{article} \begin{document} $U_1 \mathbin{\hat\oplus}\dots\mathbin{\hat\oplus}U_m$ \end{document} If you don't like the look of \oplus, then make your own: \documentclass{article} \...
Steven B. Segletes's user avatar
3 votes
Accepted

Drawing sphere with 6 points using TiKz

Here's a way to have your hand drawing, while your screencopy follows in a similar way. Some remarks: in general, don't try too much in one go; loops have a hard time here, because you try combining ...
MS-SPO's user avatar
  • 12.7k
3 votes
Accepted

Making a character active in a macro

The trick is to make the comma math active This way, the command \MakeCommaBreakable can properly go inside the formula, so the effect of math activation is confined. \documentclass{article} \...
egreg's user avatar
  • 1.1m
3 votes

How I can write long equation in LaTeX?

A variant with array. But notice \innpr, in particular around integrals. \documentclass{article} \usepackage{amsmath, amssymb,array,mathtools} \DeclarePairedDelimiter{\innpr}{\langle}{\rangle} \...
egreg's user avatar
  • 1.1m
3 votes

\vdots missing in Fira Math?

I thought of a different solution than the one on the previous answer, so I decided to share it, although I think it is less elegant. The graphicx package provides the command \rotatebox, which allows ...
Níckolas Alves's user avatar
3 votes
Accepted

Setting font face for \mathrm in math mode

As you've observed, \mathrm takes the "Roman" (i.e., upright) font face from the prevailing text font, not the prevailing math font. To force usage of the plain (non-bold) upright glyphs ...
Mico's user avatar
  • 510k
3 votes

Setting font face for \mathrm in math mode

You want to choose a different font for \mathrm and fontspec allows this. \documentclass{article} \usepackage{enumitem} \usepackage{babel} \usepackage{unicode-math} \babelprovide[import, onchar=fonts ...
egreg's user avatar
  • 1.1m
3 votes

How to break alignment on a row inside the align environment?

align doesn't have any \multicolumn equivalent but you could arrange the columns have more equal spacing or use gather(ed) and not align at all. \documentclass[a4paper, 11pt, twoside, titlepage]{...
David Carlisle's user avatar
2 votes

Add \dot{\tilde{\mathbb{x}}} to a document

My answer give a comparison between \tilde and \widetilde. \documentclass[a4paper,12pt]{article} \usepackage{amsmath,amssymb} \begin{document} $\dot{\tilde{\mathbf{x}}}$ \end{document} \documentclass[...
Sebastiano's user avatar
  • 55.2k
2 votes

How I can write long equation in LaTeX?

Some suggestions after @Sebastiano 's answer: a) I would much prefer it if lines were equidistant. A (crude) way to achieve this would be by using a \phantom{\int_0^t} in the shorter lines. b) I would ...
nplatis's user avatar
  • 2,200
2 votes

Summation Sign Font

Updating 1: 2024/05/03 The \sum symbol is taken from pakage txfonts: see short MWE and of the figure. %% Compile and read me! \documentclass[a4paper,12pt]{article} \usepackage{txfonts} \usepackage[T1]{...
Sebastiano's user avatar
  • 55.2k
2 votes

bold math in latex minipage

You can vastly simplify the input. \documentclass[11pt]{article} \usepackage{amsthm, amsmath,graphicx,mathtools,booktabs} \newcommand{\Oplus}[1]{% \vcenter{\hbox{% \settoheight{\dimen0}{\...
egreg's user avatar
  • 1.1m
2 votes
Accepted

Is there a proper way to put `\fillin[]` inside `align` environment in the LaTeX `exam` class?

These are by no means errors. The Overleaf editor is instructed to mark cases where there are $ signs inside a known math display environment. The text you give in brackets is the correct answer and \...
egreg's user avatar
  • 1.1m
2 votes
Accepted

Automated text style in math mode

For the question about the pzc font you can hook into $ using \everymath. This is not always very robust but maybe it is sufficient for your purposes. This approach requires one additional step, which ...
Marijn's user avatar
  • 38.1k
2 votes

Checking if the contents of the \item's of a \list environment are entirely in inline math mode

A comment up front: Instead of employing a very-low-level list environment and then having to hand-edit the appearance of each and every \item label, I suggest you load the enumitem package and type \...
Mico's user avatar
  • 510k
2 votes

I want to increase the line spacing in the following array table, what should I do?

With {NiceArray} of nicematrix, you have an option cell-space-limits to set a minimal space above and below each cell. Moreover, the key hvlines draws all the rules. \documentclass{article} \...
F. Pantigny's user avatar
  • 41.6k
2 votes

Make zero and plus sign same size inside subscript in math mode

By default, TeX renders first-level subscript (and superscript) material in \scriptstyle, with a 30% reduction in font size, while second-level subscript (and superscript) material gets rendered at an ...
Mico's user avatar
  • 510k
2 votes
Accepted

Math symbols in minted

As you are using an unicode-aware engine, you'll just need to pick a monospaced font which has the glyph. To find out, which fonts on your computer have the symbol, type albatross ≥ in a terminal and ...
samcarter_is_at_topanswers.xyz's user avatar
2 votes

Math symbols in minted

If you are tied to pdflatex, you can fake the symbol. I also add ≤ for completeness. \documentclass{article} \usepackage{minted} \usepackage{newunicodechar} \newif\ifmintedsub \newunicodechar{≤}{\...
egreg's user avatar
  • 1.1m

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