Styling the other document divisors
Saturday, June 2nd, 2007 | LaTeX
While sectional titles aren’t as stylistically free as the chapter page, it is still important to carry over the style of the chapter page to sections, subsections and other such entries you have throughout your text. Thus, if the chapter style contained sans-serif text and a line below the text, it might be relevant to make the sections be sans-serif and possibly with both a line on top and below the section title.
While memoir is indeed very configurable, it doesn’t contain quite as an elaborate amount of commands to configure the sections, subsections and so forth. The primary command to customise with here is the \setXheadstyle where X can be sec, subsec, or subsubsec (and possibly more). So writing up the section style mentioned above would look like this:
\newcommand{\ruledsection}[1]{%
\noindent%
\parbox[t]{\textwidth}{%
\hrule\vskip1em
\sffamily\Large\bfseries #1\vskip1em%
\hrule%
}
}
\setsecheadstyle{\ruledsection}
Here we set the style to our custom command that will be called with the section number and title as an argument. This gives us the following output when compiled:
Since styling in this way is fairly simple, I will not go into painstriking detail of how to create more section styles. It is, though, useful to note that there are three more useful commands to know of: \setbeforeXskip, \setafterXskip, and \setXindent. The two first commands take lengths such as ‘-3.5ex plus -1ex minus -.2ex’ as arguments, and the last command just takes a regular length as an argument.
To see how these lengths can be used in practice, please refer to the memoir manual.
No comments yet.
Leave a comment
Categories
Archives
- February 2012
- July 2011
- June 2011
- November 2010
- October 2010
- April 2010
- November 2009
- October 2009
- June 2009
- May 2009
- February 2009
- January 2009
- December 2008
- November 2008
- October 2008
- September 2008
- August 2008
- May 2008
- April 2008
- March 2008
- February 2008
- January 2008
- December 2007
- November 2007
- October 2007
- September 2007
- August 2007
- June 2007
- May 2007
- April 2007
- March 2007
- February 2007
- December 2006
- November 2006
- October 2006
- September 2006
- June 2006
- April 2006
- March 2006
- February 2006
- January 2006
- December 2005
- November 2005
- October 2005
- September 2005
- May 2005
- April 2005
- March 2005
- February 2005
- January 2005
- December 2004
- June 2004
- April 2004
- February 2004
- November 2003
- January 2003
- November 2002