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

3
votes
1answer
96 views

Aligned equation which can break through pages [duplicate]

I'm writing long sequences of aligned math equations, and LaTeX interprete them as single, unbreakable objects... which is Ok if the equation is nowhere near the end of the page. Q: Is there a way to ...
3
votes
1answer
3k views

Beamer: Transparent AND centered background image on intro slide

I know this is similar to other questions. Other answers address either: Adding a transparent image Centering an image but I cannot find an answer with both. With previous answers I can ...
3
votes
2answers
6k views

Align multiline equation with expression after equal sign

I am trying to align a multiline equation using array within the equation but it turns out it doesn't do very well. The code I am using is as follows: \begin{equation}\ \begin{array}{lcl} ...
1
vote
1answer
334 views

Alignement of tikz-pictures and tables in subfigures

Basically, I'm trying to explain the depth-first search. I'd like to align my images in the following manner: I'd like to put two graphs in each single line, with the corresponding 'table' ...
19
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} ...
17
votes
2answers
348 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$ ...
15
votes
1answer
408 views

A center environment for plain TeX

In TeX, one can center a single line of text with \centerline. How would one implement a center justification environment for a single long line of text in plain TeX without the addition of any ...
14
votes
6answers
1k views

How to stack boxes like a vertical version of \mbox?

I would like a vertical equivalent to \mbox{} that somehow takes a sequence of boxes and stacks them on top of each other. I'd like the resulting width to be the width of the widest box, and I'd like ...
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 ...
13
votes
3answers
3k views

How do I (temporarily) cancel centering?

There I was, a-merrily tracing through the depths of beamer's code on the trail of the Dreaded Overprint Hurler of Bexhill-on-Sea, when I came across Something Completely Different. It looked like a ...
11
votes
3answers
192 views

Can I locally switch to a 'greedy' justification algorithm?

I'm not optimistic about this since this is a core part of TeX's algorithm, but is there any way to switch to a 'greedy' justification algorithm? That is, instead of working on the paragraph as a ...
11
votes
3answers
306 views

Aligning complex numbers in centre of table with siunitx

I'm trying to align complex numbers in the middle of a table column using the siunitx package for nicer alignment, but the numbers are centring based on where the decimal point would be on the real ...
10
votes
1answer
441 views

The indentfirst package does not work with ragged2e package

I am using the ragged2e package in the article class and want the first paragraph within the justify environment to be indented. As such, I used the indentfirst package. However, this does not change ...
10
votes
1answer
309 views

Using \vtop affects indentation of \intertext

I am using the \iteminput macro from the solution at How to adjust macro to respect current \linewidth? to import content from other TeX files. However, this appears to be effecting the indentation ...
10
votes
2answers
673 views

Horizontal alignment within an equation using Tikz

I am trying to center horizontally the first terms of a system of equations inside the alignat environment. I don't know if Tikz is the right way to go, but as I might have to add some other ...
10
votes
1answer
4k views

Change alignment for individual table rows

Is it possible to change alignment for individual rows? Example: +------------+--------------+--------------+ | Left | Center | Right | +------------+--------------+--------------+ ...
9
votes
2answers
178 views

Centering all tables in a document with etoolbox

(I know there are already other questions about centering tables such as this. This question is specific to etoolbox.) How do I center all tables using etoolbox? I can do ...
9
votes
3answers
2k views

Centering table column titles above comma-aligned numbers

I am trying to make the following table look nice. With that I want the title to be centered horizontally, and the numbers to be alligned at comma. Here is how it looks now: And my code. ...
9
votes
3answers
933 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
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
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
2answers
370 views

KOMA-Script scrbook: width of chapter and section number

I'm using KOMA-Script’s scrbook class and have problems with the Table of Contents. When the chapter number is too large, the chapter number is glued to the chapter heading. The chapter-section ...
8
votes
3answers
7k views

Beamer: How text wrapping around a graphic right aligned?

I want to include a graphic in beamer presentation with right alignment and this graphic should be wrapping by text. I tried three packages but non of them works correct (minimal example below). ...
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.
7
votes
2answers
1k views

Push a block of lines to the right margin

The following code does what I need: \hbox to \textwidth{\hfill \vbox{ \hbox{some text} \hbox{some other text} } %vbox } %hbox The important things here are: Lines are not ...
7
votes
3answers
447 views

Aligning different parts of an equation with certain spots in the line above

I am trying to get certain parts in the second line of an equation to line up with certain parts in the first line. For example, X=AAA+BBB+CCC = a + b + c where here I am wanting the lower-case ...
6
votes
2answers
234 views

Equations side-by-side, both numbers on the right

How can I typeset two equations side-by-side but get both equation numbers printed on the right? a = b c = d (1, 2) I need to reference both equations individually in the ...
6
votes
1answer
118 views

Flush what's following \hfill to the next line if it doesn't fit

I'm using \hfill to flush some text to the end of the line. However, when the stuff preceding \hfill takes up most of the line, the text at the end is broken over to the next line. What I am want is ...
6
votes
1answer
220 views

