{horizontal-alignment} is about aligning document elements horizontally, e.g. typesetting paragraphs using \centering or \raggedright or adjusting the horizontal position of several equation or table components. If your question is generally about (horizontal) white space, use {spacing} instead.

learn more… | top users | synonyms (6)

11
votes
1answer
3k views

Algpseudocode (algorithmicx) package comments

How to align comments in algorithmic environment to the right? For \Comment, if the comment is too long it gets wrapped and starts at the beginning of next line. It would look better if it was aligned ...
11
votes
3answers
15k views

Beamer: How text wrapping around a graphic right aligned?

I want to include a graphic in beamer presentation with right alignment and this graphic should be wrapping by text. I tried three packages but non of them works correct (minimal example below). ...
11
votes
1answer
457 views

Aligning text in S columns in a way that respects the decimal marker for numerical entries

As I understand it, using various options for the S column in siunitx, I may produce columns containing both numerical and nonnumerical entries. I may have the numerical entries aligned at their ...
11
votes
3answers
4k views

How do I center the table of contents title using tocloft?

I'm getting odd behavior using package tocloft to format my table of contents and center the titles "Contents", "List of Figures", and "List of Tables". Using the code suggested in the tocloft ...
11
votes
1answer
369 views

Right aligned text in picture environment slightly off

I'm making some placecards and using the picture environment to try to control exactly where everything goes. My problem is that, in the example below, the two lines are not exactly right-aligned. Any ...
11
votes
1answer
3k views

Describing steps in an equation

I am always describing the steps on how a formula is achieved or describing the underlying Mathematical principles taken to solve a problem in the align environment. But the descriptions are not ...
11
votes
1answer
8k views

Vertical alignment of dots in equation

Consider the following example: \documentclass{article} \usepackage{mathtools} \begin{document} \begin{alignat*}{6} 1 && 2 && ...
11
votes
1answer
577 views

Misaligned month label in TikZ calendar

I'm putting together a multi-month calendar in TikZ and am seeing some awkward and undesired alignment in the month labels despite using the month label above centered style. In particular, the month ...
11
votes
1answer
2k views

Having problems aligning in a table with siunitx when using uncertainties in some power of 10

I'm trying to have a table, with an S column (from the siunitx-package) where the numbers are aligned to the \pm signifying uncertainty. Some values have uncertainties like 1.00 x 10⁴ and that seems ...
11
votes
1answer
3k views

Align equals sign in table

I am trying to align an equals sign between two sets of cells. The first table here doesn't want to align, whilst the second table does. Is there a more elegant way of doing this? ...
10
votes
5answers
738 views

In LaTeX, make a box with the width of another text

I am looking for a command like \makebox{text to set width}[c]{new text} which would make a box with the width of text to set width containing ____new text____ centered.
10
votes
1answer
32k views

centering caption of a figure

I want to put the caption of my figure in the center but I can't do that. when I put my figure in the center the caption is also in the center but when the caption is too long and there is a return to ...
10
votes
3answers
6k views

How to put two images side by side and put some symbol in the center?

I want to put two images side by side and put a comparison symbol in between them. Here is the tikz code : \documentclass{article} \usepackage{tikz} \usepackage[margin=15mm]{geometry} ...
10
votes
4answers
5k views

Left-aligning specific text in math-mode

I currently have via \documentclass{scrartcl} \KOMAoptions{ fontsize = 10pt , headings = normal , } \usepackage{amsmath} \usepackage{multicol} \usepackage{siunitx} \begin{document} ...
10
votes
2answers
9k views

Numbers in tables: align by decimal point *and* flush right?

This is a followup question to siunitx: aligning numbers by decimal points in tables doesn't work for bolded or italicized numbers and Aligning numbers by decimal points in table columns. While ...
10
votes
3answers
262 views

Centering disregarding symbol ®

I have a titlepage for a report. This title is split into two lines with only the word "BRAND®" on the second. It should be centered, but should disregard the ® as it is placed in the third line ...
10
votes
4answers
267 views

