diff --git a/pkgs/scribble-pkgs/scribble-doc/scribblings/scribble/core.scrbl b/pkgs/scribble-pkgs/scribble-doc/scribblings/scribble/core.scrbl index 39c22913..491fbccb 100644 --- a/pkgs/scribble-pkgs/scribble-doc/scribblings/scribble/core.scrbl +++ b/pkgs/scribble-pkgs/scribble-doc/scribblings/scribble/core.scrbl @@ -382,7 +382,7 @@ The recognized @tech{style properties} are as follows: @item{@racket['grouper] --- The part is numbered with a Roman numeral, and its subsections continue numbering as if they - appeared in the preceeding part. In other works, the part acts + appeared in the preceeding part. In other words, the part acts like a ``part'' in a book where chapter numbering is continuous across parts.} diff --git a/pkgs/scribble-pkgs/scribble-lib/scribble/scribble.tex b/pkgs/scribble-pkgs/scribble-lib/scribble/scribble.tex index d5b0fc2c..3641debc 100644 --- a/pkgs/scribble-pkgs/scribble-lib/scribble/scribble.tex +++ b/pkgs/scribble-pkgs/scribble-lib/scribble/scribble.tex @@ -185,18 +185,21 @@ % Useful for some styles, such as sigalternate: \newcommand{\SNumberOfAuthors}[1]{} +\let\SOriginalthesubsection\thesubsection +\let\SOriginalthesubsubsection\thesubsubsection + % sections \newcommand{\Spart}[2]{\part[#1]{#2}} -\newcommand{\Ssection}[2]{\section[#1]{#2}} -\newcommand{\Ssubsection}[2]{\subsection[#1]{#2}} +\newcommand{\Ssection}[2]{\section[#1]{#2}\let\thesubsection\SOriginalthesubsection} +\newcommand{\Ssubsection}[2]{\subsection[#1]{#2}\let\thesubsubsection\SOriginalthesubsubsection} \newcommand{\Ssubsubsection}[2]{\subsubsection[#1]{#2}} \newcommand{\Ssubsubsubsection}[2]{{\bf #2}} \newcommand{\Ssubsubsubsubsection}[2]{\Ssubsubsubsection{#1}{#2}} % "star" means unnumbered and not in ToC: \newcommand{\Spartstar}[1]{\part*{#1}} -\newcommand{\Ssectionstar}[1]{\section*{#1}} -\newcommand{\Ssubsectionstar}[1]{\subsection*{#1}} +\newcommand{\Ssectionstar}[1]{\section*{#1}\renewcommand*\thesubsection{\arabic{subsection}}\setcounter{subsection}{0}} +\newcommand{\Ssubsectionstar}[1]{\subsection*{#1}\renewcommand*\thesubsubsection{\arabic{section}.\arabic{subsubsection}}\setcounter{subsubsection}{0}} \newcommand{\Ssubsubsectionstar}[1]{\subsubsection*{#1}} \newcommand{\Ssubsubsubsectionstar}[1]{{\bf #1}} \newcommand{\Ssubsubsubsubsectionstar}[1]{\Ssubsubsubsectionstar{#1}} @@ -223,6 +226,11 @@ \newcommand{\Ssubsubsubsectiongrouperstar}[1]{\Ssubsubsubsectionstar{#1}} \newcommand{\Ssubsubsubsubsectiongrouperstar}[1]{\Ssubsubsubsubsectionstar{#1}} +\newcommand{\Ssubsectiongrouperstarx}[2]{\setcounter{GrouperTemp}{\value{subsection}}\Ssubsectionstarx{#1}{#2}\setcounter{subsection}{\value{GrouperTemp}}} +\newcommand{\Ssubsubsectiongrouperstarx}[2]{\setcounter{GrouperTemp}{\value{subsubsection}}\Ssubsubsectionstarx{#1}{#2}\setcounter{subsubsection}{\value{GrouperTemp}}} +\newcommand{\Ssubsubsubsectiongrouperstarx}[2]{\Ssubsubsubsectionstarx{#1}{#2}} +\newcommand{\Ssubsubsubsubsectiongrouperstarx}[2]{\Ssubsubsubsubsectionstarx{#1}{#2}} + % Generated by `subsubsub*section': \newcommand{\SSubSubSubSection}[1]{\Ssubsubsubsubsectionstar{#1}} diff --git a/pkgs/scribble-pkgs/scribble-test/tests/scribble/docs/secref.scrbl b/pkgs/scribble-pkgs/scribble-test/tests/scribble/docs/secref.scrbl new file mode 100644 index 00000000..384ac202 --- /dev/null +++ b/pkgs/scribble-pkgs/scribble-test/tests/scribble/docs/secref.scrbl @@ -0,0 +1,36 @@ +#lang scribble/base + +@title[#:tag "top"]{Title} + +@section[#:tag "1" #:style 'grouper]{Section One} + +This is @secref["1"] in @secref["top"]. + +See @secref["2"] and @secref["2.1"]. + +See @secref["3"], @secref["3.1"], @secref["3.2"], @secref["3.2.1"], and +@secref["3.3"]. + + +@section[#:tag "2" #:style 'grouper]{Section Two} + +@subsection[#:tag "2.1"]{Section Two.One} + +[content a] + + +@section[#:style '(grouper unnumbered) #:tag "3"]{Section Three} + +@subsection[#:tag "3.1"]{Section Three.One} + +[content b] + +@subsection[#:tag "3.2"]{Section Three.Two} + +@subsubsection[#:tag "3.2.1"]{Section Three.Two.One} + +[content c] + +@subsection[#:tag "3.3" #:style 'unnumbered]{Section Three.Three} + +[content d] diff --git a/pkgs/scribble-pkgs/scribble-test/tests/scribble/docs/secref.txt b/pkgs/scribble-pkgs/scribble-test/tests/scribble/docs/secref.txt new file mode 100644 index 00000000..ab7b4256 --- /dev/null +++ b/pkgs/scribble-pkgs/scribble-test/tests/scribble/docs/secref.txt @@ -0,0 +1,32 @@ +Title + +I. Section One + +This is Section One in Title. + +See Section Two and Section Two.One. + +See Section Three, Section Three.One, Section Three.Two, Section +Three.Two.One, and Section Three.Three. + +II. Section Two + +1. Section Two.One + +[content a] + +Section Three + +2. Section Three.One + +[content b] + +3. Section Three.Two + +3.1. Section Three.Two.One + +[content c] + +Section Three.Three + +[content d] diff --git a/pkgs/scribble-pkgs/scribble-test/tests/scribble/docs/secref2.scrbl b/pkgs/scribble-pkgs/scribble-test/tests/scribble/docs/secref2.scrbl new file mode 100644 index 00000000..3985fe71 --- /dev/null +++ b/pkgs/scribble-pkgs/scribble-test/tests/scribble/docs/secref2.scrbl @@ -0,0 +1,55 @@ +#lang scribble/base + +@title[#:tag "top"]{Title} + +@table-of-contents[] + +@section[#:tag "1"]{Section One} + +This is @secref["1"] in @secref["top"]. + +See @secref["2"] and @secref["2.1"]. + +See @secref["3"], @secref["3.1"], @secref["3.1.1"], @secref["3.2"], +@secref["3.2.1"], and @secref["3.3"]. + +See @secref["4"]. + +See @secref["5"] and @secref["5.1"]. + +@section[#:tag "2"]{Section Two} + +@subsection[#:tag "2.1"]{Section Two.One} + +[content a] + + +@section[#:style '(unnumbered) #:tag "3"]{Section Three} + +@subsection[#:tag "3.1" #:style 'grouper]{Section Three.One} + +@subsubsection[#:tag "3.1.1"]{Section Three.One.One} + +[content b] + +@subsection[#:tag "3.2" #:style 'grouper]{Section Three.Two} + +@subsubsection[#:tag "3.2.1"]{Section Three.Two.One} + +[content c] + +@subsection[#:tag "3.3" #:style '(unnumbered grouper)]{Section Three.Three} + +[content d] + + +@section[#:style '(unnumbered) #:tag "4"]{Section Four} + +[content e] + + +@section[#:tag "5"]{Section Five} + +@subsection[#:tag "5.1"]{Section Five.One} + +[content f] diff --git a/pkgs/scribble-pkgs/scribble-test/tests/scribble/docs/secref2.txt b/pkgs/scribble-pkgs/scribble-test/tests/scribble/docs/secref2.txt new file mode 100644 index 00000000..e44443ea --- /dev/null +++ b/pkgs/scribble-pkgs/scribble-test/tests/scribble/docs/secref2.txt @@ -0,0 +1,65 @@ +Title + +    1 Section One + +    2 Section Two +      2.1 Section Two.One + +    Section Three +      I Section Three.One +        1 Section Three.One.One +      II Section Three.Two +        2 Section Three.Two.One +      Section Three.Three + +    Section Four + +    3 Section Five +      3.1 Section Five.One + +1. Section One + +This is Section One in Title. + +See Section Two and Section Two.One. + +See Section Three, Section Three.One, Section Three.One.One, Section +Three.Two, Section Three.Two.One, and Section Three.Three. + +See Section Four. + +See Section Five and Section Five.One. + +2. Section Two + +2.1. Section Two.One + +[content a] + +Section Three + +I. Section Three.One + +1. Section Three.One.One + +[content b] + +II. Section Three.Two + +2. Section Three.Two.One + +[content c] + +Section Three.Three + +[content d] + +Section Four + +[content e] + +3. Section Five + +3.1. Section Five.One + +[content f] diff --git a/pkgs/scribble-pkgs/scribble-test/tests/scribble/docs/secref3.scrbl b/pkgs/scribble-pkgs/scribble-test/tests/scribble/docs/secref3.scrbl new file mode 100644 index 00000000..a946dafc --- /dev/null +++ b/pkgs/scribble-pkgs/scribble-test/tests/scribble/docs/secref3.scrbl @@ -0,0 +1,55 @@ +#lang scribble/base + +@title[#:tag "top"]{Title} + +@table-of-contents[] + +@section[#:tag "1"]{Section One} + +This is @secref["1"] in @secref["top"]. + +See @secref["2"] and @secref["2.1"]. + +See @secref["3"], @secref["3.1"], @secref["3.1.1"], @secref["3.2"], +@secref["3.2.1"], and @secref["3.3"]. + +See @secref["4"]. + +See @secref["5"] and @secref["5.1"]. + +@section[#:tag "2"]{Section Two} + +@subsection[#:tag "2.1"]{Section Two.One} + +[content a] + + +@section[#:tag "3"]{Section Three} + +@subsection[#:tag "3.1" #:style 'grouper]{Section Three.One} + +@subsubsection[#:tag "3.1.1"]{Section Three.One.One} + +[content b] + +@subsection[#:tag "3.2" #:style 'grouper]{Section Three.Two} + +@subsubsection[#:tag "3.2.1"]{Section Three.Two.One} + +[content c] + +@subsection[#:tag "3.3" #:style '(unnumbered grouper)]{Section Three.Three} + +[content d] + + +@section[#:style '(unnumbered) #:tag "4"]{Section Four} + +[content e] + + +@section[#:tag "5"]{Section Five} + +@subsection[#:tag "5.1"]{Section Five.One} + +[content f] diff --git a/pkgs/scribble-pkgs/scribble-test/tests/scribble/docs/secref3.txt b/pkgs/scribble-pkgs/scribble-test/tests/scribble/docs/secref3.txt new file mode 100644 index 00000000..6860e292 --- /dev/null +++ b/pkgs/scribble-pkgs/scribble-test/tests/scribble/docs/secref3.txt @@ -0,0 +1,65 @@ +Title + +    1 Section One + +    2 Section Two +      2.1 Section Two.One + +    3 Section Three +      3.I Section Three.One +        3.1 Section Three.One.One +      3.II Section Three.Two +        3.2 Section Three.Two.One +      Section Three.Three + +    Section Four + +    4 Section Five +      4.1 Section Five.One + +1. Section One + +This is Section One in Title. + +See Section Two and Section Two.One. + +See Section Three, Section Three.One, Section Three.One.One, Section +Three.Two, Section Three.Two.One, and Section Three.Three. + +See Section Four. + +See Section Five and Section Five.One. + +2. Section Two + +2.1. Section Two.One + +[content a] + +3. Section Three + +3.I. Section Three.One + +3.1. Section Three.One.One + +[content b] + +3.II. Section Three.Two + +3.2. Section Three.Two.One + +[content c] + +Section Three.Three + +[content d] + +Section Four + +[content e] + +4. Section Five + +4.1. Section Five.One + +[content f]