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

18
votes
1answer
10k 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 ...
11
votes
1answer
3k 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
6k 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
385 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
148 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 ...
8
votes
3answers
2k views

Centering in tabularx and X columns

How can I center the column when using X in tabularx environment like in this example? \begin{tabularx}{\textwidth}{@{}lXXXXX@{}} 1 & 2 & 3 & 4 & 5 \\ \end{tabularx}
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
637 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
5k views

How can I center text/math inside a list environment?

When using math (display) mode in conjunction with a list environment, the displayed material is not truly centered on the page; it is only centered with respect to the indentation of the item. ...
10
votes
2answers
623 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 ...
8
votes
2answers
272 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 ...
6
votes
3answers
1k 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
156 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
274 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
1k 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
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
684 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 ...
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 ...
2
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 ...
17
votes
2answers
5k 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
246 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
203 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 ...
19
votes
6answers
3k 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" ...
15
votes
1answer
549 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
195 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 ...
16
votes
2answers
1k 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
416 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
316 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
614 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
15k 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
4k 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} ...
14
votes
3answers
4k 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 ...
14
votes
3answers
6k 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 ...
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} ...
10
votes
2answers
196 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
8k 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
658 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 ...
10
votes
1answer
18k 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 ...
6
votes
1answer
1k 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 ...
5
votes
2answers
5k 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
728 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} ...
5
votes
1answer
3k 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. ...
24
votes
3answers
906 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 ...
16
votes
2answers
8k 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 ...
13
votes
3answers
8k views

Right-align chapter/section/subsection header

How can I change the alignment of a chapter/section/subsection heading? Preferably, I want this to be something I specify in the header, as this will be necessary for all headers in the document.
10
votes
2answers
1k views

Justify Table by Row

For example, is it possible to justify the first row of a table differently from the rest? Maybe there is a way to combine two tables to look like one? MWE: \documentclass{article} \begin{document} ...
9
votes
4answers
214 views

Custom alignment of text in itemized environment

I want to describe the variables involved in an equation in an itemized environment such that every item begins with the variable name and subsequently comes the description for it. I'd like to have ...
9
votes
2answers
673 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 ...
8
votes
3answers
402 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 ...
7
votes
2answers
717 views

Justification when using the dramatist package

I'm trying to typset a play using the dramatist package. I'm having difficulty figuring out how I change some settings. I want to ensure that the text that the characters say, is justified, rather ...