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

4
votes
2answers
27 views

Tikz matrix arrows alignment

I have a problem that I cannot solve for myself. The following code produces the following image, which I do not really like. \documentclass{article} \usepackage{tikz} \usetikzlibrary{matrix, ...
3
votes
1answer
38 views

How can I arrange the table and the image in a minipage vertically?

I need the table and the image arranged vertically in the minipage instead of horizontally. I also add the pictures used in the code in the end. \documentclass[12pt,a4paper]{article} ...
0
votes
1answer
29 views

Why does one sometimes get what appears to be arbitrary spacing with the subcaption package? [duplicate]

I have a very simple MWE which demonstrates the problem: \documentclass{book} \usepackage{graphicx} \usepackage{subcaption} \begin{document} \begin{figure} \centering ...
1
vote
1answer
41 views

How to globally left align the text of paragraphs containing variable-length headers with the first line of the paragraph?

I have several paragraphs each with unique headers of differing lengths: \documentclass[12pt]{article} \begin{document} \subsection{Subsection 1} \paragraph{Title} Paragraph text here. Paragraph ...
0
votes
1answer
27 views

Line wrapping mathmode in ACM article-proc style

I am using the ACM document class acm_proc_article-sp. It is a two column page style. I keep running into a badbox where I have some line of text, and then a short equation in mathmode. For example, ...
4
votes
2answers
27 views

centered text/equations inside align environment

is there a way to insert a centered line of text or mathematics inside an align-environment? For example, in the code below, I'd like to have the \vdots between the equations above and below ...
2
votes
1answer
35 views

How do I center text in a cell with `tcbox`?

I have this code in preambule: \documentclass[12pt,letterpaper,twoside]{article} \renewcommand*\rmdefault{cmd} \usepackage{amsmath} \usepackage{amssymb} \usepackage{amsfonts} \usepackage{animate} ...
5
votes
2answers
71 views

Table alignment problem

So I wasn't happy with how esttab was formatting my regression tables from the statistical program Stata. So I instead I decided to attempt to build my own skeleton table, which had better formatting, ...
7
votes
0answers
36 views

Adding color package destroys listing centering

I am using @egreg's answer to make listings centered: \documentclass[a4paper]{book} \usepackage[T1]{fontenc} \usepackage[ hang, small, it, hypcap=true ]{caption} \usepackage{fancyvrb} ...
4
votes
1answer
35 views

Page number shifted to the left

I am writing a report with different geometry settings for the title page, so after finishing the latter with \end{titlepage}, I specified the new settings for the rest of the document using ...
3
votes
1answer
31 views

References spilling out of margin in bibliography

I have a search for this problem but all I could find was the case of reference citations in document spilling over, not the bibliography. Quite simple problem I hope... In my bibliography some of ...
1
vote
1answer
29 views

cannot figure out how to produce some tikz pictures next to each other

Ideally I would like to have the tikzpictures be in one line centered horizontally with its caption each preserving its node size and line strength and vertically aligned to a common bottom line. I am ...
4
votes
3answers
96 views

Aligning in- and out-text for algorithms

I use the algorithm2e package to typeset algorithms with custom keywords for input and output. When using \SetKwInput{KwInput}{Input} to define the keywords, colons are added but input and output are ...
2
votes
1answer
32 views

Center all same theorem

I would like to know if it's possible right from the definition of a theorem to center it : \begin{center} \begin{minipage}{5cm} { { \theoremstyle{plain} \theorembodyfont{\small} ...
1
vote
0answers
43 views

Centering TikZ picture inside poster box

I would like to center a tikzpicture inside a posterbox (baposter) \headerbox{Vorgehensweise}{name=definitions,column=3,below=problem,span=3}{ \usetikzlibrary{shapes.geometric, ...
0
votes
1answer
55 views

How to do \flushleft and \flushright with tikzpictures

I have two charts, one is drawn with pgfplots, the other with pgf-pie. I want put these two chart in align horizontally, so one is on the left and the other is on the right. I have read Aligning using ...
2
votes
3answers
42 views

How to right-align any line or word in a paragraph in any documentclass?

I have done some search for margin alignment in Latex but cannot find how can I right-align any single line? For example, in a letter sometimes we put a Sincerely on the right. But without using ...
2
votes
1answer
37 views

Align itemize bullet to text

I am looking for a command to align text to the itemize's bullet. {\addtolength{\leftskip}{10mm} \textbf{Short text in here} \begin{itemize} \item A description of.. \item Another description of.. ...
4
votes
1answer
77 views

Alignment of text in two columns: forcing empty lines in one, to avoid collisions in the other

I have a question about aligning text in two columns. A similar question was asked here:Two Columns whose content is positioned relative to each other, but I wasn't able to get the example solution ...
1
vote
1answer
87 views

Table heading formatting

I have had this problem before (sort of) - it's related to this question I asked previously. Basically, I am having trouble with my table headings. I want the headings to be bold and centered ...
2
votes
1answer
33 views

Algorithm2e comment line alignment problem

I would like to align a comment within the algorithm environment of algorithm2e in such a way that each line of a multi line comment is left aligned. See the following MWE. In this MWE the second and ...
4
votes
1answer
28 views

Color behind numbers in lstlisting

Currently, my listings use this style : \definecolor{lstgrey}{RGB}{217, 217, 217} \definecolor{lstback}{RGB}{246, 246, 246} \newlength{\numberlengthnormal} ...
2
votes
1answer
27 views

How to right-align whole longtables

Say I have the following document: \documentclass{article} \usepackage{longtable} \begin{document} \begin{longtable}{|lr|} \hline A & 1\\ B & 2\\ C & 3\\ \hline ...
2
votes
3answers
78 views

Problem with horizontal and vertical centering of multiline cells in a table

I'm having difficulties perfectly centering (both horizontally and vertically) a few cells in my table. Here is a screenshot of what it looks like right now: The problem line is the one which ...
0
votes
1answer
32 views

Latex table alignment [duplicate]

I have a table of 2 columns, I want the writing in the left column to be centered and the right column to be aligned to the left. Using the commands below, the left column is exactly how I want it, ...
3
votes
1answer
26 views

Justify text from right in two column springer document class

I am facing one problem in justifying text in springer document class. my code is as below \documentclass[twocolumn]{svjour3} %\documentclass[conference]{IEEEtran} \usepackage{graphicx} ...
3
votes
1answer
47 views

Change bibliography title align when using quotchap

I'm writing my Masters Thesis and I'm using quotchap package in my chapter tiles. However I want Bibliography title align at left instead of right like the other titles. I've tried ...
2
votes
1answer
34 views

Leaked styling from my stackon

\documentclass[12pt]{article} \usepackage{verbatimbox,stackengine,xcolor,hyperref} \usepackage[left=2cm,right=2cm]{geometry} \begin{document} \title{} \author{} \maketitle \section{Overview} There ...
5
votes
3answers
89 views

Two text lines in `flalign` environment

I want to achieve what the picture shows below. Basically, I want those two very long text lines to split into two lines shown below. My major problem is that if I keep the text in one line in ...
1
vote
1answer
35 views

How can I align horizontally matrices of different dimensions?

I'm wondering how can I align two different matrices horizontally. They are: [-1 0 +1] And: [-1 0 +1].T This is my code: \begin{equation} \begin{bmatrix} -1 & 0 & -1 \end{bmatrix} ...
4
votes
3answers
101 views

Horizontal alignment of equation and text

I want to make a list of Quantum Mechanics formula like the format of the following picture. But I am confused about how to make the equations align to the left while the text to the right. Usually, ...
7
votes
2answers
97 views

minipage horizontal alignment

I'm using minipage to put two tables next to each other, and instead it is putting them in vertically. It seems like this is usually caused by having blank lines between the minipages, but that isn't ...
2
votes
1answer
54 views

Dividing page into equally sized sections, vertically and horizontally

I am the editor of a student-paper for mathematicians and physicists, which is made entirely through LaTeX. Right now I need to make a page with several different sections, a lot like the ad-pages of ...
2
votes
2answers
48 views

How to center the graphic of LTXexample?

Scenario I want to write a tutorial on PSTricks, but because latex-dvips-ps2pdf (see the code shown in First Attempt section) makes my effort to prevent reader from copying the listing numbers no ...
4
votes
1answer
64 views

How to make a keyword list with enumitem with labels aligned right in the margin?

I kinda succeeded in doing with without using the enumitem package, by doing this: (disregard the lines, it's made with showframe) \newenvironment*{keywordlist}{% \list{}{% ...
2
votes
4answers
109 views

Alignment in a piecewise function

I would like to have the following two equalities displayed with the = aligned. I use the following code. The = are not aligned, and 2.5pt is typeset before the = in each line! Also, there is an ...
5
votes
1answer
54 views

How to obtain a fixed gap between columns in a table?

How can I center a column of a table which is raggedleft/raggedright at a specified position? Basically the length between W and X, X and Y and Y and Z should be the same, W should be raggedright, Z ...
2
votes
2answers
35 views

Multiple columns in table, problem with alignment

The following code generates a table: \begin{table}[!t] % increase table row spacing, adjust to taste \renewcommand{\arraystretch}{1.3} \caption{An Example of a Table} \label{table_example} ...
3
votes
1answer
27 views

How to force part of a paragraph title to correctly align with right marging (using e.g. \hfill)

I would like to have a \paragraph{A paragraph title 2000} with the term '2000' aligned to the right margin. If I use \subsubsection{A subsubsection title \hfill 2000}the term 2000is correctly aligned ...
0
votes
0answers
24 views

Make the text left side [duplicate]

I am trying to write in a template LaTeX document, all the text I am writing is centred. I couldn't find the command causing this problem and I don't know how should I make the text start from left ...
3
votes
1answer
44 views

Centering / horizontal alignment of text inside tikz boxes

I am facing a problem with centering the text inside the boxes: \documentclass[a4paper,fontsize=12pt,a4paper,DIV=10,BCOR=10mm,twoside,titlepage=false,openany,pagesize]{scrbook} ...
2
votes
1answer
29 views

Shortcut to declare alignment of many columns in a table

Suppose I have a table with 20 columns that should all be centered. Is there a way to declare the alignment without literally counting out 20 c's? Something like c{20} might be the syntax. I feel like ...
3
votes
1answer
59 views

My Own CV Template - Help!

I wanted to develop a hybrid of moderncv and article class, another CV template. I am facing difficulties. Here is my code till now: \documentclass[12pt]{article} \usepackage{libertine} ...
1
vote
1answer
42 views

ragged2e justifying - centering figures

I am preparing a beamer presentation and I used the ragged2e package to justify the text in my slides (I justified the itemize environment). However, this does not allow me anymore to center a figure. ...
5
votes
2answers
94 views

How can I DeclareMathOperator* with spacing after it, preserving the alignment?

In the context of optimization problems, I'm using \usepackage{amsmath} \DeclareMathOperator*{\minimize}{\text{minimize}} \DeclareMathOperator*{\subjto}{\text{subject to}} to declare some operators ...
2
votes
1answer
70 views

How to properly format a proof/explanation with multiple points of alignment?

This answered question addresses how to properly align/format a proof, allowing one to add text commentary alongside equations without ruining the alignment of the equations; however, it only seems ...
0
votes
0answers
46 views

Aligning figures in a table

I'm trying to align four figures vertically and horizontally. But I couldn't get it right in spite of repeated tweaks. I guess its a fairly small error. Can someone help me out? Here is a MWE -- there ...
2
votes
2answers
39 views

Centering figure caption does not work

I have a few narrow figures for which I want to center the caption. I have to use a LaTeX template from Springer (svmult.cls). This makes captions left-aligned by default. I took a look at this ...
4
votes
2answers
87 views

Align split equation to the margins

How to align a two-lined equation such that the first line left aligns with the surrounding text and the second line right aligns with the surrounding text? Example (where the pipes denote the left ...
2
votes
2answers
99 views

Center equation ignoring condition/remark

Really basic question, probably already answered but couldn't find anything. I have this code: \documentclass[a4paper]{scrreprt} \usepackage{fontspec} \usepackage{amsmath} \begin{document} ...