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

7
votes
1answer
154 views

Center over-long equations between both margins

I understand the reasoning behind the fairly narrow textwidth in a default LaTeX article. 60-80 characters per line and all that. However, I am preparing a document that features many lengthy ...
6
votes
1answer
1k views

Displaying an equation in a list

How could one get a displayed equation inside a list environment, say itemize, so that the equation is both centered horizontally and on the same line as the bullet, but with the bullet still on the ...
5
votes
1answer
384 views

How to ensure that 2 couples of figures are on 2 facing pages?

I would like to reproduce the following layout with two figures on one page and two others on the facing pages. I would like the first couple to be on an even-numbered page and the second on an ...
11
votes
2answers
965 views

How to align comments with lstlistings?

I am using listings with these settings: \lstset{language=C++,basicstyle=\small\sffamily, numbers=none, frame=tb, columns=fullflexible, showstringspaces=false } I like the proportionally ...
21
votes
1answer
11k views

Fixed column-width table with text left-aligned in cells

\section{Section Title} %label{8.4.47} \subsection*{Some note on Section} \begin{footnotesize} \begin{tabular}{p{2cm}|p{4cm}|p{3cm}|p{3cm}} Heading 1 & Heading 2 & Heading 3 & Heading 4 ...
19
votes
6answers
4k views

Skip to absolute position on line

Is there a way to skip to a fixed position on a line? (a specific tab position) Example: The quick \skiptoposition{1.5cm} brown \skiptoposition{2.5cm}fox which would put "brown" 1.5cm and "fox" ...
11
votes
1answer
4k views

center /verbatim text in /figure

I'm trying to center a the content of a figure that has verbatim text in it, but the verbatim text is always right-aligned: \begin{figure} \centering \begin{verbatim} some text here ...
11
votes
5answers
7k views

Align Note below table

My question concerns the "Note" below the table. This is my code: \begin{table} \begin{center} \caption{ Descriptive statistics of total sample based on modified data set}\label{table:descrtotal} ...
9
votes
1answer
403 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 ...
2
votes
3answers
166 views

align separate equations [duplicate]

I have the following structure in my tex Part of this paper has this structure where there are many short one-two line explanations cut by one line equations \begin{equation}\label{s1} y=z+r+c ...
10
votes
2answers
653 views

Custom alignment of columns in align environment

I need to typeset two columns of equations, each row typeset with an equation number to the right as with an ordinary equation. The first column must be centered, and the second column must be ...
7
votes
2answers
3k views

Place four algorithms (algorithm2e) in a subfigure and arrange them in two rows and two columns

I want to arrange four algorithms set with the algorithm2e package in two rows and two columns, as shown in the figure below. I've tried the subfigure package and have also read several related ...
1
vote
2answers
680 views

How to center a verse horizontally

I have a Sanskrit Verse that I want to appear at the center of the page. I am using verse environment as shown below. \begin{verse} तपः स्वाध्याय निरतम् तपस्वी वाग्विदाम् वरम् | \\ नारदम् परिपप्रच्छ ...
13
votes
2answers
6k views

Raggedleft paragraph in a table

I am trying to typeset a table of two columns, where each column consists of paragraphs and the paragraphs in the right hand column are set raggedleft. Here is a minimal example of the code I thought ...
10
votes
2answers
282 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
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]} ...
6
votes
3answers
2k views

Left-aligned text inside an equation

Inside an equation-like environment, I'd like to have some text that is aligned to the left margin of the text block, something like \intertext, but in the same line as the equation Something like ...
5
votes
3answers
182 views

Troubles with column width in the tables headings

Well, we all know that compose tables in LaTeX is not easy, however, despite the large number of existing packages and options to facilitate this, I still have some problems I could not solve, and I ...
5
votes
2answers
285 views

multiple pairs of columns

Consider this example code which creates a 2x6 table where the 6 columns are formed from three name/value pairs: \documentclass{article} \usepackage[svgnames,table]{xcolor} \usepackage{tabu} ...
5
votes
1answer
2k views

How to vertically and horizontally centre text and images in (different) table cells?

I have a table which contains images in one column. I would like the first column to have text centred vertically and horizontally. I would like the second column to have text left justified and ...
3
votes
2answers
592 views

Align (center) header row in table

I use @{\hskip 50pt} to separate columns in my table. The problem which arises is that I add this extra space after a multicolumn. This also moves the header row so that it is no longer centred. Is ...
3
votes
3answers
3k views

Numbering side-by-side equations or inline equations

I am trying to produce a two-column table of math equations, where each cell contains its own left-justified, numbered equation. I tried using \begin{equation} \end{equation} inside the tabular ...
3
votes
2answers
720 views

Centering contents after \unvbox

Trying to build a complex macro, I managed to compute what I need in a vbox. Now, I want to \unvbox this box to allow page breaks, and would like each element it contains to be centered. I can't find ...
3
votes
2answers
3k views

Vertical alignment with subfig and pstricks

I'm working with pstricks to add illustrations to a paper, as I found that it allows me to save much time compared to editing files with dia/xfig/visio/etc. and including pngs. But I'm having a few ...
2
votes
2answers
2k views

Left-aligning LaTeX Bibliography Display

I have problem on how to make the bibliography item left-aligned. My current bibliography output is below. As you can see, the reference item code is currently right-aligned, and I need it to be ...
17
votes
2answers
6k views

Alignment of equals sign in multiple align environments

I have multiple align environments in my document, separated by a small paragraph of text: \begin{align*} foo &= something very very long compared to the other align \end{align*} explanation ...
11
votes
7answers
273 views

Alignment in cases

