Document Classes ⇒ Indenting subsections using the article.cls
Re: Indenting subsections using the article.cls
B.A.
Learn LaTeX easily with newest books:
The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis
The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more
LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis
Re: Indenting subsections using the article.cls
Regards,
B.A.
Re: Indenting subsections using the article.cls
I have found this example, but it does not work. (it's close, but wrong)
I'm beginning to think this is just impossible.
It would help me if you could explain the syntax in the following line (from the example)
\def\section#1{\leftskip=\saveskip\oldsection{#1}\leftskip=\sectskip}
THanks,
Paul
Indentation of Chapter/Sections
To get something like this:
Section
...........................
Subsection
.......................................
.....................
Subsubsection
.............................
............................
Subsection
........................
.............
Section
..................................
..................
insert in Layout->Preamble
\newdimen\sectskip
\newdimen\subsectskip
\newdimen\saveskip
\saveskip=\leftskip
\sectskip=1cm
\subsectskip=2cm
%% etc.
\let\oldsection\section
\let\oldsubsection\subsection
%% etc.
\def\section#1{\leftskip=\saveskip\oldsection{#1}\leftskip=\sectskip}
\def\subsection#1{\leftskip=\sectskip\oldsubsection{#1}\leftskip=\subsectskip}
%% etc.
%%
Re: Indenting subsections using the article.cls
\newdimen\saveskip
\newdimen\sectskip
\newdimen\subsectskip
\newdimen\subsubsectskip
\saveskip=\leftskip
\sectskip=1cm
\subsectskip=2cm
\subsubsectskip=3cm
\let\oldsection\section
\let\oldsubsection\subsection
\let\oldsubsubsection\subsubsection
\def\section#1{\leftskip=\sectskip\oldsection{#1}}%
\def\subsection#1{\leftskip=\subsectskip\oldsubsection{#1}}%
\def\subsubsection#1{\leftskip=\subsubsectskip\oldsubsubsection{#1}}
But what I suggested in a previous message does the same -- as I see it, the only difference is that it introduces new lengths (\sectskip,\subsectskip and so on) to realize the indentions, which might make it easier to have variants of your layout according to the document, for instance. You must know that \leftskip is the name, in Plain TeX, of the 'glue' (= length) added at the beginning of each line of a paragraph. The default is 0pt, which means that the lines begin at the left margin. The previous code begins by saving the original value of leftskip under the name of \saveskip, then modifies the actual value by setting it to what want for the indention of sections (\leftskip=\sectskip), etc.
So I would suggest the simpler code for the preamble (maybe you would like to save the original value of \leftskip -- I haven't done it):
\let\oldsection\section
\renewcommand{\section}{\leftskip=1cm \oldsection}
\let\oldsubsection\subsection
\renewcommand{\subsection}{\leftskip=2cm \oldsubsection}
\let\oldsubsubsection\subsubsection
\renewcommand{\subsubsection}{\leftskip=3cm \oldsubsubsection}
I've tested both ways: they apparently give the same result.
I hope I've been clear. Also, let me know if it does what you want.
Regards,
B.A.
Re: Indenting subsections using the article.cls
Thanks for your patient help.
I have finally made it work. Perhaps all your suggestions have been right all along.
The final difference is this:
If I place a blank line (double carraige return) in-between sections, all is well.
Without the blank line ahead of (and after) a new section or subsection, it produces wierd results.
Please try this and see if you agree.
Thanks Very Much, Once Again.
Problem Solved!
Paul
Re: Indenting subsections using the article.cls
\renewcommand{\subsection]{\par\leftskip=2cm\oldsubsection}
I tested it (not extensively) and it does the trick, without adding vertical space in case of a blank line.
Regards,
B.A.