1

I would like some assessment on the situational utilities of various vertical space commands, namely: \smallskip, \medskip, \bigskip, \vspace*{value}, \\[value].

\smallskip, \medskip, \bigskip, and \vfill are formed using \vspace.

But the above do not produce a vertical space in the following code


    \documentclass{book}
\usepackage{geometry}
\geometry{ paperheight=21cm, paperwidth=21cm, left=8mm, right=8mm,
  top=21mm, bottom=21mm}

\usepackage{fix-cm}
\makeatletter
\renewcommand\normalsize{%
   \@setfontsize\normalsize{13pt}{15pt}
   \abovedisplayskip 10\p@ \@plus2\p@ \@minus5\p@
   \abovedisplayshortskip \z@ \@plus3\p@
   \belowdisplayshortskip 6\p@ \@plus3\p@ \@minus3\p@
   \belowdisplayskip \abovedisplayskip
   \let\@listi\@listI}
\makeatother

\usepackage{bm}                % makes bold arguments
\usepackage[x11names]{xcolor}  % loads 317 named rgb colours

\usepackage{amsmath}
\usepackage{amsthm}

\boldmath
\renewcommand{\seriesdefault}{\bfdefault}

\newcommand\blskip{\\[0.3\baselineskip]}

\begin{document}

\normalsize

\newtheorem{theorem}{Theorem}[section]
\newtheorem{corollary}{Corollary}[theorem]
\newtheorem{lemma}[theorem]{Lemma}

\section{Fourier Transform}

\begin{theorem}
  [\color{blue} \textbf{Convolution Property of Fourier Transform}]
  \label{convolution}

  \textcolor{blue}{\bigskip This is not insterted on a new line}
  \textcolor{blue}{\vspace{8pt} This does not work either}

  \textcolor{blue}{\blskip This worked as intended}

  The Fourier transform of the product of two functions, \( u_1(t) \)
  and \( u_2(t) \), is equal to the product of the Fourier transforms
  \( F(u_1) \) and \( F(u_2) \).

\end{theorem}

\end{document}

What is happening? How does the utilisation of \\{skip}, but the others based upon \vspace do not?

Veak
  • 1
  • The answers to this question contain decent details that may help. –  Apr 23 '22 at 21:19
  • I flagged this as a duplicate based on the first question but your edits point to different issues so I retract it. In the future, when you post a code sample, could you make sure the code can compile as it is please? As in, include from \documentclass{book} etc, include relevant packages (such as \usepackage{amsmath}, key definitions such as defining \newtheorem etc. It just makes it easier to help for the future, this contains more information on MWE's (minimal working examples). Hope someone can help answer this! –  Apr 23 '22 at 21:53
  • It is bad style to have any explicit vertical spaces in the document but despite the name \newcommand\blskip{\[0.3\baselineskip]}` does not add a vertical skip it adds a line break and will generate errors where you have used it. Please always provide a real test document not just a fragment that does not run on its own. – David Carlisle Apr 23 '22 at 22:01
  • One should not be too prescriptive on good style, if a user is sure additional vertical spacing is required, particularly for long proofs. – Veak Apr 23 '22 at 22:05
  • @DavidCarlisle You are right to state that it is a line break actually. So will change the name accordingly. Although it does add some vertical space of 0.3\baselineskip. – Veak Apr 23 '22 at 22:18
  • see my answer, it dosn't add it in a form that you want to use here though. – David Carlisle Apr 23 '22 at 22:21

1 Answers1

1

By design the initial text of the theorem is inline, theamsthm documatioon shows a break style that always starts a new line.

enter image description here

\documentclass{article}

\usepackage{amsthm,color} \newtheoremstyle{break}% {}{}% % Note that final punctuation is omitted. {\itshape}{}% {\bfseries}{}% {\newline}{}

\theoremstyle{break}

\newtheorem{theorem}{thm}

\begin{document}

\newcommand\blskip{\\[0.3\baselineskip]}

\begin{theorem}
  [\color{blue} \textbf{Convolution Property of Fourier Transform}]
  \label{convolution}

  \textcolor{blue}{\bigskip This is not insterted on a new line}
  \textcolor{blue}{\vspace{8pt} This does not work either}

  \textcolor{blue}{\blskip This worked as intended}

  The Fourier transform of the product of two functions, \( u_1(t) \)
  and \( u_2(t) \), is equal to the product of the Fourier transforms
  \( F(u_1) \) and \( F(u_2) \).

\end{theorem}

\end{document}

\textcolor (ulike \color) starts a paragraph and horizontal mode, so your \bigskip (which is \vspace{\bigskipamount}) does work but adds vertical sppace after the paragraph has been broken in to lines and adds it immediately after the line that has the vadjust node containing the skip, so the vertical space appears after the first line of the paragraph, not before the paragraph.

Conversely the last line, igoring the color is

\mbox{}\\[0.3\baselineskip]

so you get parskip space then a "white" line of a paragraph, with just the paragraph indentation box, then you get a forced line break with .3\baselineskip. So it may look a bit like a vertical space of 1.3\baselineskip but it will behave very strangely at a page break. If a page breaks before the paragraph, the blank line will not be dropped at the start of a page, as vertical space would be. If a page break happens after the blank line, you will have a blank line at the bottom of on page then the .3\baselineskip space will be dropped at the start of the next.

David Carlisle
  • 757,742
  • Would the cleanest and understandable solution then consist of using \color? With your changes, we could then avoid using \vspace or \blskip. – Veak Apr 23 '22 at 22:25
  • I have noticed that when I change the document setting to use a bold typeface, the text following the theorem number \begin{theore}[Convolution] does not inherit the bold typeface? One might consider it a bug. – Veak Apr 23 '22 at 22:28
  • you (I guess?) incorrectly posted such a bug to the latex bug tracker, I don't see why you would consider it a bug? – David Carlisle Apr 23 '22 at 22:34
  • What would be your suggested solution if is not a bug? I would argue some enhancements if you don't mind hearing. Or perhaps the solutions are already built-in and need only to use them. – Veak Apr 23 '22 at 22:36
  • What I wanted to have was a bold typeface throughout, with the theorem string and theorem number in colour. – Veak Apr 23 '22 at 22:38
  • 1
    That is an unrelated question to this one though (which is about vertical space) – David Carlisle Apr 23 '22 at 22:40
  • Would you help explain why I get LaTeX Error: Command \theorem already defined. Or name \end... illegal, see p.192 of the manual. when using your solution? – Veak Apr 23 '22 at 23:17
  • @Ephram I copy and pasted @David's answer and do not get the error message you have, can you explain the steps you took to get the error? Did you copy and paste bits of the answer into your own main document? The error says that you have defined \theorem already so perhaps you kept your original definition and copied this answers definition in too and have 2 definitions, delete one of them perhaps and check back into us –  Apr 23 '22 at 23:38
  • 1
    @LaccaseTVersicolor You were correct. I had \newtheorem{theorem}{Theorem}[section] again after that to use the section numbering. So I included [section] to David's definition. – Veak Apr 23 '22 at 23:46