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

9
votes
1answer
2k 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 ...
25
votes
1answer
9k 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
300 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
653 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} ... ...
22
votes
4answers
8k 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
2k 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 ...
26
votes
3answers
1k 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
2k 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
2k 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 ****...
6
votes
1answer
6k 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 ...
7
votes
3answers
27k 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
736 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, ...
15
votes
4answers
609 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
173 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
2k 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
4k 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.
12
votes
2answers
1k 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 ...
4
votes
2answers
584 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 even-...
8
votes
1answer
8k 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
6
votes
3answers
4k views

Why are the lines around my multicolumn cell misaligned?

In the following table, why does the double line before the diff column not go through? I guess all the multicolumn{1} are wrong? How can I fix it? \begin{table} \centering \begin{tabular}{|l||c|c|c|...
32
votes
3answers
82k views

How to center large figures in LaTeX and how to fix short justified lines?

I have 2 questions: I am trying to center a figure in LaTeX, but above a certain size it just starts at the left margin and goes beyond the right. How can I make it actually center, so the amount it ...
12
votes
2answers
42k views

Section Heading Centering problem

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

Spacing/stretching marginnote

I want to do something like this \marginnote{ \hspace{\stretch{1}} \framebox{text} \hspace{\stretch{1}} } i.e., center the marginnote. The problem seems to be that the width is defined to be that of \...
7
votes
2answers
1k views

Positive and Negative power in matrices and fixed size

I'd like to create a matrix that has some positive power and negative power. I'd like to have an alignment to right, so for example: \begin{array}{rr} 3 \times 10^3 & 2 \times 10^3 \\ 3 \...
3
votes
1answer
1k views

How can I do numbering with a hanging indent to the left into the page margin?

I am compiling some solutions to textbook exercises, and I am trying to do so in the style of the book. The way the book does it is that the body of each exercise appears unindented, left-aligned, ...
40
votes
2answers
139k views

How do you center equations?

I can't seem to center equations without causing some weird formatting problem. The following results in the R being dropped: \begin{center} E(R_{i,t})=E(\alpha_i)+E(\beta_{i,F_1 } F_{1,t})+E(\...
2
votes
2answers
221 views

How Do I Horizontally Center An Operator Relative To Aligned Equations Above and Below

I want to achieve the following effect in a new enviornment I'm defining where the stuff inside what's supposed to be delimeters is a \begin{aligned} \end{aligned} block. \begin{equation} ...
5
votes
2answers
444 views

Wrapping \obeylines with \halign into a macro

In the TeXbook, Knuth gives an example: Are you tired of typing \cr? You can get plain TEX to insert an automatic \cr at the end of each input line in the following way: \begingroup \let\par=\cr \...
2
votes
2answers
298 views

Centering a long line that spills over the margins.

I'm trying to TeX a fairly long line of text: \exists C\forall f(f\in C\Leftrightarrow f\in\ms{F}\wedge (\forall x\forall y)((x\in\dom f\wedge y\in\dom f\Rightarrow x=y)\wedge(\forall z)(z\in\dom f\...
0
votes
1answer
181 views

Why did my exact calculation still produce small gaps on the most left and right table rules?

I have specified each tabular cell width exactly using formula ##1\linewidth-2\tabcolsep-1.5\arrayrulewidth as shown in the following code snippet: \documentclass[dvips,dvipsnames,rgb]{book} \...
4
votes
2answers
948 views

How to overlap two adjacent edges of 2 framed minipages placed side by side?

How to overlap the adjacent edges? In other words, the adjacent edges should be combined into one edge shared between to minipages such that all rules will have the same thickness. \documentclass[...
5
votes
2answers
966 views

Multi-column delimiter in align

I want to set the following, but with all the <'s aligned horizontally Source of this failed attempt: \documentclass[12pt]{article} \usepackage{amsmath} \usepackage{amssymb} \begin{document} ...
5
votes
1answer
720 views

aligning columns at decimal point in TikZ matrices

Is there a way to align numbers in a TikZ matrix at the decimal points, as is possible in normal tables (Aligning numbers by decimal points in table columns)? http://www.texample.net/tikz/builds/ ...
4
votes
1answer
938 views

What is the difference between \Centering and \centering?

My question is already written on the title above. EDIT 1: I attempted to use \Centering and remove \arraybackslash in my original code below. It cannot be compiled. \documentclass[dvips,...
38
votes
3answers
11k views

Centering \vdots in a system of many equations

I have a system of equations with an arbitrary number of equations (k). I'd like to use \vdots to compactly describe the system, like so: \begin{align*} R(-1) &= \sum_{i=1}^m A(i)R(i-1) \\ R(-...
7
votes
2answers
13k views

How can I prevent LaTeX from breaking words and wrapping them to the next line?

I want to have my entire document fully justified but without the words being broken up and hyphenated at the end of a line if it is too long. I have come across the \raggedright argument which ...
5
votes
2answers
2k views

Complicated alignment within multiline equation

I'm having trouble getting the desired alignment behavior in a set of "sets" that I'm typesetting. I have a bunch of set definitions of the form $$U = \{\text{$x$ $|$ $x$ satisfies some condition}\}$...
31
votes
1answer
20k 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 \\...
5
votes
4answers
3k views

How to center the whole tabular, center the header line cells, and have some space after it?

I have a few questions about tables that are probably pretty basic. Here is the code for my table. \begin{table} \begin{tabular}{| r | l | l |} \hline \textbf{Species} & \textbf{Abbrev.}...
12
votes
1answer
2k views

Do I need \leavevmode for centering figures?

I have an image I'd like horizontally centered on the page. Currently, I'm using the following code (which does work) under pdflatex: \usepackage{float} ... \begin{figure}[H] \begin{center} \...
2
votes
2answers
527 views

certificate ending layout

How can I achive the above layout in latex? Place and Name should be on the same horizontal line, and so as Date and En.No.. Signature, Name and En.No should come on a same vertical line.
18
votes
3answers
15k 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.
3
votes
2answers
3k views

AMS align: Left aligned text/math plus multicolumn align

This question is basically a combination of two previous posts: Adding left aligned text to an equation. and AMS align / Align multiple “=”, too much space (the latter being my own question). What I ...
3
votes
0answers
1k views

Can one make 3-column alignments with amsmath? [duplicate]

Possible Duplicate: Align two inequalities I'd like to make an {align} with three columns, with an [rcl] type alignment, to typeset something like a < b < c a < bb < c a < ...
3
votes
1answer
4k views

Two matrices side by side

I'm trying to typeset two matrices side by side, somewhat like: A = (matrix) B = (matrix) I tried to next the matrices inside an align environment: \begin{align*} A &= \begin{pmatrix} ... ...
4
votes
1answer
3k views

Override \centering to left justify an image

Background Dozens of source code snippets inserted into a document as images inside of Algorithm floats. Other images are screen captures, inserted as Graphics floats, to make a distinction. All ...
16
votes
2answers
13k views

Raggedleft and raggedright simultaneously

This seems trivial, but I'd like a single line to have some text with left-justification and right-justification at the same time, eg. left text here ...
11
votes
3answers
20k views

How to Center a BeamerColorBox

The question is, how to horizontally center a beamercolorbox on the page? I put it in the center environment, but that doesn't work. \setbeamercolor{bgcolor}{fg=black,bg=blue} \begin{center} \...
3
votes
3answers
1k views

Protecting negative spacing in math mode

I am using \! to create negative spacings and put a dash over a symbol in math mode. (Here I am denoting missing transverse energy by defining a command \met where a dash is put across E_T, see code ...
9
votes
2answers
501 views

How, in ConTeXt, can I get body text to align flush to the outside?

I'm using ConTeXt Mk IV, and I'd like the text in a two-page document to line up like so: +--------+--------+ + + + + xxx + xx + + xxxx + xxx + + xx + + + +...