diff --git a/src/in_layout.tex b/src/in_layout.tex index e5447df..fcc70c2 100644 --- a/src/in_layout.tex +++ b/src/in_layout.tex @@ -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} %%-------------------------------------------------- diff --git a/src/in_macros.tex b/src/in_macros.tex index 3ac0219..8f36a4a 100644 --- a/src/in_macros.tex +++ b/src/in_macros.tex @@ -61,9 +61,10 @@ \def\stopindexescape#1\doneindexescape{} %%-------------------------------------------------- -%% Cross references. +%% Cross-references. %%-------------------------------------------------- \newcommand{\addxref}[1]{% + \hypertarget{#1}{}% \glossary[xrefindex]{\indexescape{#1}}{(\ref{\indexescape{#1}})}% } @@ -92,6 +93,7 @@ % 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 @@ -99,7 +101,7 @@ \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 @@ -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} @@ -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} @@ -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)}} @@ -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} @@ -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 @@ -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}} @@ -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" %%-------------------------------------------------- diff --git a/src/in_styles.tex b/src/in_styles.tex index 300e138..e3710f9 100644 --- a/src/in_styles.tex +++ b/src/in_styles.tex @@ -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 @@ -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} diff --git a/src/in_tables.tex b/src/in_tables.tex index 675090f..7513039 100644 --- a/src/in_tables.tex +++ b/src/in_tables.tex @@ -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}