5

I have the following stub document:

\documentclass[12pt]{article}

% packages used in this MS:
\usepackage{amsmath, amssymb, amsthm}
\usepackage{calc}                             % to allow duplicate page
%                                               number 1
\usepackage{endnotes}
\usepackage{fancyhdr}
\usepackage[margin=1in]{geometry}
\usepackage{graphicx}
\usepackage{mathtools}                        % for absolute value sign
\usepackage[pdftex]{hyperref}
\usepackage{setspace}
\usepackage{tabularx}                         % auto-calculates column %                                               widths
\usepackage{textcomp}
\usepackage{url}
\usepackage{verbatim}                         % for comment environment


% personally-written macros in file:
\include{macros} % none of these get called in what follows

%%%%%%%%%%%%%%%%%%%% ACTUAL TEXT BEGINS HERE %%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}

    \setlength{\footskip}{10.15pt}                    % no footer at all
    % set up running header---text part defined just below
    \pagestyle{fancy}
    \newcounter{alteredpagenum} % this will equal true page number minus 1
    %                             to allow two "Page 1"s---needed for blind
    %                             review
    \setcounter{alteredpagenum}{1}

    \newcommand\runninghead{MAXCOV-HITMAX}
    \noindent Running head:  \runninghead

    \begin{center}
        MAXCOV:  When is it a dependable admixture method?
    \end{center}

    \vspace*{1.5in}

    \begin{center}
        Author Note
    \end{center}

    \renewcommand\baselineskip{2\baselineskip}

    \setlength{\parindent}{0pt}

    The author is on the emeritus faculty of Psychology at the University
    of Minnesota---Twin Cities.

    The author would like to acknowledge the generous assistance of Leslie
    J. Yonce and Paul E. Meehl, as well as the stimulating article by
    Maraun and Slaney.

    Correspondence concerning this article should be addressed to:

    William M. Grove

    767 Meadowood Dr.

    Woodbury, MN \hspace{.25in} 55125--1177

    E-mail:  grove001@umn.edu
    \pagebreak

% says at this point (line 68), ``TeX capacity exceeded, sorry [main memory size=5000000].''

\end{document}

Note the comment about TeX complaining about capacity exceeded. I have tried and tried to simplify this file, checking & rechecking, and still always get the same error message. While I'm no LaTeX tyro I'm not a complete novice either, and it just escapes me what I'm doing wrong. Any ideas would be appreciated.

Sincerely, Will Grove

  • 2
    Note that \include before \begin{document} is wrong, use \input or better rename the file to macros.sty and use \usepackage{macros} (unrelated to the error in this case) – David Carlisle Jan 16 '17 at 22:42
  • 1
    If you want “double spacing”, use the features of setspace, which you are even loading. – egreg Jan 16 '17 at 23:34
  • Thank you for posting a working example! At the same time, much of your code does not seem to be relevant to the question you're asking here. Please limit the example to only the code required for your issue to appear. You can have a look at this guide for how to prune your code for this purpose. – Martin Schröder Jan 17 '17 at 8:55
10

Multiplication with keeping \baselineskip as rubber length

\baselineskip is a "rubber length" with optional stretch and shrink components. Values are usually assigned with \setlength. Multiplication is supported by package calc:

\usepackage{calc}
\setlength{\baselineskip}{\baselineskip * 2}

Example: If \baselineskip is 10.0pt plus 2.0pt minus 0.5pt, then all three components are multiplied: 20.0pt plus 4.0pt minus 1.0pt.

A simple low level alternative is given in Ian Thompson's answer:

\multiply\baselineskip by 2

Also e-TeX can be used:

\baselineskip=\glueexpr\baselineskip * 2\relax

Multiplication with stripping stretch and shrink components

However, using 2 as direct factor for \baselineskip results in a simple dimension without stretch and shrink components. With 10.0pt plus 2.0 pt minus 0.5pt as value for \baselineskip, the result of

\baselineskip=2\baselineskip

or

\setlength{\baselineskip}{2\baselineskip}

is 20.0pt.

9
    \renewcommand\baselineskip{2\baselineskip}

sets up an infinite loop.

\baselineskip is a primitive register which should not be redefined.

\setlength\baselineskip{2\baselineskip}
3

If you do \renewcommand\command{whatever}, then whatever doesn't get expanded until the command is used. So, after

\renewcommand\baselineskip{2\baselineskip},

\baselineskip will expand to 2\baselineskip, after which \baselineskip is expanded again, and TeX becomes stuck in an infinite loop. A simple way to avoid this is to multiply the value by two instead:

\multiply\baselineskip by 2
  • 1
    note that even without the loop the renewcommand would be wrong \renewcommand\baselineskip{5cm} would not loop but would not affect the baseline as it would just redefine the \baselineskip token not to refer to the baselineskip primitive. – David Carlisle Jan 16 '17 at 23:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.