summaryrefslogtreecommitdiffstats
path: root/ast/starstyle.sty
diff options
context:
space:
mode:
authorWilliam Joye <wjoye@cfa.harvard.edu>2017-12-08 18:59:21 (GMT)
committerWilliam Joye <wjoye@cfa.harvard.edu>2017-12-08 18:59:21 (GMT)
commit4432c8d7e1ccb371db03e13cdb5378fceaa5ad04 (patch)
tree52449d211eba99b24d2e4f6e66193f9511c60b59 /ast/starstyle.sty
parentd8a2dbd825159e4a57ec0c6f4465f62be9e05111 (diff)
downloadblt-4432c8d7e1ccb371db03e13cdb5378fceaa5ad04.zip
blt-4432c8d7e1ccb371db03e13cdb5378fceaa5ad04.tar.gz
blt-4432c8d7e1ccb371db03e13cdb5378fceaa5ad04.tar.bz2
upgrade AST
Diffstat (limited to 'ast/starstyle.sty')
-rw-r--r--ast/starstyle.sty162
1 files changed, 162 insertions, 0 deletions
diff --git a/ast/starstyle.sty b/ast/starstyle.sty
new file mode 100644
index 0000000..c2cea2e
--- /dev/null
+++ b/ast/starstyle.sty
@@ -0,0 +1,162 @@
+\ProvidesPackage{starstyle}
+%%%%
+%% Package for styling the output (primarily in pdf)
+%%%%
+
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% Number sections down to subsubsection level
+\setcounter{secnumdepth}{4}
+
+% %%% Formatting of the section headging
+\newcommand{\colorsection}[1]{%
+\colorbox{bblue}{\strut\parbox{\dimexpr\textwidth-2\fboxsep}{\thesection\ \quad #1}{\huge\strut}}}
+
+\newcommand{\colorsectionnumberless}[1]{%
+\colorbox{bblue}{\strut\parbox{\dimexpr\textwidth-2\fboxsep}{#1}\strut}}
+
+
+% % Section headings (including numberless)
+
+\ifpdf
+\titleformat{name=\section}%
+{\normalfont\Large\bfseries}{}{0pt}{\colorsection}
+\titleformat{name=\section,numberless}%
+{\normalfont\Large\bfseries}{}{0pt}{\colorsectionnumberless}
+\fi
+
+%... Chapter headings
+\ifwithchapters
+ \titleformat{name=\chapter}[display]%
+ {\normalfont\huge\bfseries\thispagestyle{plain}}{%
+ \chaptertitlename\ \thechapter}{0pt}{}
+
+ \titleformat{name=\chapter,numberless}[display]%
+ {\normalfont\huge\bfseries\thispagestyle{plain}}{}{0pt}{\Huge}
+
+ %... spacing after chapter headings
+ \titlespacing*{\chapter}{0pt}{0pt}{20pt}
+
+\fi
+
+
+%.. section spacing
+\titlespacing*{\section}{0pt}{3.5ex plus 1ex minus .2ex}{2.3ex plus .2ex}
+\titlespacing*{\subsection}{0pt}{2ex plus 1ex minus .2ex}{1.5ex plus .2ex}
+\titlespacing*{\subsubsection}{0pt}{2ex plus 1ex minus .2ex}{1ex plus .2ex}
+\titlespacing*{\paragraph}{0pt}{2ex plus 1ex minus .2ex}{1em}
+\titlespacing*{\subparagraph}{\parindent}{2ex plus 1ex minus
+ .2ex}{1em}
+
+
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+%%% Page styles (e.g. headers and footers)
+
+\pagestyle{fancy}
+\fancyhf{}
+\rhead{\slshape \thestardocinitials{}/\thestardocnumber{} \leftmark}
+\lhead{\thepage}
+\renewcommand{\headrulewidth}{0.0pt}
+
+
+\ifwithchapters
+\renewcommand{\chaptermark}[1]{
+ \markboth{#1}{}}
+\else
+\renewcommand{\sectionmark}[1]{
+ \markboth{#1}{}}
+\fi
+
+% .. Reset the plain pagestyle (used on chapter pages) to only have
+% the page number and no rules.
+\fancypagestyle{plain}{%
+\fancyhf{}%
+
+\iftwoside
+\fancyhead[RE,LO]{\thepage}%
+\fancyhead[LE,RO]{\slshape
+ \thestardocinitials{}/\thestardocnumber{}\nouppercase{---\leftmark}}%
+\else
+\fancyhead[LO]{\thepage}
+\fancyhead[RO]{\slshape
+\thestardocinitials{}/\thestardocnumber{}\nouppercase{---\leftmark}}%
+\fi
+
+\renewcommand{\headrulewidth}{0pt}%
+\renewcommand{\footrulewidth}{0pt}%
+}
+
+% ensure correct chaptermakr is used when in pagestyle plain
+\pagestyle{plain}
+\fancyhf{}
+
+\iftwoside
+\fancyhead[LE,RO]{\slshape \thestardocinitials{}/\thestardocnumber{} \nouppercase{---\leftmark}}
+\fancyhead[RE,LO]{\thepage}
+\else
+\lhead{\slshape \thestardocinitials{}/\thestardocnumber{} \nouppercase{---\leftmark}}
+\rhead{\thepage}
+\fi
+
+\renewcommand{\headrulewidth}{0.0pt}
+
+\ifwithchapters
+\renewcommand{\chaptermark}[1]{
+ \markboth{#1}{}}
+\else
+\renewcommand{\sectionmark}[1]{
+ \markboth{#1}{}}
+\fi
+
+
+\renewcommand{\headrulewidth}{0pt}%
+\renewcommand{\footrulewidth}{0pt}%
+
+\ifwithchapters
+\renewcommand{\chaptermark}[1]{\markboth{{#1}}{}}%
+\else
+\renewcommand{\sectionmark}[1]{\markboth{{#1}}{}}%
+\fi
+
+%% Select the fancy pagestyle as default
+\pagestyle{fancy}
+
+
+
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% General spacing
+\setlength{\headheight}{1.5cm}
+\setlength{\parskip}{\medskipamount}
+\setlength{\parindent}{0pt}
+\renewcommand{\arraystretch}{1.5}
+
+
+%%%% Set up defaults for floats
+% maximum size of 'top area'
+\renewcommand{\topfraction}{0.9}
+% maximum size of 'bottom area'
+\renewcommand{\bottomfraction}{0.9}
+% minimum amount of text on a non-float page
+\renewcommand{\textfraction}{0.1}
+
+
+
+%Enumerate list appearance
+\setlist[enumerate,1]{label=(\arabic*)}
+
+
+% macros for typesetting parameters
+\providecommand{\aparam}[1]{\texttt{#1}} % ADAM parameter
+\providecommand{\cparam}[1]{\texttt{#1}} % CONFIG parameter
+\providecommand{\ndfcomp}[1]{\texttt{#1}} % NDF component
+
+
+
+\newcommand{\menuitem}[2]{\item[\protect{\hyperref[#1]{#1}}] #2}
+\newcommand{\classitem}[1]{\item [\protect{\hyperref[#1]{#1}}]}
+
+
+