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

19
votes
6answers
4k 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" ...
17
votes
2answers
2k 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 ...
7
votes
2answers
4k 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 ...
5
votes
2answers
440 views

Flexible/automatic alternative to multienum?

I'd like to typeset the items in an enumerate environment side-by-side. Preferably, each item would take up only as much space as necessary, perhaps plus some extra padding, and the next item would be ...
11
votes
4answers
4k 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: ...
20
votes
3answers
18k 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. ...
15
votes
1answer
3k 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 | ...
5
votes
1answer
2k 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 ...
5
votes
1answer
834 views

Aligning in text (non-math)

I would like to align some text similar to how the align math environment works. I don't want to put the text in a table, because I don't want it to float. I tried putting the text in a tabular ...
13
votes
1answer
1k views

Centre roman numbers in enumerate environment

I have an enumerated list that uses roman numbers. \documentclass{article} \usepackage{enumitem} \begin{document} \begin{enumerate}[label=\roman*] \item first entry \item second entry ...
6
votes
1answer
2k views

Emulate \hfill in LaTeX equations?

I have a set of equations, where each line consists of a formula and an explanation (info about indices). Now, let's say the structure looks like this: \newcommand{\lw}{\linewidth} \begin{align*} ...
1
vote
1answer
965 views

Align table-text in Lyx 1.6.9

