Tagged Questions

{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
2k views

Draw horizontal line left and right of some text (a single line)

I want a horizontal line to the left and right of some text, that is at most one line wide. The lines should be equally sized such that they fill the remaining horizontal space (like two \hfills in a ...
2
votes
1answer
4k views

Centering Text using multirow that overflows onto multiple lines

I am trying to create a table where one column has multiple rows. This is very easy to do using the multirow package. However, if I specify a width for this \multirow and my text overflows, the second ...
3
votes
1answer
797 views

Changing the alignment of chapter headings and quotes in quotchap

How can I change the alignment of chapter headings and quotes in quotchap without modifying the .sty file? More specifically, I would like left-align the chapter headings and right-align the quotes.
3
votes
2answers
362 views

Macro to allow for alignment points within its argument

I would like to have a macro that allows for alignment points inside it. As a specific example, I would like to be able to say: \begin{align*} a &= b\\ \bracr{c &= d} \end{align*} ...
4
votes
2answers
2k views

Aligning text columns

I am using the following code to try to obtain something to the effect of Author: Laboratory Partners: Amos NG Rebecca ROYCROFT ...
5
votes
1answer
9k views

How to shift one equation only towards the left margin

I have an equation extending into the right margin and off the page. I have many equations. For this equation only, I would like to shift it to the left. MWE below. \documentclass[twoside]{book} ...
4
votes
3answers
528 views

Text without hyphenation with Tikz

How do I get the text does not break the line? I have \begin{tikzpicture} \node[align=left,text width=3cm] {Contemplando a contemporaneidade}; \end{tikzpicture} but i need
4
votes
1answer
1k views

Aligning function arguments in “algorithm” environment.

In the "algorithm" environment, when a function call spans multiple lines, I would like to have its arguments aligned, like so: MyFunction(long_arg_name0, long_arg_name1, ...
5
votes
2answers
451 views

flushright of theorem captions

Is it possible to flushright captions of theorem envrionments? For example consider the following code: \usepackage{amsmath} % \usepackage{amsfonts} % \usepackage{amsthm}% \theoremstyle{definition} % ...
11
votes
1answer
15k views

How do I align text?

How do I do something like this in LaTeX? X: a, b, c, e, f, g
16
votes
3answers
22k views

Use flalign or alignat or align or similar environment to align to the left

The following is a small example to use flalign environment to generate equation. \documentclass{article} \usepackage{amsmath} \usepackage{txfonts} \begin{document} The formula is: \begin{flalign*} ...
17
votes
3answers
4k views

How can I align two nodes to the left in TikZ?

I have two unaligned nodes |AAAAAAA| |B| and I want to have the node with the B aligned to the left of the node with AAAs and below it |AAAAAAA| |B| How can this be done?
1
vote
1answer
158 views

alignment in align-env: what is aligned in what way?

In this example: \begin{align*} & \lim( \neg ( \Sigma^* a_1 \Sigma^* a_2 \dotsb a_n \Sigma^* ) ) & = & \{ \alpha \in \Sigma^\omega | \exists^\omega n : \alpha [0,n] \notin \Sigma^* a_1 ...
1
vote
2answers
2k views

How to align multiple lines on same indent?

Desired effect is this: But my document is this: my code: From paragraph 1: \\ \textbf{Q1}\quad The writer calls the advertising industry ‘universal’. What phrase is used later in the paragraph ...
4
votes
3answers
3k views

Flush a left-flushed box right

I would like to put an address in my document as follows: | | | Name | | Street #| | City | | ...
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. ...
3
votes
1answer
1k views

Table: Caption is centered but table itself not

I have another problem with a table in my document. The following code centers the caption but not the table itself. Any hints why? \begin{table}[htbp] \begin{tikzpicture} \node (table) [inner ...
9
votes
2answers
9k views

How to align image

If i have in my beamer presentation some list of items and on that slide i wanna add a picture, which i want to be aligned e.g. to right top corner. \begin{frame}[fragile]{III. Override pages} ...
11
votes
3answers
11k views

Left alignment in TikZ

I'm not able to align the text left. \documentclass{article} \usepackage{tikz} \usetikzlibrary{positioning} \newcommand{\altura}{.45cm} \begin{document} \begin{tikzpicture}[x=1cm, y=-\altura, node ...
2
votes
1answer
890 views

amsart and enumerate environment

I'm using the amsart documentclass. Now the equation numbers are aligned to the left, I'm okay with that but what bothers me is the following: If I have equations in an enumerate environment it ...
6
votes
3answers
6k views

Insert a symbol at the end of line

I want to insert a symbol (\Box) at the end of the line.
64
votes
2answers
93k views

How to create fixed width table columns with text raggedright/centered/raggedleft?

I would like to create a table with some columns' width specified, while the text in those columns should be centered both horizontally and vertically. I found out that \usepackage{array} ...
5
votes
3answers
454 views

How can I align numbers in equations?

What is the best way to produce the following: (Image shows a typo)
6
votes
1answer
259 views

Is there a ConTeXt version of the LaTeX lefteqn?

What I want is to be able to set up equations like this: a very long first expression = the second line = and a third line = and maybe even a fourth In LaTeX, this would be ...
6
votes
2answers
1k views

How to center the TOC?

I would like to design the table of contents aligned to a vertical line near the center of the page. The chapter and section titles need to be flushright, the numbers flushleft, and between titles and ...
9
votes
2answers
726 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 ...
18
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 ...
13
votes
2answers
6k 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. ...
3
votes
1answer
823 views

In ModernCV, how to define a command in the cls style file to allow lines with right-aligned word.

I am using ModernCV for my CV. I want to achieve something like the following example (please note that the address "align2@rightMargin.com" is aligned to the right margin): Please note the last ...
13
votes
3answers
16k views

How to format the chapter heading?

How can I change the chapter heading of the book class to typeset centered chapter names as shown in the image above?
1
vote
2answers
594 views

Enumeration flush right

How can I do enumeration like this: Some loresipsum, lores ipsume loresipsum, lores ipsume loresipsum, lores ipsume loresipsum, lores ipsume loresipsum, lores ipsume loresipsum, lores ipsume ...
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 ...
22
votes
1answer
6k views

Underfull \hbox in bibliography

I am getting lots of "Underfull \hbox" warnings that point to the *.bbl file. It looks like these messages appear only when URLs are very long, like in the below example: @techreport{nistguidesec, ...
1
vote
2answers
277 views

Is it possible to add centering and vspace to the caption text of a figure?

I have a figure containing a pair of plots that represent data points from 15 referenced papers (indicated in the plots as 1-15). To better indicate the source of each data point, I have added ...
7
votes
2answers
514 views

Aligning columns, but allowing for text inbetween

I need help aligning text that spans multiple lines where I have Verbatim code in between. Here is a mock example to show what I mean: Fruit Amount Apple $3.00 \begin{verbatim} ... ...
18
votes
4answers
4k views

Place figures side by side, spill into outer margin

I would like to place two figures side by side (not subfigures) and what’s more, I’d like to let the figures spill into the outer margin (since they are too wide for the the text width. Like this: ...
2
votes
2answers
1k views

Center a Listing on page [duplicate]

I am trying to center a listing horizontally within a page. So far I have tried defining the following macro: \lstnewenvironment{snippet}[1][] {\centering \lstset{float=htpb,#1}} {} But ...
24
votes
3answers
958 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 ...
2
votes
1answer
1k views

How to align table or figure caption where the table starts?

HI How can I start the caption where table starts or figure starts? \captionsetup{justification=justified, singlelinecheck=false} does not work for me because it places the caption at the ...
1
vote
1answer
1k views

Using tabular in fancyhdr

For my header page layout, I use fancyhdr. I use tabulars in the headers. The following is my code. \documentclass[titlepage,a4paper,12pt]{article} %***************************** preamble region ...
3
votes
1answer
4k views

Right-aligned columns using the tabularx environment

I'm trying to typeset a matrix which has entries of differing widths. However, for aesthetic reasons, I would like each of the columns of the matrix to be the same width, and I'd furthermore like ...
2
votes
3answers
15k views

How to left-align a table in LaTeX

There are many Q&A's about left-aligning either table content-cells, or table captions. I'd like to left-align tables (or any/all floats for that matter). I would like to be able to tell that ...
1
vote
1answer
663 views

How to make the subsection number and the section title share the same vertical alignment in ToC?

Background The following screenshot shows "the left part of section title" and "the left part of subsection number" have different vertical alignment lines. For 12pt option passed to \documentclass, ...
14
votes
4answers
518 views

Bump right-aligned text to next line if no room

I'm trying to write a simple command that will put some text right-aligned, but bump it to the next line if it doesn't fit well. Since an image is worth a thousand words: The "Normally" case is ...
1
vote
2answers
164 views

Opposing alignment of multiple lines of long text without exceeding \linewidth

I'm trying to create some documents using the flashcards macros, and I'd like to have the text aligned like follows ____________________________________ | | ...
5
votes
2answers
1k views

Combined header cell in a table

This question is closely related to at least two other ones; namely, Tables of numbers, and slashbox alternative. What I'm after, is the horizontal- and vertical-alignment of row- and column-headers ...
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.
10
votes
2answers
824 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 ...
3
votes
2answers
519 views

Is there package to create a “Problem-Solution” environment that is symmetric for “twoside” pages?

Background The following screenshot shows a Problem-Solution environment that is symmetric for twoside papers. NOTE: The problem heading is on the right side for odd-numbered pages. For ...
8
votes
1answer
6k views

Multiline figure caption centering

How to center a figure caption that's too long for a single line? Or at least, make the text in other lines line-up with text after "Slika 1:". It currently looks like this