I would like to have my whole document showing a blank line (or space) between paragraphs and no indentation. I know how to do it line by line, but is there a way to change that with just one or a few lines at the beginning of the document? Like a package you can install, or a new command?
[Tex/LaTex] How to use a vertical space between paragraphs, rather than indentation
indentationpackagesparagraphsparskipspacing
Related Solutions
I found a copy of the relevant class file here; assuming that this is the same as the one that you are using, the culprit is the following comment:
\parskip 0pt % Extra vertical space between paragraphs.
% Set to 0pt outside sections, to keep section heads
% uniformly spaced. The value of parskip is set
% to leading value _within_ sections.
% 12 Jan 2000 gkmt
Sure enough, looking further down in the document we find that in the definition of the section commands, \parskip
gets reset. For example:
\def\@ssect#1#2#3#4#5{%
\@tempskipa #3\relax
\ifdim \@tempskipa>\z@
\begingroup
#4{%
\@hangfrom{\hskip #1}%
\interlinepenalty \@M #5\@@par}%
\endgroup
\else
\def\@svsechd{#4{\hskip #1\relax #5}}%
\fi
\vskip -10.5pt %gkmt, 7 jan 00 -- had been -14pt, now set to parskip
\@xsect{#3}\parskip=10.5pt} % within the starred section, parskip = leading 12 Jan 2000 gkmt
That innocuous \parskip=10.5pt
at the end means that every time a \section
, \subsection
, \subsubsection
, or \paragraph
command is used then \parskip
gets reset to 10.5pt
. (The command \@sect
has the same ending.)
So to reduce \parskip
, you need to reduce it each time that you start a section or otherwise. Depending on your needs, a variety of strategies are possible. The simplest would be to have a copy of the class file in the same directory as the TeX file and simply edit out that extra \parskip=10.5pt
(actually, edit out both of them: one from \@ssect
and one from \@sect
). If you need to leave the class file pristine for some reason, then you can redefine these commands in your preamble. The simplest would be to simply copy out the definitions from the class file with the appropriate modifications to \parskip
. If you do this, then the copied definitions need to be sandwiched between \makeatletter ... \makeatother
.
If you want to be a bit more fancy, you could have the \section
commands remember what \parskip
is when they are called, then reset it at the end. This would involve hacking three commands from the class file, since the command \@startsection
also messes with \parskip
. So it would be something like (not tested!):
\makeatletter
\let\orig@startsection=\@startsection
\let\orig@ssect=\@ssect
\let\orig@sect=\@sect
\newskip\orig@parskip
\orig@parskip\parskip % just for safety's sake!
\def\@startsection{%
\orig@parskip\parskip%
\orig@startsection}
\def\@ssect#1#2#3#4#5{%
\orig@ssect{#1}{#2}{#3}{#4}{#5}%
\parskip\orig@parskip}
\def\@sect#1#2#3#4#5#6[#7]#8{%
\orig@sect{#1}{#2}{#3}{#4}{#5}{#6}[#7]{#8}%
\parskip\orig@parskip}
\makeatother
I'd still use the parskip
package and try to sort out problems regarding lists and individual indented paragraphs, but you may change the length \medskipamount
which is used by \medskip
. (In the following example, I'm changing \medskipamount
in the document body for demonstration purposes -- you should modify it in the preamble.)
\documentclass{article}
\begin{document}
Some text.
\medskip
Some text.
\setlength{\medskipamount}{12pt plus 4pt minus 4pt}% Default: 6pt plus 2pt minus 2pt
\medskip
Some text.
\end{document}
As Ulrike Fischer suggested, you may also define a dedicated command to be used between paragraphs:
\documentclass{article}
\newcommand*{\myparskip}{\vspace{\medskipamount}}
\begin{document}
Some text.
\myparskip
Some text.
\renewcommand*{\myparskip}{\vspace{\bigskipamount}}
\myparskip
Some text.
\end{document}
Output for both variants:
Best Answer
Adding
to the preamble of your document (the part between
\documentclass{...}
and\begin{document}
will set the paragraphs to have no indentation and a bit of space between them.Note that this isn't a complete solution, because there may be elements in your document that you don't want this format to apply to (footnotes, for example). A proper solution would involve (effectively) writing a new document class.
You can read a bit about how the
parskip
package works by looking at the comments inparskip.sty
itself.