# What is the easiest way to see default “spaces” with respect to “ex” and “em” in the book class?

What is the easiest way to see default "spaces" with respect to "ex" and "em" in the book class? I mean by spaces all horizontal and vertical spaces such as:

1. the space before and after the section headings in the text
2. the space between the captions and the text after it
3. the space between the header and the main text
4. the space between the figures and their caption
5. the space between the footnotes at the bottom of the pages

and so on.

I'm using xelatex and TeX Live 2012 on Win7.

-
See, for instance, page 132 of lshort. In your command line, type texdoc lshort –  hpesoj626 Jan 9 '13 at 10:45
@hpesoj626 I want the default values, not the customized values of the lshort. Also, I want a complete list. –  Sisabe Jan 9 '13 at 10:49
@Sisabe lshort documents LaTeX2e, which is the version of LaTeX in use. Therefore you find there the default values documented. –  tohecz Jan 9 '13 at 11:00
@tohecz I want the values as a list. –  Sisabe Jan 9 '13 at 11:02
@Sisabe There is no such list of all distances. List all of them you are interested in and we will provide a code to show them. –  tohecz Jan 9 '13 at 11:04

This answer makes use of Philippe Goutet's \convertto macro in What are the various units (ex, in, pt, etc.) expressed in mm?.

## Code

%http://tex.stackexchange.com/questions/89986/what-is-the-easiest-way-to-see-default-spaces-with-respect-to-ex-and-em-in#89986
\documentclass{book}

\usepackage{array}

\makeatletter
\def\convertto#1#2{\strip@pt\dimexpr #2*65536/\number\dimexpr 1#1}
\makeatother

\begin{document}

\begin{tabular}
{>{\def\colunit{pt}}l
>{\convertto{pt}{\rowlength}}l
>{\def\colunit{em}}l<{\convertto{em}{\rowlength}}l
<{\convertto{ex}{\rowlength}}}

\multicolumn{1}{l}{} & \multicolumn{1}{l}{\textbf{pt}} & \multicolumn{1}{l}{\textbf{em}} & \multicolumn{1}{l}{\textbf{ex}}\\

\gdef\rowlength{\lineskip} \verb!\lineskip!  & & & \\
\gdef\rowlength{\baselineskip} \verb!\baselineskip! & & & \\
\gdef\rowlength{\belowcaptionskip} \verb!\belowcaptionskip! & & & \\
\gdef\rowlength{\abovedisplayskip} \verb!\abovedisplayskip! & & & \\
\gdef\rowlength{\belowdisplayskip} \verb!\belowdisplayskip! & & & \\
\gdef\rowlength{\abovedisplayskip} \verb!\abovedisplayskip! & & & \\
\gdef\rowlength{\abovedisplayshortskip} \verb!\abovedisplayshortskip! & & & \\
\gdef\rowlength{\belowdisplayshortskip} \verb!\belowdisplayshortskip! & & & \\
\gdef\rowlength{\parskip} \verb!\parskip! & & & \\
\gdef\rowlength{\textfloatsep} \verb!\textfloatsep! & & & \\
\gdef\rowlength{\intextsep} \verb!\intextsep! & & & \\
\gdef\rowlength{\floatsep} \verb!\floatsep! & & & \\
\gdef\rowlength{\textheight} \verb!\textheight! & & & \\

\gdef\rowlength{\textwidth} \verb!\textwidth! & & & \\
\gdef\rowlength{\parindent} \verb!\parindent! & & & \\

\gdef\rowlength{\oddsidemargin} \verb!\oddsidemargin! & & & \\
\gdef\rowlength{\evensidemargin} \verb!\evensidemargin! & & & \\
\gdef\rowlength{\marginparsep} \verb!\marginparsep! & & & \\
\gdef\rowlength{\topmargin} \verb!\topmargin! & & & \\
\gdef\rowlength{\marginparwidth} \verb!\marginparwidth! & & & \\
\gdef\rowlength{\marginparpush} \verb!\marginparpush! & & & \\
\end{tabular}
\end{document}