putting two indices and exponents side to side

I did not find the answer to my following question on the web. I apologize in advance if this question has already been answered somewhere. I would like to write a matrix with the two subscripts and ...
10
votes
2answers
491 views

Selective alignment tabs in tabular/array?

For a while now I've been thinking about an array/tabular feature that would be quite nice to have. It doesn't seem to exist yet, as far as I can discover. And unfortunately, I can't spare the time ...
10
votes
3answers
1k views

TikZ: How to center captions below figures in matrix

I have three figures that I want to align in a matrix. Each figure is drawn in a different way and needs a caption that is centered below the corresponding figure. Here is what I currently have: ...
10
votes
3answers
4k views

Centered box, text inside it flushed right?

I have some text (like a title), that needs to be centered, and some notes to it (multiline - note 1 \\ note 2), which should be directly underneath it and on the left side of it: Some ...
10
votes
3answers
2k views

Centering table column titles above comma-aligned numbers

I am trying to make the following table look nice. With that I want the title to be centered horizontally, and the numbers to be alligned at comma. Here is how it looks now: And my code. ...
10
votes
2answers
350 views

Math Spacing in the presence of a trailing/non-trailing comma

I thought I knew how to use a \hphantom{} but don't know of an easy way to handle this case due to the comma. I want to get the text aligned for the X row. I added the appropriate \hphantom{{}+1} ...
10
votes
2answers
2k views

Properly align numbers with units in table

I need to typeset a table comparing, among other things, the temporal resolution of certain datasets. Ordinarily, I would put the common unit into the table header, and only list the values in the ...
10
votes
2answers
511 views

Infinitely shrinkable glue except if surrounded by text?

Say \a and \b are two macros that expand to some text and either one may be \empty but not both. I want to put \a and \b in a line, centered and separated by a \quad. \hfil\a\quad\b\hfil Problem: ...
10
votes
1answer
1k views

How to keep the alignment of equation array on a new page?

I have a very long equations inside \begin{eqnarray} long equation go over 2 pages... \end{eqnarray} I can't break into two by \begin{eqnarray} 1/n of long \end{eqnarray} ...
10
votes
1answer
6k views

How do I set right alignment in a longtable column with a fixed width?

How do I set right alignment in a longtable column with a fixed width? I have \begin{longtable}{p{3cm}p{8cm}} and I'd like my first column to be aligned on the right.
10
votes
1answer
20k views

Left align (to the page) displayed math

