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

5
votes
2answers
5k views

Alignment of text in itemize environment

I would like to generate a list of "Aims" (1,2,3...etc) as the \item label, with the text for the aim located adjacent (with \hspace{Xmm}). For items that exceed the width of the line, the alignment ...
5
votes
2answers
424 views

Wrapping \obeylines with \halign into a macro

In the TeXbook, Knuth gives an example: Are you tired of typing \cr? You can get plain TEX to insert an automatic \cr at the end of each input line in the following way: \begingroup \let\par=\cr ...
12
votes
3answers
1k views

How do I obtain multline-type alignment within a group of equations?

I want to achieve something like the following (for now achieved using Microsoft Paint): That is, I want to group a number of multi-line equations within a single equation-type environment (i.e. ...
9
votes
3answers
190 views

How can you change the alignment of calstable?

calstable is always left aligned. \documentclass{article} \usepackage{cals} \begin{document} \begin{center} \begin{calstable} \colwidths{{1.5cm}{1.5cm}{1.5cm}} ...
9
votes
3answers
4k 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
1answer
115 views

Why is this lettrine being bumped into the margin?

Consider the MWE from an earlier question: \documentclass{article} \usepackage{lettrine} %\usepackage{fontspec} %\defaultfontfeatures{Ligatures={Historical}} ...
8
votes
1answer
631 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 ...
8
votes
1answer
1k views

Using infer from the proof package?

I am using the \infer command from the proof package. Few things that I am trying to do unsuccessfully: How can I have some space between the elements of the proof? such as space between x and y ...
8
votes
3answers
14k views

How to Center a BeamerColorBox

The question is, how to horizontally center a beamercolorbox on the page? I put it in the center environment, but that doesn't work. \setbeamercolor{bgcolor}{fg=black,bg=blue} \begin{center} ...
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 ...
7
votes
2answers
3k views

How to align terms in alignat environment

These are my math equations. To enhance readability, I'd like the third column to be aligned around the + sign; that is, I wish to place some horizontal blank in front of $n\mathbf{A}_0$ (not ...
7
votes
4answers
4k views

Table caption align top-right

How I can align caption for table like this? Current code: \begin{table}[h] \caption{} \centering \begin{tabular}{|l|r|r|l|} \hline № & X & Y & Время ...
7
votes
2answers
5k 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 ...
7
votes
2answers
16k views

How to center the minipage?

The left margin is too wide if I set 1.5\textwidth: \begin{document} \noindent\begin{minipage}{1.5\textwidth} test \end{minipage} \end{document}
6
votes
1answer
140 views

Aligning and centering a lstlisting with two columns on a page

Consider the following code taken from here to produce a fancy listing : % PACKAGES \documentclass[11pt,a4paper]{book} \usepackage[top=1in, bottom=1in, left=1in, right=1in]{geometry} ...
5
votes
2answers
150 views

Implicit \hfil at the end of each paragraph?

Why do Alpha \hfil\ Omega\par and Alpha \hfil\ Omega not flush "Omega" to the right?
5
votes
1answer
769 views

Center parts in toc with tocloft

I'm trying to create a toc in a large Latex document which uses the KOMA script. In the toc I would like to center the parts and remove all other components (pagenumber, partnumber). I use tocloft (a ...
5
votes
1answer
449 views

Inserting an image on the right

I got a problem in my LaTeX document. I used the codes below: \begin{flushleft} \begin{figure}[tp] \centering \includegraphics{C:/Users/churva/Desktop/wla.jpg} ...
5
votes
1answer
504 views

Changing the table of contents

I'm finalizing my dissertation, and they require that the "Table of Contents - Continued" heading in the ToC (that shows if it flows onto a second page) be centered. I thought I could find the code ...
5
votes
3answers
3k views

Why are the lines around my multicolumn cell misaligned?

In the following table, why does the double line before the diff column not go through? I guess all the multicolumn{1} are wrong? How can I fix it? \begin{table} \centering ...
4
votes
2answers
15k views

How to right-align a title (without creating a complete custom title page)?

I suppose this is a simple matter, but I'm still finding my way around where to put things in LaTeX. I would like to right-align (i.e. flush to right) the contents of an article's title page. By ...
3
votes
1answer
102 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 ...
1
vote
1answer
380 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
361 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
460 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 ...
13
votes
3answers
4k 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
206 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
328 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 ...
11
votes
1answer
4k views

Change alignment for individual table rows

Is it possible to change alignment for individual rows? Example: +------------+--------------+--------------+ | Left | Center | Right | +------------+--------------+--------------+ ...
10
votes
1answer
543 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
334 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
705 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
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
2answers
186 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
8k 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). ...
9
votes
3answers
1k 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
2k views

How to flush right but align left? [duplicate]

I am writing an introduction, and I need to put my name at the end of it at the right side of the page, but it should be aligned left: Lorem Ipsum is simply dummy text of the printing and typesetting ...
9
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.
9
votes
2answers
8k 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
204 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
419 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 ...
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 ...
6
votes
2answers
262 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
124 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
245 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
791 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
1answer
166 views

Boxing some cells in tabular enviroment

I would like to make a table in LaTeX, where I box some of the cells within my table. And I would like to be able to nest boxes so that I can have a box in a box. Here I have an example of what I ...
6
votes
2answers
634 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, ...