2
votes
0answers
16 views

Changing a macro's output depending on immediate context

I've set up a macro for differential parts as so: \newcommand{\dd}[1]{\,\mathrm{d}#1} which is useful for differentials at the end of integrals because of the space. (I realise the argument ...
5
votes
1answer
51 views

Change Sectional Skip Conditioned on Text Existing or not Before Sectional Division

I have a simple document layout with a main heading for the title, and the possibility of starting the first sectional unit (with a standard \section command) right after the title -- meaning, with no ...
6
votes
1answer
561 views

Applying condition around \intertext and \shortintertext leaves excess vertical space

When I try to make either \intertext or \shortintertext conditional I get excess vertical spacing prior to the conditional text as per the MWE below. Note the excess vertical spacing prior to "Albert ...
3
votes
1answer
334 views

Adding vertical spacing between chapter and its first section in table of contents

I'm using the style files given by my university for my thesis but they are quite old (eethesis document class). In my PDF output, the vertical space before and after the major headings in the table ...
5
votes
2answers
300 views

\xspace in combination with ifmmode

Sometimes I want a special font for the word "true", use it in mathmode as well as outside, and have a correct space afterwords if I am not in mathmode. Using \newcommand{\tru}{\ifmmode ...
8
votes
2answers
333 views

Custom ToC — Put vspace only below chapters that have sections in them

I’m using the titletoc package in the book class. Currently, my chapter entries are configured like this (I left out the unimportant parameters for simplicity): \titlecontents{chapter}[0pc] ...
15
votes
5answers
2k views

Proper way to detect empty/blank text

I am attempting to ignore a command if it is passed with empty/blank text. My use case is not as complicated as one Expand away empty macros within ifthenelse where @egreg provides what seems like a ...
10
votes
2answers
303 views

How to check if a section title (or any heading) is the first line of a new page?

I would like to be able to use an \if command to check if a \section appears on the first line of a new page. If a section heading is the first line of a new page, I would like to then adjust some of ...
2
votes
1answer
245 views

Are there any packages that I should not be using with ifthen package

I am new to TeX and I started adding package files to prepare my document without worrying about conflicts. I am asking this subjective question because I am not sure if I can post entire document ...