Skip to main content
9 votes
Accepted

Vertical alignment issue with tikzpicture

The issue is that positioning commands measure distance from the edges of the nodes, not the centers. To measure from the center of the previous node, use right = 2cm of Spec-Gauss.center. To measure ...
Sandy G's user avatar
  • 46.6k
7 votes
Accepted

Add a space after itemize only if no text follows

Would this do? \documentclass{article} \usepackage{enumitem} \setlength{\parskip}{10ex} \setlength{\parindent}{0pt} \newenvironment{enumerateD}{\begin{enumerate}[topsep=-\parskip]} {\end{enumerate}\...
Willie Wong's user avatar
  • 25.7k
7 votes

Aligning Question

I suggest you use an array environment and use the r column type for the 15 data columns. The data columns will all have equal width, given by the width of $-6$. \documentclass{article} \usepackage{...
Mico's user avatar
  • 515k
6 votes
Accepted

How can I align keys A, B, C, D exam-randomizechoices?

Note that oneparchoices is a paragraph. It only looks like a tabular because of all entries are the same width. First you need to make \correctchoicelabel the same width as choicelabel. When doing ...
John Kormylo's user avatar
  • 81.2k
6 votes
Accepted

Creating a complex aligned equation with blockarray

Here is a possibility with nicematrix. One way to guarantee alignment in different arrays is to make them both part of the same array (or in this case, the same NiceMatrix). \documentclass{article} \...
Sandy G's user avatar
  • 46.6k
6 votes
Accepted

Why isn't the part title vertically centered by default?

The part page is forced with a forced pagebreak, in your example by \end{document} which does \clearpage which does \newpage. newpage is \def \newpage {% \if@noskipsec \ifx \@nodocument\relax ...
David Carlisle's user avatar
6 votes
Accepted

Same code produces differing results page to page

The hook you're adding material to at shipout shouldn't be used to add anything to the vertical list (ltshipout-doc). It isn't, in fact, getting added to the currently shipping out page, but to the ...
cfr's user avatar
  • 208k
6 votes
Accepted

Vertical alignment of array inside array

Here is a solution with {bNiceArray} of nicematrix. \documentclass{article} \usepackage{nicematrix} \begin{document} \[\begin{bNiceArray}{c|c|c}[cell-space-limits=2pt] \begin{pmatrix} 1 & 2 \\ 3 ...
F. Pantigny's user avatar
  • 43.2k
5 votes

Top aligning chemmacros pictures

Lower both formulas by their height. I changed the loading part, bacause a warning appears if module is given in \chemsetup. \documentclass[12pt]{article} \usepackage{upgreek}% to avoid an annoying ...
egreg's user avatar
  • 1.1m
5 votes

How do I move the \fboxsep in the middle

Don't use \null as it doesn't have any height. Instead, set a \phantom number; it'll allow you to have a box that roughly matches the size of the contents. Also, define a command that can do all of ...
Werner's user avatar
  • 607k
5 votes
Accepted

Circuitikz with Labels on the right side

Ah, I got it. What I normally do is choose an element in the circuit drawing, name it (naming the node or the element), and then align the table to the baseline of that element. For example, in the ...
Rmano's user avatar
  • 42.2k
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
  • 515k
5 votes
Accepted

Vertical centering of math in a table

With {NiceTabular} of nicematrix and its key cell-space-limits. \documentclass{article} \usepackage{mathtools} \usepackage{nicematrix} \begin{document} \begin{center} \begin{NiceTabular}{w{c}{1.5cm}...
F. Pantigny's user avatar
  • 43.2k
4 votes
Accepted

Vertically aligning the center of text and images

You can write a text wrapper around the \vcenter primitive (which is basically what also adjustbox dos internally). A starred form ignores the depth of the content. \documentclass{article} \...
campa's user avatar
  • 31.9k
4 votes

Vertically aligning the center of text and images

You could use the adjustbox package: \documentclass{article} \usepackage[showframe]{geometry} \RequirePackage{atbegshi,picture} \AtBeginShipout{% \AtBeginShipoutUpperLeft{% \put(\...
lukeflo's user avatar
  • 1,597
4 votes
Accepted

Align equations with align

Two renderings (I'd prefer the second one, avoiding the unsightly blank space). \documentclass{amsart} \newcommand{\commentedrel}[2]{% #1 = relation, #2 = comment \overset{\substack{\text{\makebox[...
egreg's user avatar
  • 1.1m
4 votes

Align equations with align

Something like this? Do note that none of the \left and \right sizing directives in your code do anything useful. Get rid of them. \documentclass{amsart} \usepackage{mathtools} % for '\mathclap' ...
Mico's user avatar
  • 515k
4 votes

Vertically centering subtable in cells of a main longtable

The way you're entering the data in the longtable environment, LaTeX "knows" about individual cells -- and about shifting some of the down (or up) if they're the argument of a \multirow ...
Mico's user avatar
  • 515k
4 votes

Vertical alignment of \underset

With some “primitive” coding: \documentclass{article} \usepackage{amsmath,amssymb} \makeatletter \newcommand{\tofrom}[2]{\mathrel{\tofrom@{#1}{#2}}} \newcommand{\tofrom@}[2]{% \vbox{\...
egreg's user avatar
  • 1.1m
4 votes
Accepted

Problem with vertical centering of cells of a same row of a longtable

I suggest you switch the underlying column type of the L, C, and R column types from p to m. (m is mnemonic for "middle", I suppose.) \documentclass{article} \usepackage{longtable,array,...
Mico's user avatar
  • 515k
4 votes
Accepted

How do I create this simple table using tabularray or something similar?

Welcome to TeX.SE! you should provide MWE (Minimal Working Example), a small but complete document (see @cfr comment). This site is not service "we-do-your-task-instead-of-you", so there is ...
Zarko's user avatar
  • 300k
4 votes

A vertical line separates matrix entries in the tikzpicture matrix environment?

Since Cc and G are not aligned right, whereas D and H are more-or-less aligned left, it's not possible to make it both vertical and have it halfway between both Cc and D and halfway between G and H ...
cfr's user avatar
  • 208k
4 votes
Accepted

Why is the spacing above equation larger than that below, when the \belowdisplayskip = \abovedisplayskip?

If you add \showoutput and look at (for example) the last equation starting Z= you see ...\glue(\parskip) 0.0 ...\glue(\baselineskip) 10.05556 ...\hbox(0.0+0.0)x500.484, glue set 485.484fil ....\hbox(...
David Carlisle's user avatar
4 votes
Accepted

Align the tops of two minipages

Normally, you could use \begin{minipage}[t]{<width>} to top align the minipages, like @Skillmon suggested in the comments. For the specific case of a tcolorbox, you should combine this with the ...
samcarter_is_at_topanswers.xyz's user avatar
4 votes
Accepted

Small vertical spacing glitch

Is this what you are looking for: \documentclass[12pt,letterpaper,twoside]{book} \usepackage{lmodern} \usepackage{amsmath} \usepackage{tensor} \usepackage{pifont} \begin{document} \begin{...
Tom's user avatar
  • 7,733
4 votes

Small vertical spacing glitch

I see, to align the subscripts x and y in the fractions, you can use the subdepth package along with the \smash[b] command. Here's how you can adjust your equation: \documentclass[a4paper,12pt]{...
Sebastiano's user avatar
  • 56.7k
4 votes

Small vertical spacing glitch

In LuaTeX (i.e. in OpTeX too) you can control the numerator default distance from the fraction rule by the \Umathfractionnumup LuaTeX primitive: \Umathfractionnumup\textstyle=.6em \Umathfractionnumup\...
wipet's user avatar
  • 75.7k
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
4 votes

Aligning axes in two graphics vertically in Tikz

You could place both plots in the same tikzpicture: \documentclass[a4paper,10pt,reqno]{article} \usepackage{amsmath} \usepackage[margin=1in]{geometry} \usepackage{tikz} \usetikzlibrary{matrix} \...
samcarter_is_at_topanswers.xyz's user avatar
4 votes

How to Create a Fully Centered and Adjustable Multiline Table in LaTeX?

Your table I woulood design on the following (more profesisional) way. At its codding I also would consider @Kenneth Odle comment: \documentclass{article} \usepackage[margin=25mm]{geometry} \...
Zarko's user avatar
  • 300k

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