New answers tagged

2

Here is a solution. Use \setlength{\cftbeforetoctitleskip}{<dimen>} because \lstlistoflistings use \tableofcontents \documentclass{article} \usepackage{tocloft} \usepackage{listings} \setlength{\cftbeforetoctitleskip}{5cm} \begin{document} A \lstlistoflistings \begin{lstlisting}[caption={bla bla},label=list] for i:=maxint to 0 do begin { do nothing } ...


2

The warnings (not errors) come from the bookmark code. The setting of the space factor by \@ can be used with TeX, but not in bookmark strings. There the command can be disabled by: \usepackage{hyperref}% option "pdfencoding=auto" or "unicode" recommended \pdfstringdefDisableCommands{\let\@\@empty}


1

You're using wrongly \flushleft \newcommand{\insertImg}[3]{% \begin{figure}[h] \centering \includegraphics[height=50mm]{#1} \caption{#2}\label{#1} \raggedright Źródło: Na podstawie \cite{#3} \end{figure} } \newcommand{\insertImgSetSize}[4]{% \begin{figure}[h] \centering \includegraphics[height=#2mm]{#1} \caption{#3}\label{#1} ...


5

You check for math mode and then use \mathpalette: \documentclass{article} \usepackage{amsmath} \makeatletter \newlength{\negph@wd} \DeclareRobustCommand{\negphantom}[1]{% \ifmmode \mathpalette\negph@math{#1}% \else \negph@do{#1}% \fi } \newcommand{\negph@math}[2]{\negph@do{$\m@th#1#2$}} \newcommand{\negph@do}[1]{% \settowidth{\negph@wd}{#1}...


0

You can use the \smashoperator command, from mathtools: \documentclass{article} \usepackage{mathtools} \begin{document} \begin{equation*} \smashoperator{\bigcup_{a \in \{\text{set that is very wide}\}}} S_a \end{equation*} \end{document}


0

I came around \lower and \raise TeX "primitives" here at https://www.tug.org/utilities/plain/cseq.html. And manually lower and raise a box in the \overset works fine for me. \overset{\lower.5em\hbox{aaa}}{bbb}


1

You can always check with \ifvmode or \ifhmode, e.g., \ifvmode do this\else do that\fi. But here you don't need that because \par acts that way (don't use \newline or \\ to end paragraphs). I added the \noindent which does no harm if \parskip=0pt and acts as you seem to want when \parskip≠0pt. \newenvironment{myenv} {\begin{trivlist}\item} {\par\...


2

Use \floatsetup{captionskip=…}: \documentclass{book} \usepackage{graphicx} \usepackage{floatrow} \usepackage{caption} \captionsetup{ slc=false, } \begin{document} \begin{figure} \floatsetup{captionskip=2cm} \ffigbox[\FBwidth] {\caption{Caption goes here.}} {\includegraphics{example-image-a}} \end{figure} \end{document}...


1

The relevant LaTeX parameters are: \intextsep: the space between text and floats in the running text \textfloatsep: the space between a float at the top of the page and the text, also the space below text and a float at the bottom of the page \floatsep: the space between to consecutive floats Thus you should be adjusting the first two of these parameters....


0

You can either patch the \cventry macro to reduce the space inserted after it using etoolbox: \usepackage{etoolbox} \patchcmd{\cventry}% <cmd> {\\ \end{tabular*}}% <search> {\\[-.5\normalbaselineskip]\end{tabular*}}% <replace> {}{}% <success><failure> The above can be inserted just before \begin{document} and will ...


0

In LyX, I added \usepackage{amsmath} to Document -> Settings -> LaTeX Preamble. Then instead of using array environment, which generates I change to aligned environment, which generates a much better looking equation array and spacing There are other discussions on the left alignments that seem very complicated. But what I found in my case is that, if ...


2

You're essentially getting a big chunk of indivisible white space and because of a feature of LaTeX, if the first page turns out to be overfull, a blank page is produced instead and the contents moved on to the next page, which will again be overfull. The “bbb” disappears about one meter below the bottom edge of the paper. Here's a \breakablevspace macro ...


8

The vspace is one large block. So you get an overful box and the bbb is somewhere outside the page. The aaa is moved along with the space to page 2 as there is no break point before the \vspace*. To get what you want you should better use smaller vspace in a loop: \documentclass{article} \usepackage{pgffor} \begin{document} aaa \foreach\x in {1,2,...,100} ...


2

You're probably obtaining the “Bad” line in the output below, but beware that, in display math mode that code would produce the “Ugly” line: The “Good” line is obtained with \varprojlim\nolimits^{W}\! F and you certainly want to define a command for this: \newcommand{\wlim}{\varprojlim\nolimits^{W}\!} You might be tempted to say that the amount of ...


5

If by “other TeX” you mean LaTeX then use a dedicated chemistry package: \documentclass{article} \usepackage{chemformula} \begin{document} \ch{^{239}Np} \\ \ch{^{239}_{93}Np} % or \ch{^{239}93Np} \end{document} or \documentclass{article} \usepackage[version=4]{mhchem} \begin{document} \ce{^{239}Np} \\ \ce{^{239}_{93}Np} \end{document} or \...


3

Obviously Np should be upright. Hence \documentclass{article} \usepackage{tensor} \begin{document} $^{239}\mathrm{Np}$ With tensor package: $\tensor[^{239}]{\mathrm{Np}}{}$ But with both numbers not $\tensor[^{239}_{93}]{\mathrm{Np}}{}$ but $\tensor*[^{239}_{93}]{\mathrm{Np}}{}$ \end{document}


2

You could throw in a negative kern and that would close up some of the space. \documentclass[10pt,letterpaper]{article} \begin{document} ${}^{239}N\kern -1pt p$ \end{document} You could also use the elements package: \documentclass[10pt,letterpaper]{article} \usepackage{elements} \begin{document} $^{239}$\elementsymbol{Neptunium} The electron ...


2

It seems that columns does not include any side margins for the text, while block does. But they have the same width text width. By including some lines (long lines 20 cm and short 10 cm) the spacing between the (text) columns of 10 cm becomes more clear. One solution would be to decrease the width of the 10 cm columns by 8pt as in the next picture. The ...


4

The answer is in the definition of \LEFTRIGHT, which means it is so “by design”: \def\LEFTRIGHT#1#2#3{% \specdelim@#1% \ifspecdelim@ \LEFTRIGHT@#1.{\vc@nt@r{#3}}% \else \left#1 \vc@nt@r{#3}% \right.% \fi \kern-2\nulldelimiterspace\mskip-\thinmuskip \specdelim@#2% \ifspecdelim@ \LEFTRIGHT@.#2{\vphantom{\vc@nt@r{#3}}}% \else \left.% \...


2

I suggest you give your table an "open" and easily-accessible look by getting rid of the vertical bars. To further ease the readability of the numbers in the middle column, consider aligning them on the (implicit) decimal marker. \documentclass[a4paper]{abntex2} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage{siunitx,array,booktabs,...


2

You can do that with makecell, which allows for line breaks and a common formatting of cells introduced by the \thead or \makecell commands. I replaced the abntex2 cls (not installed on my system) with report: \documentclass[a4paper]{report} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage{makecell} % \usepackage{showframe} \renewcommand\...


4

It is possible to redefine \bigskip to produce empty paragraph with some height. The problem is that \bigskip etc. is used internally in some LaTeX commands and environments, so it could break quite a lot of configurations. It is best to suppress it by default. I would use custom spacing commands instead. % myspaces.sty \newcommand\mybigskip{\bigskip} \...


1

The following may be in line with what you're after: \documentclass{article} \usepackage{tabularx} \newcommand{\setyear}[1]{{\small #1}} \begin{document} \section{Work Experience} \noindent \begin{tabularx}{\linewidth}{r|X} \smash{\begin{tabular}[t]{>{\scshape}c@{}} Aug \setyear{2011} to \\ Jul \setyear{2015} \end{tabular}} & Application ...


3

You can insert a paragraph containing a blank space ~ which will be converted to the equivalent of &nbsp;. PDF: HTML: \documentclass{article} \usepackage{longtable} \begin{document} \begin{longtable}{|p{.5\textwidth}|} \hline test \\ \hline \end{longtable} ~ \begin{longtable}{|p{.5\textwidth}|} \hline test \\ \hline \end{...


7

\documentclass{article} \usepackage{lipsum} \begin{document} \lipsum[1] \noindent A\hfill B\hfill C \lipsum[1] \end{document}


5

There are better solutions, but one based on your idea with \centerline is very easy: \leftline{Left \hfill Center \hfill Right}


2

You are introducing the spaces yourself. \renewcommand{\@makechapterhead}[1]{% {\singlespacing \parindent \z@ \raggedleft \normalfont \vspace*{30mm}% <= Space here \ifnum \c@secnumdepth >\m@ne \fontsize{60}{70}\selectfont \scshape \bf \textsc \@chapapp\space \thechapter % Chapter followed by number \par\nobreak \fi ...


2

titlespacing does not allow the starred \section* commands as arguments. Instead, a \section* gets the same spacing that you set for a normal, numbered \section. Simply replace your four \titlespacing commands with the two from the code below. \documentclass[a4paper]{article} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage{titlesec} \...


1

I discovered that using a minipage appears to work a few hours after posting. \newenvironment{smallbox}[1][p]{% \begin{boxe}[#1] \begin{minipage}[c][\textheight]{\linewidth} }{\end{minipage}\end{boxe}}


1

Thanks for adding an MWE. The important point in your code is line \usepackage{subcaption} That packages loads internally package caption (see documentation with texdoc subcaption on your terminal/console), so you are able to use the command \captionsetup[table]{position=below} to get a better distance between table and heading. Please see the ...


3

Note that it is not recommended to use titlesec together with a KOMA-Script class. So I will use \RedeclareSectionCommand to change the skips before and after the section titles. \enoteheading uses \section* for the note heading. So you can prepend a \RedeclareSectionCommand to get the desired result. Note that I am not sure if \enoteheading should be ...


2

New lines are treated as spaces. So in your code \newcommand{\lraB}{ % <-- you are putting a space here! %lots of latex logic %so this command is on multiple lines B % <-- you are putting a space here! } If you want to avoid spurious spaces you should end the lines with a comment character %: \newcommand{\lraB}{% <-- HERE %lots of ...


0

Instead of \tab, you may use \hspace{10mm} which gives a 10mm space similar to using \tab.


3

Normally the end of line after \end{figure} doesn't produce a visible space. Actually, the code will carry on a possible white space coming from before the environment, adding a normal space if figure starts in paragraph mode and there was no space before \begin{figure}. So Before\begin{figure} <code> \end{figure} Test will produce a regular ...


0

OK, following up on Barbara Beeton's comment -- it's just a matter of introducing white space between the standard text and the \begin{quote} and \end{quote}. conversation is actually foundational for meaning. It looks as though Ogden and Richards have already been all over this point, and so I'll cede the floor to them.\footnote{\url{https://en.wikipedia....


4

\newcommand{\listsuppmatname}{Supplementary Materials} \newlistof{suppmat}{smat}{\listsuppmatname} \newcommand{\suppmat}[1]{% \refstepcounter{suppmat}%%%%% \noindent{Video \thechapter.\thesuppmat}%%%%%%%% \addcontentsline{smat}{suppmat}%%%%% {\protect\numberline{\thechapter.\thesuppmat}#1}%%%%% } Your macro was adding 4 spaces each time, I ...


1

\documentclass{amsart} \begin{document} \begin{equation} \renewcommand*{\arraystretch}{2} \begin{bmatrix} \dfrac{1}{i} \\ \dfrac{1}{j} \end{bmatrix} \end{equation} \end{document}


2

\\ has an optional parameter. You can write (precise values according to you taste): \[ \begin{bmatrix} \dfrac{1}{i} \\[18pt] % here - PS \dfrac{1}{j} \end{bmatrix} \] I have changed $...$ to \[...\] because so high matrix in text mode is not a good idea.


5

You can try with a sidebyside box from tcolorbox. Option sidebyside adapt= ... defines which part fixes proportions between left and right parts and the other one takes the rest of the line. \documentclass[parskip=full]{scrartcl} \usepackage{blindtext} \usepackage{tikz} \usepackage[most]{tcolorbox} \begin{document} \Blindtext[1] \tcbsidebyside[...


5

Coffins were really invented to address this, you want a baselineskip offset between the pole along the bottom baseline of the first coffin and the top baseline of the second \documentclass{article} \usepackage{expl3,kantlipsum} \begin{document} \ExplSyntaxOn \coffin_new:N \l_exp_my_coffin \coffin_new:N \l_exp_your_coffin \vcoffin_set:Nnn \l_exp_my_coffin ...


2

You can add struts \documentclass{article} \usepackage{xcoffins,kantlipsum} \begin{document} \footnotesize\parindent=0pt \NewCoffin \MyCoffin \NewCoffin \YourCoffin \SetVerticalCoffin \MyCoffin {.5\linewidth} {% \strut\kant*[1]\strut } \SetVerticalCoffin \YourCoffin {.5\linewidth} {% \strut\kant*[2]\strut } \hrule \JoinCoffins \MyCoffin [b,l] \...


1

It is easier than you might think, without loading any package. \documentclass[12pt,a4paper, egregdoesnotlikesansseriftitles% The name of this option might change in the future ]{scrreprt} \usepackage{graphicx} \usepackage{lineno} \usepackage[english]{babel} \usepackage[super]{natbib} \usepackage{booktabs} \usepackage{textcomp, gensymb} \usepackage[table]{...


0

Finally i found i was looking for. Here is my solution: \usepackage[titles]{tocloft} \renewcommand{\cftbeforesecskip}{0pt}%change indent between sections \renewcommand{\cftdot}{}%remove dots


3

Have you considered using the tasks package? It can achieve something like what you're asking for. \documentclass{article} \usepackage{tasks} \begin{document} I'm trying to make a list in which each item has multiple lines, and I want the items to line up horizontally, like this: \begin{tasks}(2) \task this is the first item in the ...


2

Here is how to remove the dotted line from the toc, at least for article class. \documentclass{article} \makeatletter \renewcommand*\l@subsection[2]{% \ifnum \c@tocdepth >\@ne \addpenalty\@secpenalty \addvspace{\z@ \@plus\p@}% vertical space (1.0em \@plus\p@ for section} \setlength\@tempdima{2.3em}% #3 from \@dottedtocline \begingroup ...


0

A quick workaround would be to delete the following lines %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \makeatletter \addtocontents{toc}{\begingroup \let\protect\l@chapter\l@specialchapter} \addcontentsline{toc}{chapter}{CHAPTER} \addtocontents{toc}{\endgroup} \makeatother %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% in ...


2

The bottom option essentially adds \vfill at the end of every page, so your \vfill makes TeX divide the blank space in two equal chunks. Use third order infinite glue: \documentclass[a4paper]{article} \usepackage[hang,bottom]{footmisc} \begin{document} This is my text\footnote{this is my footnote} \vspace{0pt plus 1filll} This is my bottom-of-page ...


0

I needed it for only one specific table and instead of changing how it works through the entirety of document I found that doing the following suited my needs: \begin{table} \centering {\def\arraystretch{1.3} \begin{tabularx}{0.75\textwidth}{clX} \textbf{\#} & \textbf{User} & \textbf{Occupation} \\ \hline 1 & Test Person 1 &...


2

Based on Measure remaining space on page and use it on another page, I formulated the \fixV macro, applied to the end-of-page comment. \documentclass[a4paper]{article} \usepackage[hang,bottom]{footmisc} \newcommand\fixV[1]{\edef\tmp{\the\parindent}\setbox0=\hbox{% \begin{minipage}{\textwidth}\hspace{\tmp}\strut#1\strut\end{minipage}}\box0% \vspace{\...


1

I've removed an extra \dotfill from \tocchapter since there is already a \dotfill as part of \@tocline. Secondly, I've created a macro that specifically handles your CHAPTER entry via a local redefinition within the ToC itself: \documentclass{amsbook} \usepackage{blindtext} \makeatletter \renewcommand\tocchapter[3]{% \indentlabel{\@ifnotempty{#2}{\...



Top 50 recent answers are included