[Tugindia] Section spacing

Suresh Kumar skumar at techbooks.com
Tue Jul 20 09:13:33 CEST 2004


Hi Suresh/Ragu:

If you use \section, \sectionAB, \subsectionBC etc. then your basic 
document structure will be changed based on your output requirements. I 
recommend to use your coding structure as standard as possible with little 
bit of tweak in the base macros. I can see a better option here. We can use 
following changes in the \@startsection macro:-

%%%%%%%%% picked up from latex.ltx %%%
%
\def\@startsection#1#2#3#4#5#6{%
   \if at noskipsec \leavevmode \fi
   \par
   \@tempskipa #4\relax
   \@afterindenttrue
   \ifdim \@tempskipa <\z@
     \@tempskipa -\@tempskipa \@afterindentfalse
   \fi
   \if at nobreak
   \ifnum#2=2    % 2 for subsection, 3 for subsubsection etc
         \vskip-12pt     % required space between 2 heads
   \fi
     \everypar{}%
   \else
     \addpenalty\@secpenalty\addvspace\@tempskipa
   \fi
   \@ifstar
     {\@ssect{#3}{#4}{#5}{#6}}%
     {\@dblarg{\@sect{#1}{#2}{#3}{#4}{#5}{#6}}}}
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%

Let me know your thoughts :)

Best Wishes

....Suresh Kumar

At 06:58 PM 7/19/2004, Ragu.solaiappan, Integra wrote:
>Dear Suresh,
>
>Can you please try with the following method of using different
>\@startsection in your class file.
>
>Your input files should be:
>
>         \sectionAB{This is A heading followed by B head}
>
>         \subsection{This is B heading}
>
>         xxxx  xxxx  xxxx  xxxx  ..
>
>         \section{This is A heading only followed by text}
>
>         xxxx  xxxx  xxxx  xxxx  ..
>
>Please check the following lines from the .cls file.
>
>
>You must define \@startsection and \@startsectionAB
>
>
>\def\section{\@startsection{section}{1}{\z@}
>     {24pt plus 6pt minus 2pt}
>     {12pt}
>     {\reset at font\hyphenpenalty9999\TWELVE\BOLD}}
>
>% when A head followed by B head - \sectionAB{...}
>\def\sectionAB{\@startsectionAB {section}{1}{\z@}
>     {24pt plus 6pt minus 2pt}
>     {12pt}
>     {\reset at font\hyphenpenalty9999\ELEVEN\BOLD}}
>
>By this method, you can get your output without any problem.
>
>Regards
>Ragu
>
>
>
>Dear All,
>
>In the section definition, I have mentioned above 36pt and below 24pt as
>constant spacing.
>The below spacing, for Section is constantly 24pt.
>
>
>Example:                1. Section
>
>                            This is the section text with base to base 24pt.
>... .. .
>
>
>But, I require 36pt spacing if the subsection is followed by the section.
>Is their any possibility to define such cases in the class files itself.
>
>
>Example:                1. Section
>
>
>                         1.1. Subsection
>                              This is the subsection text ... ... .. .
>
>
>Any suggestions will be helpful. Thanks in advance.
>
>with regards,
>suresh
>
>_______________________________________________
>Home:        http://www.tug.org.in/
>unsubscribe: http://tug.org/mailman/listinfo/tugindia


More information about the tugindia mailing list