New answers tagged

2

To increase the separation between the number and the text, change \labelsep to the length you prefer. It is assumed that the numbered paragraph ends with a blank line. \documentclass[a4paper,12pt]{report} \usepackage{blindtext} \newcounter{mypar}[chapter] \renewcommand{\themypar}{\thechapter.\arabic{mypar}} \newcommand{\mypar}{% ...


1

The qed={} is adding a line of space, I think. If you comment that out, the disparity disappears: \documentclass{article} \usepackage{amsthm} %%%%%%%%%%% Uncomment to use pure amsthm %%%%%%%%%%%% % \newtheorem{mytheorem}{Mytheorem} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%% Comment out to use pure amsthm %%%%%%%%%% ...


1

(Earlier comment re-posted as an answer.) It looks like your document uses the \flushbottom setting. To change this, insert the instruction \raggedbottom immediately before \begin{document}.


4

align and align* use a vertical skip amount of about 10pt above the environment. This can be set to 0pt, but this should be done within a group, i.e. use {% \abovedisplayskip=0pt% \begin{align*} ... \end{align*} }% Please note, that there's \belowdisplayskip as well, having the analogous meaning for the space below the environment. Reducing just one ...


3

By default the content of a beamer frame is vertically centered. So what you want to do is align the content at the top. For one frame you can do that like this. \begin{frame}[t] ... \end{frame} If you want to align all the frames at the top, add the t option when loading the beamer class. \documentclass[t]{beamer}


3

Try this \documentclass{article} \begin{document} \noindent \makebox[0pt][l]{\Large\bfseries John Smith}%% \rule[-0.5ex]{\columnwidth}{0.4pt} Hell world, this is my cover letter. \end{document} There are commands like \rlap and \\lap. But, I think \makebox is kind of fun. You can set the width of the box and the alignment to be left, right, or ...


1

Don't change \footnotesize... We need to change three components to address your three requirements. Change the footnote number. For this we need to adjust \@makefnmark, which starts out like this (from latex.ltx): \def\@makefnmark{\hbox{\@textsuperscript{\normalfont\@thefnmark}}} We can replace the insertion of \normalfont with ...


2

Here's a possibility: \documentclass{article} \usepackage{amsmath} \makeatletter \everymath{\if@display\else\thickmuskip=2mu plus 2mu\fi} \makeatother \begin{document} \begin{center}% just to show the effect $a=b$ \end{center} \[ a=b \] \end{document} Alternatively (and preferably), but this requires using \(...\) for inline math: ...


1

For completeness, you could also define the macro as \def\naive#{na\"{\i}ve} which will require that it be followed by {} when ever it is used. For example, the \naive{} approach will work whereas the \naive approach will raise an error which says Use of \naive doesn't match its definition.. See page 204 of The TEXbook for details. Also, this answer may ...


5

*This is a summary answer, highlighting the benefits and drawbacks for the different techniques available to preserve spaces following a control word. Conceptually, this is intended for LaTeX implementations where the control word does not accept arguments, expands to simple, possibly formatted, text, and is used primarily in prose. Background: The TeX ...


2

Use a combination of setspace and parskip: \documentclass{article} \usepackage{kantlipsum}% for dummy text \usepackage{parskip} \usepackage{setspace} \doublespacing \parindent=1.5em % or whatever you need \begin{document} \kant[1-2] \end{document}


0

In my experience the trick to precise control over the space between lines is to use \vspace. Try this: \documentclass{article} \usepackage{lipsum} \begin{document} \lipsum[1] \lipsum[2] \vspace{4mm} \lipsum[3] \vspace{8mm} \lipsum[4] \end{document}


3

I'm not sure why the algorithmicx package does \item[]\nointerlineskip instead of doing nothing when it's processing an end instruction not to be printed. If I patch the relevant command to do nothing, the spacing is correct, at least in this case. \documentclass{article} \usepackage[noend]{algpseudocode} \usepackage{etoolbox} \makeatletter ...


3

The amsmath package sets \if@display to true in displays; the primitive \textstyle has no influence over it. Since the standard definition of \pmod checks \if@display, you get the additional space nonetheless. You have two strategies available. First strategy: redefine \pod (which \pmod depends on) so it doesn't add the space. This can be done with ...


1

You can use \everypar: \documentclass{article} \usepackage{tikz} \begin{document} \section{Some section} \subsection[Some subsection]{Some subsection} \everypar=\expandafter{% \the\everypar\tikz[remember picture,overlay,baseline]{\node at (current page.center){bla};}% \everypar={}} \begin{quote} This text has too much distance to the subsection ...


0

Even though you're using remember picture,overlay, TikZ still leaves a zero dimensional \hbox after the section commands which results in the start of a paragraph before your quote environment. You can achieve the same effect by writing: \documentclass{article} \usepackage{tikz} \begin{document} \section{Some section} \subsection{Some ...


6

It's easy to do it; but of course this changes all spacing around the semicolon in math mode. I left the second row for comparison. \documentclass{beamer} % punctuation is type 6 \mathcode`;=\numexpr\mathcode`;-"6000 \begin{document} \begin{frame}{Mutual Information} \begin{align} I(X;Y)&=H(X) - H(X\mid Y)\\ I(X{;}Y)&=H(X) - H(X\mid Y) ...


2

If you are sure that \grad will be followed by a fixed (but easily extendable) set of binary operators, this should work: \documentclass{article} \usepackage{amsmath} \usepackage{xparse} \DeclareMathOperator{\gradop}{grad} \ExplSyntaxOn % the list of admissible binary operators \tl_const:Nn \c_denis_grad_ops_tl { \cdot \wedge } ...


5

\DeclareMathOperator makes a \mathop atom, which are designed for use as prefix functions. In contexts where they are not being used as a prefix application, such as the higher order composition here you can always make a \mathord atom by surrounding with braces, {\grad} which will have the same spacing as \mathrm{grad}


3

You can insert tokens with escapebegin and escapeend. If you don't use mathescape but escapechar you can e.g. switch to displaystyle: \documentclass{article} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage{listings} % #################################################################### COLORS # \lstset{language=, keepspaces=true, ...


2

Interesting question! \documentclass{article} \usepackage{listings} \lstset{language=, keepspaces=true, basicstyle=\ttfamily, columns=fullflexible, mathescape=true, } \newcommand{\PRESPACE}{\vadjust pre{\vskip\abovedisplayskip}} \newcommand{\POSTSPACE}{\vadjust{\vskip\belowdisplayskip}} \newcommand{\DS}{% ...


1

Do not use package titlesec together with a KOMA-Script class. There is the command \RedeclareSectionCommand to change the space before and after a section title. But use the correct units ... \RedeclareSectionCommand[ beforeskip=-50pt, afterskip=30pt ]{chapter} \RedeclareSectionCommands[ beforeskip=-1sp, afterskip=1.2pt ...


0

the bad spacing in your example is due to the spurious space you've added from the end of line characters, This just adds \par before \vspace so it is used in vertical mode, and % to avoid adding white space \documentclass{article} \newlength{\itemspace} \let\olditem\item \newenvironment{myitemize}{% \setlength{\itemspace}{0in}% \begin{itemize}% ...


4

You need \ignorespacesafterend; but you can consider the comment package. \documentclass{article} \usepackage{comment} \newenvironment{nothing} {\setbox0\vbox\bgroup} {\egroup\ignorespacesafterend} \begin{document} Hello, this is some text. \begin{nothing} This is nothing. \end{nothing} More text. Hello, this is some text. More text. Hello, this ...


8

Place \unskip after \egroup to make the two invocations behave the same. \documentclass{article} \newenvironment{nothing}{\setbox0\vbox\bgroup} {\egroup\unskip} \begin{document} Hello, this is some text. \begin{nothing} This is nothing. \end{nothing} More text. Hello, this is some text. More text. \end{document}


1

Not an answer, but a demonstration of italic and mathcal fonts. \documentclass{standalone} \usepackage{xcolor} \newcounter{mycount} \begin{document} \fboxsep=0pt \parbox{25pt}{\baselineskip=0pt \lineskip=0pt \loop\stepcounter{mycount} \fbox{$\color{red}\Alph{mycount}$}% \fbox{$\color{red}\mathcal{\Alph{mycount}}$} \ifnum\value{mycount}<26\relax\repeat} ...


1

As mentioned in comment, you have to toggle the usage of xmajorticks in your first plot like here: % arara: pdflatex \documentclass[a4paper]{article} \usepackage{pgfplots} \usepgfplotslibrary{groupplots} \pgfplotsset{compat=1.13} \begin{document} \begin{tikzpicture} \begin{groupplot}[% ,group style={% ,group size=1 by 2 ...


1

Multiple spaces are interpreted as one space by LaTeX. You could add the space you need with \hspace*{} commands. \blockquote{ \#6 \\ you\\ \\ \\ \hspace*{1em}are\\ \\ \hspace*{3em}inscribed\\ \hspace*{5em}in the\\ \hspace*{6em}lines on the\\ \hspace*{2.5em}ceiling\\ \\ \hspace*{3em}you\\ \\ \hspace*{1em}are\\ \\ \hspace*{3em}inscribed in\\ ...


1

I did the best I could with no MWE. \documentclass{article} \usepackage{mathtools} \usepackage{showframe} \begin{document} \rule{1pt}{41\baselineskip} Let $P=(x_P, y_P, z_P)$ be a fixed point on the plane, $R$ a fixed length, and $X=(x,y,z)$ a variable point such that $XP=R$. As $X$ varies, it is obvious that it does so along a circle. Obviously, we ...


6

When typesetting material in narrow columns, it's frequently advisable to give up on full justification and, instead, to go for a "ragged-right" (aka: flushleft) look. To achieve this look for the entire document, load the ragged2e package with the option document. \documentclass[10pt]{article} \usepackage[inner=1.1in,outer=.7in,top=.9in,bottom=1in, ...


3

As often, microtype is your friend. A short explanation of what it does is there, you might want to look at the documentation, too (texdoc microtype comes with magnificent examples of what it does, if opened with a recent pdfviewer). \documentclass[10pt]{article} ...


1

I suggest you use the command \vspace{} with a negative length argument, each time you need to remove an unused space. This is not obviously the best solution for such an issue, but if you don't find a better one, you should resort to it.


3

You write your equation an quite complicated way. Tray: \documentclass{article} \usepackage{mathtools} \usepackage[active,displaymath,tightpage]{preview}% for show only tcolorbox \setlength\PreviewBorder{1em} \begin{document} \begin{align*} E(X) & = \sum_{x=0}^{\infty}x\frac{e^{ - \lambda }\lambda ^x}{x!} \\ & = ...


3

You need to modify the definition of \slideentry. You can see this command in the .nav file. This file is used to generate the dots. The original definition is in beamerbasenavigation.sty. I add only three lines: those contain %%%. \documentclass[compress]{beamer} \useoutertheme[subsection=false]{miniframes} \makeatletter \def\slideentry#1#2#3#4#5#6{% ...


1

\setlength\floatsep{1.25\baselineskip plus 3pt minus 2pt} \setlength\textfloatsep{1.25\baselineskip plus 3pt minus 2pt} \setlength\intextsep{1.25\baselineskip plus 3pt minus 2 pt} Put the above in the preamble, and change the 1.25 to desired one. The First Line is for length between two adjacent floats The Second Line - for floats on top and bottom of ...


0

You can insert an invisible item and check for it; I add a better definition of \cProb that can be called like \cProb{B}{A} \cProb[\big]{B}{A} \cProb[\Big]{B}{A} \cProb[\bigg]{B}{A} \cProb[\Bigg]{B}{A} \cProb*{B}{A} where only the last one uses \left and \right. Trust me, it's better not to have automatic delimiter size in general. ...


1

This command \myspace will have the desired behaviour. Not clever enough to recognize other spaces than itself, though. \documentclass[border=12pt, varwidth]{standalone} \makeatletter \newcommand*\myspace{\futurelet\myspace@token\myspace@i} \def\myspace@i{\ifx\myspace@token\myspace\else\thinspace\fi } \makeatother \begin{document}\thispagestyle{empty} ...


2

It's a bug in breqn, which I always recommend not using. Workaround: use \hiderel whenever breqn has different ideas from the usual typesetting rules. You need to do similarly for every relation symbol you want in places like that. Note that amsmath is not required, but recommended anyway. \documentclass{article} \usepackage{amsmath} \usepackage{breqn} ...


2

If I were you, I would consider using booktabs here as it would help a lot on your table layout. Just see my example. The command you have been asking for would be \addlinespace here. Please note that I have set the caption above the table as it looks quite bad on the lower side for your example. I have reduced the table width a bit by adding @{} but it is ...


2

With your MWE I can't reproduce your image. Text in nodes are normally vertical spaced: I guess, that in your document you have in preamble determined bigger baseline stretch, something like \renewcommand\baselinestretch{1.5}, which gives approximately the same image as you show in the your question: The cure against this vertical stretching ...


1

If your \headheight is not properly set, fancyhdr will set it for you. It will only be set after the page where it detects it to be too small as is reported in the .log: Package Fancyhdr Warning: \headheight is too small (XX.XXXXXpt): Make it at least YY.YYYYYpt. We now make it that large for the rest of the document. This may cause the page layout to ...


2

In my point of view the spacings between the nested levels are quite good and there's no need to change the separations, but the space above (and below!) an item list is controlled by topsep, which can be set with topsep=... in the optional argument to enumerate If this length should be valid for all 2nd level lists, use \setlist[enumerate,2]{topsep=...} ...


2

The input suggested produces ! LaTeX Error: Bad math environment delimiter. See the LaTeX manual or LaTeX Companion for explanation. Type H <return> for immediate help. ... l.7 \begin{equation} \tag{3} Note that after an error tex tries to "recover" so it can check more of the ...


2

Here's another attempt; unfortunately, it seems that the “surd” symbol is not available in Unicode. \documentclass{book} % Run with xelatex %%% fonts \usepackage{amsmath} \usepackage{mathtools} \usepackage{amsfonts} \usepackage{amssymb} %%% mathfonts \usepackage{unicode-math} \setmainfont{TeX Gyre Pagella} \setmathfont{texgyrepagella-math.otf} ...


4

Here is a version that uses stacks. It is not currently set up to obey the smaller math styles, however. \documentclass[class=book]{book} % Run with xelatex %%% fonts \usepackage{libertine} \usepackage{amsmath} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{stackengine} \stackMath %%% mathfonts \usepackage{unicode-math} ...


0

@HarishKumar suggested the easiest way to fix the problem. It approximates what \nonzeroparskip does (which is slightly more flexible). However, if you want to avoid using enumitem, then you could do this: \documentclass{memoir} \makeatletter % memoir.cls has these two commands: % \newcommand*{\abnormalparskip}[1]{% % ...


0

Between two algorithms, use the code below: \vspace{-0.5cm} You can set what ever number you want in {}, a negative value will shrink the spacing.


1

The paragraph and lists chapter of the memoir user guide talks about the use of \tightlist. I successfully applied the \tightlist declaration inside of the document. \documentclass{memoir} \begin{document} \tightlist \begin{enumerate} \item Read this a little... \item ...bit easier \end{enumerate} \end{document} According the help you can ...


6

You can use the nicefrac package: \documentclass{article} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage{fourier} \usepackage{mathtools} \usepackage{nicefrac} \begin{document} \[ \begin{bmatrix} \nicefrac{1}{6} & \nicefrac{5}{6} & 0 & 0 \\ 0 & 0 & 1 & 0 \\ 0 & \nicefrac{1}{6} & 0 ...


4

Instead of writing \frac{a}{b}, use a/b: \documentclass{article} \usepackage{amsmath} \begin{document} \[ \begin{bmatrix} 1/6 & 5/6 & 0 & 0 \\ 0 & 0 & 1 & 0 \\ 0 & 1/6 & 0 & 5/6 \\ 5/6 & 0 & 0 & 1/6 \end{bmatrix} \qquad \renewcommand{\frac}[2]{#1/#2} \begin{bmatrix} ...



Top 50 recent answers are included