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

6
votes
4answers
191 views

How to use `\phantom` to align equations along a sum operator?

The following MWE shows the following bogus optimization problem with objective and constraints. I'm trying to achieve a visual alignment of the contraints in lines 2 and 3. However, a simple \phantom ...
3
votes
1answer
46 views

Geometry and Equation centering: strange behavior

I have found a strange "bug", where my equations do not seem to be aligned correctly when using the geometry package. I try to explain this behavior in more detail using this MWE: \documentclass[ ...
4
votes
2answers
257 views

How to Make My Equation Look Better With Text

I am creating a calculus study guide with LaTeX. I want my equations to be left aligned, but with the added text everything sort of looks terrible (not really left aligned and quite jagged in my ...
6
votes
1answer
80 views

Prevent second line hanging in questions

How do I prevent the second line to be indented as in the following example? \documentclass{exam} \begin{document} \begin{questions} \setcounter{question}{100} \question This is a ...
3
votes
4answers
198 views

How to move math symbols vertically and horizontally

How do I move the double arrow horizontally to the right? \documentclass{article} \usepackage{amsmath} \begin{document} \begin{tabular}{p{5cm}p{5cm}} {\begin{align} \underset{u(t), \eta(t), ...
3
votes
2answers
84 views

Align Caption to the left

I am trying to align caption to the left but its coming centered. Please see the figure. The code is \begin{figure}[!t] \includegraphics[scale=0.22]{Figure 1.pdf} \caption{The caption is coming to ...
6
votes
2answers
152 views

\underbrace spacing

I am currently using the \underbrace command and would like to center \cdot between the two terms. How can I better format this dot product and also line up the underprice text to the same heights? ...
2
votes
1answer
91 views

Left-align numbers in ToC

How do I lelft-align the chapter and section, number in the ToC? My code is: \documentclass[12pt]{report} \usepackage{tocloft} \makeatletter \renewcommand{\numberline}[1]{#1~} \begin{document} ...
6
votes
2answers
87 views

How to (best) align this list?

The desired result: My attempt: \documentclass[12pt,a4paper]{article} \usepackage{amsmath,enumerate} \usepackage{tablists} \usepackage{multicol} \title{Extension Multiplication of Algebra} ...
3
votes
1answer
25 views

Marking single table values with dot alignment

I have a table with multiple columns that I have aligned with the S column type from siuntx. In each column I want to mark some special values in a clear and subtle way, I've used the * symbol for ...
1
vote
1answer
74 views

How to left adjust a linear program?

\documentclass[11pt,a4paper]{article} \usepackage{fontenc} \usepackage[utf8]{inputenc} \usepackage{mathtools} \begin{document} \begin{alignat*}{2} \text{minimize } & \sum_{i=1}^m c_i x_i ...
1
vote
0answers
34 views

Centering code listings in tabular

I'm inserting code listings using mint into a tabular, but the text and listings in corresponding columns aren't centered. How do I center them? Here's my table code: \begin{center} ...
3
votes
1answer
89 views

Automatically add \noindent for short paragraphs

Is there a way to activate \noindent to each line which is so small that there is no line break in the paragraph? An example: The code This is a long paragraph: Lorem ipsum dolor sit amet, ...
5
votes
2answers
64 views

How can I set up a FAQ page in a booklet?

I want to set up a simple FAQ page at the end of a booklet I'm working on. The format will be: Q. The text of the question. A. The text of the answer. I want the text to be left-aligned, but to ...
1
vote
0answers
62 views

HZ typesetting system in plain TeX

How can I use the hz typesetting engine with plain TeX and pdfTeX? I read about it in TUG Vol 36 no.2, Peter Karow article, link: TUG Vol 36 no.2, Peter Karow.
3
votes
1answer
28 views

Place something in the middle of a hphantom (more or less)

I have a part of a formula like $\det (T + S + Z)$. For alignment purposes, I want to create a horizontal space of exactly the width of this formula. But in the middle of this space, I want to ...
1
vote
0answers
31 views

Conditional raggedright

Can I make (XeLa)TeX automatically use \raggedright whenever a paragraph would otherwise produce underfull or overfull boxes? (Might be useful for marginal paragraphs.)
0
votes
0answers
79 views

Using menukeys within lstlisting

I'd like to use the menukeys package to print keyboard key symbols like "enter" or "ctrl+c" in a listing. They should (1) not change the alignment of other characters, (2) keep some distance to ...
5
votes
2answers
97 views

New line right aligned

What I'm trying to do is right-align a new line. In other words, I want to have a block of justified text, as normal, and then I wish to have a line break, with the new line right-aligned like this: ...
3
votes
2answers
37 views

Non left-aligned equations

My equation is not left-aligned; see the attached image. I'd like it to be left-aligned. \begin{equation} P(w_{i} | h) = \left\{ \begin{aligned} \frac{n(h, w_{i})}{n(h)} Si n(h, ...
4
votes
1answer
78 views

Automatically calculate length of line + alignment

Consider the following code: \documentclass{article} \usepackage{mathtools} \usepackage{ulem} \newcommand*\mlr{\hspace{6em}} \newcommand*\addition[4]{% \begin{array}{@{} r @{,} l @{}} ...
0
votes
1answer
42 views

How to set the width of last column in \settabs?

The last column in sample line in tabbed alignment is not used for anything. If we use sample line in \settabs, we must put there the widest cell for corresponding column (which may not be the first). ...
4
votes
2answers
83 views

Indentation of the second line in a very lone sentence after \textbullet WITHOUT itemize environment

I have a very long sentence after a \textbullet. Because it is very lone, it goes to the second line. But there is no indentation in the second line. How could I add indentation and align the second ...
1
vote
1answer
30 views

Why vrules are not aligned between rows of tabbed alignment?

How to make \vrules aligned against each other in the following example? Why the sample line after \settabs does not work as needed? \magnification=\magstep5 \nopagenumbers \font\ttl=rm-lmtl10 ...
1
vote
1answer
34 views

Text alignment of command output

I have created a new command where the functionality works as expected, but the output is a Little unexpected. As you can see, the "Else" text is not aligned with the "Kaldenavn" text. How can it be ...
1
vote
1answer
37 views

Left align single equation in gather

How do I left align a single equation in gather environment? \begin{gather} a=1 \\ % How to left align this? b=2 \\ \end{gather}
0
votes
1answer
58 views

\hbox cause alignment Error

I have an issue i can't figure it out, i have a definition like \let\rendsplit@old=\rendsplit@ \def\rendsplit@{% \global\setbox\z@\vbox{\hbox{\vbox{\unvcopy\z@}}}% \rendsplit@old% } the ...
1
vote
2answers
65 views

\begin{align} giving messed up alignment + bad box error

I am having a problem with this. In texStudio ,it's not even running, and in sharelatex, it runs but the alignment is messed up... \begin{align} k &= 1\\ && T(n) = 4T(n-1)-4T(n-2)\\ k ...
4
votes
1answer
91 views

Move frametitle horizontally

I want the title of my frames to be a little more to the right than it is the case by default. I thought I had the ideal solution with \addtobeamertemplate{frametitle}{\hspace*{1em}}{} (1em just ...
2
votes
1answer
58 views

How to add borders to algorithms that put side by side

I put two algorithms side by side using the following code, however, there is no borders for them and the it is hard to identify the two algorithms. The codes: \documentclass{llncs}% ...
3
votes
0answers
56 views

Need linebreak when \fbox exceeds the text area

Need to align a "fbox", when exceeds the text area. MWE: \documentclass{article} \begin{document} Blah \fbox{Text within box in horizontal line} Blah ... Blah \fbox{Text within box in horizontal ...
4
votes
1answer
57 views

Conflicts between fleqn and gathered?

I want my document formatted with fleqn. I was previously having issues with a missing equation number using gather, so following Problem with cross referencing using gather environment I switched to ...
1
vote
0answers
77 views

Measuring Length cause wrong equations alignment [closed]

Forgive my poor language and my unprofessional question but i need to understand more. I wrote 2 definitions for a commands, the first command write the current X position and Y position BEFORE the ...
1
vote
1answer
28 views

Rows of the same column behaves differently, why?

I have a tabularx with 4 columns and 2 2-3 rows. The problem is that even though the first row behaves as expected, the second one doesn't. I am trying to set the 3rd column right aligned and the 4th ...
2
votes
1answer
49 views

Memoir ruled section centering problem

\documentclass[twocolumn]{memoir} \setaftersecskip{0em} \setsecheadstyle{\large \normalfont \bfseries \centering \MakeUppercase } \setsecnumformat{ \csname the#1\endcsname\par\nobreak ...
3
votes
1answer
68 views

Regression table with asterisks, parentheses and different number formats

I'd like to format a regression table that has asterisks, parentheses and different number formats. In particular, coefficients have three digits, but I have one row with the number of observations, ...
7
votes
2answers
149 views

Align \max operator and \text in optimization problem specification

A mysterious space is inserted before the max operator, breaking the alignment in the process. \documentclass{article} \usepackage{amsmath} \begin{document} \begin{align*} &\max c_i \\ ...
4
votes
3answers
88 views

Aligning an element of an Array to a bracket

I am new to writing in Latex and I'm struggling with what is probably a simple formatting issue. In essence, what I would like is for the left square bracket to be in line with the comma after -a in ...
2
votes
2answers
45 views

tabular whole page lr

I have some problems with creating a table. I'd like to have a table with no borders that fills the total text width, with 2 columns aligned right and left respectively. However, I can either make a ...
0
votes
2answers
71 views

Alignment with \mbox in one line [duplicate]

In my MWE below, I included an \mbox in my \align environment. I wanted the text line to be flush left, but when I inclued the text line as a separate line, all the equations got shifted to the ...
2
votes
3answers
140 views

how to maintain text justification after forcing a new line

How to break a line of text (\newline or \\) and still maintain justification for its texts?
1
vote
1answer
83 views

Positioning of the Table Notes of a threeparttable

How to position (center) the 'tablenotes' of a threeparttable? Any help is appreciated. Thanks in advance. I have done all the necessary code, but i need few help in the formatting process. The ...
3
votes
2answers
65 views

Centering text in box

I would like to horizontally center the text in the \fbox: \fbox{\vbox{\hbox{Words,}\hbox{words,}\hbox{and only words again}}} How would I do this?
1
vote
0answers
32 views

How might I align the result of the sum of the following figure as represented in the second figure?

(2)-figure is represented as follows; \documentclass[11pt,a4paper]{article} \usepackage{amsmath} \usepackage{array} \usepackage{booktabs} \begin{document} using the detached coefficients, we ...
4
votes
2answers
186 views

How to align two tikz rectangles

I have created two boxes through tikz as shown in the code below. The one inside the enumerate is shifted a bit. How can I align them? \documentclass{article} \usepackage{enumitem} \usepackage{tikz} ...
3
votes
1answer
45 views

Create a heading with a horizontal bar interrupted by text

I'm trying to create a command that creates text to look like the image attached. Specifically, I want a develop a command, say we call it "CenterTextWithLine", such that I type: ...
0
votes
1answer
74 views

Horizontal alignment problems in table, v2

This is another follow-up question to "Alignment issues in a table". Code \documentclass[ a4paper, 12pt, landscape, danish ]{article} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} ...
1
vote
1answer
52 views

Justified Text in Classic Thesis CV Template

I'm currently trying to put together a CV using the classic thesis styled cv template. I cannot seem to figure out how to get the text in each description to be fully justified. I've tried using the ...
5
votes
1answer
50 views

Horizontal alignment issues and differences using \\ and \newline in the text

This minimal example shows the behaviour I am wondering about: \documentclass[11pt]{book} \usepackage[english]{babel} \usepackage[a4paper]{geometry} \begin{document} \frontmatter \pagestyle{plain} ...
0
votes
0answers
58 views

How do I center an image?

I inserted an image into my document, and set centering, but the image is centered along the edge, rather than the center of the image. how can I center the image in relation to the center of the ...