{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)

14
votes
1answer
736 views

Align numbers and separated uncertainties in tables with S columns

If I have a table like this \documentclass{article} \usepackage{booktabs} \usepackage[separate-uncertainty=true]{siunitx} \begin{document} \begin{table} \centering \begin{tabular}{ ...
12
votes
1answer
7k views

Place label in middle of line with TikZ

What is the best way to place a label in the middle of a line with TikZ? I mean smack dab in the middle of the line, not above or below it. The following is close \begin{tikzpicture} \draw[|->, ...
12
votes
4answers
5k views

Aligning plain `align` and `cases`?

The cases environment works very well for enumerating cases within a large left bracket. I'd like to be able to combine it with the align environment so that equals-signs and conditions also line up: ...
21
votes
4answers
10k views

How to align table headers differently than all other table cells?

I'm using fixed-width columns with my table, and using both longtable and booktabs packages (as well as tabularx because of \newcolumntype command). In my table, I'll have lots of number data in ...
14
votes
5answers
2k views

In a tabular, how to left align ignoring minus signs?

I'd like to create a table that is aligned left, but minus signs are ignored. E.g., the following gives a normal left-aligned table \begin{tabular}{llll} & a & b & c ...
12
votes
1answer
2k views

right description list LaTeX beamer

How to do right align a description list using beamer? Name | Joel Spolsky Address | Some address Using the enumitem package as suggested in Description list with right alignment of ...
8
votes
3answers
3k views

Format spacing for correlation table (any statistical table)

I'm attempting to format a correlation table for publication but can't get the spacing right when I include significance stars. I'd like to have minimal space between columns. The space between ...
44
votes
3answers
19k views

What is the correct way to center a \tikzpicture? [duplicate]

Possible Duplicate: Should I use center or centering for figures and tables? What is the correct way to cause a \tikzpicture to be centered? By default it appears to be aligned with the ...
16
votes
1answer
27k views

How to center a specific caption?

I'm having a problem with centering my figure captions. Particuarly, I know that we can use \usepackage[justification=centering]{caption} to center captions, however, I'm interested in just centering ...
13
votes
3answers
1k views

How do I obtain multline-type alignment within a group of equations?

I want to achieve something like the following (for now achieved using Microsoft Paint): That is, I want to group a number of multi-line equations within a single equation-type environment (i.e. ...
11
votes
4answers
661 views

Position margin notes relative to left margin in plain TeX

I want to add margin notes in the Tufte style to my Plain TeX document. (I'm using eplain, if that matters.) I know that if I were using LaTeX I could just use tufte-latex, but as a thorough ...
10
votes
1answer
4k views

Negative Sign and Matrix Alignment

I am having trouble centering the elements of a matrix such that the negative sign is not taken into account during alignment. Additionally, I would also like the space between the left parenthesis ...
10
votes
2answers
6k 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 ...
7
votes
1answer
366 views

Right-aligned line-break with long verses in verse

I'm happily using the verse environment to typeset French poetry. However, I'm unsatisfied with the behavior of long-line breaks (when the verse is too long to fit on the page). The verse behavior is ...
7
votes
2answers
6k views

How to place and number 3 short equations in one line?

I have 3 short equations which consume much vertical space, if each one is typeset in a separate line. How can I typeset them in one line in a "mathematically correct" way? I do not necessarily need ...
6
votes
1answer
401 views

\bfseries and alignment in table

I'm trying to highlight some decimal-point aligned entries in two large tables which are arranged in two columns. I'm using \bfseries to do this and unfortunately this seems to be affecting the ...
6
votes
2answers
1k views

How to center the TOC?

I would like to design the table of contents aligned to a vertical line near the center of the page. The chapter and section titles need to be flushright, the numbers flushleft, and between titles and ...
5
votes
2answers
7k views

Alignment of text in itemize environment

I would like to generate a list of "Aims" (1,2,3...etc) as the \item label, with the text for the aim located adjacent (with \hspace{Xmm}). For items that exceed the width of the line, the alignment ...
5
votes
1answer
842 views

Center parts in toc with tocloft

I'm trying to create a toc in a large Latex document which uses the KOMA script. In the toc I would like to center the parts and remove all other components (pagenumber, partnumber). I use tocloft (a ...
5
votes
2answers
428 views

Wrapping \obeylines with \halign into a macro

In the TeXbook, Knuth gives an example: Are you tired of typing \cr? You can get plain TEX to insert an automatic \cr at the end of each input line in the following way: \begingroup \let\par=\cr ...
9
votes
1answer
135 views

Why is this lettrine being bumped into the margin?

Consider the MWE from an earlier question: \documentclass{article} \usepackage{lettrine} %\usepackage{fontspec} %\defaultfontfeatures{Ligatures={Historical}} ...
9
votes
3answers
200 views

How can you change the alignment of calstable?

calstable is always left aligned. \documentclass{article} \usepackage{cals} \begin{document} \begin{center} \begin{calstable} \colwidths{{1.5cm}{1.5cm}{1.5cm}} ...
9
votes
3answers
5k views

Table column width “fill to margin”

I kind of would expect tables to be able to "fill to margin", instead of choosing a number and iteratively rebuilding the document until it is the right size. For example, I want this 2-column table ...
9
votes
1answer
1k views

Using infer from the proof package?

I am using the \infer command from the proof package. Few things that I am trying to do unsuccessfully: How can I have some space between the elements of the proof? such as space between x and y ...
8
votes
1answer
690 views

eledmac and two column footnotes

I like dblfnote and have been working with it for a good while. Now my footnotes are just getting too long and the typesetting results accordingly undesirable, they would be way better if footnotes ...
8
votes
3answers
15k views

How to Center a BeamerColorBox

The question is, how to horizontally center a beamercolorbox on the page? I put it in the center environment, but that doesn't work. \setbeamercolor{bgcolor}{fg=black,bg=blue} \begin{center} ...
8
votes
5answers
5k views

Table will not center (and it is spilling off the right side of the page)

I just generated this table using Excel2LaTeX: Even though I enclosed the table in \begin{center} the table did not get centered. The table still sticks out the right side. Is there somehow that ...
7
votes
2answers
3k views

How to align terms in alignat environment

These are my math equations. To enhance readability, I'd like the third column to be aligned around the + sign; that is, I wish to place some horizontal blank in front of $n\mathbf{A}_0$ (not ...
7
votes
1answer
533 views

TikZ graph not aligning

I am having two issues with TikZ pictures. I have three graphs side by side, and I am having issues, but only with some of them, which is very odd. First the x-axis is going out of alignment (some ...
7
votes
4answers
4k views

Table caption align top-right

How I can align caption for table like this? Current code: \begin{table}[h] \caption{} \centering \begin{tabular}{|l|r|r|l|} \hline № & X & Y & Время ...
7
votes
2answers
2k views

Push a block of lines to the right margin

The following code does what I need: \hbox to \textwidth{\hfill \vbox{ \hbox{some text} \hbox{some other text} } %vbox } %hbox The important things here are: Lines are not ...
7
votes
2answers
18k views

How to center the minipage?

The left margin is too wide if I set 1.5\textwidth: \begin{document} \noindent\begin{minipage}{1.5\textwidth} test \end{minipage} \end{document}
6
votes
2answers
156 views

Is it possible to typeset with angled margins?

I'm typesetting a book using memoir in XeLaTeX, but on some pages, as an accent, I would like to make an angled margin, something like this: Even if I have to define the page limit separately ...
6
votes
1answer
165 views

Aligning and centering a lstlisting with two columns on a page

Consider the following code taken from here to produce a fancy listing : % PACKAGES \documentclass[11pt,a4paper]{book} \usepackage[top=1in, bottom=1in, left=1in, right=1in]{geometry} ...
5
votes
2answers
252 views

Implicit \hfil at the end of each paragraph?

Why do Alpha \hfil\ Omega\par and Alpha \hfil\ Omega not flush "Omega" to the right?
5
votes
2answers
1k views

Beamer table of contents custom bullets: Long section titles do not align

I have redefined the table of contents bullets in my slides to a circled number. However, long section titles which span more than one line do not align with the text from the previous line but with ...
5
votes
1answer
4k views

subcaption/subfigure not centered, and caption too narrow

I'm using the subcaption package to make some subfigures with subcaptions (clearly), in a two column document, specifically the IEEE Transactions journal document class. There are a lot of figures, ...
5
votes
1answer
494 views

Inserting an image on the right

I got a problem in my LaTeX document. I used the codes below: \begin{flushleft} \begin{figure}[tp] \centering \includegraphics{C:/Users/churva/Desktop/wla.jpg} ...
5
votes
3answers
3k views

Why are the lines around my multicolumn cell misaligned?

In the following table, why does the double line before the diff column not go through? I guess all the multicolumn{1} are wrong? How can I fix it? \begin{table} \centering ...
4
votes
1answer
104 views

Auto-numbering table environment with aligned numbers

I'm trying to create a table environment with: A header row that spans an arbitrary number of columns, aligned, automatically numbered cells with aligned numbers uniform spacing between the all ...
4
votes
2answers
16k views

How to right-align a title (without creating a complete custom title page)?

I suppose this is a simple matter, but I'm still finding my way around where to put things in LaTeX. I would like to right-align (i.e. flush to right) the contents of an article's title page. By ...
3
votes
2answers
228 views

Comic book or graphic novel style panels in LaTeX

I have heard that LaTeX is not necessarily suited to make panels. That even two-column is difficult to get the text to align. I would like to draw stuff like this: --------------------------- ...
3
votes
1answer
109 views

Aligned equation which can break through pages [duplicate]

I'm writing long sequences of aligned math equations, and LaTeX interprete them as single, unbreakable objects... which is Ok if the equation is nowhere near the end of the page. Q: Is there a way to ...
3
votes
1answer
2k views

pgfplots and figure centering

I'm wondering about a way to exclude the axis labels and axis graduation from how latex will center the figure with respect to the caption. Labels and graduation along the y-axis (assuming it lies on ...
1
vote
1answer
418 views

Alignement of tikz-pictures and tables in subfigures

Basically, I'm trying to explain the depth-first search. I'd like to align my images in the following manner: I'd like to put two graphs in each single line, with the corresponding 'table' ...
19
votes
3answers
2k views

LaTeX word wrapping poorly

LaTeX is not word wrapping this anything close to sanely: \documentclass{article} \usepackage{graphicx} \usepackage{wrapfig} \usepackage{geometry} \usepackage{lipsum} \geometry{margin=1in} ...
17
votes
2answers
375 views

Why do I have to put the center environment in a group for \@afterindentfalse\@afterheading to suppress indentation?

Consider the following two macros, the only difference being that one has the environment inside a group: \documentclass{article} \makeatletter \newcommand\thisworks{% {\begin{center} $\ast$ ...
15
votes
1answer
507 views

A center environment for plain TeX

In TeX, one can center a single line of text with \centerline. How would one implement a center justification environment for a single long line of text in plain TeX without the addition of any ...
14
votes
6answers
1k views

How to stack boxes like a vertical version of \mbox?

I would like a vertical equivalent to \mbox{} that somehow takes a sequence of boxes and stacks them on top of each other. I'd like the resulting width to be the width of the widest box, and I'd like ...
13
votes
3answers
5k views

How do I (temporarily) cancel centering?

There I was, a-merrily tracing through the depths of beamer's code on the trail of the Dreaded Overprint Hurler of Bexhill-on-Sea, when I came across Something Completely Different. It looked like a ...