I have this text in LaTeX: $$ sgn(x)= \begin{cases} -1 & \mbox{za podmínky } x>0\\ 0 & \mbox{za podmínky } x=0\\ 1 & \mbox{za podmínky } x>0 \end{cases} $$ But I ...
19
votes
2answers
212 views

What's a quick way to align text?

I am often writing quick statements in which I would like the following lines to continue underneath the end of the first. Is there a quick way to do this (requires arrays?) this is the first ...
15
votes
1answer
620 views

How to fix the math-spacing when a lot of \phantom, \mathrlap, etc. are used?

This question led to a new package: underoverlap Introduction Based on this question and then this question, I'm trying to perfect the \overunderbrace macro. Right now, I'm trying to get the ...
11
votes
1answer
209 views

Alignment rules

I find myself quite frequently in the need to check whether some elements on my page are aligned exactly as intended. As a result, I usually end up magnifying the output 400% and using a rule over my ...
17
votes
2answers
2k views

Aligning inside tabular environment, specific cell

I'm trying to align specific content of the single cell. For example, \begin{tabular}{|r|r|} \hline 1 & 2 \hline right & to_the_left \hline 1 & 2 \hline ...
12
votes
4answers
442 views

How do I get this strange alignment?

I would like to get a nonstandard alignment in the following code: \begin{align} \text{First left hand side} & = \text{First right hand side} \\ \text{Second left hand side} & = ...
10
votes
1answer
400 views

Correct alignment of multiple-line inequality

I want to display a set of inequalities to look like the code below this is the lower bound ≤ this is the thing to be bounded ≤ this is the upper bound My attempt to do this is the following: ...
9
votes
4answers
743 views

Align denominator of fraction to left

The highlighted part has the equation centred, which looks rather imbalance with the top equation, is it possible to align the highlighted part to the left? Below is the code I am using. ...
8
votes
2answers
17k views

Section Heading Centering problem

\begin{center} \section*{\textcolor{blue}{Ukaaranta }} \end{center} \subsection*{Shabhu Harivat} \addcontentsline{toc}{subsection}{shambhu harivat} \begin{center} ...
5
votes
2answers
5k views

Left-alignment like Fleqn-option only for specific equations

I want to left-align some equations. (Note: I want to align the equations themselves, not code inside of the equations.) I have the following example code: \documentclass{scrartcl} ...
4
votes
1answer
3k views

How to put two minipages side-by-side, which use 100 % of the text width?

In draft-mode a black marker indicates that the reserved space is too low. This also appears in the following example, but it shouldn't. How can I put two minipages exactly side-by-side? ...
17
votes
3answers
8k views

Aligning Decimal Points in Table

I want to align two numbers in two different rows the decimal point. I do see a link for that here: Aligning numbers by decimal points in table columns However, I don't understand how to ...
14
votes
3answers
5k views

\hfill in math mode

Is there any easy way of declaring a new command which emulates \hfill in math mode. I don't want flalign or something similar. I want to use the command in the same way (and with the same freedom) I ...
13
votes
4answers
1k views

Best Pattern For Adding Commentary in align Environment? [duplicate]

I've been using the align environment to line up equations in proofs/explanations/etc and I like to place parenthetical commentary for each step, similar to the code below: \documentclass{article} ...
11
votes
1answer
20k views

How can I left-align a caption?

I am using this for captions: \usepackage[font=small,format=plain,labelfont=bf,up,textfont=normal,up]{caption} But they all come out centred - I want them aligned with the left margin - how can I ...
10
votes
2answers
211 views

Math Spacing in the presence of a trailing/non-trailing comma

I thought I knew how to use a \hphantom{} but don't know of an easy way to handle this case due to the comma. I want to get the text aligned for the X row. I added the appropriate \hphantom{{}+1} ...
10
votes
2answers
9k views

tikzpicture alignment and centering

I have several very similar images except some have some extra graphics that enlarge them slightly. This causes some pictures to be offset and not aligned visually when it's clear they should be. How ...
10
votes
2answers
729 views

How to align integers on the right, but still center them

Suppose we have a table like this: \begin{tabular}{c} Heading \\ 1 \\ 10 \\ 100 \\ \end{tabular} This will center all the numbers. If I want to align them to the right, I could change the column ...
6
votes
1answer
2k views

Algpseudocode (algorithmicx) package comments

How to align comments in algorithmic environment to the right? For \Comment, if the comment is too long it gets wrapped and starts at the beginning of next line. It would look better if it was aligned ...
6
votes
1answer
4k views

Center aligning chapters

I'm using the following to center align chapters. Heres the code \newcommand{\cchapter}[1]{\chapter[#1]{\centering #1}} And using \cchapter to format chapters. But the chapter heading for eg. ...
5
votes
2answers
7k views

center and \centering both add space above; \centerline does not

The nag package suggests I use the center environment in LaTeX, rather than the TeX \centerline command. When I do that, however, I find that the former inserts a blank line above the line (in my ...
5
votes
2answers
816 views

Remove additional space around \underbrace{…}

How do I remove the additional space that is added when using \underbrace{...}, to get the same width in both lines: \documentclass{scrreprt} \usepackage[ngerman]{babel} \usepackage[utf8]{inputenc} ...
24
votes
3answers
933 views

Can I get full justification for italic text?

In the TeXbook, Knuth notes that italics can lead to problems with justification: EXERCISE 14.16 When an entire paragraph is typeset in italic or slanted type, it sometimes appears to be offset ...
18
votes
2answers
10k views

Any way to center text within a \parbox?

Probably I'm missing something, but I'm really struggling to find an answer to this simple question: How to center text within a \parbox? Side note: I don't want to switch to any other environment ...