Hot answers tagged

34 votes
Accepted

Why is the 'mod' function in LaTeX so wide? (extra space on the left of it)

See section 5.2 of the amsmath manual for the details of \mod and related commands (\mod, \pmod, \bmod, \pod) but the short version is that if you want parens around it, you should use \pmod: \...
user avatar
18 votes
Accepted

How can I convince TeX to add space around math operators?

The space around \binop is \medmuskip and LaTeX follows plain TeX in giving this a value with a large shrink component \medmuskip=4mu plus 2mu minus 4mu You could change this value to get different ...
user avatar
14 votes
Accepted

Extra spacing on the left of operator?

Typing in |\sin x| is a very common error and my eyes bleed every time I see it. The problem is that | is treated as an ordinary symbol, which makes it handy to type |x|, but fails miserably when one ...
user avatar
  • 992k
10 votes
Accepted

Automatically smash all inline math

Of course \smash is not meant for this. Forget it. If you really want that the space around binary operation symbols is not affected by justification adjustments, simply do \medmuskip=1\medmuskip in ...
user avatar
  • 992k
10 votes
Accepted

When a Period Immediately Follows the Lettrine --- A Typography Question

The lettrine makes a box and after a box the space factor is set to 1000. So the period is treated as sentence ending. Add \@ after the period. \documentclass[12pt]{book} \usepackage[T1]{fontenc} \...
user avatar
  • 992k
9 votes
Accepted

Spacing after \mathinner

! is \mathclose not \mathord alledgedly to improve the spacing in its conventional use as factorial. However the only case where this affects the space before the ! is with \mathinner (\left\right) ...
user avatar
9 votes
Accepted

\frac with mathpazo: bar too close to denominator

Let’s briefly go through how TeX creates a fraction (many details will be ignored for the sake of simplicity). First, TeX needs to know where the fraction bar should be drawn and how thick it should ...
user avatar
  • 9,278
9 votes
Accepted

Dost thou feel that I reinvent the wheel? (Trying to create my own lightweight antilabe macro.)

