Path: utzoo!utgpu!news-server.csri.toronto.edu!clyde.concordia.ca!uunet!mcsun!unido!sbsvax!yxoc From: yxoc@sbsvax.cs.uni-sb.de (Ralf Treinen) Newsgroups: comp.text.tex Subject: Re: need LaTeX macros for section and subsection numbering Message-ID: <4907@sbsvax.cs.uni-sb.de> Date: 15 Jun 90 09:03:19 GMT References: Distribution: comp Organization: Universitaet des Saarlandes, Saarbruecken, W-Germany Lines: 40 In article , jiang@hbar.rice.edu (Jun Jiang) writes: > > The tricky thing here is the dot "." after each section number such as > I. A., etc. I could redefine the \thesection and \thesubsection > command to append a ".", but when I use \ref{sec:xxx}, I also get a > dot after the section numbers. This looks strange in the middle of a > sentence. > Try the following. It changes the generic command for section headings such that a dot is printed after the section number. Use it as a documentstyle, or enclose it in "\makeatletter" and "\makeatother". % Change \@sect from latex.tex. % A dot will be printed after the counter in the section heading. % The toc - and aux entries will not be affected. % Ralf Treinen (yxoc@cs.uni-sb.de) \def\@sect#1#2#3#4#5#6[#7]#8{\ifnum #2>\c@secnumdepth \def\@svsec{}\else \refstepcounter{#1}\edef\@svsec{\csname the#1\endcsname.\hskip 1em }\fi \@tempskipa #5\relax \ifdim \@tempskipa>\z@ \begingroup #6\relax \@hangfrom{\hskip #3\relax\@svsec}{\interlinepenalty \@M #8\par} \endgroup \csname #1mark\endcsname{#7}\addcontentsline {toc}{#1}{\ifnum #2>\c@secnumdepth \else \protect\numberline{\csname the#1\endcsname}\fi #7}\else \def\@svsechd{#6\hskip #3\@svsec #8\csname #1mark\endcsname {#7}\addcontentsline {toc}{#1}{\ifnum #2>\c@secnumdepth \else \protect\numberline{\csname the#1\endcsname}\fi #7}}\fi \@xsect{#5}} -- Ralf Treinen | Universitaet des Saarlandes FB 14 - Informatik (Dept. of CS) | D-6600 Saarbruecken 11, West Germany --------------------------------------+-------------------------------------- email: treinen@cs.uni-sb.de | phone: +49 681 302 2065