Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
ots-doctools
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ots
ots-doctools
Commits
77066355
Commit
77066355
authored
5 years ago
by
Karl Fogel
Browse files
Options
Downloads
Patches
Plain Diff
New OTS LaTeX package 'ots-sectioning'
parent
7fa4dffd
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
latex/ots-sectioning.sty
+94
-0
94 additions, 0 deletions
latex/ots-sectioning.sty
with
94 additions
and
0 deletions
latex/ots-sectioning.sty
0 → 100644
+
94
−
0
View file @
77066355
% OTS Sectioning LaTeX package: numbered and unnumbered sections together
%
% Copyright 2019 Open Tech Strategies
%
%% This program can be redistributed and/or modified under the terms
%% of the LaTeX Project Public License Distributed from CTAN archives
%% in directory macros/latex/base/lppl.txt.
%
\NeedsTeXFormat
{
LaTeX2e
}
[1994/06/01]
\ProvidesPackage
{
ots-sectioning
}
[2016/09/01 v0.01 LaTeX package for numbered and unnumbered sections in OTS docs]
% Use these (instead of \section) to make a top-level section for
% which numbering is on or off, respectively. For most of the
% sections, numbering should be on, but for a few it should be off.
%
% For appendices, use \appdxsection. (This is related to CAMH
% template stuff that is too boring to go into here.) For Appendix
% sub and subsubs, use appdxsubsection and appdxsubsubsection. Note
% that the Glossary is not considered an appendix; usually the
% Glossary is a regular \unnumberedsection.
\newcommand
{
\unnumberedsection
}
[1]
{
%
% \newpage
\setcounter
{
secnumdepth
}{
-1
}
\section
{
#1
}}
\newcommand
{
\numberedsection
}
[1]
{
%
% \newpage
\setcounter
{
secnumdepth
}{
3
}
\section
{
#1
}}
\newcommand
{
\appdxsection
}
[1]
{
%
% Save existing section format
\let\oldthesection\thesection
% Create a subsection line in the doc and establish the name of the
% section for label purposes, but don't put it in the TOC
\renewcommand
{
\thesection
}{
Appendix
\Alph
{
section
}}
\addtocontents
{
toc
}{
\protect\setcounter
{
tocdepth
}{
0
}}
\hypersetup
{
bookmarksdepth=0
}
\section
{
#1
}
\hypersetup
{
bookmarksdepth=4
}
\addtocontents
{
toc
}{
\protect\setcounter
{
tocdepth
}{
4
}}
% Manually make a line for the TOC without the "Appendix" bit in
\addcontentsline
{
toc
}{
section
}{
\hspace
{
0.2em
}
\thesection\hspace
{
0.5em
}
#1
}
%\addcontentsline{toc}{subsubsection}{\parbox{0.45in}{\hfill\thesubsubsection}\hspace{1em}#1\Dotfill\hspace{0.35em}}
% Restore normal section format
\let\thesection\oldthesection
}
\newcommand
{
\appdxsubsection
}
[1]
{
%
% Save existing section format
\let\oldthesection\thesection
% Create a subsection line in the doc and establish the name of the
% section for label purposes, but don't put it in the TOC
\renewcommand
{
\thesection
}{
Appendix
\Alph
{
section
}}
\addtocontents
{
toc
}{
\protect\setcounter
{
tocdepth
}{
0
}}
\hypersetup
{
bookmarksdepth=0
}
\subsection
{
#1
}
\hypersetup
{
bookmarksdepth=4
}
\addtocontents
{
toc
}{
\protect\setcounter
{
tocdepth
}{
4
}}
% Manually make a line for the TOC without the "Appendix" bit in
\renewcommand
{
\thesection
}{
\Alph
{
section
}}
\addcontentsline
{
toc
}{
subsection
}{
\thesubsection\hspace
{
0.5em
}
#1
}
% Restore normal section format
\let\thesection\oldthesection
}
\newcommand
{
\appdxsubsubsection
}
[1]
{
%
% Save existing section format
\let\oldthesection\thesection
% Create a subsection line in the doc and establish the name of the
% section for label purposes, but don't put it in the TOC
\renewcommand
{
\thesection
}{
Appendix
\Alph
{
section
}}
\addtocontents
{
toc
}{
\protect\setcounter
{
tocdepth
}{
0
}}
\hypersetup
{
bookmarksdepth=0
}
\subsubsection
{
#1
}
\hypersetup
{
bookmarksdepth=4
}
\addtocontents
{
toc
}{
\protect\setcounter
{
tocdepth
}{
4
}}
% Manually make a line for the TOC without the "Appendix" bit in
\renewcommand
{
\thesection
}{
\Alph
{
section
}}
\addcontentsline
{
toc
}{
subsubsection
}{
\hspace
{
0.2em
}
\thesubsubsection\hspace
{
0.5em
}
#1
}
%\addcontentsline{toc}{subsubsection}{\parbox{0.45in}{\hfill\thesubsubsection}\hspace{1em}#1\Dotfill\hspace{0.35em}}
% Restore normal section format
\let\thesection\oldthesection
}
\endinput
%%
%% End of file `ots-sectioning.sty'.
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment