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

9
votes
2answers
332 views

Help me create my out patient documentation template

\documentclass[a5paper]{article} \usepackage{eso-pic} \usepackage{fancyhdr} \usepackage[pdfauthor={VB},% pdftitle={Consultation},% pagebackref=true,% ]{hyperref} \usepackage[headsep=3cm,top=4cm, ...
9
votes
1answer
617 views

One-line equation with two columns

I try to write an equation with two similar formulas, i.e. \begin{equation} \qquad A_1 = B + C \qquad A_2 = D + E \qquad \end{equation} Of course, instead of \qquads I want to use something like ...
9
votes
1answer
628 views

Text justification within multicols environment

I'm using this 3-column layout. \begin{multicols}{3} [.. a lot of text ..] \end{multicols} I want to left-align the text in the left column, center the text in the middle column, and right-align ...
9
votes
2answers
670 views

Protrusion of fractions in tabulars

I have a number of tables in a book that I am busy with that have quite a few tables of the general form shown below: If you notice the fractional part of the numbers 5 1/2 and 16 1/2 protrude to ...
9
votes
2answers
429 views

How, in ConTeXt, can I get body text to align flush to the outside?

I'm using ConTeXt Mk IV, and I'd like the text in a two-page document to line up like so: +--------+--------+ + + + + xxx + xx + + xxxx + xxx + + xx + + + ...
9
votes
1answer
1k 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? ...
9
votes
1answer
1k views

How to have a figure touch the edge of the page?

How can I position a figure (picture) so that it: is aligned on the left-hand side with the text (this is in two column page) touches (or exceeds) the right-hand side of the page? An example can ...
8
votes
5answers
4k views

fully stretch text horizontally on page

Is there a way to fully stretch one line of text on the full width of the page, without manually setting the letter spacing, no matter how many characters on the line?
8
votes
5answers
4k 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 ...
8
votes
4answers
235 views

How to align five equations on three lines, e.g., 2-2-1, with the last equation centered?

I'm trying to use the alignat environment to arrange five equations on three lines as follows: two equations on the first line, two equations on the second line (aligned with those of the first ...
8
votes
1answer
24k views

horizontally center table

Strangely in this MWE the table is shifted to the left but in my original document I have exactly the same code but the table is centered. Can anyone solve the mystery? \documentclass{article} ...
8
votes
4answers
1k views

Centered but left-aligned paragraph

I want to have a paragraph, that is centered but in itself left-aligned. Does somebody of you know how to achieve this? (I have text in a paragraph, on each line the text is shorter than the width, ...
8
votes
3answers
163 views

Control the alignment of each “cell” in amsmath's aligned environment

In amsmath's aligned environment, the alignment of each "cell", or each "column" is predetermined, and seems to work in the following way: the first "column" is aligned to the right, the second to the ...
8
votes
3answers
134 views

Aligning elements in set

How can I create a set with aligned elements? Example: I tried using align but it does not align as nicely as in the example. \begin{align*} &P = \set{ &A &\rightarrow &a | ...
8
votes
4answers
324 views

Decimal separator and axis label centering with Tikz

The following code creates a figure with Tikz without the use of pfgplots (that I want to avoid here): % compilation: pdflatex --jobname=Runge-f1 Runge.tex \documentclass[12pt]{book} ...
8
votes
2answers
15k views

Section Heading Centering problem

\begin{center} \section*{\textcolor{blue}{Ukaaranta }} \end{center} \subsection*{Shabhu Harivat} \addcontentsline{toc}{subsection}{shambhu harivat} \begin{center} ...
8
votes
2answers
7k 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 ...
8
votes
5answers
297 views

centering a part of an equation

I am using \vdots in my equation, and I need it to be centered. As shown in the figure it is automatically left indented. I am not able to bring the dots to the center. I am providing MWE also. ...
8
votes
3answers
317 views

Poster text positioning: Get width of \hfill

How can 0123456789 be aligned as shown in red: Same baseline as abcdefghij, aligned left with ABCDEFGHIJKL? \vlines are just for illustration. I am designing a poster where exact text positioning ...
8
votes
2answers
197 views

Multiple equations with a large “{” in front: alignment and labelling

I'm trying to get the equation shown in the picture. But i only manage to get the following coding. Can anyone help me to label it with numbering like the picture? I tried with \begin{eqnarray} or ...
8
votes
3answers
2k views

Centering in tabularx and X columns

How can I center the column when using X in tabularx environment like in this example? \begin{tabularx}{\textwidth}{@{}lXXXXX@{}} 1 & 2 & 3 & 4 & 5 \\ \end{tabularx}
8
votes
3answers
174 views

box the size of A containing B

A thing I'd often like to do is put in my document a box the size of some text A and containing some other text B. For instance, I have two tikz nodes, one containing $n$ and one containing $n+1$, and ...
8
votes
3answers
1k views

How to align piecewise functions?

I have two piecewise functions defined like this: \begin{align*} \left\{ \begin{array}{ll} i = x^2 + y^2 \\ j = a^2 + b^2 \\ \end{array} \right. \\ \left\{ ...
8
votes
3answers
2k views

horizontal alignment of dot over hat over bold greek letter!

For some strange reason, this: \hat{\dot{\bm{\phi}}} prints the dot and the hat slightly off the left of the phi letter. Any ideas if this can be fixed? thanks. Using bm package for bold symbols.
8
votes
2answers
252 views

Have almost managed to get my TOC the way I want, but need help making it 100% perfect

If you compile my current TOC code: \documentclass[a4paper,10pt]{book} \usepackage{lipsum,kantlipsum} \usepackage[dotinlabels]{titletoc} \contentsmargin{0pt} ...
8
votes
2answers
1k views

Mixing enumerate and tabbing, whats wrong here?

So I can't seem to figure out whats wrong with my LaTeX file. Do you guys see anything obvious? \documentclass[11pt]{article} \newcommand{\df}[1]{\textbf{#1}} \begin{document} \section{Midterm 1} ...
8
votes
2answers
101 views

How to align only some equations in an align environment?

Here's what I got: \begin{align*} P[E_{m}] &= P[m] + P[2m] + P[3m] + \dots \\ &= \frac{1}{\varsigma(s)} \langle m^{-s} + (2m)^{-s} + (3m)^{-s} + \dots \rangle \\ &= \frac{1}{\varsigma(s)} ...
8
votes
3answers
399 views

TikZ Matrix - How can I align content horizontally which is spanning over multiple cells/rows?

I'd like to finetune the big rectangle in the last column and its content, i.e. that it's all aligned to the third column's center. It is currently too far on the right: So far I have been unable ...
8
votes
1answer
5k views

Multiline figure caption centering

How to center a figure caption that's too long for a single line? Or at least, make the text in other lines line-up with text after "Slika 1:". It currently looks like this
8
votes
2answers
2k views

siunitx: aligning numbers by decimal points in tables doesn't work for bolded or italicized numbers

This is a follow-up question for Aligning numbers by decimal points in table columns. User lockstep provided this solution: \usepackage{siunitx} \begin{document} \begin{tabular}{S[table-format=3.2]} ...
8
votes
3answers
831 views

Justify a text inside a figure environment

I insert several figures in my document, but I am unable so far to fully justify the text just below the caption: "BLA BLA BLA" \begin{figure} \centering \caption{NICE TITLE}\label{graph:p} ...
8
votes
1answer
304 views

How to force equation to be closer to the sum operator?

I would like to know if it is possible to force the equation to be closer to the operation sum? When there are a lot of subscript under the sum operator, it tends to pouch the equation to the right, ...
8
votes
3answers
183 views

Multiple alignments

If I have a string of equations whose equal signs are aligned and one of the equations is too long and needs to span multiple lines, how do I create a second alignment. For instance, in the following ...
8
votes
2answers
1k views

ragged2e: “newcommands” option produces “underfull \hbox” warnings

The ragged2e package provides the commands \Centering, \RaggedRight and \RaggedLeft for setting ragged text while allowing hyphenation. The package offers a newcommands option that sets the standard ...
8
votes
2answers
77 views

Align \footnote left

At the moment my footnote looks like this ²Commit-Hooks definieren was die Softwareversionierung (zum Beispiel SVN) machen soll, sobald ein Commit passiert. The second line just does not align to ...
8
votes
2answers
189 views

How to horizontally align headers and decimal centered cells

I use this code to produce a table and to align the column with the dot of the numerical values. \documentclass{article} \usepackage{dcolumn} \begin{document} \begin{tabular}{l D{.}{.}{3} ...
8
votes
1answer
8k views

text justify in beamer

I like to justify the texts inside the block using beamer. I cant do that in presentation. Can any one please help me?
8
votes
1answer
3k 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.
8
votes
3answers
161 views

Move right-aligned paragraph more to the center

So I am typesetting a little songbook for our Christmas get-together. To make better use of the limited space, I am using the multicol package; no issues there. What I'd like to do is move a whole ...
8
votes
2answers
177 views

Better way to center text below overline with given length

I need to create lines for signatures. I need 3 of them with different texts below them, but i want all lines to have the same length and the texts centered below them. Tables with \hlines made the ...
8
votes
1answer
139 views

Indent and spacing in tables (or: How to do it better?)

I'm using the tabular environment in order to properly display my address in the text. But as the following example shows, the first column of the table doesn't align with the main body text. Also ...
8
votes
2answers
272 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 ...
8
votes
3answers
2k 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 ...
8
votes
2answers
69 views

Horizontal alignment across nested aligned

Is there a way to left align the first 2 rows with the last one? \documentclass{article} \usepackage{amsmath} \begin{equation*} \left\{{\begin{aligned} &\left.{\begin{aligned} &A+B=X\\ ...
8
votes
2answers
578 views

\RaggedRight makes document longer

I have a document carefully written to fit in 4 pages; but when I added a \raggedright (or \RaggedRight with use of the ragged2e package) the length gets longer. Furthermore, suddenly the output ...
8
votes
1answer
165 views

How do I adjust the placement of descriptions I've made alongside enumerated statements within a boxed theorem environment?

Basically, what I'd like is to have an elegant command that would enable descriptions (commutativity, associativity, etc.) made alongside enumerated statements to be aligned to the far right side of ...
8
votes
2answers
8k 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} ...
8
votes
2answers
4k 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 ...
8
votes
2answers
150 views

Included graphics with text: Alignment

tl;dr How do I align text to text within \included graphics? Let's look at the following logo, which I want to include (in a vector format, e.g. pdf or svg). The blue/red lines are my annotations. ...
8
votes
1answer
527 views

List of abbreviation

I want to display a list of abbreviation in two columns and list each abbreviation preceded by the corresponding letter. for example : A AAR .... AG .... i use the package nomencl : below the ...