Skip to content

Commit

Permalink
Reflect latest TeX config from C++IS source.
Browse files Browse the repository at this point in the history
  • Loading branch information
grafikrobot committed Nov 10, 2023
1 parent bd8565e commit d9ea123
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 14 deletions.
4 changes: 3 additions & 1 deletion src/in_layout.tex
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@
%%--------------------------------------------------
%% If there is insufficient stretchable vertical space on a page,
%% TeX will not properly consider penalties for a good page break,
%% even if \raggedbottom (default) is in effect.
%% even if \raggedbottom (default for oneside, not for twoside)
%% is in effect.
\raggedbottom
\addtolength{\topskip}{0pt plus 20pt}

%%--------------------------------------------------
Expand Down
32 changes: 23 additions & 9 deletions src/in_macros.tex
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,10 @@
\def\stopindexescape#1\doneindexescape{}

%%--------------------------------------------------
%% Cross references.
%% Cross-references.
%%--------------------------------------------------
\newcommand{\addxref}[1]{%
\hypertarget{#1}{}%
\glossary[xrefindex]{\indexescape{#1}}{(\ref{\indexescape{#1}})}%
}

Expand Down Expand Up @@ -92,14 +93,15 @@
% defines a first-level section whose name is "Scope" and whose short
% tag is intro.scope. The square brackets are mandatory.
\def\Sec#1[#2]#3{%
\addxref{#2}%
\ifcase#1\let\s=\chapter\let\l=\clauselabel
\or\let\s=\section\let\l=\label
\or\let\s=\subsection\let\l=\label
\or\let\s=\subsubsection\let\l=\label
\or\let\s=\paragraph\let\l=\label
\or\let\s=\subparagraph\let\l=\label
\fi%
\s[#3]{#3\hfill[#2]}\l{#2}\addxref{#2}%
\s[#3]{#3\hfill[#2]}\l{#2}%
}

% A convenience feature (mostly for the convenience of the Project
Expand Down Expand Up @@ -175,7 +177,7 @@
% This command uses the "cooked" \indeximpldef command to emit index
% entries; thus they only work for simple index entries that do not contain
% special indexing instructions.
\newcommand{\impldef}[1]{\indeximpldef{#1}implementation-defined}
\newcommand{\impldef}[1]{\indeximpldef{#1}imple\-men\-ta\-tion-defined}
% \impldefplain passes the argument directly to the index, allowing you to
% use special indexing instructions (!, @, |).
\newcommand{\impldefplain}[1]{\index[impldefindex]{#1}implementation-defined}
Expand Down Expand Up @@ -219,7 +221,7 @@
% General code style
%%--------------------------------------------------
\newcommand{\CodeStyle}{\ttfamily}
\newcommand{\CodeStylex}[1]{\texttt{#1}}
\newcommand{\CodeStylex}[1]{\texttt{\protect\frenchspacing #1}}

\definecolor{grammar-gray}{gray}{0.2}

Expand Down Expand Up @@ -267,6 +269,10 @@
\newcommand{\CppXIV}{\Cpp{} 2014}
\newcommand{\CppXVII}{\Cpp{} 2017}
\newcommand{\CppXX}{\Cpp{} 2020}
\newcommand{\CppXXIII}{\Cpp{} 2023}
\newcommand{\CppXXVI}{\Cpp{} 2026}
\newcommand{\IsoCUndated}{ISO/IEC 9899}
\newcommand{\IsoC}{\IsoCUndated{}:2018}
\newcommand{\opt}[1]{#1\ensuremath{_\mathit{\color{black}opt}}}
\newcommand{\bigoh}[1]{\ensuremath{\mathscr{O}(#1)}}

Expand Down Expand Up @@ -303,7 +309,9 @@
{\noteoutro{#3}}
\newenvironment{#1}
{\begin{tail#1}}
{\end{tail#1}\small\par} % \small\par is for C++20 post-DIS compatibility
% \small\par is for C++20 post-DIS compatibility
{\end{tail#1}\small\par\penalty -200}

}

\newnoteenvironment{note}{Note \arabic{note}}{end note}
Expand Down Expand Up @@ -355,9 +363,9 @@
\newcommand{\fldval}{\Fundesc{Value}}
\newcommand{\flddesc}{\Fundesc{Description}}

%% Cross reference
%% Cross-reference
\newcommand{\xref}{\textsc{See also:}\space}
\newcommand{\xrefc}[1]{\xref{} ISO C #1}
\newcommand{\xrefc}[1]{\xref{} \IsoC{}, #1}

%% Inline comma-separated parenthesized references
\ExplSyntaxOn
Expand Down Expand Up @@ -412,6 +420,7 @@
}
\newcommand{\uname}[1]{\textsc{#1}}
\newcommand{\unicode}[2]{\ucode{#1} \uname{#2}}
\newcommand{\UAX}[1]{\texorpdfstring{UAX~\textsmaller[1]{\raisebox{0.35ex}{\#}}#1}{UAX \##1}}
\newcommand{\NTS}[1]{\textsc{#1}}
\newcommand{\ntbs}{\NTS{ntbs}}
\newcommand{\ntmbs}{\NTS{ntmbs}}
Expand Down Expand Up @@ -710,19 +719,24 @@
%%--------------------------------------------------
%% Environment for imported graphics
%%--------------------------------------------------
% usage: \begin{importgraphic}{CAPTION}{TAG}{FILE}
% usage: \begin{importgraphic}{CAPTION}{TAG}{FILE}\end{importgraphic}
% \importexample[VERTICAL OFFESET]{FILE}
%
% The filename is relative to the source/assets directory.

\newenvironment{importgraphic}[3]
{%
\newcommand{\cptn}{#1}
\newcommand{\lbl}{#2}
\begin{figure}[htp]\centering%
\includegraphics[scale=.35]{#3}
\includegraphics[scale=.35]{assets/#3}
}
{
\caption{\cptn \quad [fig:\lbl]}\label{fig:\lbl}%
\end{figure}}

\newcommand{\importexample}[2][-0.9pt]{\raisebox{#1}{\includegraphics{assets/#2}}}

%%--------------------------------------------------
%% Definitions section for "Terms and definitions"
%%--------------------------------------------------
Expand Down
6 changes: 3 additions & 3 deletions src/in_styles.tex
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,8 @@
%%--------------------------------------------------
% set heading style for annexes
\newcommand{\Annex}[3]{\chapter[#2]{(#3)\protect\\#2\hfill[#1]}\relax\annexlabel{#1}}
\newcommand{\infannex}[2]{\Annex{#1}{#2}{informative}\addxref{#1}}
\newcommand{\normannex}[2]{\Annex{#1}{#2}{normative}\addxref{#1}}
\newcommand{\infannex}[2]{\addxref{#1}\Annex{#1}{#2}{informative}}
\newcommand{\normannex}[2]{\addxref{#1}\Annex{#1}{#2}{normative}}

%%--------------------------------------------------
%% set footnote style
Expand Down Expand Up @@ -261,7 +261,7 @@
\ifvmode\else\par\fi\lst@emptylinepenalty
\vskip\parskip
\vskip\baselineskip
% \lsthk@EveryLine has \lst@parshape, i.e. \parshape, which causes an \hbox
% \lsthk@EveryLine has \lst@parshape, i.e., \parshape, which causes an \hbox
% \lsthk@EveryPar increments line counters; \refstepcounter balloons the PDF
\global\advance\lst@newlines\m@ne
\lst@newlinetrue}
Expand Down
2 changes: 1 addition & 1 deletion src/in_tables.tex
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@

% General Usage: TITLE is the title of the table, XREF is the
% cross-reference for the table. LAYOUT is a sequence of column
% type specifiers (e.g. cp{1.0}c), without '|' for the left edge
% type specifiers (e.g., cp{1.0}c), without '|' for the left edge
% or right edge.

% usage: \begin{floattablebase}{TITLE}{XREF}{LAYOUT}{PLACEMENT}
Expand Down

0 comments on commit d9ea123

Please sign in to comment.