You can use zref-savepos. Two runs of LaTeX are necessary if a new \antilabe macro appears. The macro \antilabe will save the x-position of the last word in the line and in the next nonempty line (...
user avatar
  • 992k
9 votes

Triangular Node has Unexpected Inner Space

According to the doc for regular polygon (pgfmanual v3.1.9a, sec. 71.3 "Geometric Shapes" or this online version), border of this shape is always constructed using the incircle, hence may ...
user avatar
  • 21.7k
9 votes

How can I place two circuit diagrams next to each other?

As Tom said before, please always provide a minimal working example (MWE). Your problem is pretty simple. You have a blank line here: \end{tikzpicture} \begin{tikzpicture} That creates a new ...
user avatar
  • 2,164
8 votes

Understanding the alignment issues with split and phantom

Here's a \phantom free implementation, using instead a nested aligned. The biggg fences are courtesy of https://tex.stackexchange.com/a/387592/4427, but you should try harder to avoid them: I find the ...
user avatar
  • 992k
8 votes

How can I have spaces in text within a formula?

I suggest you use \text instructions for the 2 strings that don't need line breaking and \parbox directives for the 2 strings that do. Both \text and \parbox typeset their arguments in text mode, ...
user avatar
  • 439k
8 votes

Should I put "\" or "{}" at the end of commands?

There should be no difference between using \LaTeX{} or \LaTeX\ as far as spacing is concerned. As mentioned in the comments there must be something else going on in your example, and for this you ...
user avatar
8 votes
Accepted

Why does my matrix look so vertically spaced apart?

Countermand \linespread{1.5} with \renewcommand{\arraystretch}{0.66667} Full example: \documentclass{article} \usepackage{amsmath} \linespread{1.5} \renewcommand{\arraystretch}{0.66667} \begin{...
user avatar
  • 992k
8 votes
Accepted

How can I place two circuit diagrams next to each other?

I don't know why you define those nodes that you won't use them. Those will create empty space in your figure. I have deleted them. And notice: If next time you ask a question, please provide a ...
user avatar
  • 4,053
7 votes
Accepted

Incorrect spacing when placing binary operator in macro

a \begingroup group does not affect spacing in the same way. \documentclass{article} \usepackage{xcolor} \newcommand{\typo}[1]{\begingroup\color{red}#1\endgroup}% for pointing out that there is a ...
user avatar
7 votes
Accepted

Figures three spaces after and before text

Here are the lengths associated with vertical spacing around floats (from the layouts package, section 6.2 Detailed float layout): You should be able to set the lengths \textfloatsep and \intextsep (...
user avatar
  • 567k
7 votes
Accepted

Are \onehalfspacing and {spacing}{1.5} Supposed to Yield Different Results?

The environment name is onehalfspace, not onehalfspacing AND, it is (for a 10pt document) equivalent to \begin{spacing}{1.25}. \documentclass{book} \usepackage{setspace} \usepackage{lipsum} \begin{...
user avatar
7 votes
Accepted

Why are there two commands \> and \: that do the same thing?

In plain TeX, Knuth used \> for \mskip\medmuskip: \def\,{\mskip\thinmuskip} \def\>{\mskip\medmuskip} \def\;{\mskip\thickmuskip} \def\!{\mskip-\thinmuskip} LaTeX uses \> with a different ...
user avatar
  • 992k
6 votes

Align individual letters below each other

How about this? \documentclass{article} \setlength{\tabcolsep}{0pt} \begin{document} \begin{tabular}{ c c c c c c c c c c c c } C&R&Y&P&T&O&G&R&A&P&H&Y \\...
user avatar
  • 7,877
6 votes

cellcolor in array LaTeX

How about this? \documentclass[border=5pt]{standalone} \usepackage{amsmath} \usepackage[table]{xcolor} \usepackage{array} \begin{document} $\left(\begin{array}{ccccc|lr} ...
user avatar
  • 7,877
6 votes

Understanding the alignment issues with split and phantom

I would use nested aligned rather than trying to force align,ent with phantoms, I would also use the seconf form I think with defined variables for the subterms (I wouldn't leave the first form with ...
user avatar
6 votes

French representations of functions

I prefer to draw this kind of diagram with tikz-cd package. I have written the open interval using \DeclarePairedDelimiter from mathtools \documentclass{article} \usepackage{mathtools} \usepackage{...
user avatar
  • 2,250
6 votes

Spacing problem with \usepackage{siunitx}

You should remove the quantity-product = {,} option. This sets the symbol to be used between the number and the unit, and is set to \, by default. In your MWE it does nothing because it should be set ...
user avatar
  • 12k
6 votes

How can I have spaces in text within a formula?

Load the amsmath package (or mathtools which also loads amsmath). The amsmath package offers the function \text{}. The \text{} function is intended to be used within math and respects spaces, e. g. \...
user avatar
6 votes
Accepted

left aligning \[ \] $$ $$ formulas

The simplest solution uses the fleqn environment, from nccmath: \documentclass{article} \usepackage{amsmath, nccmath} \usepackage{showframe} \renewcommand{\ShowFrameLinethickness}{0.4pt} \begin{...
user avatar
  • 261k
6 votes
Accepted

Why is the spacing so large on this equation?

Since you're setting your questions inside a \parbox, it will necessarily be justified. And justification requires content to stretch to fill the line as needed, which happens around binary and ...
user avatar
  • 567k
6 votes
Accepted

Extra space with \ensuremath in acro

You're responsible of those spaces. I denote by ! the significant ones and with x those that are ignored because they are processed in math mode: \newcommand{\BS}[2]{ \ensuremath{ { \mathcal{#1}_{\...
user avatar
  • 992k
6 votes

Remove unwanted vertical space before and after math (and other) environments in tabular cells

For math equations you can use any of amsmath math environments: aligned, gathered and split With tabular the result is not very nice: \documentclass{memoir} \usepackage{amsmath} \begin{document} ...
user avatar
  • 255k
6 votes
Accepted

How to set more separation for certain latex symbols

You seem to want \widetilde{\in} to be a relation symbol; but the problem is that accenting a symbol makes it to lose its type and produces something treated as an ordinary symbol. This can be cured ...
user avatar
  • 992k

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