{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.
96
votes
1answer
8k 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}
31
votes
2answers
5k 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 ...
24
votes
1answer
3k 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 ...
38
votes
1answer
5k 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 ...
10
votes
3answers
8k views
How to format the chapter heading?
How can I change the chapter heading of the book class to typeset centered chapter names as shown in the image above?
21
votes
2answers
6k views
Center column with specifying width in table (tabular enviroment)?
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 ...
16
votes
4answers
2k 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:
...
14
votes
2answers
3k views
Raggedleft and raggedright simultaneously
This seems trivial, but I'd like a single line to have some text with left-justification and right-justification at the same time, eg.
left text here ...
15
votes
5answers
2k views
Align two inequalities
I am trying to align two inequlities vertically. The \le signs should have the same horizontal positions and the term in the should be centered. My first attempt:
\begin{align*}
\sum a &\le \sum ...
7
votes
2answers
1k views
Centering a TikZ picture around an area
I often find myself in the following situation: A tikzpicture of mine consists of a main area and some outer material like text labels which are hardly symmetric around the main area. If such a ...
7
votes
2answers
1k views
Balancing long table inside multicol in LaTeX
I would like to put some longer tabular data inside the multicols environment while maintaining its balancing abilities. I have tried supertabular with the trick to redefine \newpage as columnbreak. ...
12
votes
3answers
630 views
Is there a way to measure the remaining space of a line of text?
I'd like to write the following:
Some long paragraph of text \measureremainder{\whatsleft}\begin{mimipage}{\whatsleft}
stuff
\end{minipage}
so that the minipage takes up exactly the remaining ...
25
votes
2answers
29k 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}
...
3
votes
2answers
1k views
Center flow chart horizontally
I have the following flow chart but it appears uncentered. How can I center it?
\documentclass{article}
\usepackage{pstricks}
\usepackage{pst-node}
\usepackage{pst-blur}
\pagestyle{empty}
...
11
votes
3answers
8k views
How to make enumerate items align at left margin?
I would like to have my lists to have no indent for the top level, i.e. having the same left margin as the surrounding paragraph, with just enough space for the widest label to fit:
Paragraph text
...
15
votes
4answers
1k 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 ...
6
votes
1answer
2k 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 ...
42
votes
4answers
3k 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 ...
20
votes
5answers
2k views
Best way to create an system of equations enviroment?
I am trying to write a few system 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 some ...
17
votes
2answers
4k 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. ...
17
votes
3answers
2k 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) \\
...
17
votes
1answer
317 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 ...
14
votes
4answers
383 views
Bump right-aligned text to next line if no room
I'm trying to write a simple command that will put some text right-aligned, but bump it to the next line if it doesn't fit well. Since an image is worth a thousand words:
The "Normally" case is ...
13
votes
2answers
2k views
Split-like environment inside cases environment
I'd like to have a cases environment with some cases that are too long to fit on one line. I tried this:
\begin{cases}
\begin{split}
long expression \\ second line of long expression
...
7
votes
2answers
721 views
Array with labeling columns
Is there an intelligent way to label (or name) columns in a matrix? I would like to have something like
\[M=\left[\begin{array}{c|cc}
1 & 2 & 3\\
4 & 5 & 6
...
13
votes
3answers
10k views
Use flalign or alignat or align or similar environment to align to the left
The following is a small example to use flalign environment to generate equation.
\documentclass{article}
\usepackage{amsmath}
\usepackage{txfonts}
\begin{document}
The formula is:
\begin{flalign*}
...
8
votes
3answers
4k views
How can I center all tables in a document?
Background
Would like to center all tables within floats, without having to add \centering to each table.
Ideas
Tried the following:
\let\originaltabular\tabular
...
11
votes
5answers
5k 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? ...
8
votes
2answers
594 views
How to align comments with lstlistings?
I am using listings with these settings:
\lstset{language=C++,basicstyle=\small\sffamily,
numbers=none,
frame=tb,
columns=fullflexible,
showstringspaces=false
}
I like the proportionally ...
11
votes
5answers
3k views
Align Note below table
My question concerns the "Note" below the table. This is my code:
\begin{table}
\begin{center}
\caption{ Descriptive statistics of total sample based on modified data set}\label{table:descrtotal}
...
14
votes
1answer
6k 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 ...
11
votes
1answer
2k views
Description list with right alignment of labels
I want a description list that looks like the following:
Name | Joel Spolsky
Address | Some address
Some zipcode
Telephone | +31 123 456
E-Mail | ...
10
votes
2answers
3k 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 ...
8
votes
1answer
306 views
Alignments by means of the tikzmark macro
This is a follow up of my previous question Issues and potentiality of the tikzmark macro: dynamic box adaptation. I thought should have been better to ask two questions although they are related to ...
1
vote
2answers
429 views
How to center a verse horizontally
I have a Sanskrit Verse that I want to appear at the center of the page. I am using verse environment as shown below.
\begin{verse}
तपः स्वाध्याय निरतम् तपस्वी वाग्विदाम् वरम् | \\
नारदम् परिपप्रच्छ ...
10
votes
2answers
422 views
Custom alignment of columns in align environment
I need to typeset two columns of equations, each row typeset with an equation number to the right as with an ordinary equation. The first column must be centered, and the second column must be ...
7
votes
4answers
92 views
Bump right-aligned text to next line iff no room
I a chat discussion it was suggested that \hspace*{\fill} (with a space before it to allow for a line break) was sufficient to always get the text following aligned to the right. And indeed, it is ...
6
votes
3answers
568 views
Left-aligned text inside an equation
Inside an equation-like environment, I'd like to have some text that is aligned to the left margin of the text block, something like \intertext, but in the same line as the equation
Something like ...
6
votes
1answer
907 views
Displaying an equation in a list
How could one get a displayed equation inside a list environment, say itemize, so that the equation is both centered horizontally and on the same line as the bullet, but with the bullet still on the ...
5
votes
1answer
126 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}
...
5
votes
1answer
889 views
How to vertically and horizontally centre text and images in (different) table cells?
I have a table which contains images in one column. I would like the first column to have text centred vertically and horizontally. I would like the second column to have text left justified and ...
4
votes
2answers
199 views
multiple pairs of columns
Consider this example code which creates a 2x6 table where the 6 columns are formed from three name/value pairs:
\documentclass{article}
\usepackage[svgnames,table]{xcolor}
\usepackage{tabu}
...
3
votes
2answers
473 views
Centering contents after \unvbox
Trying to build a complex macro, I managed to compute what I need in a vbox.
Now, I want to \unvbox this box to allow page breaks, and would like each element it contains to be centered.
I can't find ...
2
votes
2answers
1k views
Left-aligning LaTeX Bibliography Display
I have problem on how to make the bibliography item left-aligned. My current bibliography output is below.
As you can see, the reference item code is currently right-aligned, and I need it to be ...
2
votes
2answers
2k views
Vertical alignment with subfig and pstricks
I'm working with pstricks to add illustrations to a paper, as I found that it allows me to save much time compared to editing files with dia/xfig/visio/etc. and including pngs.
But I'm having a few ...
18
votes
1answer
4k 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 ;-/
...
12
votes
4answers
304 views
How do I get this strange alignment?
I would like to get a nonstandard alignment in the following code:
\begin{align}
\text{First left hand side} & = \text{First right hand side} \\
\text{Second left hand side} & = ...
15
votes
2answers
9k 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 ...
5
votes
2answers
514 views
Remove additional space around \underbrace{…}
How do I remove the additional space that is added when using \underbrace{...}, to get the same width in both lines:
\documentclass{scrreprt}
\usepackage[ngerman]{babel}
\usepackage[utf8]{inputenc}
...
4
votes
2answers
3k views
Left-alignment like Fleqn-option only for specific equations
I want to left-align some equations. (Note: I want to align the equations themselves, not code inside of the equations.)
I have the following example code:
\documentclass{scrartcl}
...

