2

Whenever I need to start a new paragraph I do the following

\documentclass[11pt,a4paper]{report}
\usepackage{amsmath,amsfonts,amssymb,amsthm,blindtext,epsfig,epstopdf,titling,url,array,xspace}
\usepackage[nopar]{lipsum}
\usepackage{thmtools}
\usepackage[a4paper,bindingoffset=0.2in,left=1in,right=1in,top=1in,bottom=1in,footskip=.25in]{geometry}

\theoremstyle{plain}
\newtheorem{theorem}{Theorem}[section]

\begin{document}

\noindent
abcdefg\\
\\
abcdefg

\begin{theorem}
abcdefg
\end{theorem}

\end{document}

which generates the spacing indicated in red, which seems too broad in comparison to the spacing resulted from using \theoremstyle{plain} from thmtools package (indicated in blue). So I was wondering how do I reduce the spacing that are indicated in red to blue.

enter image description here

James
  • 249
  • 2
    never use \\ at the end of a paragraph, it creates spurious lines that are "infinitely bad" (badness 10000) and warnings in the log. – David Carlisle Sep 28 '17 at 20:04
  • 1
    https://tex.stackexchange.com/questions/82664/when-to-use-par-and-when-or-blank-lines/82666#82666 – David Carlisle Sep 28 '17 at 20:07
  • @DavidCarlisle Thank you for your tips and correction I appreciate it. I still get the same height of vertical spacing using \par or \newline so could you kindly let me know how to reduce the spacing height to the blue one? – James Sep 28 '17 at 20:20
  • 1
    You need to give us a simple compilable example that shows the problem. – Thruston Sep 28 '17 at 20:22
  • 2
    do not use \newline or \par just use a blank line (which will do the same as \par) it is impossible to tell you what to change given the fragments posted (questions should always have a complete test document that shows the issue) by default you get no vertical space at a paragraph break so if you are getting space then your document is setting it, and you need to set it to a smaller value – David Carlisle Sep 28 '17 at 20:23
  • @DavidCarlisle I have modified the example accordingly. Thank you for pointing out the problem and look forward to hearing from you. – James Sep 28 '17 at 20:42
  • @Thruston I have changed my example so that it is compilable, thank you for pointing it out. – James Sep 28 '17 at 20:43

2 Answers2

3
\noindent
abcdefg\\
\\
abcdefg

is a single three line paragraph, with the middle line having the maximum badness and generating

Underfull \hbox (badness 10000) in paragraph at lines 12--16

If you remove the spurious markup and have two paragraphs before the theorem (which is I think the intent) then

abcdefg

abcdefg

\begin{theorem}
abcdefg
\end{theorem}

produces

enter image description here

as the latex default is for paragraphs starting with an indent and no vertical space.

You could add the parskip package if you want no indentation and vertical space

after

\usepackage{parskip}

you get

enter image description here

which is closer to your requirements, you then may want to adjust the spacing above theorems using thmtools

David Carlisle
  • 757,742
  • Thank you for your enlightening answer, much appreciated. I would like to know if there is any way I can add the vertical space and remove the indentation without using the parskip package? – James Sep 28 '17 at 21:24
  • @James of course, you can set \parindent=0pt and \parskip=whatever vertical space you want but then all "hidden" paragraphs such as section headings and list items and theorems get extra vertical space so you need to redefine them all to add less space to take account of the parskip space that is being added, that last step is what parskip package does, but doing it by hand isn't necessarily wrong and allows finer control. Of course not having vertical space and indenting paragraphs (and so following a few hundred years of typesetting tradition:-) is an option to be considered... – David Carlisle Sep 28 '17 at 22:08
2

Define a suitable theorem style that uses the default for thmtools, instead of the default from amsthm.

\documentclass[11pt,a4paper]{report}
\usepackage[
  a4paper,
  bindingoffset=0.2in,
  left=1in,
  right=1in,
  top=1in,
  bottom=1in,
  footskip=.25in,
  heightrounded, % <--- don't forget this
]{geometry}
\usepackage{amsmath,amssymb,amsthm,titling,url,array,xspace}
\usepackage{thmtools}

\declaretheoremstyle[
  headfont=\bfseries,
  bodyfont=\itshape,
]{myplain}
\declaretheorem[
  style=myplain,
  within=section,
  name=Theorem,
]{theorem}

\declaretheoremstyle[
  headfont=\bfseries,
  bodyfont=\upshape,
  headformat=(\NAME\ \NUMBER),
  headpunct=,
]{example}
\declaretheorem[
  style=example,
  name=Example,
]{example}
\renewcommand{\theexample}{\roman{example}}

\begin{document}

\setcounter{chapter}{2} \setcounter{section}{2}

Some unspecified text that should occupy at least one line and some more
ending with a \textbf{decomposition} of $G$ if $H\oplus K=G$.

\begin{example}
$\mathbb{Z}$ is not decomposable, because, for all positive integers $m$ and $n$,
 $\{0\}\ne mn\mathbb{Z}\subseteq m\mathbb{Z}\cap n\mathbb{Z}$.
\end{example}

$G$ is cyclic with $|G|=p^\alpha$ implies $G$ is something we won't tell.

\begin{theorem}[Primary Decomposition]
Something fun happens when we consider all primes.
\end{theorem}

\end{document}

enter image description here

Some notes: \bigoplus is the wrong symbol for the direct sum of two subgroups.

The package epsfig has been deprecated for more than 20 years and should not be used in new documents. Use graphicx instead, if you need to insert graphics.

The package epstopdf doesn't need to be loaded if you already load graphicx. Neither amsfonts if you load amssymb.

Never use \\ for vertical spacing or for ending a paragraph.

egreg
  • 1,121,712