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

130
votes
1answer
18k views

Should I use center or centering for figures and tables?

What is the correct way to center figures and tables (figure, table)? \begin{center} ... \end{center} or \begin{centering} ... \end{centering}
51
votes
4answers
6k views

What is the difference between 'fil' and 'fill'?

TeX provides the commands \vfil and \vfill (and their corresponding horizontal versions \hfil and \hfill). These commands are actually defined as: \vskip 0cm plus 1fil \vskip 0cm plus 1fill where ...
49
votes
2answers
28k views

When should we use \begin{center} instead of \centering?

After reading this question Should I use center or centering for figures?, I want to know the answer of the following. When should we use \begin{center} instead of \centering? For example, should we ...
48
votes
3answers
13k views

Center figure that is wider than \textwidth

I have a figure that is wider than the \textwidth of my document. (I don't want to change the \textwidth.) As a result, the leftmost part of the figure is flush with the left margin, while the ...
47
votes
2answers
62k views

How to create fixed width table columns with text raggedright/centered/raggedleft?

I would like to create a table with some columns' width specified, while the text in those columns should be centered both horizontally and vertically. I found out that \usepackage{array} ...
45
votes
6answers
1k views

Starting a line where the previous line finishes

I have been using LaTeX for standard things like letters and scientific reports. I recently came to visit my grandmother who writes some poetry and told her I could make a nice pdf from her ...
44
votes
1answer
3k views

Manual/automatic line breaks and text alignment in TikZ nodes

How can I insert a line break in a TikZ node? Simply putting \\ where I want the break doesn't work (see MWE). Is there a way to make lines break automatically at some specified width? And can I ...
44
votes
1answer
10k views

Aligning numbers by decimal points in table columns

Let me begin by stating that I did google the answers (and I'll reference to them soon). Yet each of the resources I found discussed one particular method, I'm interested in a comparison of the ...
37
votes
6answers
5k views

Best way to create an system of equations environment?

I am trying to write a few systems of equations, and I want the terms to be nicely spaced as below 2x + y + 3z = 10 \\ x + y + z = 6 \\ x + 3y + 2z = 13 Now, using ...
34
votes
3answers
10k 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 ...
29
votes
2answers
14k views

Center column with specifying width in table (tabular enviroment)? [duplicate]

I have table that has long headers and I would like to specify width of the column, but also be able to remain it's centred position. Something like |c{0.30\textwidth}|. It is possible? How to ...
29
votes
2answers
491 views

Does combining microtype with ragged right make any sense?

My impression when using microtype in a document that used \RaggedRight (everything said is probably true for \raggedright as well but who cares really ...) always was that all lines just get ...
27
votes
2answers
486 views

Is there a tool that makes paragraphs into rectangles?

I was just wondering if there was a LaTeX tool for making paragraphs of text into perfect rectangles. The effect is shown below in a schematic
27
votes
2answers
378 views

Align nodes containing numbers on the decimal separators

In a plot, I have several vertically distributed nodes containing numbers with different numbers of digits before and after the decimal separator, and a trailing percent sign. I would like to align ...
25
votes
3answers
4k views

Centering \vdots in a system of many equations

I have a system of equations with an arbitrary number of equations (k). I'd like to use \vdots to compactly describe the system, like so: \begin{align*} R(-1) &= \sum_{i=1}^m A(i)R(i-1) \\ ...
25
votes
2answers
18k views

Vertically center cells of a table?

What is the easiest way to center align each row of table? I have a table column that contains an image and other cells in the same row contain text. I would like to know how to vertically center ...
24
votes
3answers
625 views

Strange default exponent positioning?

Why is this red exponent so far away from the right parenthesis? To my eye it is too far away. \documentclass{article} \usepackage{xcolor} \begin{document} ...
24
votes
3answers
905 views

Can I get full justification for italic text?

In the TeXbook, Knuth notes that italics can lead to problems with justification: EXERCISE 14.16 When an entire paragraph is typeset in italic or slanted type, it sometimes appears to be offset ...
23
votes
7answers
530 views

Writing a table with equally spaced columns, based on the widest column

Friends, I'm trying to generate a table in which I have all columns equally spaced (same width). In my case, the width for all columns would be the width of the widest column of the table: ...
23
votes
4answers
520 views

unexpected interaction between \raggedright and \parshape

While answering Random start of line, I came upon a strange interaction between \raggedright and \parshape. If a ragged-right paragraph ends in a short line, this line will be "the most ragged". ...
22
votes
2answers
7k views

Line breaking of URLs in bibliographies

I have a problem with the line break of an URL. The URL can´t break correct and extends into the border. I´ve tried some things. Amongst others I loaded the package breakurl, but without any success. ...
22
votes
1answer
11k views

Changing left margin in itemize environment of beamer class

I can't figure out how to line up the symbols of an itemize environment in beamer with the left part of the main text. In other words, I would like to supress the left margin in beamer itemize lists. ...
21
votes
3answers
60k views

How to center text without adding space AND not altering alignment of surrounding text?

In normal text, how do I center part of a sentence (it happens to be the end of a sentence) but leave the text in the rest of the paragraph unaltered? Also, no vertical space should be added before or ...
21
votes
4answers
30k views

How to make text aligned left/center/right in the same line?

I am trying to align some text to left/center/right in the same line. For example, I want to put my phone number on the left, my name in the center, and my email on the right, how do I do that?
20
votes
3answers
68k views

How do you center equations?

I can't seem to center equations without causing some weird formatting problem. The following results in the R being dropped: \begin{center} E(R_{i,t})=E(\alpha_i)+E(\beta_{i,F_1 } ...
20
votes
5answers
478 views

“Q” and “A” in margin - out of alignment

I have defined a command for a letter in the margin as follows (using marginnote because marginpar did not work at all): \newcommand{\sideletter}[1]{\marginnote{\Huge\bf\sffamily\color{orange} #1}} ...
20
votes
3answers
8k views

How do I left-align entries in a matrix with \begin{matrix}?

I'd like to left align the -1 entry in the following matrix so that the 1s line up. Is there a way to get matrices to ignore signs in that way? \begin{matrix} 1 & 1 \ 1 & -1 \ ...
20
votes
2answers
5k views

What is \null and when do we need to use it?

Up to now I don't understand well what \null actually is and when we need it. I have only known that it can be used to create hypothetical anchors as follows. \documentclass{article} ...
20
votes
2answers
11k views

Difference between flushright and raggedleft

What is the difference between flushright and raggedleft?
20
votes
1answer
5k views

Underfull \hbox in bibliography

I am getting lots of "Underfull \hbox" warnings that point to the *.bbl file. It looks like these messages appear only when URLs are very long, like in the below example: @techreport{nistguidesec, ...
20
votes
1answer
5k views

How to center a listing?

I'm trying to get some console output in my homework. I put it in a listings environment but I want it to be centered horizontally on the page. The only thing I get centered is the caption ;-/ ...
19
votes
6answers
3k views

Skip to absolute position on line

Is there a way to skip to a fixed position on a line? (a specific tab position) Example: The quick \skiptoposition{1.5cm} brown \skiptoposition{2.5cm}fox which would put "brown" 1.5cm and "fox" ...
19
votes
2answers
6k views

How can I center a too wide table?

I have a document containing a table which is slightly too wide for the page. But instead of growing to the right side only, I would like to have it centered on the page. I have tried to use the ...
19
votes
2answers
203 views

What's a quick way to align text?

I am often writing quick statements in which I would like the following lines to continue underneath the end of the first. Is there a quick way to do this (requires arrays?) this is the first ...
18
votes
5answers
10k views

How can I automatically center an image?

I use: \documentclss{mwrep} ... \begin{figure} \includegraphics{a.jpg} \caption[Long caption]{Caption} \label{pic-a} \end{figure} How can I make images to be always visible on the center of page? ...
18
votes
3answers
1k 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} ...
18
votes
4answers
2k views

Centering \section* and adding them to the ToC

I'm using LaTeX and the book class and have one problem: I want that my starred sections (only starred sections) appear in the center of the pages instead of the left side of the pages and also these ...
18
votes
3answers
31k views

How to center large figures in LaTeX and how to fix short justified lines?

I have 2 questions: I am trying to center a figure in LaTeX, but above a certain size it just starts at the left margin and goes beyond the right. How can I make it actually center, so the amount it ...
18
votes
3answers
6k views

Justify text in moderncv cover letter

I am writing a cover letter and CV using moderncv. Everything works fine so far, but the text in the cover letter is not justified. I think it is good that it is not hyphenated, but it would look much ...
18
votes
1answer
10k views

Fixed column width table with text left aligned in cells

\section{Section Title} %label{8.4.47} \subsection*{Some note on Section} \begin{footnotesize} \begin{tabular}{p{2cm}|p{4cm}|p{3cm}|p{3cm}} Heading 1 & Heading 2 & Heading 3 & Heading 4 ...
17
votes
4answers
3k views

Horizontal equivalent to \raisebox?

Is there a horizontal equivalent to \raisebox? I'd like to shift some content horizontally without altering the layout of surrounding content. Edit: I feel bad because my question wasn't precise ...
17
votes
4answers
8k 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 ...
17
votes
3answers
861 views

Alignment of multiple variables in a linear system

I am trying to lay out a few linear equations, but with the different variables aligned in columns like this: x + y = 1 } x = 0 y + 2z = 1 } y = 1 x + z = 0 } z = 0 (with ...
17
votes
3answers
15k views

making a table fit on a page by moving it left

I have a table where the last columns fall off the page. Instead of making the text smaller I would like the table to not adhere to the margin of where it begins. I would like to move it to the left. ...
17
votes
4answers
3k views

Place figures side by side, spill into outer margin

I would like to place two figures side by side (not subfigures) and what’s more, I’d like to let the figures spill into the outer margin (since they are too wide for the the text width. Like this: ...
17
votes
2answers
5k views

Alignment of equals sign in multiple align environments

I have multiple align environments in my document, separated by a small paragraph of text: \begin{align*} foo &= something very very long compared to the other align \end{align*} explanation ...
17
votes
1answer
412 views

Precision copyfitting in xcoffin

Further indulging my curiosity with xcoffins, I'm playing with xcoffins-tschichold-example.tex. In the TeX reconstruction of the front page of Elementare Typographie, the text is slightly misaligned ...
16
votes
2answers
8k views

Any way to center text within a \parbox?

Probably I'm missing something, but I'm really struggling to find an answer to this simple question: How to center text within a \parbox? Side note: I don't want to switch to any other environment ...
16
votes
1answer
26k views

Change align of a single cell in tabular [duplicate]

Possible Duplicate: Aligning inside tabular environment, specific cell I have a simple table with a given align. I want to know if there is a way to specify a different align for a cell. ...
16
votes
2answers
1k views

Aligning inside tabular environment, specific cell

I'm trying to align specific content of the single cell. For example, \begin{tabular}{|r|r|} \hline 1 & 2 \hline right & to_the_left \hline 1 & 2 \hline ...