How can I left align the display math environment (either $$ or \[)? I keep running into people asking about the align environment; but I just want to change displayed math from center to left align ...
10
votes
5answers
266 views

Uneven height when using superscript in frac

I want to fine tune some of mine equations, when I encountered this Notice, how the superscript in the derivative operator fits nicely and doesn't lower the symbols in the denominator, while the ...
10
votes
1answer
16k views

Center hrule in the middle of the page

I would like to center a horizontal line on my page and I would like the width of this line to be half \textwidth. Here is what I tried but it doesn't work : \documentclass[10pt,a4paper]{article} ...
10
votes
2answers
1k views

Center Aligning Labels in a enumerate environment

I am trying to get enumerate environment do the following: (subgroup) some description of a subgroup of a group G. (hello!) This subgroup is a hello subgroup of G and satisfies an ...
10
votes
2answers
231 views

\raggedyleft in memoir?

In memoir instead of \raggedright, you can use \raggedyright[<space>] which is much more beautiful in narrow columns. However what I also need is \raggedyleft which does not exist and I don't ...
10
votes
1answer
18k views

How do force center-alignment in a caption in a figure?

When I use the following code: \documentclass{article} \usepackage{graphicx} \begin{document} \begin{figure}[h!] \begin{center} \caption{test} ...
10
votes
1answer
8k views

Centered frame title in beamer

How to set up beamer in a document so that frame titles are centered? Most of the themes seem to use left aligned frame titles.
10
votes
3answers
6k views

How to left align the section title in latex?

I am using the \documentclass{ctexart}, and this document class centers the section title by default. How could I left align the section title?
10
votes
2answers
324 views

Accessing side-bearings in LuaTeX

This question has been solved, in XeTeX, by this code: \def\kright#1{\leavevmode #1\kern-\XeTeXglyphbounds3 \the\XeTeXcharglyph`#1 } \def\kleft#1{\leavevmode \kern-\XeTeXglyphbounds1 ...
10
votes
2answers
635 views

Purpose of “control space”

I could not find enough information on Google about control space (\). What is the purpose of it? Where should it be used?
10
votes
2answers
8k views

Center text in a single table cell

Suppose I have simple table. While I want the columns in general to be flush both right and left, there are certain cells that I want to be centered. \documentclass[12pt,a4paper]{book} \def\x{This ...
10
votes
2answers
11k views

Left and right aligned text boxes

I am writing a thesis and at the bottom of the title page, I need to include two participating institutes. So far, I have come up with this (using \parbox, but I cannot figure out how to right align ...
10
votes
1answer
146 views

Is this a known issue with the centering of eqnarray?

In this example, \documentclass{article} \begin{document} \begin{eqnarray*} A&=&B,\\ C&=&D,\\ E&=&F, \end{eqnarray*} \begin{eqnarray*} A&=&\mathord{B,}\\ ...
10
votes
3answers
19k views

Alignment of horizontal subfigures

I have three images as subfigures. Two images are aligned happily, the first one doesn't line up. All images are the same size (519x346 pixels). This is what it looks like: I'd like to line up ...
10
votes
2answers
11k views

How to align image

If i have in my beamer presentation some list of items and on that slide i wanna add a picture, which i want to be aligned e.g. to right top corner. \begin{frame}[fragile]{III. Override pages} ...
10
votes
1answer
599 views

How to split and align equations when they are inside an enumerate environment?

How to make the first line of aligned equations sit in the same baseline as the bullet and make the equation left justified? \documentclass{article} \usepackage{amsmath} \begin{document} ...
10
votes
1answer
413 views

Using \vtop affects indentation of \intertext

I am using the \iteminput macro from the solution at How to adjust macro to respect current \linewidth? to import content from other TeX files. However, this appears to be effecting the indentation ...
10
votes
2answers
3k views

alignment of multicolumn cell

Consider this table \begin{tabular}{lr@{}l} Bla & \multicolumn{2}{c}{A $\to$ B} \\ \hline X & 23.1&* \\ Y & 7.5& \end{tabular} which produces The second column ...
10
votes
2answers
4k views

How to flush right but align left? [duplicate]

I am writing an introduction, and I need to put my name at the end of it at the right side of the page, but it should be aligned left: Lorem Ipsum is simply dummy text of the printing and typesetting ...
10
votes
1answer
5k views

How can I align the full names in a list of acronyms?

I am using latex to write my thesis report and would like to generate list of abbreviation for same. I use the acrnonyms package to generate it. Following is my minimal code: ...
10
votes
1answer
7k views

tikz nodes: centering with small font

I am trying to create tikz nodes with centered text, but changing fontsize. Unfortunately, while normally-sized text is nicely centered inside the nodes, the smaller text is not centered, but shifted ...
10
votes
2answers
7k views

How to align source code produced by listings package with main paragraph text

I'm using the latex listings package for the first time to format some HTML. I'm noticing that by default, the html code is being pushed further left than the main paragraph text of my document. Is ...
10
votes
2answers
141 views

Alignment of environment inside enumeration

I defined an environment to add notes, i.e. pieces of text that are not strictly relevant to the question at hand but perhaps still interesting to read, via \usepackage[framemethod=tikz]{mdframed} ...
10
votes
3answers
275 views

Aligning matrices

Sorry if this might be a very banal question. I am fairly new to LaTeX and I am having issues with matrices alignment. I am trying to achieve pretty much what is shown in this picture, I have tried ...