{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
148 views

\raggedyleft in memoir?

In memoir instead of \raggedright, you can use \raggedyright[<space>] which is much more beautiful in narrow columns. However what I also need is \raggedyleft which does not exist and I don't ...
9
votes
2answers
287 views

Align position of decimal point within table of numbers, text and percentage values

I have asked sthg similar with a MWE today answered by David C., but this is a more difficult follow-up question. Also I have just made a new account :) The Question is simple: I want the numbers to ...
9
votes
2answers
9k 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} ...
9
votes
2answers
484 views

Why are my Images not correctly centered?

First of all this is my first posting here on tex.stackexchange.com. I'm new to the tex world and I need a little bit of your help. I am trying to align text relative to a figure. How it should look ...
9
votes
2answers
6k views

Justify text inside itemize environment with beamer class

I would like to justify text inside an itemize environment with the beamer class. Text appears to be justified by default with the article class, but not with the beamer class. The following code ...
9
votes
1answer
371 views

In align environment, put word at left margin and still align equations with &?

In an align environment, how can I put a word such as "Now" or "And" at the left margin and still align equations on that line and subsequent lines with &?
9
votes
3answers
3k 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
4k views

How to add a picture to fancyhdr *header* (and align in the top right)?

In the MWE below, the blue square aligns according to plan, whereas the dummy-image doesn't, see screenshots below. How to re-code so that the dummy-image "A" is aligned like the blue square? ...
9
votes
1answer
268 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} ...
9
votes
1answer
223 views

Using discretionary linebreaks in centering environment

I am having trouble with the interaction between discretionary line breaks and centering. I have defined macros for math mode that contain discretionary line breaks to help TeX lay out inline ...
9
votes
1answer
138 views

How can I align the terms of this equation nicely?

I have the following alignat segment: \begin{alignat*}{3} \text{max}_{\underline{\lambda}} \text{min}_{\underline{x}} \quad & \underline{c}^T \underline{x} + \underline{\lambda}^T(\underline{d} ...
9
votes
1answer
2k views

How to center a lstlisting

I have the following problem. I want to center a listing, I tried this approach: How to center a listing? It works but when I try to set frame or numbers specifically for each listing I get errors. ...
9
votes
2answers
122 views

Preventing line shrinking with raggedright

Sometimes with \raggedright, if a line is too long, but only slighly so, it will be shrunk instead of broken up. Here is an example: \documentclass{article} \raggedright \begin{document} This is a ...
9
votes
2answers
3k views

How to center verbatim [duplicate]

\begin{figure} \centerline \begin{verbatim} for (int a = 0; a < 10; a++) for (int b = 0; b < 10; b++) ... \end{verbatim} \caption{C++ code} \end{figure} I would like the figure to be ...
9
votes
3answers
935 views

Leftalign labels with enumitem

I'm using the enumitem package to define a legal list: \usepackage{enumitem} \newlist{legal}{enumerate}{10} \setlist[legal]{label*=\arabic*.} The output for a list looks like this: 1. foo 1.1 ...
9
votes
1answer
923 views

\mathclap not centering

I'm trying to stack two symbols on top of each other (not \stackrel) using \mathclap in the mathtools package, but the symbols are not centering: \mathclap{\rightleftharpoons}\circ How do I get the ...
9
votes
3answers
247 views

Remember position of equal sign from one align environment to the next

As you know, the align-environment puts all positions marked with & (normally the equals sign) exactly beneath each other. I now want to save the position LaTeX calculates for & and use it ...
9
votes
1answer
140 views

How to float something right even if it wraps down a line?

I have a situation where I have some data in section headings (and sometimes normal paragraphs} that needs to be: floated right not split across lines I was able to accomplish this for most cases ...
9
votes
2answers
8k views

Include centered full page figure with no margins

I have a big figure that takes up a full page. I'd like to include it in my latex document on a separate page, centered horizontally and vertically. I managed to put it on a separate page (or it is ...
9
votes
1answer
222 views

Centering contents name with [twocolumn] contents

I'm trying to make Table of Contents in two columns, but I'd like to center the contents name. Now I'm doing \twocolumn \tableofcontents but these commands give something like this: Contents name ...
9
votes
1answer
416 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 ...
9
votes
2answers
407 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
854 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
715 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
703 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
445 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

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
5k 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
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 ...
8
votes
3answers
20k views

How can I use an align environment flush left?

Is there a way possible to imitate the align environment for math mode commands, without having all writing being placed toward the center on the output page? MWE: \documentclass{article} ...
8
votes
4answers
241 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
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
200 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
136 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
422 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
5answers
363 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
358 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
206 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

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
3answers
186 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
3k views

How to put two images side by side and put some symbol in the center?

I want to put two images side by side and put a comparison symbol in between them. Here is the tikz code : \documentclass{article} \usepackage{tikz} \usepackage[margin=15mm]{geometry} ...
8
votes
3answers
2k 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
2answers
3k 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
2answers
276 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
1answer
6k 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
104 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
458 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
3answers
1k 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
353 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, ...