I created a table with normal font text inside. After I select the text and go to Edit>>Text style>>Customized and select Larger, in the input the text looks aligned ok (it's right in the ...
6
votes
1answer
3k views

Center wide longtable (not tabular or tabularx)

I have a long and wide table that does fit on A4 format, but is too wide for the text margins. I want that table to be able to spread over multiple pages, but I also want it to be centered on the ...
4
votes
1answer
555 views

References to align with the rest of the text

I'm using LaTeX2e and don't want the abbreviations that appear in my text (at \cite) to appear also in the left margin of the bibliography, so have: \documentclass{article} ...
6
votes
5answers
865 views

Breaking up an equation in the align* environment

I'm trying to produce the following formatting without use of all the \quad commands to get the last equation to align nicely across the break up (a(x), b(x), and c(x) are actually really long ...
8
votes
2answers
824 views

\raggedouter to typeset marginal text in twoside book

We used the following code fragment \newcommand{\raggedouter}{% \checkoddpage% \ifoddpage% \RaggedRight% \else% \RaggedLeft% \fi% } to provide a ...
1
vote
2answers
620 views

Alignment of columns of nested tables (tabularx)

I want to nest 2 tabularx tables: the columns of the "inside" table belong to a column of the "outside" table and therefore shall be indented and have a vertical line on their side. I tried to do ...
2
votes
3answers
1k views

Align Quote to right

I want to align \begin{quote} Text Author (\cite{Source}) \end{quote} to the right side of the paper. How can I do this?
2
votes
1answer
3k views

How can I use an align environment flush right?

Is there an option analogous within the align environment to the left align for right align, i.e. fralign. MWE: \documentclass{article} \usepackage[fleqn]{amsmath} % Instead have [freqn]. ...
17
votes
2answers
347 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$ ...
10
votes
2answers
4k views

Dynamically size arrow \mapsto in function definition

I have the following diagram: However, this looks a bit ugly, I would like a version that looks a little bit better. For example, size the last arrow such that the T_\phi is moved to the right. ...
2
votes
1answer
195 views

New command for inline text

As I did not get an answer I was fully satisfied with in my last thread, although there were many great suggestions. I will therefore try to rephrase my question here. I also have some new inputs, ...
12
votes
2answers
6k views

\flushleft with p{} option in tabular

If I have defined tabular alignment with the p{} option, \begin{tabular}{p{.3\textwidth}p{.7\textwidth}} ...(contents)... \end{tabular} Is there a way to specify that I want it \flushleft without ...
3
votes
2answers
3k views

Multiple Tab stops in Math Split?

I am using mathmode with split. How can you use multiple tab stops. I want to span an equation across multiple lines, but then the last few I want to indent even more. \[ \begin{split} some& ...
11
votes
2answers
967 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 ...
7
votes
1answer
1k views

Table of contents (minitoc, parttoc) and line breaks

I have to make a table of contents for each part of a book document. I use minitoc package, and \parttoc command. I have line breaks (\\) in the chapters and sections titles in both [] and {} ...
2
votes
1answer
496 views

Text justification in mla-paper package

What command should I use to justify the entire text, both right and left, in mla-paper style package.
6
votes
6answers
2k views

An enumeration of equations with aligned equal signs

I'd like to have something like the following: \begin{enumerate} \item $1 + 1 = 2$ \item $1 = 2 - 1$ \end{enumerate} The thing is, I'd also like the equals signs to be aligned. But I'd like the ...
3
votes
2answers
699 views

How can I insert address blocks on the left and right side of the page?

I want to insert my local address on the left side of the page and my permanent address on the right side of the page. However, I want both address blocks to be left-aligned. Basically, I want ...
14
votes
3answers
19k views

Indent an entire paragraph / section?

I am writing a document with some odd spacing. I am copying another document, and therefrore the layout must be almost exact. I have sections divided by letters below, and some paragraphs in each ...
1
vote
2answers
529 views

Matrix gauss package problem with alignment

So far I am using the gauss document package, because it offers to show row operations. Now If i try to add fractions inside the matricies, or - signs things gets messy... The text will not align ...
12
votes
2answers
2k 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 ...
6
votes
1answer
127 views

How can I float some text to the right of the first line of a paragraph?

I'd like to put some right-aligned text on the first line of my paragraph, and have the rest of the text wrap around it, like this: Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed ...
2
votes
5answers
3k views

Centering tabular array of images

I have a tabular array of four images and I am not able to center it. My images are pushed towards the right edge of the sheet. The centering looks fine for single images , so I am guessing this issue ...
6
votes
2answers
1k views

Equations in the margin: automatic flush right or left?

How can I automatically have equations in a \marginnote aligned flush left or right in a two-sided document? A previous question suggested to make equations flush left by using flalign* and extra ...
12
votes
5answers
3k views

How can I properly align the line numbers of a source code listing with the margin?

I want to include a code snippet in a document using the listings package. In my document, I have the following: \begin{figure}[!htbp] \setlength{\fboxsep}{0pt}% \setlength{\fboxrule}{0pt}% ...
5
votes
3answers
3k views

Aligning text off-center

I am wondering if there is a recommended way of centering text at a certain point in a line of text? When trying to align monospace characters on multiple consecutive lines, alignment is fine with ...
5
votes
2answers
376 views

Tab not as extra alignment tab

Is there a way to have LaTeX render the tabs in a tabular environment to determine the columns so that there is no further need for the ampersands & ? Most of the time the columns only contain a ...
1
vote
1answer
410 views

tabular align with irregular number of rows

I am trying to set up a tabular system like the one below, but latex does not seem to want to work with different number of elements in each row. Any way to fix this ? |Prime numbers| | Integers | ...
4
votes
3answers
293 views

Dual table alignment and lines

I have a table that is to big to fit in the page width, thus it is separated into two tables. The truth is that I only use one table but insert an empty row in the middle so that the columns stay ...
5
votes
2answers
2k views

Center text node

I currently have the following TikZ code: \documentclass{scrbook} \usepackage{tikz} \begin{document} \tikzset{ tlstartyear/.style={ name=tlstartyear, above=5pt, ...
5
votes
4answers
571 views

Problem with the alignment of characters

I am having some trouble in displaying characters in LaTeX. Here is what I am doing. I am performing a binary addition and would like to have all the characters aligned one below the other. Here ...
2
votes
1answer
521 views

Tikz and alignment with two nodes on the same line

Another minimal example: \documentclass{article} \usepackage{tikz} \begin{document} \begin{tikzpicture} \node[draw=black,% rounded corners=2pt,% rectangle,% bottom color=black!80!white] (A) {node ...
2
votes
1answer
638 views

Flow chart nodes misaligned

I would like to do a flow chart with the first row width the same as that of the second row but just below the first row. I can not do it and actually I don't know how to fix the problem. If anyone ...
2
votes
1answer
310 views

TikZ and different alignments on the same line

This is my minimal example: \documentclass{article} \usepackage{tikz} \begin{document} \begin{tikzpicture} \node[draw=black, rounded corners=2pt, rectangle, bottom color=black!80!white, text ...
6
votes
2answers
1k views

Positioning of text (box) relative to other text

I'm looking at the first, 'letter class' example in LaTeX/Letters - Wikibooks, open books for an open world. What I'd like to do is to use a \newcommand - say, \insertbox - which would be inserted ...
4
votes
3answers
229 views

Format math definition

$$ A = \{ x_{1}y_{1}z_{1}...x_{k}y_{k}z_{k} : x_{i}, y_{i}, z_{i} \in \{0, 1\}, k \geq 1, \text{ and } x < y < z \text{ where } x = x_{1}...x_{k}, y = y_{1}...y_{k}, \text{ and } z = ...
14
votes
7answers
1k views

Aligning polynomial terms

In LaTeX align, I'm struggling to align polynomial terms and assume there's an easy way to do it. But I cannot find the simple/elegant solution. What I would like is something like this: x1 + x2 ...
6
votes
3answers
2k views

How do I right align certain cells in a (booktabs) table?

I'm very new to LaTeX, and I'm currently waist deep in my first project using it. I'm trying to right align some text in cells in a table. I am using booktabs, not sure if that changes anything (I'm ...
5
votes
1answer
811 views

How to center text between two rectangles in TiKZ?

I have the following TiKZ code: \documentclass{article} \usepackage{tikz} \begin{document} \begin{tikzpicture} \newcommand{\delim}[1]{\draw(#1,-0.2) -- (#1,-0.5);} \draw (0,0) rectangle (1,1); ...