Tag Info

New answers tagged

0

There are four predefined lengths, which control the vertical whitespace of displayed formulas: \abovedisplayskip=12pt plus 3pt minus 9pt \abovedisplayshortskip=0pt plus 3pt \belowdisplayskip=12pt plus 3pt minus 9pt \belowdisplayshortskip=7pt plus 3pt minus 4pt The "short" version is used for equation, when the last line of text is short.


1

don't leave a blank line between text and any display math -- that adds extra space because you are saying "start a new paragraph here." if you have just a short bit of text between lines of an aligned display, you can use \intertext: text above \begin{align} a &= b + c\\ &= d + e\\ \intertext{because} &= f + g \end{align}


0

My comment last month nagged at me, until I remembered an answer I gave at Rounded box around placeholder text that supports line breaking (in which I was trying to eliminate this gapping effect), and decided it was worth trying to adapt to enhance it. What I do is paint the natural spaces of alternating letters in alternating colors (here cyan!80 and ...


1

This provides both a semi-automatic and a fully automatic solution to the problem... In all cases, it is "automatic" in that all the mdframe parameters necessary to create the color padding are taken directly from the environments without user intervention. If the user opts for the "semi-automatic" solution form, it allows them to manually invoke a macro ...


0

One possibility: \documentclass[11pt,a4paper]{memoir} \usepackage[a4paper,top=2.5cm,bottom=2.5cm,left=2cm,right=2cm]{geometry} \usepackage[ngerman,english]{babel} % select the language \usepackage[utf8]{inputenc} % input encoding \usepackage{mathptmx} % font size extension \usepackage{blindtext} % blindtext ...


0

Update: This appears to be a bug in certain versions of mdframed! mdframed.sty 2013/03/09 1.8: Good mdframed.sty 2013/07/01 1.9b: Bad mdframed.sty 2013/08/18 1.9d: Good Note that you can get the latest version of mdframed from https://github.com/marcodaniel/mdframed


5

Here are four strategies. The first is what I like the best. \documentclass{article} \usepackage{amsmath} \newcommand{\su}[1]{% \text{\thickmuskip=3mu$#1$}% } \begin{document} \begin{alignat*}{2} &\text{Normal: } && \sum_{k=1}^{m}a_{k}\\ &\text{Modified: } && \sum_{\text{$k=1$}}^{m}a_{k}\\ &\text{Thin space: } && ...


5

as stated by Werner in a comment, \mathop is intended to define operators like lim et al., while = is a relation. as for the spacing, that was determined through knuth's examination of numerous examples published in the most carefully typeset journals of the early 20th century. these publications are cited in various writings by knuth. i recommend ...


6

TeX sets \thickmuskip between the relational operator and most other math atoms in styles \displaystyle and \textstyle, but no space in script styles \scriptstyle and \scriptscriptstyle. A \thinspace is also inserted in script styles between an operator atom (\mathop) and an ordinary atom (\mathord). Thus \sum_{n \mathop{=} 1} gets you the desired ...


2

Another layout with different types of "X" columns, and a better vertical spacing with the help of the cellspace package: \documentclass[a4paper, 11pt]{article} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage{lmodern} \usepackage{graphicx}%[draft] \usepackage{array, booktabs, multirow} \usepackage{tabularx} \newcolumntype{Y}{ ...


3

You can simply use the standard command multicolumn to achieve this. Then you choose which of the columns of the top tables should span more than one column of the lower table. Then do this in each row of the top table. \begin{tabular}{|l|l|l|l|l|l|} \hline \multicolumn{2}{|l|}{ parameter } & value & \multicolumn{2}{l|}{ parameter } & value ...


5

Here's one option using tabularx: \documentclass{book} \usepackage{tabularx} \newcolumntype{C}{>{\centering\arraybackslash}X} \begin{document} \begin{table} \small \centering \begin{tabularx}{.7\linewidth}{|X|C|X|C|} \hline parameter & value & parameter & value \\ \hline blah blah & a & blah blah & 2 \\ blah blah ...


2

A first trial without equal widths, but I am not sure whether I understand the request correctly... ;-) \documentclass{scrbook} \begin{document} \begin{table}[ht] \small \centering \begin{tabular}{l|l|c|l|c|l} \cline{2-5} & parameter & value & parameter & value \\ \cline{2-5} & blah blah & a & blah blah & 2 \\ ...


7

I introduce \widow which uses the \widowpenalty to prevent a hanging single line (unless the whole paragraph only took a single line). You insert \widow as the last word of the paragraph. In this way, it doesn't apply to your whole document, but is applied locally to resolve a local problem. This same approach applies outside of mdframed, as well. ...


2

If you do not have vertical lines, then this can be solved by \noalign{\vspace{6pt}} Full example: \documentclass{article} \begin{document} \begin{tabular}{p{4cm}p{4cm}} Lorem ipsum dolor sit amet consectetur & adipisicing elit\\ \noalign{\vspace{6pt}}% sed do eiusmod tempor incididunt ut labore & et dolore magna aliqua.\\ ...


2

The \\ mechanism can be used, but one has to account for the height of the \parbox, either manually or automatically. The other option, if all rows are to be adjusted, is to use the \extrarowheight parameter of the array package, or else \arraystretch as was mentioned in the comments. \documentclass{article} \usepackage{array} \begin{document} ORIGINAL ...


5

You could put a strut in the first column. \documentclass{article} \begin{document} \begin{tabular}{p{4cm}p{4cm}} Lorem ipsum dolor sit amet consectetur\rule[-6pt]{0pt}{6pt} & adipisicing elit \\ sed do eiusmod tempor incididunt ut labore & et dolore magna aliqua.\\ \end{tabular} \end{document}


1

Below I present two possibilities; in the first one, the object is treated as a floating object; in the second one, the object is static. One option using a minipage inside the figure environment; the minipage has fixed height equal to \textheight; the object is treated as a float: \documentclass{article} \usepackage{showframe} \usepackage{subfig} ...


4

Another instance of problems with material in vertical mode; use \leavevmode: \documentclass{article} \usepackage[framemethod=tikz]{mdframed} \parskip=32pt \begin{document} \begin{mdframed}[suppressfirstparskip=false,frametitle={Theorem 1.}] Text \label{Yeah} \end{mdframed} \begin{mdframed}[suppressfirstparskip=false,frametitle={Theorem 2.}] ...


3

First of all, I've adjusted your code not to have bad boxes. If you omit the tabu length then it uses \linewidth. If you use all columns of type X then the space is divided into the columns depending on the first parameter you give to the column. So, specifying X[5] is not the same as specifying p{5cm}. Moreover, the right way to specify an X column is ...


1

You can have the same result with the enumitempackage, which is much more versatile. Here are two examples, in which I chose to make the label indentation equal to paragraph indentation: \documentclass[12pt, a4paper]{report} \usepackage[utf8]{inputenc} \usepackage[textheight = 24cm]{geometry} \pagestyle{empty} \usepackage{lipsum} \usepackage{enumitem} ...


2

We used \plparsep=0.2in and negative value in \plitemsep: \plitemsep=-0.2in. For now this is our result. %! *latex mal-spacing.tex \documentclass[12pt]{report} \pagestyle{empty} \usepackage{paralist} \plparsep=0.2in \plitemsep=-0.2in \begin{document} Text before. \begin{compactenum} \item foo\par bar1\par bar2\par \item foo \item bar ...


3

Just close math mode and reopen it: \documentclass{article} \usepackage{stmaryrd} \newcommand{\sem}[2][]{% \mbox{$\llbracket$\bfseries #2$\rrbracket^{#1}$}% } \begin{document} Here are \sem{Two words} and here is \sem[1]{One}. \end{document}


2

memoir provides its own interface for caption management, and there may be some clashes when using it in conjunction with caption (see section 10.13 The class versus the caption package (and its friends), p 206 of the memoir user manual). However, you can update \caption to grab its contents, evaluate whether the argument is empty/not, and condition ...


1

If you really don't use captions anywhere, redefine \caption to do nothing. \renewcommand{\caption}{} Which I think will do what you want.


6

The space is controlled by the parameter \doublerulesep which you can set at any point in the document \setlength\doublerulesep{2cm} Either in the preamble for the whole document or if just this table, inside the table environment alongside \centering and any other local declarations.


0

I changed to class article so that I could work with it. One of the primary things was to change the width of all three subfigures to be the same. Also, subfigures were invoked with top, not bottom, alignment. Once that was done, the middle figure's width/height, when expressed as a fraction of \textwidth, had to be changed (I also used \hfil and \hfill ...


4

< and > are relational operators ("less than" and "greater than"). They can be used as delimiters, but TeX needs to know it (the traditional way with \langle and \rangle are added for comparison): \documentclass{article} \begin{document} \[ \mathopen< a, b, c \mathclose> \times T = \langle a, b, c \rangle \times T \] \end{document} ...


2

You may also put the binary operator > between braces: \documentclass{article} \usepackage{mathtools} \begin{document} \[ {>} \times T \] \end{document} Edit. Sorry, > is in fact a relational operator, as Heiko Oberdiek noticed. Putting it into a pair of braces makes the binary operator \times consider it as an operand, and so there is ...


2

This occurs because both > and \times are binary operators. If you use \mathord> \times T the > will not be treated as a binary operator, and the spacing will be as you desire.


4

\addvspace only inserts vertical space up to some maximum: \documentclass{article} \usepackage{lipsum} \newenvironment{myenv} {\par\addvspace{\baselineskip}}% \begin{myenv} {\par\addvspace{\baselineskip}}% \end{myenv} \begin{document} \lipsum[4] \begin{myenv} \lipsum[4] \end{myenv} \begin{myenv} \lipsum[4] \end{myenv} \lipsum[4] \end{document} ...


4

I'd suggest you to use a \list (as many of the standard LaTeX2e environments do): \documentclass{article} \usepackage{lipsum}% just to generate text for the example \newenvironment{myenv} {\list{}{\leftmargin=0pt}\item\relax}{\endlist} \begin{document} \lipsum[4] \begin{myenv} \lipsum[4] \end{myenv} \begin{myenv} \lipsum[4] \end{myenv} \lipsum[4] ...


-1

Like Raphael said in the comments: \documentclass{minimal} \usepackage{siunitx} \begin{document} The temperature is $\approx \SI{200}{\kelvin}. \end{document}


0

I found a way by adjusting the minpage's width: \begin{figure} \centering \begin{minipage}[t]{.45\textwidth} \centering \includegraphics[scale=FIGURE1_SCALE]{images/Figure1.pdf} \caption{My Figure1 Caption} \end{minipage}\hfill \begin{minipage}[t]{.3\textwidth} \centering \includegraphics[scale=FIGURE2_SCALE]{images/Figure2.pdf} \caption{My Figure2 Caption} ...


0

You might want to look at my cals tables package, which supports padding in cells and widths of border lines. See the demo PDF: http://mirrors.ctan.org/macros/latex/contrib/cals/examples/demo.pdf


5

~ is a relational symbol and should be used such. Further you can use \SI macro inside the math mode. Hence, the correct way is \documentclass{minimal} \usepackage[detect-all]{siunitx} \begin{document} The temperature is $\sim\SI{200}{\kelvin}$. \end{document}


6

You could define \newcommand{\appr}{{\mathord{\sim}}} as per the answer you linked to; with double curly braces this is even usable in \SI like so \SI{\appr 200}{\kelvin} MWE: compare this solution (first line) to your desired output (second line) \documentclass{minimal} \usepackage{siunitx} \newcommand{\appr}{{\mathord{\sim}}} \begin{document} The ...


2

EDITED to catch more cases (and examine failure modes) I concur with David's recommendation not to make the space active. So the approach I take here is to make the dot active, with the ability to turn the feature on (\initialsON) and off (\initialsOFF) as needed, if it is found to interfere with something else. The choice of an active dot will bring with ...


1

And here's the proper way to do it in beamer: the inner command \beamer@sectionintoc (defined in beamerbasetoc.sty) inserts \vfill after each section entry in the ToC; patch the command to suppress \vfill and use a vertical skip of \itemsep (the separation between items in a list) or any other length that suits your needs: \documentclass{beamer} ...


0

The cellspace package ensures a minimal spacing between the top of a cell and the bottom of the above cell and independantly between the bottom of the cell and the top of the below cell. So you can have better vertical spacing of cells and contents of cells vertically centred, which is not the case if you play with \arraystretch. Makecell allows for ...


6

I added support for initials to my package luavlna. This package uses luatex node processing callbacks for language dependent insertion of non-breaking spaces after one letter words and initials. Example: \documentclass{article} \usepackage{fontspec} \usepackage[czech, english]{babel} \usepackage{luavlna} \preventsinglelang{czech} \begin{document} ...


0

You could use the following work-around for your first frame and then play with the second argument of \fontsize to adjust the space between the lines: \frame{ \frametitle{Outline} \bgroup \vskip1\baselineskip \fontsize{10}{18}\selectfont \tableofcontents \vskip0pt plus 1filll \egroup } I've taken your initial example, no additional ...


1

Here is a way to patch \tableofcontents such that its contents are embedded inside a minipage: \pretocmd{\tableofcontents}{\begin{minipage}{\textwidth}}{}{} \apptocmd{\tableofcontents}{\end{minipage}}{}{} The MWE then becomes: \documentclass{beamer} \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} \usepackage{lmodern} \usepackage[english]{babel} ...


3

Without tabulary (works also with tabulary \documentclass{scrartcl} \usepackage[utf8]{inputenc} \usepackage{array,booktabs} \usepackage{amsmath} \begin{document} {\def\arraystretch{2.5} \begin{tabular}{@{} l r @{} >{${}}c<{{}$} @{} l @{}} \toprule Mean squared error & MSE &= &$\dfrac{1}{n}\sum\limits_{t=1}^{n}e_t^2$ \\ \midrule Root ...


2

Don't use \hline and also remove the vertical rule that adds no information and simply interrupts the flow of reading. \documentclass{scrartcl} \usepackage[utf8]{inputenc} \usepackage{tabulary} \usepackage{booktabs} \usepackage{amsmath} \begin{document} \centering \begin{tabulary}{18cm}{L R @{} >{${}}c<{{}$} @{} L} \toprule Mean squared error & ...


5

I can't really explain the technical reason I think, but add a \par after the title. You also want to set the width of the minipage to \dimexpr\textwidth-2\fboxsep. This is because \fbox inserts some space between the frame and content. And finally, you need some % at the end of some lines, to avoid spurious spaces, see e.g. What is the use of percent signs ...


0

I think $a \equiv r \;(\bmod\; n)$ does what you want (as mentioned by jfbu in the comment).


3

Surely you are using a document class (like the standard book) where the bibliography starts a new page since a \chapter* command is issued (or similar). A solution could be to redefine \clearpage (the command responsible of the new page) locally to the bibliography, so that the latter doesn't start a new page, something like \begingroup ...


2

I enclose a small Lua snippet which add spaces after letters except commas, colons and semicolons. It adds space after spaces. This is a small example. %! lualatex mal-words.tex \documentclass[11pt]{article} \pagestyle{empty} %\newcommand{\spreadletters}[2]{\makebox[#2][s]{#1}} % 1. approach %\usepackage{seqsplit} % 2. approach \usepackage{luatextra} ...


13

Using Paul Stanley's answer to your question Conditions for fancy chapter title, here's a way: \documentclass{book} \usepackage[explicit]{titlesec} \usepackage{lipsum} \usepackage[T1]{fontenc} \usepackage{lmodern} \newcommand{\chaptercolor}{blue} \usepackage{tikz} \usepackage{xparse} \titleformat{\chapter}[display] {\normalfont\filcenter} ...



Top 50 recent answers are included