[texhax] redefine section heading in memoir class

Paul Tremblay phthenry at iglou.com
Tue Apr 11 20:47:53 CEST 2006


On Tue, Apr 11, 2006 at 07:17:05PM +0200, Lars Madsen wrote:
> 
> I don't quite know what Paul is trying to do here, but perhaps this will 
> do the trick. Otherwise specify the requitements a bit more.
> 
> \documentclass{memoir}
> \setsecindent{36pt}
> \setlength{\beforesecskip}{.5in}
> \setlength{\aftersecskip}{.5in}
> %\renewcommand{\secheadstyle}{\bfseries\fontsize{24}{29}\selectfont}
> \setsecnumformat{\llap{\csname the#1\endcsname\quad}}
> \pagestyle{empty}
> \begin{document}
> \section{This is  the section which is a long section about
>   modernizing and so fourth}
> \noindent \hrulefill\quad this just shows the text width \quad\hrulefill 
> \null
> \section*{This is  the section which is a long section about
>   modernizing and so fourth}
> 
> note that the 36pt goes from the left edge to the left edge of the
> section title. The section number is typeset inside this area.
> 
> \end{document}

Thanks for the response. This code works if one has LaTeX do the
numbering, if one uses \section{title}. However, I want to supply my
own numbers. I have already given the titles numbers such as Appendix
A1. I want my title to look like:

2.1 Modernizing Main St: Woolworth's Stores Adapt to the 
    New Look after WW 2


Right now I can achieve this only through a work-around:

% assure that the heading does not become a widow
\needspace{4ex}

% these two commands create a hanging indent
\setlength{\parindent}{-36pt}
\setlength{\leftskipt}{36pt}

% fontsize
\fontsize{18}{23}
\selectfont

2.1 Modernizing Main St: Woolworth's Stores Adpapt to 
the New Look after WW 2
\par
\vspace{18pt}

% note that I normally set these lengths in an envrionment. 
% This is just an example
\normalsize
\setlength{\parindent}{18pt}
\setlength{\leftskipt}{0pt}

Starting with the end of the war...\par
% end example

The problem with this code above is that the \needspace{4ex} command
is rather crude since it cannot adjust to longer or shorter titles.
LaTeX's \section*{} command does a very good job with making sure my
titles don't appear as widows.

So I want the second line of my title to be indented from the first
line of the title, as in the example above. 

Just to be clear, I am using LaTeX to format an XML document. I don't
want to have LaTeX to any numbering. The XML document (through XSLT)
already has numbers.

Thanks

Paul

-- 

************************
*Paul Tremblay         *
*phthenry at iglou.com    *
************************


More information about the texhax mailing list