Skip to content

Commit d7cf23c

Browse files
committed
US-1 Add numbering for bullets. Bullets are numbered within the surrounding
paragraph or bullet, not within the relevant bulleted list, so that numbers are unique. The main text formatting is unchanged; bullet numbers are placed in the left margin, just like paragraph numbers. Also fixes #177.
1 parent a018474 commit d7cf23c

File tree

2 files changed

+27
-8
lines changed

2 files changed

+27
-8
lines changed

source/layout.tex

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,19 +21,37 @@
2121
\checkandfixthelayout
2222

2323
%%--------------------------------------------------
24-
%% Paragraph numbering
24+
%% Paragraph and bullet numbering
25+
2526
\newcounter{Paras}
2627
\counterwithin{Paras}{chapter}
2728
\counterwithin{Paras}{section}
2829
\counterwithin{Paras}{subsection}
2930
\counterwithin{Paras}{subsubsection}
3031
\counterwithin{Paras}{paragraph}
3132
\counterwithin{Paras}{subparagraph}
33+
34+
\newcounter{Bullets1}[Paras]
35+
\newcounter{Bullets2}[Bullets1]
36+
\newcounter{Bullets3}[Bullets2]
37+
\newcounter{Bullets4}[Bullets3]
38+
3239
\makeatletter
33-
\def\pnum{\addtocounter{Paras}{1}\noindent\llap{{%
34-
\scriptsize\raisebox{.7ex}{\arabic{Paras}}}\hspace{\@totalleftmargin}\quad}}
40+
\newcommand{\parabullnum}[2]{%
41+
\stepcounter{#1}%
42+
\noindent\makebox[0pt][l]{\makebox[#2][r]{%
43+
\scriptsize\raisebox{.7ex}%
44+
{\arabic{Paras}%
45+
\ifnum \value{Bullets1}>0 .\arabic{Bullets1}%
46+
\ifnum \value{Bullets2}>0 .\arabic{Bullets2}%
47+
\ifnum \value{Bullets3}>0 .\arabic{Bullets3}%
48+
\fi\fi\fi}%
49+
\hspace{\@totalleftmargin}\quad%
50+
}}}
3551
\makeatother
3652

53+
\def\pnum{\parabullnum{Paras}{0pt}}
54+
3755
% Leave more room for section numbers in TOC
3856
\cftsetindents{section}{1.5em}{3.0em}
3957

source/styles.tex

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -129,11 +129,12 @@
129129
}
130130

131131
%%--------------------------------------------------
132-
%% change list item markers to em-dash
133-
\renewcommand{\labelitemi}{---}
134-
\renewcommand{\labelitemii}{---}
135-
\renewcommand{\labelitemiii}{---}
136-
\renewcommand{\labelitemiv}{---}
132+
%% change list item markers to number and em-dash
133+
134+
\renewcommand{\labelitemi}{---\parabullnum{Bullets1}{\labelsep}}
135+
\renewcommand{\labelitemii}{---\parabullnum{Bullets2}{\labelsep}}
136+
\renewcommand{\labelitemiii}{---\parabullnum{Bullets3}{\labelsep}}
137+
\renewcommand{\labelitemiv}{---\parabullnum{Bullets4}{\labelsep}}
137138

138139
%%--------------------------------------------------
139140
%% set section numbering limit, toc limit

0 commit comments

Comments
 (0)