biblatex: no linebreaks in name lists when typesetting ragged-right

When typesetting a bibliography \raggedright, biblatex seems to have trouble breaking a line between an author's first/last/middle names (and, if multiple authors are present, between two authors). ...
6
votes
1answer
636 views

Alignment of Margin caption with floatrow and caption

I want my captions in marginpar to be left aligned. I am using raggedright option in caption package along with floatrow package. The captions are left aligned only for long captions. MWE ...
6
votes
2answers
430 views

Keeping the distance between mathematical symbols consistent?

In order to make text flushed both left and right, latex adjusts the distance between words, and to a lesser extent, the distance between characters within a word. This is good, however it also ...
6
votes
2answers
524 views

How can I change the whitespace above and below center?

Is it possible to control the space above and below center, e.g. the way it can be controlled above and below math display? In other words, is there an equivalent to, say, ...
6
votes
3answers
806 views

Math indentation environment

I'd often like to set formulas like Is there some other way than doing this by manually inserting whitespace (with \quad etc.), i.e., something like \begin{align*} f( & 1 + g( & 2 + \\ ...
6
votes
1answer
124 views

How to distribute narrow expressions along a line?

I want something like this: two narrow equations/words equally distributed along the linewidth. I used next code: \documentclass{beamer} \usetheme{Warsaw} \begin{document} \begin{frame} ...
6
votes
3answers
2k views

Right align inside header

I have a header, prepared using fancyhdr. I would like the first row of the left header to be right-aligned with the second row of the left header. In the following MWE I would like "My City" to be ...
5
votes
1answer
1k views

subcaption/subfigure not centered, and caption too narrow

I'm using the subcaption package to make some subfigures with subcaptions (clearly), in a two column document, specifically the IEEE Transactions journal document class. There are a lot of figures, ...
5
votes
1answer
185 views

Array Alignment using TikZ Matrices; cell over a complete row

I want to align subplots in a pgfplot. with \matrix it is easy to align pictures. My problem is, that I need several rows with two columns/pictures and a last row with a picture over both columns. ...
5
votes
1answer
221 views

Tabular alignment of text and figure

For an exam paper I'm preparing, I want to properly build a top page header, with the university logo, and two block of text side-by-side (for course, department, etc.). I have already seen some ...
5
votes
1answer
1k views

`\hfill`-like spacing in math mode without using `align`

In question 83509, a way of getting \hfill-like behaviour in the align environment is described, but for my purposes, I need one that works in the equation environment. (I want to display some ...
5
votes
2answers
4k views

How to center text in tabularx? [duplicate]

Possible Duplicate: Centering in tabularx and X columns I was using \begin{tabular} to insert a table in my article. The titles for columns were long which caused the table to extend out ...
5
votes
1answer
3k views

LaTeX advanced use of subcaption package

I am trying to create a figure with subfigures aligned both horizontally and vertically in the same figure to explain this better i attached a primitive drawing. The labels are not of importance in ...
5
votes
2answers
424 views

align columns in multiple tables

I am trying to align the columns of multiple tables. I know I can use p column format to fix column widths but I would prefer that TeX automatically figure out the widths for me. I was hoping to: ...
5
votes
1answer
1k views

siunitx: How to get bold, aligned entries and how to align when units differ in length?

I tried my first steps with siunitx, but I have trouble achieving the following in the minimal example below: 1) aligning the entries in the first column with respect to the decimal dot 2) getting a ...
5
votes
2answers
3k views

How can I put three pictures with sub-captions in two rows using subfig package?

I would like to put three pictures with sub-captions in two rows using the subfig package. I want to center the single picture in the second row. I use the following code : ...
4
votes
2answers
62 views

Align text in tables in LyX

I want to align the text of one of my tables like this: However, I got this: The header of the table are centered and rotated (in case of the first column header) and the rest of the text are ...
4
votes
2answers
363 views

Over wide figure with caption of the same width that both spill out of the right margin and are aligned flush left

This question is similar to that question, but instead I want to place a figure caption flush left aligned to an overwide figure so that it spills out of the right margin. MWE ...
4
votes
3answers
338 views

Alignment in multiple locations of a single equation based on first line

I want to align a multi-line equation so that it basically looks like this: a = (b + c + d + e) f = g The requirements of this alignment are: The equal signs should be aligned. The beginning ...
4
votes
2answers
3k views

LyX: set width of image to 100% of page width

When I insert an image into LyX and set it to 100% page width, its left side is not at the farthest most edge of the left page. Instead it starts where the text margin is, and since it's too large to ...
4
votes
1answer
707 views

Exact position of a node in a rectangle

This question led to a new package: fancytabs I have a node positioned in a shaded rectangle with: \newcommand{\tabstyle}{\Large\scshape} \newcommand{\tabheight}{4cm} ...
4
votes
1answer
3k views

Override \centering to left justify an image

Background Dozens of source code snippets inserted into a document as images inside of Algorithm floats. Other images are screen captures, inserted as Graphics floats, to make a distinction. All ...