5

I Googled a bit but could not solve the following situation: Basically LaTeX for some reason decides to make spacing between lines bigger than usual in the first part of my text (between the main- and smaller-heading), as in the example below.

Just want to fix this as simply as possible.

\documentclass[a4paper,12pt]{article}
\linespread{1.3}
\begin{document}
\begin{LARGE}
\begin{center}
Topic
\end{center}
\end{LARGE}
wrong
\\
\\
spacing
\\
\\
here
\\
\\
wrong
\\
\\
spacing
\\
\\
here
\\
\\
\begin{Large}
\begin{center}
Introduction 
\end{center}
\end{Large}
normal
\\
\\
spacing
\\
\\
here
\\
\\
normal
\\
\\
spacing
\\
\\
here
\end{document}
6
  • Welcome to TeX.sx! Usually, we don't put a greeting or a "thank you" in our posts. While this might seem strange at first, it is not a sign of lack of politeness, but rather part of our trying to keep everything very concise. Upvoting is the preferred way here to say "thank you" to users who helped you. Dec 9, 2012 at 20:21
  • 10
    What LaTeX guide did you consult? I know none that suggests that kind of input. It's wrong under almost all respects.
    – egreg
    Dec 9, 2012 at 20:23
  • 15
    Please check your tone- users on this site keep it professional. Accusing LaTeX of making 'idiotic' and 'stupid' decisions reflects more on the user than it does on the software.
    – cmhughes
    Dec 9, 2012 at 20:25
  • 14
    LaTeX follows instructions, if you give it incorrect instructions it does the wrong thing. Dec 9, 2012 at 20:27
  • 3
    I don't think it is necessary to downvote this question. The OP is a newcomer and I understand that if someone doesn't know LaTeX well, he can get very desperate and angry.
    – yo'
    Dec 9, 2012 at 21:44

2 Answers 2

11

by using \\ to go to new lines, and never putting in a blank line or \par, latex never gets out of horizontal mode. however, the second Large environment ("Introduction") implicitly contains \par within the \end processing.

(la)tex uses the baseline distance in effect at the end of the current paragraph (that is, everything up to the \par that is in horizontal mode) to set the paragraph just ended. thus, the lines between "Topic" and "Introduction" are set with the \baselineskip appropriate for 12pt type. there is no such resetting of size from "Introduction" (which ends with \par) to the end of the example, so the "normal" baselines are set.

there are many good reasons to insert blank lines or \par at intervals within a file, and this is one of them.

it would be a good idea to read some basic documentation on latex. "The Not So Short Introduction to Latex" is a good place to start. latex is not a totally intuitive system; starting by searching randomly for answers via google will not necessarily lead one to the best answers, or develop sound habits.

1

Use line breaks to tell LaTeX where the new paragraphs begin.

I would not recommend using \\: it will most likely not accomplish what you want and also send underfull box errors to you. If you want a list of some sort, there are three basic flavors: enumerate, itemize, and description. I've illustrated enumerate below.

Also, there's the enumitem package which allows you to pass various parameters to your list environment controlling a lot of the spacing (vertical and horizontal). I illustrated a rather drastic version of this below (I don't recommend my choices of values).

\documentclass[a4paper,12pt]{article}
\usepackage{lipsum}
\usepackage{enumitem}
\linespread{1.3}
\pagestyle{empty}
\begin{document}

\begin{center}\LARGE
Topic
\end{center}

\lipsum[1]

\begin{center}\Large
Introduction 
\end{center}

\lipsum[1-2]

\begin{enumerate}
\item first line
\item second line
\item third line
\end{enumerate}

\noindent%
Before an very scrunched up item list (probably not a good choice)
with a big indentation before each item:
\begin{itemize}[topsep=0ex,itemsep=0ex,parsep=0ex,leftmargin=4em]
\item apple
\item orange
\item peach
\end{itemize}
After list

Maybe a list is not what you desire; maybe you're trying to write
questions for an exam or quiz and want to leave spaces for answers.
You can force a prespecified vertical space by using
\verb=\vspace{...}= where \verb=...= is some length.

\noindent
\textbf{Question 1:}  What is the meaning of life?
\vspace{1in}

\noindent
\textbf{Question 2:}  Is this really a questions?

But there's not much space left here for an answer.

\end{document}

Note that the large line break in the image is due to a page break.

enter image description here

4
  • 1
    Maybe you could also use \section instead of center Dec 9, 2012 at 20:38
  • Sry I didn't see this page before your (long) reply Ellett. I will continue to compare that to my Latex-input and see if I can see any difference.
    – Johan123
    Dec 9, 2012 at 20:49
  • Thx Ellett. For some reason (don't care why really), I below get stupid spacing in the 1st but not the 2nd version (notice swap of Large and center): \documentclass[a4paper,12pt]{article} \linespread{1.3} \begin{document} \begin{center} Topic \end{center} idiotic \\spacing \begin{Large} \begin{center} Introduction \end{center} \end{Large} always normal \end{document} \documentclass[a4paper,12pt]{article} \linespread{1.3} \begin{document} \begin{center} Topic \end{center} normal \\spacing \begin{center} \begin{Large} Introduction \end{Large} \end{center} always normal \end{document}
    – Johan123
    Dec 9, 2012 at 21:07
  • 3
    @Johan123 that's because you're using things incorrectly. First: \Large is basically not an environment, even though you can use it that way. It is a command, whose scope ends at the end of a pragraph. This happens in your document only at \begin{center} and \end{center}, because you have no paragraphs at all. A good advice to you is: you should need `\` only in tables and displayed mathematics.
    – yo'
    Dec 9, 2012 at 21:55

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .