Skip to content

Commit

Permalink
Update with latest C++ LaTex base changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
grafikrobot committed Jun 18, 2024
1 parent 56aeadb commit 1dd8057
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 8 deletions.
8 changes: 4 additions & 4 deletions src/in_macros.tex
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,12 @@

% Set the xref label for a clause to be "Clause n", not just "n".
\makeatletter
\newcommand{\customlabel}[2]{%
\@bsphack \begingroup \protected@edef \@currentlabel {\protect \M@TitleReference{#2}{\M@currentTitle}}\MNR@label{#1}\endgroup \@esphack%
\newcommand{\customlabel}[3]{%
\@bsphack \protected@write\@auxout{}{\string\newlabel{#1}{{#3}{\thepage}{}{#2.\thechapter}{}}} \@esphack%
}
\makeatother
\newcommand{\clauselabel}[1]{\customlabel{#1}{Clause \thechapter}}
\newcommand{\annexlabel}[1]{\customlabel{#1}{Annex \thechapter}}
\newcommand{\clauselabel}[1]{\customlabel{#1}{chapter}{Clause \thechapter}}
\newcommand{\annexlabel}[1]{\customlabel{#1}{appendix}{Annex \thechapter}}

% Use prefix "Annex" in the table of contents
\newcommand{\annexnumberlinebox}[2]{Annex #2\space}
Expand Down
18 changes: 14 additions & 4 deletions src/in_styles.tex
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,28 @@
% footnotes

%%--------------------------------------------------
%% create chapter style
%% create chapter styles

\makechapterstyle{cppstd}{%
\renewcommand{\beforechapskip}{\onelineskip}
\renewcommand{\afterchapskip}{\onelineskip}
\setlength{\beforechapskip}{\onelineskip}
\setlength{\afterchapskip}{\onelineskip}
\renewcommand{\chapternamenum}{}
\renewcommand{\chapnamefont}{\chaptitlefont}
\renewcommand{\chapnumfont}{\chaptitlefont}
\renewcommand{\printchapternum}{\chapnumfont\thechapter\quad}
\renewcommand{\afterchapternum}{}
}

\makechapterstyle{cppannex}{%
\setlength{\beforechapskip}{\onelineskip}
\setlength{\afterchapskip}{\onelineskip}
\renewcommand{\chapternamenum}{}
\renewcommand{\chapnamefont}{\chaptitlefont}
\renewcommand{\chapnumfont}{\chaptitlefont}
\renewcommand{\printchapternum}{\chapnumfont\centering\thechapter\protect\\}
\renewcommand{\afterchapternum}{}
}

%%--------------------------------------------------
%% create page styles

Expand Down Expand Up @@ -93,7 +103,7 @@

%%--------------------------------------------------
% set heading style for annexes
\newcommand{\Annex}[3]{\chapter[#2]{(#3)\protect\\#2\hfill[#1]}\relax\annexlabel{#1}}
\newcommand{\Annex}[3]{\chapter[#2]{\textnormal{(#3)}\protect\\[3ex]#2\hfill[#1]}\relax\annexlabel{#1}}
\newcommand{\infannex}[2]{\addxref{#1}\Annex{#1}{#2}{informative}}
\newcommand{\normannex}[2]{\addxref{#1}\Annex{#1}{#2}{normative}}

Expand Down
2 changes: 2 additions & 0 deletions src/in_tables.tex
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
% floattablebase without TableBase, used for lib2dtab2base
\newenvironment{floattablebasex}[4]
{
\protect\hypertarget{tab:#2}{}
\begin{table}[#4]
\caption{\label{tab:#2}#1 \quad [tab:#2]}
\begin{center}
Expand Down Expand Up @@ -196,6 +197,7 @@
\newenvironment{LongTable}[3]
{
\newcommand{\continuedcaption}{\caption[]{#1 (continued)}}
\protect\hypertarget{tab:#2}{}
\begin{TableBase}
\begin{longtable}{|#3|}
\caption{#1 \quad [tab:#2]}\label{tab:#2}
Expand Down

0 comments on commit 1dd8057

Please sign in to comment.