Tag Info

New answers tagged horizontal-alignment

2

Issuing \sloppy in your preamble may allow for a more breathable flow of text in some cases, but also avoid* overfull boxes - typically the case when text overflows the text block/column margins. Fundamentally \sloppy gives an "emergency stretch" of 3em, which should be plenty of space to have a word break at a "more appropriate" syllable. * source2e (p ...

0

This doesn't have anything to do with quotchap. Instead, it's about expanded macros making their way into the ToC where they don't belong. Specifically \leftline... Having said that, it's easier in this case to let them migrate into the ToC, but just make them do nothing when you call \tableofcontents. Here's an example of this: \documentclass{book} ...

3

In your example, you start a group with a { immediately before \centering, but this group is never terminated with a }. Thus \centering stays in effect for the remainder of the document, and you get some complaints (but not errors) from TeX in the log: (\end occurred inside a group at level 1) ### simple group (level 1) entered at line 60 ({) ### bottom ...

1

Your formulae are on left margin. To have them (more) centred, you should add a pair of && in front of them. If you want them to be really centred, you can use the alignat* environment: \documentclass[a4paper]{article} \usepackage[utf8]{inputenc} \usepackage{mathtools} \usepackage{nccmath} \usepackage[margin=1in, showframe]{geometry} ...

2


5


3

I would use aligned rather than array here, because semantically it's not really a cases situation nor an array: \documentclass{article} \usepackage{amsmath} \begin{document} \begin{equation*} \left\{ \begin{aligned} a^{3} + b^{3} &= -q \\ ab &= \dfrac{-1}{3} \, p \end{aligned} \right. \end{equation*} \end{document}

1

The column separation specification @{<stuff>} inserts <stuff> between the columns, so the result is as expected in your case. If you want a 2.5pt gap, then you need to insert @{\hspace{2.5pt}}. However, if your main aim is to align the parts at the = sign, then you can use \documentclass{article} \usepackage{amsmath} \begin{document} ...

5

I'm more going towards what you're after than what you currently have... Specifying a fixed distance between columns is best done using the @{..} specification. So, for example, one could use l@{\hspace{1cm}}c to denote a 1cm gap between a left and centred column. \documentclass{article} \usepackage{booktabs}% http://ctan.org/pkg/booktabs ...

0

Tabular adjusts column widths automatically to cell contents. It doesn't have enough information to equally space the st1 and st2 columns relative to the multicolumn header. It fits st1, then adjusts st2 to fit the rest of the multicolumn header. Your example does not work for single word headings. Remove the space between abcdefg and fewfewfe to see the ...

0

Because the caption (abcdefg fewfewfe) is wider than the columns the last column is widened. Below is one solution, which you may or may not like. \documentclass{article} \usepackage{minibox} \begin{document} \begin{table}[!t] % increase table row spacing, adjust to taste \renewcommand{\arraystretch}{1.3} \caption{An Example of a Table} ...

2

Change the definition of \paragraph so that it is like \subsubsection and not an inline title. \documentclass[11pt,a4paper]{article} \makeatletter \renewcommand\paragraph{% \@startsection{paragraph}{4}{\z@}% {-3.25ex \@plus-1ex \@minus-.2ex}% the same spacing above, but negative {1sp}% no space after the title ...

2

Pass the align=center option to the nodes. I also changed to a matrix of math nodes to have the proper math-mode for the math expressions (regular text was produced with the help of \text from amsmath) and increased the text width: \documentclass[a4paper,fontsize=12pt,a4paper,DIV=10,BCOR=10mm,twoside,titlepage=false,openany,pagesize]{scrbook} ...

4

Replication of column specifications is done using a *{<num>}{<col spec>} interface, which should repeat <col spec> a total of <num> times: \begin{tabular}{*{20}{c}} % tabular content \end{tabular} will produce a table of 20 columns, each one centred. To add vertical column rules (which you should never do), you can use ...

3

\centering is a switch that causes everything inside the group following it to be centred. Remove it since you don't need it in this context - it is the cause of the alignment problem in your section title. Moving the list environment to the right could be done using enumitem's leftmargin or wide key-value. \documentclass[12pt]{article} ...

6

Use \centering inside the figure environment. \documentclass[10.5pt]{beamer} \usepackage{beamerthemesplit} \usetheme{Copenhagen} \setbeamercovered{transparent} \usepackage{ragged2e} \let\olditem=\item% \renewcommand{\item}{\olditem \justifying} \begin{document} \begin{frame} \begin{itemize} \item blablabla \begin{figure} \centering ...

1

You could simply not use the \text{...} "wrapper" in the second argument of \DeclareMathOperator*} macro. Instead, just write \newcommand\myspacer{\quad} \DeclareMathOperator*{\minimize}{minimize\myspacer} \DeclareMathOperator*{\subjto}{subject\ to\myspacer} The macro \myspacer is set to \quad for now. If you wish to change it to \qquad or \, that's ...

4

You can set the problem in an array to adjust the spacing. For consistency, it's best to define this as an environment: \documentclass{article} \usepackage{amsmath,array,environ} \DeclareMathOperator*{\minimize}{\text{minimize}} \DeclareMathOperator*{\subjto}{\text{subject to}} \newcolumntype{R}{>{\displaystyle}r} ...

1

Here are two ways of doing things. I define right aligned notes, that require using the flalign(*) environment and the \llap command. If there is enough white space to input a (short) note, you use the \shortrnote command. If there is not, you put the note on a line of its own. Similarly, I define left aligned notes, that use the alignat(*) environment and ...

1

Adding \usepackage{caption} results in a center-aligned caption \documentclass[graybox]{svmult} \usepackage{caption} \begin{document} \begin{figure} \centering My graphics \captionsetup{justification=centering} \caption{My caption dfhu orifv My caption dfhu orifv My caption dfhu orifv My caption dfhu orifv My caption dfhu orifv My caption dfhu orifv My ...

2

Use a minipage. \documentclass[graybox]{svmult} \begin{document} \begin{figure} \centering \begin{minipage}{.33\textwidth} \centering This text is supposed to substitute the image in this figure environment \caption{My caption} \end{minipage} \end{figure} \end{document}

4

You could use the environment multline provided by the package amsmath \documentclass{article} \usepackage{amsmath} \setlength\multlinegap{0pt} \begin{document} \begin{multline} P(x) = \\ a + b + c + d + e + f \end{multline} \end{document} The \setlength\multlinegap{0pt} assures no indentation of the first line.

4

Ypu can define the flmultline environment and its starred counterpart: \documentclass{article} \usepackage{amsmath} \usepackage{lipsum} \makeatletter \newenvironment{flmultline} {\multlinegap=\z@\start@multline\st@rredfalse} {\endmultline} \newenvironment{flmultline*} {\multlinegap=\z@\start@multline\st@rredtrue} {\endmultline} \makeatother ...

3

You could align the condition to the right margin and center the equation to the rest of the line using flalign. \documentclass{scrreprt} \usepackage{fontspec} \usepackage{amsmath}% loads also amsmath \usepackage{showframe}% to show the page layout \begin{document} \begin{flalign*} &&x_j = 1,\quad y_j = 2,\quad z_j = 3 &&\text{for }j=1, ...

7

Just load mathtools instead of amsmath (it loads the latter) and use its \mathrlap command. You may put the \qquad inside the \rlap or not. In my opinion, if you put it inside, the main part of the equation doesn't look centred to the reader,though it is. You must also be aware the condition might overlap the right margin. In such a case, I would one of ...

0

Here is a shorter code, with only one tabular environment, using booktabs and hhline: \documentclass{article} \usepackage{array, booktabs, hhline} \begin{document} \begin{table}[!ht] \centering \begin{tabular}{|c|c|c| >{\qquad}c|c|c|} \multicolumn{6}{c}{XYZ} \\ \multicolumn{3}{c}{X} & \multicolumn{1}{c} ...

1

perhaps you have missed & between the two inner tabeles , You want a table like this and you change \documentclass{article} \begin{document} \begin{table}[!ht] \begin{center} \begin{tabular}{cc} \multicolumn{2}{c}{XYZ} \\ X & Y \\ \hline \\ \begin{tabular}{|c|c|c|} ...

0

I had the same problem but the solution that was propose did not work for me. I had spent hours trying to remove these unwanted gaps in the text. I would like to share how I solved my problem, for those who are still having this issue. I used latex for my thesis and when I ended a paragraph, I used \linebreak command but it was a huge mistake that took ...

4

You can use \begin{subarray}{l}, but perhaps it's better to define a new command based on subarray (just like \substack is based on subarray). \documentclass[border=2bp]{standalone} \usepackage{amsmath} \makeatletter \newenvironment{tsubarray}[1]{% \vcenter\bgroup \Let@ \restore@math@cr \default@tag \baselineskip\fontdimen10 \scriptfont\tw@ ...

0

I found a dirty way to do it ... it works but I think it is not the best way :) Does anyone have another idea ? \documentclass{article} \usepackage{pgfplots} \pgfplotsset{compat=newest} \begin{document} \begin{figure} \begin{tikzpicture} \begin{semilogyaxis}[xmin=0, xmax=600, ymin=1e-1, ymax=1e7, axis x line*=bottom, axis y line*=left, xlabel={X}, ...

1

I assumed you wanted multiple choice because you mentioned the oneparchoices environment. I used the xpatch package to replace the 1em between choices with \hfill to evenly space the choices. This is good for very short answers. If you have longer answers, then you should look at some of the answers in this question. The code in the initial question (first ...

2

Your centring efforts are almost certainly overkill here: \begin{center} \begin{minipage}{\linewidth} \centering Generally you should only need two commands to centre images: \centering\includegraphics{...} — when the figure is smaller than the text width \centerline{\includegraphics{...}} — when the figure is wider than the text width If this ...

3

The star form of \hspace avoids to get canceled at the start of a new line: \newcommand*{\mymacro}[1]{\hspace*{\fill}\mbox{#1}\penalty-9999\relax} The penalty allows a line break, but it does not force one (-10000) to avoid an underfull \hbox warning, if the paragraph ends after \mymacro.

1

Meh... as it usually goes, as soon as I posted the question, I noticed that \path (axis cs:0,0), and I thought: "what would happen if I type rel" in there?" - and indeed, that fixes it; simply replace \path (axis cs:0,0) with: \path (rel axis cs:0,0) ... in the code above, and the plot will center as expected... It's still a brute force solution without ...

3

Include the column spacing as part of the cell contents, not the column specification: \documentclass{article} \begin{document} Original table: \begin{tabular}{@{}lr@{~~}r@{~~}r@{\hspace{10pt}}r@{\hspace{10pt}}r@{}} \hline configuration & \multicolumn{1}{c@{~~}}{$M$} & \multicolumn{1}{c@{~~}}{$w$} & ...

Top 50 recent answers are included