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

15
votes
1answer
398 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
188 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
298 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
417 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
298 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
659 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
244 views

Compute remaining horizontal space in align environment

I use align* often and sometimes it is preferable to add text to the right hand side of an equation instead of using \intertext, or \shortintertext, which tends to interrupt the math flow. This is ...
9
votes
2answers
173 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
898 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 ...
8
votes
3answers
185 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
352 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
1answer
545 views

eledmac and two column footnotes

I like dblfnote and have been working with it for a good while. Now my footnotes are just getting too long and the typesetting results accordingly undesirable, they would be way better if footnotes ...
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
425 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
219 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
117 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
215 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
608 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
402 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
497 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
766 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
121 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
176 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
217 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
2k 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
1answer
345 views

Independent Columns Environment

I am creating a two-page syllabus with a tikz calendar in the left column and all of the content on the right side of the page. Currently the right content is just like a normal article class document ...
5
votes
2answers
412 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: ...
4
votes
2answers
60 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
3answers
323 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
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
1answer
694 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 ...
3
votes
2answers
67 views

Prelim2e marking but centred without tikz

I use preliminary markup on draft versions of documents which specifies the svn repository number, timestamp, url etc. I prefer this to be typeset centred at the bottom of the page below the footer. ...
3
votes
1answer
70 views

How to wrap text with flalign*?

I am trying to left align some text as shown below: But the problem here is that the line is almost exceeding the page (shown by red arrow).What I want is somewhat shown in the blue line which ...
3
votes
2answers
333 views

Enumeration in margins and hang indentation

A solution was given to Enumeration across many sections. However, (A) it seems enumeration prevents hang indent from activating. (B) Can I get the numbers to go into the left margin and leave hang ...
3
votes
2answers
117 views

Enumeration across many sections

I am trying to combine enumeration over multiple sections: it is not working. \documentclass[12pt]{article} \usepackage[top = 1in, bottom = 1in, left = 1in, right = 1in]{geometry} ...
3
votes
1answer
114 views

Can't break a line in \maketitle with \raggedright

(This is, in a sense, a follow-up to Insert text between title and author). When using \raggedright in the preamble, LaTeX throws an error when I use a linebreak command \\ in \maketitle. How can I ...
3
votes
1answer
503 views

Siunitx: alignment, parentheses and font size

I'm trying to align numbers (that are bolded, between parentheses, etc.) by decimal points in table columns while using the auto-round option of the siunitx package. The following code doesn't work: ...
3
votes
2answers
690 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 ...