2

I have been using LaTeX for a while now, but I am very new to defining my own commands in the preamble. I am working on my thesis, and I'm using a custom .cls file which has been passed down by other grad students over the years.

When I start a new subsection, there is a certain amount of vertical space required between the preceding paragraph and the subsection heading. This works great if the subsection starts in the middle of a page, but when a subsection starts at the top of the page there is unwanted vertical space. I can manually go through and add \vspace*{-<some distance>} before certain instances of \subsection{<title>} to fix this problem, but I'd prefer to either write a new command or edit the subsection definition in the .cls file so that the vertical space is automatically removed if the subsection starts on a new page.

Thanks in advance!


EDIT 10/9/15 at 3:40 pm CDT Here's how subsections are defined in the custom .cls. Sorry for not including it originally

\renewcommand\subsection{\secdef\@subsection\@ssubsection}

\def\@subsection[#1]#2{\ifnum \c@secnumdepth >\m@ne
                       \refstepcounter{subsection}%

\addcontentsline{toc}{subsection}{\protect\numberline{\thesubsection .}\uppercase{#1}}%
                     \fi
                     \@makesubsectionhead{#1}
                     }

\def\@ssubsection[#1]#2{\@makessubsectionhead{#1}}

\def\@makesubsectionhead#1{\vspace*{\baselineskip}%
           {\parindent \z@ \raggedright \bfseries 
            \ifnum \c@secnumdepth >\m@ne
              \ifnum\c@inappendix=0\@chapapp\space\fi\thesubsection .\space
            \fi
             \uppercase{#1}\par\nobreak           
             }}
\def\@makessubsectionhead#1{\vspace*{\baselineskip}%
\bfseries  \uppercase{#1}\par\nobreak   
             }
  • Welcome to TeX.SX. This doesn't happen in the standard classes, and we would need to see this custom .cls to be able to say anything about how to edit it. – Torbjørn T. Oct 9 '15 at 20:28
  • if you don't show any code, not really possible to help – David Carlisle Oct 9 '15 at 20:29
  • Such inherited templates are most times ... well ... bad – user31729 Oct 9 '15 at 20:37
  • 2
    replace \vspace*{\baselineskip} with \vspace{\baselineskip} – touhami Oct 9 '15 at 20:50
  • 3
    @JSchaefer -- kudos for reading the documentation. more people should do that. – barbara beeton Oct 9 '15 at 21:19

Your Answer

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

Browse other questions tagged or ask your own question.