-
belowdisplayskip comes twice instead of belowdisplayshortskip. –  devendra Jan 9 '13 at 13:14
@devendra thanks. Edited. :) –  hpesoj626 Jan 9 '13 at 13:20

For the page layout ones, use the package \usepackage{layout} and add the command \layout into the document body:

\documentclass{article}
\usepackage{layout}
\begin{document}
\layout
\end{document}


The others can be displayed as well, but a list of those you want is necessary.

-

The following code uses printlen package and I typically use it to see all the parameters of interest to me. Modify the code for other parameters. Use uselengthunit to change the unit you are interested in. Unfortunately, printlen doesn't provide lengths in em and ex. However, you could convert pt to ex and em for a given fontsize.

\documentclass{report}
\usepackage{printlen}
%
\begin{document}
{\Large \textsc{Vertical}}\\
\uselengthunit{pt}
\verb|\lineskip|~~\the\lineskip\\
\verb|\baselineskip|~~\the\baselineskip\\
\verb|\baselinestretch|~~\baselinestretch\\
\verb|\abovecaptionskip|~~\printlength{\abovecaptionskip}\\
\verb|\belowcaptionskip|~~\printlength{\belowcaptionskip}\\
\verb|\abovedisplayskip|~~\printlength{\abovedisplayskip}\\
\verb|\belowdisplayskip|~~\printlength{\belowdisplayskip}\\
\verb|\abovedisplayshortskip|~~\printlength{\abovedisplayshortskip}\\
\verb|\belowdisplayshortskip|~~\printlength{\belowdisplayshortskip}\\
\verb|\parskip|~~\printlength{\parskip}\\
\verb|\textfloatsep|~~\printlength{\textfloatsep}\\
\verb|\intextsep|~~\printlength{\intextsep}\\
\verb|\floatsep|~~\printlength{\floatsep}\\
\verb|\textheight|~~\printlength{\textheight}\\
%\verb|\textwidth|~~\printlength{\textwidth}\\

\vspace{15pt} {\Large \textsc{Horizontal}}\\
\verb|\textwidth|~~\printlength{\textwidth}\\
\verb|\parindent|~~\printlength{\parindent}\\
%\verb|\textwidth|~~\printlength{\textwidth}\\

\vspace{15pt} {\Large \textsc{Misc.}}\\
\verb|\textfraction|~~\textfraction\\
\verb|\topfraction|~~\topfraction\\
\verb|\floatpagefraction|~~\floatpagefraction\\
\verb|\clubpenalty|~~\printlength{\clubpenalty}\\
\verb|\widowpenalty|~~\printlength{\widowpenalty}\\
\verb|\displaywidowpenalty|~~\printlength{\displaywidowpenalty}\\
\verb|\tolerance|~~\printlength{\tolerance}\\
\verb|\pretolerance|~~\printlength{\pretolerance}\\
\verb|\emergencystretch|~~\printlength{\emergencystretch}\\
%\verb|\textwidth|~~\textwidth\\

\end{document}

-
1- Are these values dependent on the font size of the text? 2- Why the \belowcaptionskip is zero? It's not zero, it's about 1.5 cm. –  Sisabe Jan 9 '13 at 11:30
Some values like baselineskip etc. are font dependent while others like textfraction are not. Space between caption and the text below includes among other things textfloatsep. So thats why you are seeing space below caption. –  devendra Jan 9 '13 at 11:38
@Sisabe \belowcaptionskip is zero. It is \textfloatsep and \floatsep adding the space. –  tohecz Jan 9 '13 at 12:12
@devendra Is there a way to know which one is font dependent and which one is not? –  Sisabe Jan 9 '13 at 12:15
@devendra -- while baselineskip is generally dependent on font size, it is usually not dependent on the x-height (ex). some fonts have relatively large x-height (e.g. lucida), while others (e.g. bembo) have a smaller x-height for the same nominal font size. on the other hand, textwidth should sometimes be dependent on font size; if you've ever tried to read legal "boilerplate" you will understand why -- having very small print in very long lines is a disincentive to read the content. (experience does count.) –  barbara beeton Jan 9 '13 at 14:14