TeXnik - Tips TeX and LaTeX

Welcome to the TeXnik website (under construction)

Horizontal and Vertical Spacing
TUG logo

Main page

Search CTAN:


Google c.t.t.

Google d.c.t.t.



Horizontal space |  linebreak behind paragraph-style |  Linespacing |  Linespacing in Quote/Quotation/Verse |  Paragraph Spacing |  Phantom Spacing |  Space between Text and Footnote |  Space over/under Section-title |  Spacing in ToC/LoT/LoF/ |  Vertical space |  Vertical Space for Chapter Title |  \vspace command | 

Horizontal space
Horizontal space is possible with several commands. But not every solution makes it possible to have linebreaks inside a defined whitespace. Download the LaTeX source to see how it works.
Vertical Space for Chapter Title
Additionally to the predefined vertical spaces there is some space before a chapter title, between and behind the titel:

- space before -
Chapter 1
- space between -
The Chapter Tirle
- space below -

If you want a total vertical space of for example 2 inch, then write the following in the preamble. For another space change one or all of the three values.

\setlength{\topspace}{2in%   <---- the whole vertical space
    -\topmargin%    <--- predefined
    -\headheight%          ...
    -\headsep%             ...
    -\topskip}             ...
 \vspace*{\topspace}% <---- the space above
 {\parindent \z@ \raggedright \normalfont
   \ifnum \c@secnumdepth >\m@ne
       \huge\bfseries \@chapapp\space \thechapter
       \vskip 20\p@% <--- the space between Chapter # - title
   \Huge \bfseries #1\par\nobreak
   \vskip 40\p@% <---- the space below

Spacing in ToC/LoT/LoF/
The vertical space between entries are paragraph spaces, so simply use single space but another definition for the parskip:
or any other value than "2".

Phantom Space
To get equal inter-line spacing, you could increase the \baselineskip for the eqnarray, but that can be involved. For this case, maybe the best solution is to insert
in the equation without a fraction. (\phantom, \hphantom and \vphantom aren't mentioned in many manuals, but they are defined. They leave blank space the size of their argument.)

Quote, Quotation and Verse with another spacing

In a double- or oneandhalf-spced text it's sometimes better to write Quote, Quotation and Verse in single spacing. Than write in LaTeX preamble:

                \begin{spacing}{1}\list{}{\itemsep \z@
                        \itemindent   -1.5em%
                        \rightmargin  \leftmargin
                        \advance\leftmargin 1.5em}%
               {\begin{spacing}{1}\list{}{\listparindent 1.5em%
                        \itemindent    \listparindent
                        \rightmargin   \leftmargin
                        \parsep        \z@ \@plus\p@}%
You can change the value for the spacing. But remeber that these redefinitions only work if you have in layout->document->linespacing other than single spacing! Otherwise write in preamble \usepackage{setspace}.

linebreak behind paragraph-style

some document classes have no linebreak behind the subsubsection and paragraph. for subsubsection change paragraph into subsubsection:

        {-3.25ex\@plus -1ex \@minus -.2ex}%
        {1.5ex \@plus .2ex}%

Space over/under Section/Subsection/...-Title

example for the article.cls. look at the specific class-files for section, subsection,... the definitions are always similar to this one of section. For a standard latex installation the class-files are stored in /usr/share/texmf/tex/latex/base/

in latex preamble

\setlength{\mySpaceUnder}{4cm plus .2ex}  % 4cm as an example ;-)
\setlength{\mySpaceOver}{3cm plus -1ex minus-.2ex}   % 3cm as an example
\renewcommand\section{\@startsection {section}{1}{\z@}%

use of package titlesec makes it just a little bit easier. It's part of the installed latex or available at CTAN for download. Maybe that it differs to the different classes, have a look at it.

Vertical Spacing

  • Line spacing
    • Package setspace from CTAN for individual spacing in a text, which is the best choice (read also http://www.tex.ac.uk/cgi-bin/texfaq2html?label=linespace)
    • \renewcommand\baselinestretch{factor} (valid behind the next new fontsize)
      factor=1.0 is the document-wide chosen standard. Remember, that this is not the best choice for vertical linespacing!
  • Paragraph Spacing
    • \addtolength{\parskip}{-0.2cm} for changing the vertical space between paragraphs
    • \addtolength{\parskip}{+0.2cm} for changing to your old parskip
  • General Spacing
    • put the cursor in the last line (following space) or first line (before space) and do a \clearpage
    • \vspace{length in any valid unit}, negative Space is possible!
    • \vspace{\fill} for filling up the page with vertical space.
    • \vspace*{length in any valid unit} for vertical space at the beginning of a page.
  • local time: Sat Jun 22 19:59:37 CEST 2024 ; file is: 1820.93087962963 days old
    contact webmaster _at_ TeXnik.de