summaryrefslogtreecommitdiff
path: root/macros
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2023-04-10 03:04:32 +0000
committerNorbert Preining <norbert@preining.info>2023-04-10 03:04:32 +0000
commit834896467ed7eeede69922bc224147f7b5274828 (patch)
tree3be439ebb2cf9fb9d6707e478e1415ddf1b54bb3 /macros
parent5967b720d9dc6cac6adaa93e1479c61428db2eac (diff)
CTAN sync 202304100304
Diffstat (limited to 'macros')
-rw-r--r--macros/latex/contrib/nostarch/Makefile27
-rw-r--r--macros/latex/contrib/nostarch/README10
-rw-r--r--macros/latex/contrib/nostarch/nostarch.dtx1026
-rw-r--r--macros/latex/contrib/nostarch/nostarch.ins2
-rw-r--r--macros/latex/contrib/nostarch/nostarch.pdfbin326490 -> 290838 bytes
-rw-r--r--macros/latex/contrib/nostarch/nssample.pdfbin416315 -> 279615 bytes
-rw-r--r--macros/latex/contrib/nostarch/nssample.tex2
-rw-r--r--macros/latex/contrib/photobook/DEPENDS.txtbin467 -> 462 bytes
-rw-r--r--macros/latex/contrib/photobook/Makefile13
-rw-r--r--macros/latex/contrib/photobook/photobook.cls205
-rw-r--r--macros/latex/contrib/photobook/photobook.pdfbin141677 -> 143035 bytes
-rw-r--r--macros/latex/contrib/photobook/scripts/README.md38
-rwxr-xr-xmacros/latex/contrib/photobook/scripts/cls2tex.sh6
-rw-r--r--macros/latex/contrib/uantwerpendocs/beamerthemeuantwerpenuserguide.pdfbin3224856 -> 3225047 bytes
-rw-r--r--macros/latex/contrib/uantwerpendocs/uantwerpenbamathesis-example.pdfbin131257 -> 126855 bytes
-rw-r--r--macros/latex/contrib/uantwerpendocs/uantwerpencoursetext-example.pdfbin80862 -> 80858 bytes
-rw-r--r--macros/latex/contrib/uantwerpendocs/uantwerpendocs.dtx120
-rw-r--r--macros/latex/contrib/uantwerpendocs/uantwerpendocs.pdfbin385921 -> 497253 bytes
-rw-r--r--macros/latex/contrib/uantwerpendocs/uantwerpenexam-example1.pdfbin62425 -> 62425 bytes
-rw-r--r--macros/latex/contrib/uantwerpendocs/uantwerpenexam-example2.pdfbin64889 -> 64884 bytes
-rw-r--r--macros/latex/contrib/uantwerpendocs/uantwerpenletter-example.pdfbin49314 -> 27725 bytes
-rw-r--r--macros/latex/contrib/uantwerpendocs/uantwerpenphdthesis-example1.pdfbin220972 -> 187881 bytes
-rw-r--r--macros/latex/contrib/uantwerpendocs/uantwerpenphdthesis-example2.pdfbin216322 -> 133725 bytes
-rw-r--r--macros/latex/contrib/uantwerpendocs/uantwerpenreport-example.pdfbin207517 -> 175938 bytes
-rw-r--r--macros/luatex/generic/luatexja/README8
-rw-r--r--macros/luatex/generic/luatexja/doc/luatexja-en.pdfbin717552 -> 701830 bytes
-rw-r--r--macros/luatex/generic/luatexja/doc/luatexja-ja.pdfbin1149508 -> 1148687 bytes
-rw-r--r--macros/luatex/generic/luatexja/doc/luatexja.dtx168
-rw-r--r--macros/luatex/generic/luatexja/src/ltj-base.lua12
-rw-r--r--macros/luatex/generic/luatexja/src/ltj-direction.lua7
-rw-r--r--macros/luatex/generic/luatexja/src/ltj-inputbuf.lua8
-rw-r--r--macros/luatex/generic/luatexja/src/ltj-jfont.lua58
-rw-r--r--macros/luatex/generic/luatexja/src/ltj-pretreat.lua26
-rw-r--r--macros/luatex/generic/luatexja/src/ltj-rmlgbm.lua33
-rw-r--r--macros/luatex/generic/luatexja/src/ltj-setwidth.lua7
-rw-r--r--macros/luatex/generic/luatexja/src/luatexja-core.sty22
-rw-r--r--macros/luatex/generic/luatexja/src/luatexja.lua94
-rw-r--r--macros/luatex/generic/luatexja/src/patches/lltjcore.sty16
-rw-r--r--macros/luatex/generic/luatexja/src/patches/lltjfont.sty16
39 files changed, 1412 insertions, 512 deletions
diff --git a/macros/latex/contrib/nostarch/Makefile b/macros/latex/contrib/nostarch/Makefile
index 5986ef659d..c4afc1b4b6 100644
--- a/macros/latex/contrib/nostarch/Makefile
+++ b/macros/latex/contrib/nostarch/Makefile
@@ -3,7 +3,7 @@
#
# This file is in public domain
#
-# $Id: Makefile,v 1.6 2008-05-25 18:06:28 boris Exp $
+# $Id$
#
PACKAGE=nostarch
@@ -17,28 +17,28 @@ all: ${PDF}
%.pdf: %.dtx $(PACKAGE).cls
- pdflatex $<
+ xelatex $<
- bibtex $*
- pdflatex $<
+ xelatex $<
- makeindex -s gind.ist -o $*.ind $*.idx
- makeindex -s gglo.ist -o $*.gls $*.glo
- pdflatex $<
+ xelatex $<
while ( grep -q '^LaTeX Warning: Label(s) may have changed' $*.log) \
- do pdflatex $<; done
+ do xelatex $<; done
%.cls: %.ins %.dtx
- pdflatex $<
+ xelatex $<
%.pdf: %.tex $(PACKAGE).cls
- pdflatex $<
+ xelatex $<
- bibtex $*
- makeindex -s $(PACKAGE).ist -o $*.ind $*.idx
- pdflatex $<
- pdflatex $<
+ xelatex $<
+ xelatex $<
- makeindex -s $(PACKAGE).ist -o $*.ind $*.idx
while ( grep -q '^LaTeX Warning: Label(s) may have changed' $*.log) \
- do pdflatex $<; done
+ do xelatex $<; done
@@ -47,7 +47,7 @@ all: ${PDF}
clean:
$(RM) $(PACKAGE).cls *.log *.aux \
- *.glo *.idx *.toc *.tbc \
+ *.glo *.idx *.toc *.tbc *.hd \
*.ilg *.ind *.out *.lof \
*.lot *.bbl *.blg *.gls *.sty *.ist \
*.dvi *.ps *.thm *.tgz *.zip
@@ -59,10 +59,9 @@ distclean: clean
# Archive for the distribution. Includes typeset documentation
#
archive: all clean
- tar -czvf $(PACKAGE).tgz --exclude 'debug*' \
- --exclude '*~' --exclude '*.tgz' --exclude '*.zip' --exclude CVS .
+ COPYFILE_DISABLE=1 tar -C .. -czvf ../$(PACKAGE).tgz --exclude '*~' --exclude '*.tgz' --exclude '*.zip' --exclude CVS --exclude '.git*' $(PACKAGE); mv ../$(PACKAGE).tgz .
zip: all clean
zip -r $(PACKAGE).zip * \
- -x 'debug*' -x '*~' -x '*.tgz' -x '*.zip' -x CVS -x 'CVS/*' \ No newline at end of file
+ -x 'debug*' -x '*~' -x '*.tgz' -x '*.zip' -x .git* -x '.git/*'
diff --git a/macros/latex/contrib/nostarch/README b/macros/latex/contrib/nostarch/README
index 7911a0fcb1..ca989a73ab 100644
--- a/macros/latex/contrib/nostarch/README
+++ b/macros/latex/contrib/nostarch/README
@@ -1,5 +1,5 @@
LaTeX Style For No Starch Press
- Version 1.3 2008/06/06
+
This is the ``official'' LaTeX style for No Starch Press,
http://www.nostarch.com. The class is intended to typeset books for
@@ -10,6 +10,10 @@ nshyper.sty and MakeIndex style nostarch.ist.
CHANGES:
+Version 2.0:
+ Incorporated the changes by Alex Freed and other members of
+ the NoStarch team over the years.
+
Version 1.1:
Added interface to listings package
@@ -24,3 +28,7 @@ Version 1.3:
Bug fixes
Added user-settable parameters for the table of contents
+
+Version 1.4
+
+ Updated to keep with listings package \ No newline at end of file
diff --git a/macros/latex/contrib/nostarch/nostarch.dtx b/macros/latex/contrib/nostarch/nostarch.dtx
index 1fd2bb0284..d39fb87722 100644
--- a/macros/latex/contrib/nostarch/nostarch.dtx
+++ b/macros/latex/contrib/nostarch/nostarch.dtx
@@ -1,7 +1,6 @@
% \iffalse
-% $Id: nostarch.dtx,v 1.49 2008-06-07 03:05:29 boris Exp $
%
-% Copyright 2008, Boris Veytsman
+% Copyright 2008-2023, Boris Veytsman
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either
% version 1.3 of this license or (at your option) any
@@ -63,7 +62,7 @@
% \GetFileInfo{nostarch.dtx}
% \newcommand{\progname}[1]{\textsf{#1}}
% \title{\LaTeX{} Style For \emph{No Starch Press}
-% \thanks{\copyright 2008, Boris Veytsman}}
+% \thanks{\copyright 2008--2023, Boris Veytsman}}
% \author{Boris Veytsman\thanks{%
% \href{mailto:borisv@lk.net}{\texttt{borisv@lk.net}},
% \href{mailto:boris@varphi.com}{\texttt{boris@varphi.com}}}}
@@ -83,6 +82,9 @@
% \changes{v1.0}{2008/04/07}{First public release}
% \changes{v1.1}{2008/05/24}{Added interface to listings package and
% upquote package. Updated documentation}
+% \changes{v1.4}{2020/04/29}{Updated interface with listings package}
+% \changes{v2.0}{2023/03/30}{Incorporated in-house changes by No
+% Starch Press}
%
%
%\section{Introduction}
@@ -95,6 +97,11 @@
% The suite provides main class, |nostarch.cls|, hyperref interface
% |nshyper.sty| and MakeIndex style |nostarch.ist|.
%
+% The initial version of this class was written in 2008. Since then a
+% number of changes was made for in-house processing by the \emph{No
+% Starch} team, with special thanks to Alex Freed. In 2023 these
+% changes were incorporated back to the publicly released version.
+%
%\section{User's Guide}
%\label{sec:manual}
%
@@ -127,34 +134,74 @@
% To typeset the books in the distinctive \emph{No Starch Press} style
% you will need the fonts used by them. Unfortunately these fonts
% (New Baskerville, Futura, The Sans Mono Condensed and Dogma) are not
-% free. You may buy them from the vendor or license from the
-% publisher to typeset your book. Please contact \emph{No Starch
-% Press} directly for the arrangements.
-%
-% The class uses some other \LaTeX{} classes or packages. Most
-% probably, some of them they are already installed on your system.
-% If not (or if their versions are very old), you need to download and
-% install them. Here is the list:
+% free. You have the following options:
% \begin{enumerate}
-% \item Font support packages \progname{nbaskerv}~\cite{NbaskervFont},
-% \progname{futurans}~\cite{FuturansFont},
-% \progname{dogma}~\cite{DogmaFont} and
-% \progname{thsmc}~\cite{ThsmcFont}.
-% \item \progname{booktabs} package~\cite{Fear05:Booktabs}.
-% \item \progname{caption} package~\cite{Sommerfeldt07:Caption}.
-% \item \progname{fancyhdr} package~\cite{Oostrum04:Fancyhdr}.
-% \item \progname{fancyvrb} package~\cite{VanZandt98:Fancyvrb}.
-% \item \progname{graphics} package~\cite{Carlisle05:Graphics}.
-% \item \progname{ifpdf} package~\cite{Oberdiek06:Ifpdf}.
-% \item \progname{listings} package~\cite{Heinz07:Listings}.
-% \item \progname{ragged2e} package~\cite{Schroeder03:Ragged2e}.
-% \item \progname{upquote} package~\cite{Covington03:Upquote}.
+% \item Typeset your book using only free fonts (the option |nocfonts|
+% discussed below).
+% \item Buy the fonts and install them.
+% \item Arrange with \emph{No Starch Press} for the use of these fonts
+% for your book.
% \end{enumerate}
-% These packages are called internally by |nostarch.cls|; you do not
-% need to explicitly call them from your document.
-%
-%
-%
+% The details of the installation are discussed below in
+% Section~\ref{sec:ug_fonts}.
+%
+%
+%
+%\subsection{Fonts installation}
+%\label{sec:ug_fonts}
+%
+% If you wish to try \progname{nostarch} class without bothering to
+% typeset camera-ready copy, you may use the option |nocfonts| for
+% \emph{no commercial fonts,} and the class will use only the free
+% fonts available in \TeX\ distributions.
+%
+% If you work with \emph{No Starch Press} on your book, you might be
+% provided with the fonts. Today \emph{No Starch Press} typically
+% uses \progname{xelatex} and expects the fonts in True~Type format.
+% If this is the case, use the option |cfonts|. \emph{No Starch
+% Press} recommends the authors to put the font files in the
+% subdirectory \path{fonts} of their main directory. This is where
+% \progname{nostarch} expects them. This is also the layout of
+% directories in the \emph{No Starch Press} \emph{Overleaf}
+% templates. However, if you prefer to put the fonts in another
+% directory, searcheable by \progname{xelatex}, use the option
+% |nofontsdir| in the invocation.
+%
+% These options are summarized in Figure~\ref{fig:fonts}.
+%
+% \begin{figure}
+% \centering
+% \begin{tikzpicture}
+% \node[draw, circle, radius=0.1] (start) {};
+% \node[draw, align=center, below=of start]
+% (haveFonts) {Do you have \\commercial fonts?};
+% \node[draw, left=of haveFonts, align=center] (nocfonts)
+% {Use |nocfonts|\\ option};
+% \node[draw, below=of nocfonts, rounded corners]
+% (any) {Use any engine};
+% \node[draw, right=of haveFonts, align=center] (cfonts)
+% {Use |cfonts|\\option};
+% \node[draw, below=of cfonts, align=center] (haveSubdir) {Are the fonts
+% \\in |fonts| \\subdirectory?};
+% \node[draw, left=of haveSubdir, align=center]
+% (nofontsdir) {Use |nofontsdir|\\option};
+% \node[draw, below=of haveSubdir, align=center] (fontsdir)
+% {Use |fontsdir|\\option};
+% \node[draw, below=of fontsdir, rounded corners] (xelatex)
+% {Use \progname{xelatex} engine};
+% \draw[-latex] (start) -- (haveFonts);
+% \draw[-latex] (haveFonts) -- node[above] {No} (nocfonts);
+% \draw[-latex] (haveFonts) -- node[above] {Yes} (cfonts);
+% \draw[-latex] (nocfonts) -- (any);
+% \draw[-latex] (cfonts) -- (haveSubdir);
+% \draw[-latex] (haveSubdir) -- node[above] {No} (nofontsdir);
+% \draw[-latex] (haveSubdir) -- node[right] {Yes} (fontsdir);
+% \draw[-latex] (nofontsdir) |- (xelatex);
+% \draw[-latex] (fontsdir) -- (xelatex);
+% \end{tikzpicture}
+% \caption{Flowchart for font-related options}
+% \label{fig:fonts}
+% \end{figure}
%
%
%\subsection{Invocation}
@@ -165,7 +212,7 @@
% |\documentclass[|\meta{options}|]{nostarch}|
% \end{flushleft}
%
-% \DescribeOptions{cfonts,nocfonts}
+% \DescribeOptions{cfonts,nocfonts}%
% As discussed above, \emph{No Starch Press} uses a number of
% commercial fonts to typeset their books.
% The option |cfonts| (default) tells \LaTeX{} that you do have these
@@ -174,22 +221,16 @@
% to use freely available fonts for typesetting. Of course in this
% case the result will not look like a \emph{No Starch Press} Book.
%
-%
-% \DescribeOptions{8pt,9pt,10pt,11pt,12pt}
-% The fontsize changing options (|8pt|, |9pt|, \dots, |12pt|) have no
-% effect other than producing a warning in the log.
-%
+% \DescribeOptions{fontsdir,nofontsdir}%
+% If you use commercial fonts \emph{and} \progname{xelatex}, the
+% latter usually expects them in the subdirectory \path{fonts} of the
+% main directory (see Section~\ref{sec:ug_fonts}). The options
+% |fontsdir| (default) sets up this behavior. Use the option
+% |nofontsdir| to tell \progname{xelatex} to search standard font
+% directories insted.
%
+% Figure~\ref{fig:fonts} may help to choose the right options.
%
-% \emph{No Starch Press} uses a special paper size. If you process the
-% manuscript with \progname{pdflatex} to produce PDF output, the paper
-% dimensions will be automatically set up by the class. However, if
-% you use \progname{latex} and \progname{dvips}, you need to tell
-% \progname{dvips} what paper size to choose. One way to do this is
-% to add to the \progname{dvips} options the following:
-% \begin{verbatim}
-% -T 7in,9.25in
-% \end{verbatim}
%
%\subsection{Use of \progname{hyperref} Package}
%\label{sec:guide:hyperref}
@@ -210,7 +251,7 @@
% \progname{hyperref} by |\usepackage{hyperref}| will not work since
% \progname{nshyper} patches hyperref to work with our class.
%
-%
+%
%
%\subsection{Front Matter}
%\label{sec:guide:frontmatter}
@@ -542,6 +583,7 @@
% example, in quote characters.
%
%
+%
%\subsection{Back Matter}
%\label{sec:guide:backmatter}
%
@@ -644,7 +686,7 @@
%<class>\ProvidesClass{nostarch}
%<nshyper>\ProvidesPackage{nshyper}
%<*!ist>
-[2008/06/06 v1.3 Typesetting books for No Starch Press]
+[2023/03/30 v2.0 Typesetting books for No Starch Press]
%</!ist>
% \end{macrocode}
%
@@ -653,9 +695,10 @@
%<*gobble>
\documentclass{ltxdoc}
\usepackage{array}
-\usepackage{url,amsfonts}
+\usepackage{url,amsfonts, tikz}
\usepackage[breaklinks,colorlinks,linkcolor=black,citecolor=black,
- pagecolor=black,urlcolor=black,hyperindex=false]{hyperref}
+pagecolor=black,urlcolor=black,hyperindex=false]{hyperref}
+\usetikzlibrary{positioning}
\PageIndex
\CodelineIndex
\RecordChanges
@@ -671,14 +714,27 @@
%\subsection{Options}
%\label{sec:options}
%
-%
+%\begin{macro}{\ifnostarch@cfonts}
% First, let us decide whether we have non-free fonts:
% \begin{macrocode}
\newif\ifnostarch@cfonts
\nostarch@cfontstrue
\DeclareOption{cfonts}{\nostarch@cfontstrue}
\DeclareOption{nocfonts}{\nostarch@cfontsfalse}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\ifnostarch@fontsdir}
+% \changes{v2.0}{2023/03/31}{Introduced macro}
+% We also need to check whether we want to use \emph{No Starch} in
+% house |fonts| directory
+% \begin{macrocode}
+\newif\ifnostarch@fontsdir
+\nostarch@fontsdirtrue
+\DeclareOption{fontsdir}{\nostarch@fontsdirtrue}
+\DeclareOption{nofontsdir}{\nostarch@fontsdirfalse}
% \end{macrocode}
+% \end{macro}
%
% The size-changing options produce a warning:
% \begin{macrocode}
@@ -726,8 +782,15 @@
%
% A bunch of packages:
% \begin{macrocode}
-\RequirePackage{ifpdf, fancyhdr, fancyvrb, booktabs, graphicx,
- listings, caption, makeidx, upquote}
+\RequirePackage[table]{xcolor}
+\RequirePackage{iftex, ifpdf, fancyhdr, fancyvrb, booktabs, graphicx,
+ listings, caption, makeidx, upquote, pifont,
+ textcomp, xcolor, lmodern, nameref, float, amssymb, etoolbox,
+ setspace, marginnote}
+\RequirePackage[framemethod=TikZ]{mdframed}
+\RequirePackage{soul}
+\RequirePackage[T1]{fontenc}
+\RequirePackage{ragged2e}
% \end{macrocode}
%
% We do not want the option |document| with \progname{ragged2e}: this
@@ -752,17 +815,103 @@
%\subsection{Fonts}
%\label{sec:fonts}
%
-% If we have commercial fonts, we load them. Note that the body text
-% has roman font at 10pt, and typewriter at 8.5pt.
-% Therefore we will load |thsmc| scaled. We also add |dgdefault| for
-% dogma family
+% \begin{macro}{\nostarch@fontspath}
+% \changes{v2.0}{2023/03/31}{Introduced macro}
+% The path to load fonts
+% \begin{macrocode}
+\ifnostarch@fontsdir
+ \def\nostarch@fontspath#1{Path=fonts/#1/,}
+\else
+ \def\nostarch@fontspath#1{Path,}
+\fi
+% \end{macrocode}
+% \end{macro}
+%
+% If we have commercial fonts, we load them.
% \begin{macrocode}
\ifnostarch@cfonts
- \RequirePackage{nbaskerv}%
- \RequirePackage{futurans}%
- \RequirePackage[scaled=0.85]{thsmc}%
- \RequirePackage{dogma}%
- \newcommand{\dgdefault}{fdg}%
+ \ifpdftex
+ \ClassWarning{nostarch}{Commercial fonts usually require xelatex engine}
+ \RequirePackage{nbaskerv}%
+ \RequirePackage{futurans}%
+ \RequirePackage[scaled=0.85]{thsmc}%
+ \RequirePackage{dogma}%
+ \newcommand{\dogma}{\fontfamily{fdg}\selectfont}%
+ \else %XeTeX or LuaTeX
+ \RequirePackage{fontspec}
+ \newfontface\dogma[
+ \nostarch@fontspath{dogma}
+ UprightFont=dogmab01.ttf,
+ Ligatures=TeX
+ ]{dogma} % Font used for chapter titles
+
+ \newfontface\timesnewroman[
+ \nostarch@fontspath{tnr}
+ UprightFont=times.ttf,
+ BoldFont=timesbd.ttf,
+ ItalicFont=timesi.ttf,
+ BoldItalicFont=timesbi.ttf,
+ Ligatures=TeX
+ ]{timesnewroman}
+
+ \newfontface\futurabook[
+ \nostarch@fontspath{futurans}
+ UprightFont=FuturB37.ttf,
+ BoldFont=FuturH79.ttf,
+ ItalicFont=FutuBO08.ttf,
+ BoldItalicFont=FutCBO63.ttf,
+ Ligatures=TeX
+ ]{futurabook}
+
+ \newfontface\futuraheavy[
+ \nostarch@fontspath{futurans}
+ UprightFont=FuturH79.ttf,
+ Ligatures=TeX
+ ]{futuraheavy}
+
+ \newfontface\futuraboldc[
+ \nostarch@fontspath{futurans}
+ UprightFont=futucb18.ttf,
+ Ligatures=TeX
+ ]{futuraboldc}
+
+ \newfontface\futuraboldcoblique[
+ \nostarch@fontspath{futurans}
+ UprightFont=FutCBO63.ttf,
+ Ligatures=TeX
+ ]{futuraboldcoblique}
+
+ \newfontface\futuraoblique[
+ \nostarch@fontspath{futurans}
+ UprightFont=FutuBO08.ttf,
+ Ligatures=TeX
+ ]{futuraoblique}
+
+ \setmainfont{nbaskerv}[
+ \nostarch@fontspath{nbaskerv}
+ UprightFont=NewBaskervilleEF-Roman.ttf,
+ BoldFont=NewBaskervilleEF-Bold.ttf,
+ ItalicFont=NewBaskervilleEF-RomanIta.ttf,
+ BoldItalicFont=NewBaskervilleEF-BoldIta.ttf,
+ Ligatures=TeX]
+
+ \setmonofont[Scale=0.85,
+ \nostarch@fontspath{thsmc}
+ UprightFont=ThSMCP25.ttf,
+ BoldFont=ThSMCB02.ttf,
+ ItalicFont=ThSMCI29.ttf,
+ BoldItalicFont=TSMCBI56.ttf]{thsmc}
+
+ \setsansfont[
+ \nostarch@fontspath{futurans}
+ UprightFont=futura.ttf,
+ BoldFont=FuturB41.ttf,
+ ItalicFont=FutuBO08.ttf,
+ BoldItalicFont=FutCBO63.ttf,
+ Ligatures=TeX
+ ]{futurans}
+
+ \fi
% \end{macrocode}
% Otherwise we just use sans serif font for dogma.
% \begin{macrocode}
@@ -771,13 +920,99 @@
\fi
% \end{macrocode}
%
+% A number of commands to provide font defaults in case we use
+% non-commercial fonts
+% \begin{macrocode}
+\providecommand{\dogma}{\fontfamily{dgdefault}\selectfont}
+\providecommand{\futuraboldc}{\fontfamily{\sfdefault}\fontseries{bc}%
+ \selectfont}
+\providecommand{\futuraboldcoblique}{\fontfamily{\sfdefault}\fontseries{bc}%
+ \itshape\selectfont}
+\providecommand{\futuraheavy}{\fontfamily{\sfdefault}\fontseries{hq}%
+ \selectfont}
+\providecommand{\futurabook}{\fontfamily{\sfdefault}\fontseries{k}%
+ \selectfont}
+% \end{macrocode}
%
% And switch to normal size---just in case
% \begin{macrocode}
\normalsize
% \end{macrocode}
%
+% Special commands for number balls
+% \begin{macro}{\wingding}
+% \changes{v2.0}{2023/03/31}{Introduced macro}
+% The number ball
+% \begin{macrocode}
+\newcommand{\wingding}[1]{\ding{\the\numexpr #1 + 181 \relax}}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\codewingding}
+% \changes{v2.0}{2023/03/31}{Introduced macro}
+% The number ball inside code
+% \begin{macrocode}
+\newcommand{\codewingding}[1]{\vbox{\llap{\wingding{#1}\hskip 0.5em}}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\menuarrow}
+% \changes{v2.0}{2023/04/08}{Introduced macro}
+% \begin{macrocode}
+\newcommand\menuarrow{\raisebox{.2ex}{\small $\blacktriangleright$}}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\bettertilde}
+% \changes{v2.0}{2023/04/04}{Introduced macro}
+% A tilde uses for some texts
+% \begin{macrocode}
+\newcommand{\bettertilde}{\raisebox{-1ex}{\textasciitilde}}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\slashslash}
+% \changes{v2.0}{2023/04/04}{Introduced macro}
+% The special slash
+% \begin{macrocode}
+\newcommand{\slashslash}{%
+ \raisebox{.53ex}{%
+ \scalebox{.5}{%
+ \rotatebox[origin=c]{18}{$\mathbf{/}$}%
+ }%
+ }%
+}
+% \end{macrocode}
+% \end{macro}
%
+% \begin{macro}{\neq}
+% \changes{v2.0}{2023/04/04}{Introduced macro}
+% A better $\neq$
+% \begin{macrocode}
+\renewcommand{\neq}{\mathrel
+ {%
+ \vphantom{=}%
+ \ooalign{\kern.05em\smash{\slashslash}\hidewidth\cr$=$\cr}%
+ }%
+}
+
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\keycap}
+% Taken from:
+% \url{https://tex.stackexchange.com/questions/55664/fake-small-caps-with-xetex-fontspec/225078}
+% \begin{macrocode}
+\newcommand\keycap[1]{\fauxschelper#1 \relax\relax}
+\def\fauxschelper#1 #2\relax{%
+ \fauxschelphelp#1\relax\relax%
+ \if\relax#2\relax\else\ \fauxschelper#2\relax\fi%
+}
+\def\Hscale{.83}\def\Vscale{.72}\def\Cscale{1.00}
+\def\fauxschelphelp#1#2\relax{%
+ \ifnum`#1>``\ifnum`#1<`\{\scalebox{\Hscale}[\Vscale]{\uppercase{#1}}\else%
+ \scalebox{\Cscale}[1]{#1}\fi\else\scalebox{\Cscale}[1]{#1}\fi%
+ \ifx\relax#2\relax\else\fauxschelphelp#2\relax\fi}
+% \end{macrocode}
+% \end{macro}
%
%\subsection{Page Dimensions and Paragraphing}
%\label{sec:page}
@@ -902,7 +1137,25 @@
% \end{macro}
% \end{macro}
%
-%
+% \begin{macro}{\sochapter}
+% \changes{v2.0}{2023/04/04}{Introduced macro}
+% \begin{macro}{\sotitle}
+% \changes{v2.0}{2023/04/04}{Introduced macro}
+% \begin{macro}{\sobox}
+% \changes{v2.0}{2023/04/04}{Introduced macro}
+% \begin{macro}{\sonote}
+% \changes{v2.0}{2023/04/04}{Introduced macro}
+% Some spacing commands.
+% \begin{macrocode}
+\sodef\sochapter{}{.150em}{.5em}{1em}
+\sodef\sotitle{}{.125em}{.5em}{1em}
+\sodef\sobox{}{.075em}{.5em}{1em}
+\sodef\sonote{}{.200em}{.5em}{1em}
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+% \end{macro}
+% \end{macro}
%
%\subsection{Headers and Footers}
%\label{sec:headers}
@@ -934,19 +1187,19 @@
%
% On even pages we put page number and chapter title in footer.
% \begin{macrocode}
-\fancyfoot[RO]{\fontfamily{\sfdefault}\fontsize{6pt}{6pt}%
+\fancyfoot[RO]{\sffamily \fontsize{6pt}{6pt}%
\fontseries{lq}\selectfont\rightmark%
- \hspace{2em}\fontseries{bc}\fontsize{9pt}{6pt}\selectfont\thepage}
+ \hspace{2em} \futuraboldc \fontsize{9pt}{6pt}\selectfont\thepage}
\fancyfoot[LO]{}
\fancyfoot[CO]{}
% \end{macrocode}
%
% On even pages we put page number and chapter number in footer:
% \begin{macrocode}
-\fancyfoot[LE]{\fontfamily{\sfdefault}\fontseries{bc}\fontsize{9pt}{6pt}%
- \selectfont\thepage\hspace{2em}%
- \fontseries{lq}\fontsize{6pt}{6pt}\selectfont%
- \leftmark}
+\fancyfoot[LE]{\futuraboldc \fontsize{9pt}{6pt}%
+ \selectfont\thepage%
+ \fontseries{lq}\sffamily \fontsize{6pt}{6pt}\selectfont%
+ \hspace{2em}\leftmark}
\fancyfoot[RE]{}
\fancyfoot[CE]{}
% \end{macrocode}
@@ -1012,12 +1265,11 @@
\clearpage
{\pagestyle{empty}\cleardoublepage}%
\thispagestyle{empty}%
- \null\vskip1.025in%
+ \null%\vskip1.025in%
\leavevmode\noindent\hspace{1.66in}%
\begin{minipage}[t]{2.5625in}%
\flushright
- \fontfamily{\sfdefault}\fontseries{b}%
- \fontsize{12\p@}{13\p@}\selectfont
+ \sffamily\bfseries\fontsize{12\p@}{13\p@}\selectfont
\MakeUppercase{\@title}%
\end{minipage}}
% \end{macrocode}
@@ -1041,18 +1293,18 @@
\item\relax
\centering
\null\vskip0.855in%
- {\fontfamily{\dgdefault}\fontseries{bk}\fontsize{36\p@}{37\p@}\selectfont
- \MakeUppercase{\@title}\par}%
+ {\dogma \fontsize{36\p@}{37\p@}\selectfont
+ \MakeUppercase{\sotitle{\@title}}\par}%
\if\@subtitle\@empty\relax\else
{\null\vskip25\p@%
- \fontfamily{\dgdefault}\fontseries{bq}\fontsize{24\p@}{25\p@}\selectfont
+ \dogma \fontsize{24\p@}{25\p@}\selectfont
\@subtitle\par}%
\fi
- \vspace{1.7in}%
+ \vspace{2.15in}%
\vspace{-\baselineskip}%
- {\fontfamily{\sfdefault}\fontseries{hq}\fontsize{18\p@}{22\p@}\selectfont
+ {\futuraheavy\fontsize{18\p@}{22\p@}\selectfont
by \@author\par}%
- \vspace{0.45in}%
+ \vspace{12\p@}%
\vspace{\baselineskip}%
\if\@nostarchlogo\@empty\relax\else
\includegraphics[height=1.08in]{\@nostarchlogo}\par
@@ -1099,15 +1351,23 @@
%
%
% \begin{macro}{dedicationpage}
-% \changes{v0.5}{2008/03/19}{Introduced the macro}
+% \changes{v0.5}{2008/03/19}{Introduced the macro}
+% \changes{v2.0}{2023/04/04}{Rewritten}
% Dedication is centered:
% \begin{macrocode}
\newenvironment{dedicationpage}{%
\clearpage
- {\pagestyle{empty}\cleardoublepage}%
+ \bgroup
+ \list{}{\leftmargin-1in\rightmargin\z@\labelwidth\z@%
+ \labelsep\z@\listparindent\z@\parsep8\p@\itemsep\z@%
+ \topsep\z@\partopsep\z@}%
+ \item\relax
\thispagestyle{empty}%
\null\vskip1.175in%
- \centering\normalfont}{\clearpage}
+ \centering\normalfont}{%
+ \endlist
+ \egroup
+ \clearpage}
% \end{macrocode}
% \end{macro}
%
@@ -1122,7 +1382,7 @@
% \begin{macro}{\briefcontentsname}
% The name for brief contents
% \begin{macrocode}
-\def\briefcontentsname{Brief Contents}
+\def\briefcontentsname{{Brief Contents}}
% \end{macrocode}
%
% \end{macro}
@@ -1142,6 +1402,13 @@
%
% \end{macro}
%
+% \begin{macro}{\apptoc}
+% \changes{v2.0}{2023/04/14}{Added macro}
+% Changing chapter names in appendix
+% \begin{macrocode}
+\newcommand{\apptoc}{\renewcommand{\chaptername}{Appendix}}
+% \end{macrocode}
+% \end{macro}
%
% \begin{macro}{\brieftableofcontents}
% \changes{v0.5}{2008/03/19}{Introduced macro}
@@ -1162,8 +1429,8 @@
\topsep\z@\partopsep\z@}%
\item\relax
{\centering
- \fontfamily{\dgdefault}\fontseries{bs}\fontsize{16\p@}{18\p@}\selectfont
- \MakeUppercase{\briefcontentsname}\par}\vskip40pt%
+ \dogma\fontsize{16\p@}{18\p@}\selectfont
+ \MakeUppercase{\sochapter{Brief Contents}}\par}\vskip40pt%
\@starttoc{tbc}%
\endlist
\egroup}
@@ -1190,8 +1457,8 @@
\topsep\z@\partopsep\z@}%
\item\relax
{\centering
- \fontfamily{\dgdefault}\fontseries{bs}\fontsize{16\p@}{18\p@}\selectfont
- \MakeUppercase{\contentsname}\par}\vskip18pt%
+ \dogma\fontsize{16\p@}{18\p@}\selectfont
+ \MakeUppercase{\sochapter{Contents in Detail}}\par}\vskip18pt%
\@starttoc{toc}%
\endlist
\egroup}
@@ -1221,7 +1488,7 @@
\parindent \z@ \rightskip \@pnumwidth
\parfillskip -\@pnumwidth
{\leavevmode
- \fontfamily{\sfdefault}\fontseries{bq}\fontsize{12\p@}{14\p@}\selectfont
+ \sffamily\bfseries\fontsize{12\p@}{14\p@}\selectfont
#1}\par
\nobreak
\global\@nobreaktrue
@@ -1243,8 +1510,8 @@
\parindent \z@ \rightskip \@pnumwidth
\parfillskip -\@pnumwidth
\leavevmode
- \fontfamily{\sfdefault}\fontseries{bq}\fontsize{10\p@}{12\p@}\selectfont
- #1\nobreak\hfil \nobreak\hb@xt@\@pnumwidth{\hss #2}\par
+ \sffamily \bfseries \fontsize{10\p@}{12\p@}\selectfont{#1}%
+ \nobreak\hfil \nobreak\hb@xt@\@pnumwidth{\hss #2}\par
\vskip4\p@\penalty\@highpenalty
\endgroup
\fi}
@@ -1257,7 +1524,17 @@
% \begin{macrocode}
\newlength{\sectionnumberwidth}
\settowidth{\sectionnumberwidth}{%
- \fontfamily{\sfdefault}\fontseries{k}\fontsize{9\p@}{11\p@}\selectfont
+ \futurabook\fontsize{9\p@}{11\p@}\selectfont
+ 99.99}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\boldsectionnumberwidth}
+% \changes{v2.0}{2023/04/06}{Introduced the length}
+% The number width for bold sections. Normally the width of |99.99|
+% \begin{macrocode}
+\newlength{\boldsectionnumberwidth}
+\settowidth{\boldsectionnumberwidth}{%
+ \futuraheavy\fontsize{9\p@}{11\p@}\selectfont
99.99}
% \end{macrocode}
% \end{macro}
@@ -1268,7 +1545,7 @@
% \begin{macrocode}
\newlength{\subsectionnumberwidth}
\settowidth{\subsectionnumberwidth}{%
- \fontfamily{\sfdefault}\fontseries{k}\fontsize{9\p@}{11\p@}\selectfont
+ \futurabook\fontsize{9\p@}{11\p@}\selectfont
99.99.99}
% \end{macrocode}
% \end{macro}
@@ -1280,8 +1557,8 @@
% \begin{macrocode}
\renewcommand{\l@section}[2]{\@dottedtocline{1}{\z@}{%
\sectionnumberwidth}{%
- \fontfamily{\sfdefault}\fontseries{k}\fontsize{9\p@}{11\p@}\selectfont#1}{%
- \fontfamily{\sfdefault}\fontseries{k}\fontsize{9\p@}{11\p@}\selectfont#2}}
+ \futurabook\fontsize{9\p@}{11\p@}\selectfont#1}{%
+ \futurabook\fontsize{9\p@}{11\p@}\selectfont#2}}
% \end{macrocode}
% \end{macro}
%
@@ -1294,11 +1571,21 @@
% \begin{macrocode}
\renewcommand{\l@subsection}[2]{\@dottedtocline{2}{0.5in}%
{\subsectionnumberwidth}{%
- \fontfamily{\sfdefault}\fontseries{k}\fontsize{9\p@}{11\p@}\selectfont#1}{%
- \fontfamily{\sfdefault}\fontseries{k}\fontsize{9\p@}{11\p@}\selectfont#2}}
+ \futurabook\fontsize{9\p@}{11\p@}\selectfont#1}{%
+ \futurabook\fontsize{9\p@}{11\p@}\selectfont#2}}
% \end{macrocode}
% \end{macro}
%
+% \begin{macro}{\l@boldsection}
+% \changes{v2.0}{2023/04/06}{Introduced the macro}
+% This is how we typeset bold sections in the table of contents
+% \begin{macrocode}
+\newcommand*\l@boldsection[2]{{\bfseries\@dottedtocline{1}{\z@}{%
+ \boldsectionnumberwidth}{%
+ \futuraheavy\fontsize{9\p@}{11\p@}\selectfont#1}{%
+ \futuraheavy\fontsize{9\p@}{11\p@}\selectfont#2}}}
+% \end{macrocode}
+% \end{macro}
%
%
% \begin{macro}{\l@bpart}
@@ -1314,7 +1601,7 @@
\parindent \z@ \rightskip \@pnumwidth
\parfillskip -\@pnumwidth
{\leavevmode
- \fontfamily{\sfdefault}\fontseries{h}\fontsize{9\p@}{14\p@}\selectfont
+ \futuraheavy\fontsize{9\p@}{14\p@}\selectfont
#1}\par\vskip7\p@%
\nobreak
\global\@nobreaktrue
@@ -1324,6 +1611,13 @@
% \end{macrocode}
% \end{macro}
%
+% \begin{macro}{\@pnumwidth}
+% \changes{v2.0}{2023/04/08}{Redefined macro}
+% \begin{macrocode}
+\renewcommand{\@pnumwidth}{17pt}
+% \end{macrocode}
+% \end{macro}
+%
% \begin{macro}{\l@bchapter}
% \changes{v0.6}{2008/03/21}{Introduced macro}
% There is a special formatting of chapters in the brief table of
@@ -1337,7 +1631,7 @@
\parindent \z@ \rightskip \@pnumwidth
\parfillskip -\@pnumwidth
\leavevmode
- \fontfamily{\sfdefault}\fontseries{k}\fontsize{9\p@}{14\p@}\selectfont
+ \futurabook\fontsize{9\p@}{14\p@}\selectfont
#1\nobreak\leaders\hbox{$\m@th
\mkern \@dotsep mu\hbox{.}\mkern \@dotsep
mu$}\hfill
@@ -1414,6 +1708,14 @@
% \end{macrocode}
% \end{macro}
%
+% \begin{macro}{\turnoffbigpara}
+% \changes{v2.0}{2023/04/01}{Introduced macro}
+% And the code to manually turn it off
+% \begin{macrocode}
+\newcommand{\turnoffbigpara}{\@firstparafalse}
+% \end{macrocode}
+% \end{macro}
+%
% \begin{macro}{\@chapterart}
% We also keep track of the current artwork for chapter start:
% \begin{macrocode}
@@ -1460,22 +1762,22 @@
\refstepcounter{part}%
\addcontentsline{toc}{part}{\MakeUppercase{\partname}
\thepart\protect\linebreak\penalty\@highpenalty\MakeUppercase{#1}}%
- \addcontentsline{tbc}{bpart}{\MakeUppercase{\partname~\thepart: #1}}%
+ \addcontentsline{tbc}{bpart}{\MakeUppercase{\partname~\thepart: \futuraheavy #1}}%
\else
\addcontentsline{toc}{part}{\MakeUppercase{#1}}%
- \addcontentsline{tbc}{bpart}{\MakeUppercase{#1}}%
+ \addcontentsline{tbc}{bpart}{\MakeUppercase{\futuraheavy #1}}%
\fi
{\centering
\interlinepenalty \@M
\normalfont
\ifnum \c@secnumdepth >-2\relax
- \fontfamily{\sfdefault}\fontsize{80pt}{80pt}\fontseries{bc}\selectfont
+ \futuraboldc\fontsize{80pt}{80pt}\selectfont
\MakeUppercase{\partname\nobreakspace\thepart}%
\par
\vskip 0.45in%
\fi
- \fontfamily{\dgdefault}\fontsize{16pt}{16pt}\fontseries{br}\selectfont
- \MakeUppercase{#2}\par}%
+ \dogma \fontsize{16pt}{16pt}\selectfont
+ \MakeUppercase{\sochapter{#2}}\par}%
\@endpart}
% \end{macrocode}
% \end{macro}
@@ -1489,8 +1791,8 @@
\addcontentsline{toc}{part}{\MakeUppercase{#1}}%
\addcontentsline{tbc}{bpart}{\MakeUppercase{#1}}%
{\centering
- \fontfamily{\dgdefault}\fontsize{16pt}{16pt}\fontseries{br}\selectfont
- \MakeUppercase{#2}\par}%
+ \dogma \fontsize{16pt}{16pt}\selectfont
+ \MakeUppercase{\sochapter{#2}}\par}%
\@endpart}
% \end{macrocode}
% \end{macro}
@@ -1547,7 +1849,7 @@
\addcontentsline{tbc}{bchapter}{%
\chaptername~\thechapter:~#1}%
{\centering
- \fontfamily{\sfdefault}\fontseries{bc}\fontsize{120pt}{120pt}
+ \futuraboldc\fontsize{120pt}{120pt}
\selectfont
\thechapter\par\nobreak\vskip27pt}%
\else
@@ -1557,8 +1859,8 @@
\markboth{#1}{#1}%
\fi
{\centering
- \fontfamily{\dgdefault}\fontseries{br}\fontsize{16pt}{20pt}\selectfont
- \MakeUppercase{#2}\par}\nobreak\vskip25pt\relax%
+ \dogma\fontsize{16pt}{18pt}\selectfont
+ \MakeUppercase{\sochapter{#2}}\par}\nobreak\vskip25pt\relax%
\@firstparatrue
\@afterheading}%
% \end{macrocode}
@@ -1572,12 +1874,13 @@
\def\@schapter[#1]#2{%
\vspace*{2.747in}
{\centering
+ \phantomsection
\addcontentsline{toc}{chapter}{%
\MakeUppercase{#1}}%
\addcontentsline{tbc}{bchapter}{#1}%
\markboth{#1}{#1}%
- {\fontfamily{\dgdefault}\fontseries{br}\fontsize{16pt}{20pt}\selectfont
- \MakeUppercase{#2}\par}}\nobreak\vskip25pt\relax%
+ {\fontsize{16pt}{18pt}\selectfont
+ \MakeUppercase{\dogma \sochapter{#2}}\par}}\nobreak\vskip25pt\relax%
\@firstparatrue
\@afterheading}%
% \end{macrocode}
@@ -1629,6 +1932,53 @@
% \end{macrocode}
% \end{macro}
%
+% \begin{macro}{\chapterwithquote}
+% \changes{v2.0}{2023/04/08}{Introduced the command}
+% \begin{macrocode}
+\def\chapterwithquote{%
+ \clearpage
+ {\pagestyle{empty}\cleardoublepage}%
+ \everypar{}%
+ \thispagestyle{empty}%
+ \global\@topnum\z@
+ \@afterindentfalse
+ \gdef\@chapterart{}%
+ \secdef\@chapterwithquote\@schapter}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\@chapterwithquote}
+% \changes{v2.0}{2023/04/08}{Introduced the command}
+% \begin{macrocode}
+\def\@chapterwithquote[#1]#2#3#4{%
+ \vspace*{0.622in}
+ \ifnum \c@secnumdepth > \m@ne
+ \refstepcounter{chapter}%
+ \typeout{Chapter:\thechapter\space\@currentlabel}%
+ \markboth{\@chapapp~\thechapter}{#1}%
+ \typeout{\@chapapp\space\thechapter.}%
+ \addcontentsline{toc}{chapter}{\thechapter%
+ \protect\linebreak\penalty\@highpenalty
+ \MakeUppercase{#1}}%
+ \addcontentsline{tbc}{bchapter}{%
+ \chaptername~\thechapter:~#1}%
+ {\centering
+ \futuraboldc\fontsize{120pt}{120pt}
+ \selectfont
+ \thechapter\par\nobreak\vskip27pt}%
+ \else
+ \addcontentsline{toc}{chapter}{%
+ \MakeUppercase{#1}}%
+ \addcontentsline{tbc}{bchapter}{#1}%
+ \markboth{#1}{#1}%
+ \fi
+ {\centering
+ \dogma\fontsize{16pt}{18pt}\selectfont
+ \MakeUppercase{\sochapter{#2}}\par\vspace{.1in}\normalfont\fontsize{9pt}{11pt}\selectfont\textit{#3}\par\textit{\textemdash#4}\par}\nobreak\vskip25pt\relax%
+ \@firstparatrue
+ \@afterheading}%
+% \end{macrocode}
+% \end{macro}
+%
% \begin{macro}{\chapterart}
% \changes{v0.6}{2008/03/21}{Introduced the command}
% This creates the chapterart:
@@ -1655,7 +2005,7 @@
% \begin{macrocode}
\renewcommand{\section}{\everypar{}%
\@startsection{section}{1}{-0.75in}{16pt}{6pt}{%
- \fontfamily{\sfdefault}\fontseries{b}\fontsize{12pt}{16pt}\selectfont}}%
+ \sffamily \bfseries \fontsize{12pt}{16pt}\selectfont}}%
% \end{macrocode}
% \end{macro}
%
@@ -1664,8 +2014,8 @@
% \begin{macrocode}
\renewcommand{\subsection}{\everypar{}%
\@startsection{subsection}{2}{0pt}{14pt}{4pt}{%
- \fontfamily{\sfdefault}\fontshape{it}%
- \fontseries{bc}\fontsize{12pt}{17pt}\selectfont}}%
+ \futuraboldcoblique
+ \fontsize{12pt}{17pt}\selectfont}}%
% \end{macrocode}
% \end{macro}
%
@@ -1675,7 +2025,7 @@
% \begin{macrocode}
\renewcommand{\subsubsection}{\everypar{}%
\@startsection{subsubsection}{3}{0pt}{10pt}{2pt}{%
- \fontfamily{\sfdefault}\fontseries{bp}\fontsize{10pt}{14pt}%
+ \futuraboldc \fontsize{10pt}{14pt}%
\selectfont}}%
% \end{macrocode}
% \end{macro}
@@ -1722,7 +2072,7 @@
% This is the default list on the first level
% \begin{macrocode}
\def\@listi{\leftmargin\leftmargini
- \labelwidth\leftmargin\relax
+ \labelwidth\leftmargini\relax
\advance\labelwidth-\labelsep\relax
\parsep0\p@\relax
\topsep6\p@\relax
@@ -1809,7 +2159,16 @@
% \end{macrocode}
%
% \end{macro}
-%
+%
+% \begin{macro}{description}
+% \changes{v2.0}{2023/04/08}{Redefined}
+% \begin{macrocode}
+\renewenvironment{description}%
+ {\list{}{\labelwidth=0pt \leftmargin=18pt
+ \let\makelabel\descriptionlabel}}
+ {\endlist}
+% \end{macrocode}
+% \end{macro}
%
% \begin{macro}{quotation}
% In |quotation| environment the paragraphs are indented. We use
@@ -1841,10 +2200,9 @@
% Note is a special environment for asides. It is in italics with
% the word ``NOTE'' on the margin:
% \begin{macrocode}
-\newenvironment{note}{%
- \list{\makebox[0pt][r]{\fontfamily{%
- \dgdefault}\fontseries{b}\fontsize{9pt}{11pt}\selectfont
- NOTE\hspace{2em}}}{\listparindent0pt\relax
+\newenvironment{note}{%
+ \list{\makebox[0pt][r]{\dogma \fontsize{7.5pt}{12pt}
+ \colorbox{black}{\textcolor{white}{\sonote{NOTE}}}\hspace{2em}}}{\listparindent0pt\relax
\topsep9\p@\relax
\itemindent0\p@\relax
\rightmargin0\p@\relax
@@ -1855,7 +2213,17 @@
% \end{macrocode}
% \end{macro}
%
-%
+% \begin{macro}{plainlist}
+% \changes{v2.0}{2023/04/08}{Added macro}
+\newenvironment{plainlist}{%
+ \renewcommand{\descriptionlabel}[1]{\hspace{\labelsep}\textbf{##1}} % Add em space to description label
+ \begin{description}%
+ }{%
+ \renewcommand{\descriptionlabel}[1]{\hspace{\labelsep}\textbf{##1 \quad}} % Add em space to description label
+ \end{description}%
+}
+
+% \end{macro}
%
%\subsection{Footnotes}
%\label{sec:footnotes}
@@ -1898,7 +2266,7 @@
% \changes{v0.3}{2008/03/11}{Changed LaTeX defaults}
% We make some space between footnotes:
% \begin{macrocode}
-\setlength{\skip\footins}{16\p@ \@plus 4\p@ \@minus 0\p@}
+\setlength{\skip\footins}{20\p@ \@plus 4\p@ \@minus 0\p@}
% \end{macrocode}
%
% \end{macro}
@@ -1909,14 +2277,16 @@
% footnote text}
% We do not indent the footnotes:
% \begin{macrocode}
+% \renewcommand\@makefntext[1]{%
+% \parindent 0\p@%
+% \RaggedRightParindent0\p@%
+% \noindent
+% \@makefnmark\space#1}
\renewcommand\@makefntext[1]{%
- \parindent 0\p@%
- \RaggedRightParindent0\p@%
- \noindent
- \@makefnmark\space#1}
+\@thefnmark.~#1}
% \end{macrocode}
% \end{macro}
-%
+%
%
%\subsection{Tables, Figures and Listings}
%\label{sec:tbl_fig}
@@ -1938,49 +2308,103 @@
% \end{macrocode}
% \end{macro}
% \begin{macro}{\thelistings}
-% And the same for listings:
+% \changes{v1.4}{2020/04/24}{Added \cs{AtBeginDocument}}
+% And the same for listings. Note that listings package uses
+% \cs{AtBeginDocument}, so we need to postpone this
% \begin{macrocode}
-\renewcommand \thelstlisting
- {\ifnum \c@chapter>\z@ \thechapter-\fi \@arabic\c@lstlisting}
-% \end{macrocode}
+\AtBeginDocument{%
+ \renewcommand \thelstlisting
+ {\ifnum \c@chapter>\z@ \thechapter-\fi \@arabic\c@lstlisting}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% Default listings settings
+% \begin{macrocode}
+\lstset{
+ frame = lines,
+ showstringspaces=false,
+ tabsize=4,
+ title=\lstname,
+ numbers = none,
+ caption={},
+ literate={\ }{{\ }}1{"}{\textquotedbl}1,
+ escapeinside={(@}{@)},
+ captionpos=b,
+ basicstyle=\ttfamily,
+ columns=fullflexible,
+ moredelim=[is][\bfseries]{***}{***},
+ moredelim=[is][\itshape]{___}{___},
+ moredelim=[is][\bfseries\itshape]{&&&}{&&&},
+ aboveskip=8pt,
+}
+% \end{macrocode}
+%
+% \begin{macro}{codewide}
+% \changes{v2.0}{2023/4/08}{Added environment}
+% \begin{macrocode}
+\lstnewenvironment
+ {codewide}[1][]
+ {
+ \renewcommand{\codewingding}[1]
+ {\ding{\the\numexpr ##1 + 181 \relax}}
+ \captionsetup[lstlisting]{font=nostarchfigfont,singlelinecheck=off,
+ aboveskip=4pt, belowskip=-12pt, margin=-70pt}
+ \lstset{
+ frame = lines,
+ showstringspaces=false,
+ tabsize=4,
+ title=\lstname,
+ numbers = none,
+ literate={\ }{{\ }}1{"}{\textquotedbl}1,
+ escapeinside={(@}{@)},
+ captionpos=b,
+ caption={},
+ basicstyle=\ttfamily,
+ columns=fullflexible,
+ moredelim=[is][\bfseries]{***}{***},
+ moredelim=[is][\itshape]{___}{___},
+ moredelim=[is][\bfseries\itshape]{&&&}{&&&},
+ xleftmargin=-70pt,
+ aboveskip=8pt,
+ #1
+ }}
+ {
+ \renewcommand{\codewingding}[1]
+ {\vbox{\llap{\wingding{#1}\hskip 0.5em}}}
+ \captionsetup[lstlisting]{font=nostarchfigfont,singlelinecheck=off,
+ aboveskip=4pt, belowskip=0pt, margin=0pt}}
+% \end{macrocode}
+% \end{macro}
+%
+%
+% Fonts for captions
+% \begin{macrocode}
+\DeclareCaptionFont{nostarchfigfont}{\sffamily \itshape \fontsize{8.5pt}{9pt}\selectfont}
+\DeclareCaptionFont{nostarchtabfont}{\futurabook \fontsize{9pt}{9pt}\selectfont}
+\captionsetup[figure]{font=nostarchfigfont,singlelinecheck=off,
+ aboveskip=8pt,belowskip=-8pt}
+\captionsetup[lstlisting]{font=nostarchfigfont,singlelinecheck=off,
+ aboveskip=4pt, belowskip=0pt}
+\captionsetup[table]{font=nostarchtabfont,singlelinecheck=off,
+ aboveskip=0pt,belowskip=4pt, labelfont=bf}
+% \end{macrocode}
+%
+% \begin{macro}{\captionlst}
+% \begin{macro}{\boxlst}
+% \begin{macro}{\tablelst}
+\newcommand{\captionlst}[1]{{\ttfamily \itshape \fontsize{10pt}{9pt}\selectfont #1}}
+\newcommand{\boxlst}[1]{{\ttfamily \fontsize{10pt}{9pt}\selectfont #1}}
+\newcommand{\tablelst}[1]{{\ttfamily \fontsize{10pt}{9pt}\selectfont #1}}
% \end{macro}
-%
-%
-% \begin{macro}{nostarchfigfmt}
-% This is our captions format for figures and listings
-% \changes{v0.3}{2008/03/11}{Added style}
-% \begin{macrocode}
-\DeclareCaptionFormat{nostarchfigfmt}{\fontfamily{\sfdefault}%
- \fontshape{it}\fontsize{8.5pt}{9pt}\fontseries{k}\selectfont\unskip#1#2#3}
-% \end{macrocode}
% \end{macro}
-% \begin{macro}{nostarchtabfmt}
-% \changes{v0.3}{2008/03/11}{Added style}
-% This is our captions format for tables
-% \begin{macrocode}
-\DeclareCaptionFormat{nostarchtabfmt}{\fontfamily{\sfdefault}%
- \fontshape{rm}\fontsize{8.5pt}{9pt}\fontseries{h}\selectfont\unskip#1#2%
- \fontseries{k}\selectfont#3}
-% \end{macrocode}
% \end{macro}
-%
-%
-%
-% The figure, listing and and table styles:
-% \begin{macrocode}
-\captionsetup[figure]{format=nostarchfigfmt,singlelinecheck=off,
- aboveskip=8pt,belowskip=8pt}
-\captionsetup[lstlisting]{format=nostarchfigfmt,singlelinecheck=off,
- aboveskip=8pt,belowskip=8pt}
-\captionsetup[table]{format=nostarchtabfmt,singlelinecheck=off,
- aboveskip=0pt,belowskip=4pt}
-% \end{macrocode}
%
% \begin{macro}{\tbfont}
% This is the font used for table body:
% \begin{macrocode}
\def\tbfont{%
- \fontfamily{\sfdefault}\fontseries{k}\fontsize{8pt}{10pt}\selectfont}
+ \futurabook\fontsize{8.5pt}{10pt}\selectfont}
% \end{macrocode}
% \end{macro}
%
@@ -1988,10 +2412,12 @@
% Font for table headers:
% \begin{macrocode}
\def\thfont{%
- \fontfamily{\sfdefault}\fontseries{h}\fontsize{8pt}{10pt}\selectfont}
+ \futuraheavy\fontsize{9pt}{10pt}\selectfont}
% \end{macrocode}
% \end{macro}
-%
+% \begin{macrocode}
+\AtBeginEnvironment{tabular}{\tbfont}
+% \end{macrocode}
%
% \begin{macro}{\heawyrulewidth}
% \begin{macro}{\lightrulewidth}
@@ -1999,7 +2425,7 @@
% Changing \progname{booktabs} defaults:
% \begin{macrocode}
\heavyrulewidth=3\p@
-\lightrulewidth=1.5\p@
+\lightrulewidth=1\p@
\cmidrulewidth=1.5\p@
% \end{macrocode}
% \end{macro}
@@ -2034,7 +2460,54 @@
% \end{macro}
% \end{macro}
%
+% \begin{macro}{tablewide}
+% Wide table
+% \begin{macrocode}
+\newenvironment{tablewide}[1][]
+ {
+ \captionsetup[table]{font=nostarchtabfont,singlelinecheck=off,
+ aboveskip=0pt,belowskip=4pt, labelfont=bf, margin=-70pt}
+ \begin{table}[#1]
+ }
+ {
+ \end{table}
+ \captionsetup[table]{font=nostarchtabfont,singlelinecheck=off,
+ aboveskip=0pt,belowskip=4pt, labelfont=bf, margin=0pt}
+ }
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{tabularwide}
+% Wide tabular
+% \begin{macrocode}
+\newenvironment{tabularwide}[1]
+ {
+ \hspace*{-72pt}
+ \begin{tabular}{#1}
+ }
+ {
+ \end{tabular}
+ }
+% \end{macrocode}
+% \end{macro}
%
+% \begin{macro}{figurewide}
+% Wide figure
+% \begin{macrocode}
+ \newenvironment{figurewide}[1][]
+ {
+ \captionsetup[figure]{font=nostarchfigfont,singlelinecheck=off,
+ aboveskip=8pt,belowskip=-8pt, margin=-70pt}
+ \begin{figure}[#1]
+ \hspace*{-70pt}
+ }
+ {
+ \end{figure}
+ \captionsetup[figure]{font=nostarchfigfont,singlelinecheck=off,
+ aboveskip=8pt,belowskip=-8pt}
+ }
+% \end{macrocode}
+% \end{macro}
%
%\subsection{Verbatim and Listings Customization}
%\label{sec:verbatim}
@@ -2042,7 +2515,7 @@
% \begin{macro}{Code}
% This is for framed code:
% \begin{macrocode}
-\DefineVerbatimEnvironment{Code}{Verbatim}{frame=lines,framerule=0.25pt}
+\DefineVerbatimEnvironment{Code}{Verbatim}{frame=lines,framerule=0.25pt, commandchars=\\\{\}}
% \end{macrocode}
% \end{macro}
%
@@ -2059,17 +2532,184 @@
\VerbatimFootnotes
% \end{macrocode}
%
-% We set up captions with \progname{captions}:
-% \begin{macrocode}
-\lstset{captionpos=b}
-% \end{macrocode}
-%
-% And make the code to be in typewriter font:
-% \begin{macrocode}
-\lstset{basicstyle=\ttfamily,columns=fullflexible}
-% \end{macrocode}
-%
%
+%\subsection{Boxes and projects}
+%\label{sec:boxes}
+%
+% Various boxes.
+%
+% \begin{macro}{nspgray}
+% The color for boxes
+% \begin{macrocode}
+\definecolor{nspgray}{cmyk}{0, 0, 0, 0.1}
+% \end{macrocode}
+% \end{macro}
+%
+% And various mdframed styled boxes
+% \begin{macrocode}
+\mdfdefinestyle{nspbox}{%
+ linecolor=black,
+ outerlinewidth=1pt,
+ roundcorner=5pt,
+ innertopmargin=\baselineskip,
+ innerbottommargin=\baselineskip,
+ innerrightmargin=18pt,
+ innerleftmargin=18pt,
+ backgroundcolor=nspgray,
+ }
+
+\mdfdefinestyle{custombox}{%
+ linecolor=black,
+ outerlinewidth=1pt,
+ roundcorner=5pt,
+ innertopmargin=\baselineskip,
+ innerbottommargin=\baselineskip,
+ innerrightmargin=18pt,
+ innerleftmargin=18pt,
+ }
+\newenvironment{nspbox}[1]
+{\begin{mdframed}[style=nspbox]
+ \begin{center}
+ {\dogma \fontsize{9pt}{15pt} \MakeUppercase{\sobox{#1}}}
+ \end{center}
+ \begin{flushright}
+ \begin{flushleft}
+ \parskip=.5\baselineskip
+ \tbfont
+}
+{\end{flushleft}\end{flushright}
+\end{mdframed}}
+\newenvironment{nspboxcontinued}
+{\begin{mdframed}[style=nspbox]
+ \begin{flushright}
+ \begin{flushleft}
+ \parskip=.5\baselineskip
+ \tbfont
+}
+{
+\end{flushleft}
+\end{flushright}
+\end{mdframed}}
+\newenvironment{custombox}[1]
+{\begin{mdframed}[style=custombox]
+ \begin{center}
+ {\dogma \fontsize{9pt}{15pt} \MakeUppercase{\sobox{#1}}}
+ \end{center}
+ \begin{flushright}
+ \begin{flushleft}
+ \parskip=.5\baselineskip
+ \tbfont
+}
+{\end{flushleft}\end{flushright}
+\end{mdframed}}
+
+\newenvironment{customboxcontinued}
+{\begin{mdframed}[style=custombox]
+ \begin{flushright}
+ \begin{flushleft}
+ \parskip=.5\baselineskip
+ \tbfont
+}
+{
+\end{flushleft}
+\end{flushright}
+\end{mdframed}}
+
+\newcommand{\continued}[0]{%
+ {\begin{flushright}%
+ \emph{(continued)}%
+ \end{flushright}}%
+}
+% \end{macrocode}
+%
+%
+% Project stuff
+% \begin{macrocode}
+\newcounter{project}
+\stepcounter{project}
+\newcommand{\projecthead}[1]{
+ \vspace{16pt}%
+ \noindent%
+ \hspace{-.75in}%
+ \addcontentsline{toc}{boldsection}{Project~\#\theproject: #1}%
+ {\sffamily\bfseries\fontsize{12pt}{16pt}\selectfont
+ \colorbox{black}{\textcolor{white}{Project~\#\theproject: #1}}}%
+ \vspace{6pt}%
+ \@afterindentfalse\@afterheading%
+ \refstepcounter{project}%
+}
+% \end{macrocode}
+%
+%
+%\subsection{Margin notes}
+%\label{sec:margins}
+%
+% Filenames on margins
+% \begin{macrocode}
+\renewcommand*{\marginfont}{\sffamily\itshape\fontsize{8.5}{10}\selectfont}
+\renewcommand*{\marginnotevadjust}{-\baselineskip}
+\newcommand{\marginwingding}[1]{{\fontsize{10pt}{12pt}\selectfont \wingding{#1}}}
+% \end{macrocode}
+%
+% Code below makes the margin note always on the left, taken from:
+% \url{https://tex.stackexchange.com/questions/472728/marginnote-always-on-left-side-of-the-page}
+% \begin{macrocode}
+\long\def\@mn@@@marginnote[#1]#2[#3]{%
+ \begingroup
+ \ifmmode\mn@strut\let\@tempa\mn@vadjust\else
+ \if@inlabel\leavevmode\fi
+ \ifhmode\mn@strut\let\@tempa\mn@vadjust\else\let\@tempa\mn@vlap\fi
+ \fi
+ \@tempa{%
+ \vbox to\z@{%
+ \vss
+ \@mn@margintest
+ \if@reversemargin\if@tempswa
+ \@tempswafalse
+ \else
+ \@tempswatrue
+ \fi\fi
+
+ \llap{%
+ \vbox to\z@{\kern\marginnotevadjust\kern #3
+ \vbox to\z@{%
+ \hsize\marginparwidth
+ \linewidth\hsize
+ \kern-\parskip
+ %\mn@parboxrestore
+ \marginfont\raggedleftmarginnote\strut\hspace{\z@}%
+ \ignorespaces#1\endgraf
+ \vss
+ }%
+ \vss
+ }%
+ \if@mn@verbose
+ \PackageInfo{marginnote}{xpos seems to be \@mn@currxpos}%
+ \fi
+ \begingroup
+ \ifx\@mn@currxpos\relax\else\ifx\@mn@currpos\@empty\else
+ \kern\@mn@currxpos
+ \fi\fi
+ \ifx\@mn@currpage\relax
+ \let\@mn@currpage\@ne
+ \fi
+ \if@twoside\ifodd\@mn@currpage\relax
+ \kern-\oddsidemargin
+ \else
+ \kern-\evensidemargin
+ \fi
+ \else
+ \kern-\oddsidemargin
+ \fi
+ \kern-1in
+ \endgroup
+ \kern\marginparsep
+ }%
+ }%
+ }%
+ \endgroup
+}
+% \end{macrocode}
%
%\subsection{Bibliography}
%\label{sec:biblio}
@@ -2093,9 +2733,9 @@
\addcontentsline{toc}{chapter}{\MakeUppercase{\bibname}}%
\addcontentsline{tbc}{bchapter}{\bibname}%
{\centering
- {\fontfamily{\dgdefault}\fontseries{br}\fontsize{16pt}{20pt}\selectfont
- \MakeUppercase{\bibname}\par}}\nobreak\vskip25pt\relax%
- \@mkboth{\MakeUppercase\bibname}{\MakeUppercase\bibname}}}%
+ {\dogma\fontsize{16pt}{20pt}\selectfont
+ \MakeUppercase{\sochapter{\bibname}}\par}}\nobreak\vskip25pt\relax%
+ \@mkboth{\bibname}{\bibname}}}%
% \end{macrocode}
%
% \end{macro}
@@ -2129,6 +2769,15 @@
%
%\subsection{Index}
%\label{sec:index}
+%
+% \begin{macro}{\term}
+% \changes{v2.0}{2023/04/04}{Introduced the macro}
+% An indexed term
+% \begin{macrocode}
+\newcommand{\term}[1]{\emph{#1}\index{#1}}
+% \end{macrocode}
+% \end{macro}
+%
% \begin{macro}{theindex}
% \changes{v0.6}{2008/03/22}{Introduced the macro}
% We want our index to be in the table of contents too:
@@ -2152,12 +2801,12 @@
\addcontentsline{toc}{chapter}{\MakeUppercase{\indexname}}%
\addcontentsline{tbc}{bchapter}{\indexname}%
{\centering
- {\fontfamily{\dgdefault}\fontseries{br}%
+ {\dogma%
\fontsize{16pt}{20pt}\selectfont
- \MakeUppercase{\indexname}\par}}%
+ \MakeUppercase{\sochapter{\indexname}}\par}}%
\nobreak\vskip25pt\relax]%
- \@mkboth{\MakeUppercase\indexname}%
- {\MakeUppercase\indexname}%
+ \@mkboth{\indexname}%
+ {\indexname}%
\parindent\z@
\parskip\z@ \@plus .3\p@\relax
\columnseprule \z@
@@ -2201,7 +2850,7 @@
% \changes{v0.6}{2008/03/22}{Introduced the macro}
% When an index starts a new letter, we call this macro:
% \begin{macrocode}
-\newcommand\indexgroup[1]{{\fontfamily{\sfdefault}%
+\newcommand\indexgroup[1]{{\futuraboldc
\fontseries{bc}\fontsize{11\p@}{13\p@}\selectfont#1}\par\vskip4\p@}
% \end{macrocode}
% \end{macro}
@@ -2236,9 +2885,9 @@
\gdef\@chapterart{}%
\vspace*{1.875in}%
{\centering
- \fontfamily{\dgdefault}\fontseries{br}%
+ \dogma%
\fontsize{16pt}{20pt}\selectfont
- \MakeUppercase{\updatesname}\par\nobreak\vskip40\p@}%
+ \MakeUppercase{\sochapter{\updatesname}}\par\nobreak\vskip40\p@}%
\@nobreaktrue
\everypar{%
\if@nobreak
@@ -2271,10 +2920,10 @@
\global\@topnum\z@
\gdef\@chapterart{}%
\vspace*{0.875in}%
- {\centering
- \fontfamily{\dgdefault}\fontseries{br}%
- \fontsize{16pt}{20pt}\selectfont
- \MakeUppercase{\colophonname}\par\nobreak\vskip40\p@}%
+ %{\centering
+ %\dogma%
+ % \fontsize{16pt}{20pt}\selectfont
+ %\MakeUppercase{\sochapter{\colophonname}}\par\nobreak\vskip40\p@}%
\@nobreaktrue
\everypar{%
\if@nobreak
@@ -2286,9 +2935,10 @@
\everypar{}%
\fi}\par
The fonts used in \emph{\@title} are New Baskerville, Futura, The
- Sans Mono Condensed and Dogma. The book was typeset with
+ Sans Mono Condensed, and Dogma. The book was typeset with
\LaTeXe{} package
- \texttt{nostarch} by Boris Veytsman
+ \texttt{nostarch} by Boris Veytsman with many additions by Alex
+ Freed and other members of the \emph{No Starch Press} team
\emph{(\csname ver@nostarch.cls\endcsname).}\par}
% \end{macrocode}
% \end{macro}
diff --git a/macros/latex/contrib/nostarch/nostarch.ins b/macros/latex/contrib/nostarch/nostarch.ins
index 91f669c2e8..3b8c2ffe07 100644
--- a/macros/latex/contrib/nostarch/nostarch.ins
+++ b/macros/latex/contrib/nostarch/nostarch.ins
@@ -1,7 +1,7 @@
%
% Doctrip file for nostarch
% This file is in public domain
-% $Id: nostarch.ins,v 1.3 2008-03-23 21:48:10 boris Exp $
+% $Id$
%
\def\batchfile{nostarch.ins}
\input docstrip
diff --git a/macros/latex/contrib/nostarch/nostarch.pdf b/macros/latex/contrib/nostarch/nostarch.pdf
index 47bc20db72..b5c2467124 100644
--- a/macros/latex/contrib/nostarch/nostarch.pdf
+++ b/macros/latex/contrib/nostarch/nostarch.pdf
Binary files differ
diff --git a/macros/latex/contrib/nostarch/nssample.pdf b/macros/latex/contrib/nostarch/nssample.pdf
index 2ce6ca2829..80f59d139d 100644
--- a/macros/latex/contrib/nostarch/nssample.pdf
+++ b/macros/latex/contrib/nostarch/nssample.pdf
Binary files differ
diff --git a/macros/latex/contrib/nostarch/nssample.tex b/macros/latex/contrib/nostarch/nssample.tex
index 9d56e2676a..ff4cadaeb9 100644
--- a/macros/latex/contrib/nostarch/nssample.tex
+++ b/macros/latex/contrib/nostarch/nssample.tex
@@ -1,4 +1,4 @@
-\documentclass[cfonts]{nostarch}
+\documentclass[cfonts,nofontsdir]{nostarch}
\usepackage{lipsum}
\hyphenation{ve-sti-bu-lum sene-c-tus rut-rum con-sec-te-tu-er
elei-fend no-num-my li-be-ro}
diff --git a/macros/latex/contrib/photobook/DEPENDS.txt b/macros/latex/contrib/photobook/DEPENDS.txt
index 1b2a77253b..6392841844 100644
--- a/macros/latex/contrib/photobook/DEPENDS.txt
+++ b/macros/latex/contrib/photobook/DEPENDS.txt
Binary files differ
diff --git a/macros/latex/contrib/photobook/Makefile b/macros/latex/contrib/photobook/Makefile
index 7bebae3ec8..769c5c2ac4 100644
--- a/macros/latex/contrib/photobook/Makefile
+++ b/macros/latex/contrib/photobook/Makefile
@@ -226,6 +226,7 @@ LN := cp -l
# strip docs out...
#
# XXX can we unify these???
+# ....not sure how...
%-stripped.tex: %.tex
$(DOC) --strip $< \
$(DOC) --prefix M --strip \
@@ -244,11 +245,14 @@ LN := cp -l
# list of dependencies...
#
+# NOTE: grep's -z flag generates a bunch if nulls that we need to clean
+# out via tr.
DEPENDS.txt: $(MODULE).cls
cat $< \
- | egrep -zo '\s*\\RequirePackage(\[[^]]*\])?\{[^}]*\}' \
- | sed 's/.*{\(.*\)}/hard \1\n/' \
+ | grep -Ezo '\s*\\RequirePackage(\[[^]]*\])?\{[^}]*\}' \
+ | sed -e 's/.*{\(.*\)}/hard \1\n/' \
| grep -a hard \
+ | tr -d '\000' \
> $@
@@ -265,6 +269,9 @@ version:
#----------------------------------------------------------------------
# Main targets...
+.PHONY: dep
+dep: DEPENDS.txt
+
.PHONY: pdf
pdf: $(MODULE).pdf
@@ -338,7 +345,7 @@ tag:
.PHONY: all
-all: pdf
+all: pdf dep
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
diff --git a/macros/latex/contrib/photobook/photobook.cls b/macros/latex/contrib/photobook/photobook.cls
index 0ade3c4ac0..74f8b8f5e1 100644
--- a/macros/latex/contrib/photobook/photobook.cls
+++ b/macros/latex/contrib/photobook/photobook.cls
@@ -33,8 +33,32 @@
% to edit it directly, edit the source instead.
%
%
-% XXC FEATURE image spread: add ability to push image sides outward to
-% account for gutter.,,
+%
+% XXX ASAP \bindingoffset should also affect fill/bleed images... (DONE)
+% ...shift the macros that optionally account for \bindingoffset to
+% account for \gutteroffset (DONE)
+% ...everything should respect \bindingoffset (DONE)
+% XXX ASAP add \gutteroffset and \gutterimageoffset to offset content
+% from the gutter
+% \gutterimageoffset is an additional offset added to bleed images...
+% ...currently \bindingoffset is used for both...
+% Q: should the gutter offsets be counted from the \bindingoffset???
+%
+% +-------------------------------=--
+% | . . . =
+% | . . . =
+% | . . <-> \bindingoffset
+% | . . . =
+% | . <--> = \gutteroffset
+% | . . . =
+% | <--> . = \gutterimageoffset
+% | . . . =
+% +-------------------------------=--
+%
+% XXX DOC...
+%
+%
+%
% XXX revise \clearcaption / \captionclearpage...
% XXX unify API -- see CellContent env...
% XXX make this loadable both as a class and as a package...
@@ -76,8 +100,8 @@
%%% NOTE: \def\<module-name>@[A-Z]+ macros will be visible to both the
%%% code and the generated docs...
-\edef\photobook@FILEVERSION{v0.1.15}
-\edef\photobook@FILEDATE{2023-03-18}
+\edef\photobook@FILEVERSION{v0.1.17}
+\edef\photobook@FILEDATE{2023-04-09}
%% \documentclass{ltxdoc}
@@ -224,6 +248,8 @@
%% \DescribeMacro{blockwidth=<len>}
%% \DescribeMacro{blockheight=<len>}
%% \DescribeMacro{bindingoffset=<len>}
+%% \DescribeMacro{gutteroffset=<len>}
+%%% \DescribeMacro{gutterimageoffset=<len>}
%% \DescribeMacro{bleed=<len>}
%
%% This is similar to what |geometry| does, but adds bleed support.
@@ -231,39 +257,45 @@
%% \begin{minipage}{\textwidth}
%% \begin{verbatim}
%%
-%% <---> bleed <---> bleed
-%%
-%% + - - - - - - - - - - - - - - - - - - - - - + - + ^
-%% . . . | bleed
-%% . +---------------------------------------+----- v . . ---
-%% . | ^ . = .
-%% . | . . . . . . | . . = . ^
-%% . |<-- blockwidth ----------------------->= . |
-%% . | . | . . = . |
-%% . | | . = . textheight
-%% . | . Page | . . = . |
-%% . | blockheight . = . |
-%% . | . | . . = . |
-%% . | | <---> bindingoffset |
-%% . | . . . . . . | . . = . v
-%% . | v . = .
-%% . +---------------------------------------+----- ^ . . ---
-%% . . . . | bleed
-%% + - - - - - - - - - - - - - - - - - - - - - + - + v
-%% . .
-%% | <-- textwidth --------------> . |
-%% ^ gutter
+%% <---> bleed <---> bleed
+%%
+%% + - - - - - - - - - - - - - - - - - - - - - - + - + ^
+%% . . . | bleed
+%% . +-----------------------------------------+----- v . . ---
+%% . | ^ . . = .
+%% . | . . . . . . | . . . = . ^
+%% . |<-- blockwidth ------------------------->= . |
+%% . | . | . . . = . |
+%% . | | . . = . textheight
+%% . | . Page | . . . = . |
+%% . | blockheight . . = . |
+%% . | . | . . <--> bindingoffset |
+%% . | | . . = . |
+%% . | . . . . . . | . <--> gutteroffset v
+%% . | v . . = .
+%% . +-----------------------------------------+----- ^ . . ---
+%% . . . . | bleed
+%% + - - - - - - - - - - - - - - - - - - - - - - + - + v
+%% . .
+%% | <-- textwidth --------------> . |
+%% ^ gutter
%%
%% \end{verbatim}
%% \end{minipage}
%%
+%% Note that all macros respect |\bindingoffset| but only some macros
+%% account for |\gutteroffset|, namely macros that do not display content
+%% with bleeds.
+%%
% NOTE: if blockwidth/blockheight are set they will force recalculations
% and overriding of the paperwidth/paperheight if they were changed
% by the user code anywhere between \documentclass[..]{photobook}
% and \begin{document}...
\DeclareStringOption{blockwidth}
\DeclareStringOption{blockheight}
-\DeclareStringOption[0pt]{bindingoffset}[10mm]
+\DeclareStringOption[0pt]{bindingoffset}[0mm]
+\DeclareStringOption[0pt]{gutteroffset}[0mm]
+\DeclareStringOption[0pt]{gutterimageoffset}[0mm]
\DeclareStringOption[5mm]{bleed}[5mm]
%% \DescribeMacro{flatfold=<len>}
@@ -296,6 +328,7 @@
%
%% \DescribeMacro{layoutmode=<layout>}
%% \DescribeMacro{block}
+%% \DescribeMacro{spread}
%% \DescribeMacro{endpaper}
%% \DescribeMacro{cover}
%% \DescribeMacro{jacket}
@@ -326,9 +359,9 @@
%% \end{minipage}
%%
%%
-%% |endpaper|:
+%% |spread|/|endpaper|:
%%
-%% Endpaper layout.
+%% Spread/endpaper layout.
%%
% XXX should this use \flatfold???
%% \begin{minipage}{\textwidth}
@@ -340,7 +373,7 @@
%% +---------------+---------------+
%% | . |
%% | . |
-%% | endpaper |
+%% | spread |
%% | . |
%% | . |
%% +---------------+---------------+
@@ -348,6 +381,9 @@
%% \end{verbatim}
%% \end{minipage}
%%
+%% Note that |endpaper| is simply an alias to |spread|, this helps make
+%% the book source to be more semantic and readable.
+%%
%%
%% |cover|
%%
@@ -422,7 +458,7 @@
%% \end{verbatim}
%% \end{minipage}
%%
-%% Note that for |cover|, |endpaper|, and |jacket|,
+%% Note that for |cover|, |spread|/|endpaper|, and |jacket|,
%% \href{https://ctan.org/pkg/fancyhdr}{fancyhdr}'s |\pagestyle{..}| is
%% set to |empty| by default.
%%
@@ -436,6 +472,7 @@
\@DeclareLiteralOptionTo{layoutmode}{block}
%\@DeclareLiteralOptionTo{layoutmode}{web}
\@DeclareLiteralOptionTo{layoutmode}{endpaper}
+\@DeclareLiteralOptionTo{layoutmode}{spread}
% XXX add overhang...
% XXX minght be a good idea to add cover types as separate values and
% preset defeaults per type, e.g:
@@ -671,6 +708,7 @@
\newif\ifhardcoverlayout
\newif\ifsoftcoverlayout
\newif\ifendpaperlayout
+\newif\ifspreadlayout
\newif\ifjacketlayout
% aggregates...
\newif\ifcoverlikelayout
@@ -776,9 +814,25 @@
%
%% Binding offset
%%
+%% Used to offset content to account glue-up/roughing of pages for certain
+%% types of binds like perfect binds.
+%%
\newlength\bindingoffset
\setlength\bindingoffset{\photobook@bindingoffset}
+%% \DescribeMacro{\gutteroffset=<len>}
+%%% \DescribeMacro{\gutterimageoffset=<len>}
+%
+%% Gutter offsets
+%%
+%% Mainly used to offset content without bleeds away from or into the
+%% gutter.
+%%
+\newlength\gutteroffset
+\setlength\gutteroffset{\photobook@gutteroffset}
+\newlength\gutterimageoffset
+\setlength\gutterimageoffset{\photobook@gutterimageoffset}
+
%% \DescribeMacro{\defaultfoldout=<fold-spec>}
%
%% Set the default fold specification.
@@ -972,6 +1026,7 @@
\hardcoverlayoutfalse
\softcoverlayoutfalse
\endpaperlayoutfalse
+ \spreadlayoutfalse
\jacketlayoutfalse
\coverlikelayoutfalse
\blocklayoutfalse
@@ -989,7 +1044,11 @@
\ifdefstring{\layoutmode}{jacket}{%
\jacketlayouttrue
\coverlikelayouttrue }{}
+ \ifdefstring{\layoutmode}{spread}{
+ \spreadlayouttrue
+ \endpaperlayouttrue }{}
\ifdefstring{\layoutmode}{endpaper}{
+ \spreadlayouttrue
\endpaperlayouttrue }{}
% pdf layout...
\ifx\photobook@pdfpagelayout\empty
@@ -1087,8 +1146,8 @@
+ 2\jacketwrap
+ \photobook@jacketflapfront@active
+ \photobook@jacketflapback@active \relax}\fi
- % layout: endpaper...
- \ifendpaperlayout
+ % layout: spread/endpaper...
+ \ifspreadlayout
\pagestyle{empty}%
\readlist*\pagefoldpanels{%
\the\pageblockwidth,
@@ -1096,7 +1155,7 @@
\photobook@setpagefold{in}
\setlength\blockwidth{2\blockwidth}\fi\fi
\ifdim\blockheight=0pt
- % layout: block / endpaper...
+ % layout: block / spread...
\setlength\blockheight{
\ifx\photobook@blockheight\empty
\dimexpr \paperheight - 2\bleed \relax
@@ -2909,22 +2968,30 @@
%% \end{verbatim}
%% \end{minipage}
%%
-%% The star version accounts for |\bindingoffset|.
+%% The star version accounts for |\gutteroffset|.
%%
%% Note that |layoutmode|'s other than block will change the paper size
%% but will not affect this either in size (block size) or in position
%% (top-left).
%%
+%\newenvironment{pagecell}{%
+% \begin{cell*}{\bleed,\bleed}{\pageblockwidth}{\pageblockheight}%
+%}{%
+% \end{cell*}}
\newenvironment{pagecell}{%
- \begin{cell*}{\bleed,\bleed}{\pageblockwidth}{\pageblockheight}%
+ \begin{cell*}{%
+ \bleed + \ifnumodd{\thepage}{\bindingoffset}{0pt},%
+ \bleed}%
+ {\pageblockwidth - \bindingoffset}%
+ {\pageblockheight}%
}{%
\end{cell*}}
\newenvironment{pagecell*}{%
\begin{cell*}{%
- \bleed + \ifnumodd{\thepage}{\bindingoffset}{0pt},%
+ \bleed + \ifnumodd{\thepage}{\bindingoffset + \gutteroffset}{0pt},%
\bleed}%
- {\pageblockwidth - \bindingoffset}%
+ {\pageblockwidth - \bindingoffset - \gutteroffset}%
{\pageblockheight}%
}{%
\end{cell*}}
@@ -3754,7 +3821,7 @@
% create the actual cell...
\setlength\cellparentwidth{\cellwidth}%
\setlength\cellparentheight{\cellheight}%
- \setlength\cellwidth{#1\pageblockwidth}%
+ \setlength\cellwidth{#1\pageblockwidth - #1\bindingoffset}%
\setlength\cellheight{\pageblockheight}%
%
\savecell{photobook@spreadtopages}{\cellwidth}{\cellheight}{\BODY}%
@@ -5175,7 +5242,7 @@
\begin{page}
\setlength{\parindent}{0em}
% NOTE: only the relevant blocks will be visible...
- \ifendpaperlayout%
+ \ifspreadlayout%
\begin{leftside}
\photobook@TemplateCell[#1]{ENDPAPER LEFT}
\end{leftside}
@@ -5207,7 +5274,7 @@
\newcommand\ShowMarks[1][1pt]{%
% general...
% XXX corners / cut marks...
- \ifendpaperlayout%
+ \ifspreadlayout%
% XXX fold...
\fi%
\ifcoverlikelayout%
@@ -5329,7 +5396,61 @@
+ ((#2 mm) * 2)
\relax}}
-% XXX DOC...
+
+%% \DescribeMacro{\pdfspreadstopages\{..\}}
+%
+%% \EXPERIMENTAL
+%%
+%% Include spreads from a pdf block as pages
+%%
+%% >> \pdfspreadstopages[<delta>]{<block-pdf>}
+%%
+%% |\pdfspreadstopages{..}| inserts an empty page before the first page
+%% in the block to push it to the right of the spread.
+%%
+%% To display other pages consistently it is recommended to set the
+%% block width to |2\blockwidth| and set the |pdfpagelayout| to be
+%% set to |SinglePage|, a simple way to do both is to:
+%%
+%% >> \ChangeLayout{spread}
+%%
+% XXX do we need to set the page format to double block width here???
+% XXX TEST...
+\newcommand\pdfspreadstopages[2][0mm]{%
+ \includepdf[pages={{},1-}, nup=2x1, delta=#1 #1]{#2}}
+
+
+% XXX include the cover with the foldouts removed...
+\newcommand\pdfcover[1]{%
+ % XXX crop to frontcover cell..
+ \includepdf{#1}}
+% XXX include cover cells....
+\newcommand\pdfcoverfront[1]{%
+ % XXX crop to frontcover cell..
+ \includepdf{#1}}
+\newcommand\pdfcoverback[1]{%
+ % XXX crop to backcover cell..
+ \includepdf{#1}}
+% XXX do we need this???
+%\newcommand\pdfendpaper[1]{%
+% \includepdf{#1}}
+
+
+% XXX
+% XXX do we include endpapers??:
+\newcommand\pdfweb[2]{%
+ \pdfcoverfront{#1}%
+ \pdfspreadstopages{#2}%
+ \pdfcoverback{#1}}
+
+
+
+
+%% \DescribeMacro{\TEX}
+%% \DescribeMacro{\LATEX}
+%
+%% Convenience macros to display \TeX and \LaTeX in the correct font.
+%%
\def\TEX{%
{\fontfamily{lmr}\selectfont \TeX}}
\def\LATEX{%
diff --git a/macros/latex/contrib/photobook/photobook.pdf b/macros/latex/contrib/photobook/photobook.pdf
index cf3f1d0754..82e080074f 100644
--- a/macros/latex/contrib/photobook/photobook.pdf
+++ b/macros/latex/contrib/photobook/photobook.pdf
Binary files differ
diff --git a/macros/latex/contrib/photobook/scripts/README.md b/macros/latex/contrib/photobook/scripts/README.md
index 2e00881f70..7befc14228 100644
--- a/macros/latex/contrib/photobook/scripts/README.md
+++ b/macros/latex/contrib/photobook/scripts/README.md
@@ -23,8 +23,6 @@ Support scripts
`make-spreads.sh`
----------------
-<!-- XXX add a TL;DR, "quick start" or "cheat sheet" section... abstract? -->
-
Generate LaTeX block of pages/spreads from a directory tree.
This was initially intended as a means to convert the exported directory
@@ -52,7 +50,7 @@ book/
│ ├── image-image.tex
│ ├── fullbleed.tex
│ └── ...
-├── spreads/ . . . . . . . . . . . . . . Main block layout.
+├── spreads/ . . . . . . . . . . . . . Main block layout.
│   ├── 00/ . . . . . . . . . . . . . . A basic spread.
│   │   ├── tweaks.tex The spread template is built
│   │   └── 0-DSC02432.jpg automatically with tweaks.tex
@@ -79,23 +77,22 @@ book/
├── block.tex . . . . . . . . . . . . . Block skeletal layout.
│ This usually includes the titles,
│ technical pages and sources the
-│ ./block-pages.tex.
-├── block-pages.tex . . . . . . . . . . The generated block content.
+│ ./block-spreads.tex.
+├── block-spreads.tex . . . . . . . . . The generated block content.
├── cover.tex . . . . . . . . . . . . . Cover layout.
├── jacket.tex . . . . . . . . . . . . Dust jacket layout.
└── ...
```
-<!-- XXX
-For a live example see: ../examples/book -->
+For a full example see: ../examples/book
Generate the block:
```shell
-$ make-spreads.sh ./pages > block-pages.tex
+$ make-spreads.sh ./spreads > block-spreads.tex
```
Note that `make-spreads.sh` does not force a specific layout outside of
-the `pages` directory, all paths are configurable. The way the root
+the `spreads` directory, all paths are configurable. The way the root
files are structured in this example is just one way to organize a
book's source code with minimal code duplication.
@@ -123,20 +120,20 @@ work is starting to look like a book.
When starting work on a layout it is good to at least have a basic
understanding of the book's:
- structure and how it may change,
-- core templates,
+- general look (i.e. core templates),
- exceptions from the above.
In most cases all of the above will change in one way or another during
the project's lifespan, and the main goal of this stage is to make this
-change as simple as possible -- it's all about providing the freedom to
-make changes instead of growing work invested and thus making change
-more and more expensive.
+change as efgortless as possible -- it's all about providing the freedom
+to make changes instead of growing the work invested and thus making
+change more and more expensive.
The first question is what is the _structure_ of the book we are making?
Will it have chapters? How many? Text? how much, how should it be
-structured? How are we going to deal with the title? How are we going
+placed? How are we going to deal with the title? How are we going
to present the images, full bleed, no bleeds, small, big, one per page
-or multiple images, ...etc.? At this stage this is about the presentation
+or multiples, ...etc.? At this stage this is about the presentation,
the flow of the work and not about the actual design. How many typical
spreads (i.e. spread templates) should it have? A good number should be
small-ish, for example 3-4 spread templates is a good number, if you
@@ -313,7 +310,7 @@ environment variable.
Inline captions are also supported:
```bnf
-pages/
+spreads/
├── <spread>/
│   ├── ...
│   ├── 00-<image-name>.<ext>
@@ -389,6 +386,13 @@ $ make-spreads.sh -c <path> ..
Extract the documentation from photobook.cls which is used to build the
photobook.pdf reference manual.
+This makes it possible to keep the documentation and code it describes
+in the same place/file.
+
+The format is in part inspired by LaTeX's [.dtx](http://tug.ctan.org/info/dtxtut/dtxtut.pdf)
+format but is far simpler and retains human readability with less effort.
+
+
```shell
$ cls2tex.sh --help
```
@@ -440,4 +444,4 @@ NOTE: the idea of keeping latex docs in a latex file is far simpler
in both the repo and in installed form, so .dtx is not used.
```
-
+<!-- vim:set ts=4 sw=4 nowrap : -->
diff --git a/macros/latex/contrib/photobook/scripts/cls2tex.sh b/macros/latex/contrib/photobook/scripts/cls2tex.sh
index 34cf872b1d..9119cd6e82 100755
--- a/macros/latex/contrib/photobook/scripts/cls2tex.sh
+++ b/macros/latex/contrib/photobook/scripts/cls2tex.sh
@@ -131,7 +131,7 @@ if [ -z $STRIP_DOC ] ; then
printmsg "Documentation" \
> "$OUTPUT"
cat "$INPUT" \
- | egrep '(^%'$PREFIX'|^\\edef\\'$MODULE'@[A-Z][A-Z]+)' \
+ | grep -E '(^%'$PREFIX'|^\\edef\\'$MODULE'@[A-Z][A-Z]+)' \
| sed \
-e 's/^\(\\edef\\\)'$MODULE'@/%'$PREFIX'\1/' \
-e 's/%'$PREFIX'%%%% \(.*\)/%'$PREFIX'\\subsubsection{\1}\\label{subsubsec:\1}/' \
@@ -146,8 +146,8 @@ else
printmsg "Stripped code" \
> "$OUTPUT"
cat "$INPUT" \
- | egrep -v '%'$PREFIX'' \
- | egrep -v '^(\s*%)?\s*$' \
+ | grep -Ev '%'$PREFIX'' \
+ | grep -Ev '^(\s*%)?\s*$' \
>> "$OUTPUT"
fi
diff --git a/macros/latex/contrib/uantwerpendocs/beamerthemeuantwerpenuserguide.pdf b/macros/latex/contrib/uantwerpendocs/beamerthemeuantwerpenuserguide.pdf
index caca9a6a20..dc313bbb9f 100644
--- a/macros/latex/contrib/uantwerpendocs/beamerthemeuantwerpenuserguide.pdf
+++ b/macros/latex/contrib/uantwerpendocs/beamerthemeuantwerpenuserguide.pdf
Binary files differ
diff --git a/macros/latex/contrib/uantwerpendocs/uantwerpenbamathesis-example.pdf b/macros/latex/contrib/uantwerpendocs/uantwerpenbamathesis-example.pdf
index 955a994c20..a82e4d856e 100644
--- a/macros/latex/contrib/uantwerpendocs/uantwerpenbamathesis-example.pdf
+++ b/macros/latex/contrib/uantwerpendocs/uantwerpenbamathesis-example.pdf
Binary files differ
diff --git a/macros/latex/contrib/uantwerpendocs/uantwerpencoursetext-example.pdf b/macros/latex/contrib/uantwerpendocs/uantwerpencoursetext-example.pdf
index 084f5a526e..60944d7f43 100644
--- a/macros/latex/contrib/uantwerpendocs/uantwerpencoursetext-example.pdf
+++ b/macros/latex/contrib/uantwerpendocs/uantwerpencoursetext-example.pdf
Binary files differ
diff --git a/macros/latex/contrib/uantwerpendocs/uantwerpendocs.dtx b/macros/latex/contrib/uantwerpendocs/uantwerpendocs.dtx
index 938cc829a9..5525d9c274 100644
--- a/macros/latex/contrib/uantwerpendocs/uantwerpendocs.dtx
+++ b/macros/latex/contrib/uantwerpendocs/uantwerpendocs.dtx
@@ -1,6 +1,6 @@
% \iffalse meta-comment
%
-% Copyright (C) 2013-2022 by Walter Daems <walter.daems@uantwerpen.be>
+% Copyright (C) 2013-2023 by Walter Daems <walter.daems@uantwerpen.be>
%
% This work may be distributed and/or modified under the conditions of
% the LaTeX Project Public License, either version 1.3 of this license
@@ -35,11 +35,11 @@
%<le>\ProvidesClass{uantwerpenletter}
%<ex>\ProvidesClass{uantwerpenexam}
%<bmr>\ProvidesPackage{beamerthemeuantwerpen}
-%<cls|ct|bmt|pt|rp|le|ex|bmr> [2022/08/22 v4.4 .dtx skeleton file]
+%<cls|ct|bmt|pt|rp|le|ex|bmr> [2023/04/10 v4.5 .dtx skeleton file]
%<*driver>
\documentclass[a4paper]{ltxdoc}
-\def\fileversion{4.4}%
-\def\filedate{2022/08/22}%
+\def\fileversion{4.5}%
+\def\filedate{2023/04/10}%
\usepackage{makeidx}
\usepackage{alltt}
\usepackage{longtable}
@@ -120,6 +120,8 @@
% optional fields of letter class}
% \changes{v4.4}{2022/04/04}{\@ Made titlepages insensitive to
% parindent and parskip settings + small bugfixes}
+% \changes{v4.5}{2023/04/10}{\@ Small bugfixes: more robust fonts for
+% overleaf, added some missing degrees}
%
% \DoNotIndex{\newcommand,\newenvironment,\begin,\bfseries,\draw,\clip,\else,\fi,\if,\fill,\filldraw,\ifthenelse,\ifx,\textwidth,\node,\\,\@empty,\@tempdima,\@tempdimb,\@tempswatrue,\{,\},\ ,\bf,\BODY,\break,\Alph,\and,\define@key,\color,\dx,\dy,\g,\gdef,\hbox,\tiny,\scriptsize,\footnotesize,\small,\normalsize,\large,\Large,\LARGE,\huge,\Huge,\l,\LaTeX,\let,\p@,\relax,\renewcommand,\Requirepackage,\textbf,\textsf,\texttt,\textbackslash,\vspace,\hspace,\hfill,\hskip,\vskip,\hline,\vrule,\typeout,\usebox,\end,\paperheight,\paperwidth,\par,\NewDocumentCommand,\seq}
% \setlength{\parindent}{0em}
@@ -204,6 +206,7 @@
% \item the |fancyhdr| package
% \item the |geometry| package
% \item the |graphicx| package
+% \item the |graphbox| package
% \item the |iftex| package
% \item the |ifthen| package
% \item the |tikz| package
@@ -252,6 +255,9 @@
% However, using an old \LaTeX{} + dvips setup is likely to get you into font
% problems. Advice: ditch the route via dvi. If you experience other
% problems, please inform the author.
+% New advice as of 2023: don't use Pdf\LaTeX{} anymore, stick to
+% \XeLaTeX{} or even better \LuaLaTeX{}. Your life will be
+% font-problem-worry-free.
%
% \section{Usage}
%
@@ -1083,7 +1089,7 @@
% 2. for two-sided theses, specify 'twoside' and 'openright' as options
% for one-sided theses, specify 'oneside' and 'openany' as options
-\usepackage[dutch]{babel} % or english if your text is in English
+\usepackage[english]{babel} % or english if your text is in English
\usepackage{kantlipsum} % this is just for some dummy text, please remove
\usepackage[backref,hyperindex=true,pagebackref=true]{hyperref}
@@ -1093,11 +1099,16 @@
\usepackage{mathptmx}
\iftutex
+% Just an example of font-scheme: this is in no way a recommended font
+% scheme!
\usepackage{fontspec}
-\setmainfont{Calibri} % comment this line out if you want computer
- % modern as main font, or feel free to select
- % any other font
-\setsansfont{Calibri}
+\setmainfont
+[UprightFont = *,
+ BoldFont = *b,
+ ItalicFont = *i,
+ BoldItalicFont = *z,
+]
+{calibri}
\usepackage{sansmathaccent}
\fi
@@ -1105,8 +1116,9 @@
% start of your document.
\usepackage{multicol}
-\bamadegree{ti-nl-ma-ei}
-
+\bamadegree{ti-en-ba-em}
+% \degree{} % You can specify your degree manually here, instead of using
+% % \textbackslash{}bamadegree}
\title{Minimax optimisatie voor performantie-
ruimtemodellering} % either don't split titles, or do so with hypen
% and a newline
@@ -1233,11 +1245,18 @@
% You may want to use common fonts
\usepackage{mathptmx}
\iftutex
-\usepackage{fontspec}
-\setmainfont{Calibri}
-\setsansfont{Calibri}
-\else
+% Just an example of font-scheme: this is in no way a recommended font
+% scheme!
\usepackage{cmbright}
+\usepackage{fontspec}
+\setmainfont
+[UprightFont = *,
+ BoldFont = *b,
+ ItalicFont = *i,
+ BoldItalicFont = *z,
+]
+{calibri}
+\usepackage{sansmathaccent}
\fi
\usepackage[dutch]{babel} % or dutch if your text is in Dutch
@@ -1334,7 +1353,7 @@
% \paragraph{English}
% \begin{verbatim}
%<*pt-example2>
-\documentclass[ti,10pt,twoside,openright,filled,cameraready]{uantwerpenphdthesis}
+\documentclass[ti,10pt,twoside,openright,filled,bare]{uantwerpenphdthesis}
% use some fancy font
\usepackage{newpxtext}
@@ -1447,12 +1466,18 @@
% You may want to use common fonts
\usepackage{mathptmx}
\iftutex
+% Just an example of font-scheme: this is in no way a recommended font
+% scheme!
+\usepackage{cmbright}
\usepackage{fontspec}
-\setmainfont{Calibri}
-\setsansfont{Calibri}
+\setmainfont
+[UprightFont = *,
+ BoldFont = *b,
+ ItalicFont = *i,
+ BoldItalicFont = *z,
+]
+{calibri}
\usepackage{sansmathaccent}
-\else
-\usepackage{cmbright}
\fi
\usepackage[dutch]{babel} % or dutch if your text is in Dutch
@@ -1545,10 +1570,16 @@
%% As this only works for XeLaTeX or LuaLaTeX, we chose to include
%% cmbright in any other case.
\iftutex
-\usepackage{fontspec}
-\setmainfont{Calibri}
-\else
\usepackage{cmbright}
+\usepackage{fontspec}
+\setmainfont
+[UprightFont = *,
+ BoldFont = *b,
+ ItalicFont = *i,
+ BoldItalicFont = *z,
+]
+{calibri}
+\usepackage{sansmathaccent}
\fi
\usepackage[english]{babel}
@@ -1624,10 +1655,16 @@
%<*le-cfg>
%% configuration file for uantwerpenletter class
\iftutex
-\usepackage{fontspec}
-\setmainfont{Calibri}
-\else
\usepackage{cmbright}
+\usepackage{fontspec}
+\setmainfont
+[UprightFont = *,
+ BoldFont = *b,
+ ItalicFont = *i,
+ BoldItalicFont = *z,
+]
+{calibri}
+\usepackage{sansmathaccent}
\fi
\sender{prof. Walter Daems}{Senior Lecturer}
@@ -2342,6 +2379,7 @@ Welk van de onderstaande ingredi\"enten hoort niet thuis in
% \begin{macrocode}
%<*ct|bmt|pt|rp|le|ex>
\RequirePackage{graphicx}
+\RequirePackage{graphbox}
\RequirePackage{soul}
\RequirePackage[export]{adjustbox}
\RequirePackage{color}
@@ -2746,13 +2784,21 @@ en-pr = Project report
%
% \subsection{Educational degrees}
%
-% \changes{v4.2}{2021/10/04}{Added bachelor/master degrees of FTI and FWET}
+% \changes{v4.2}{2021/10/04}{Added bachelor/master degrees of FTI and
+% FWET}
+% \changes{v4.5}{2023/04/10}{Added bachelor degrees (dutch!) in english
+% mode for FTI}
+%
% \begin{macrocode}
%<*degreedata>
ti-nl-ba-bk = Bachelor of Science in de industriële wetenschappen: bouwkunde
ti-nl-ba-ch = Bachelor of Science in de industriële wetenschappen: chemie
ti-nl-ba-em = Bachelor of Science in de industriële wetenschappen: elektromechanica
ti-nl-ba-ei = Bachelor of Science in de industriële wetenschappen: elektronica-ICT
+ti-en-ba-bk = Bachelor of Science in de industriële wetenschappen: bouwkunde
+ti-en-ba-ch = Bachelor of Science in de industriële wetenschappen: chemie
+ti-en-ba-em = Bachelor of Science in de industriële wetenschappen: elektromechanica
+ti-en-ba-ei = Bachelor of Science in de industriële wetenschappen: elektronica-ICT
ti-nl-ma-bk = Master of Science in de industriële wetenschappen: bouwkunde
ti-nl-ma-bch = Master of Science in de industriële wetenschappen: biochemie
ti-nl-ma-ch = Master of Science in de industriële wetenschappen: chemie
@@ -6139,7 +6185,7 @@ we-nl-ma-wiftw = Master of Science in wiskunde: financiële en toegepaste wiskun
%
% \begin{macrocode}
%<*bmr>
-% Copyright 2022 by Walter Daems <walter.daems@uantwerpen.be>
+% Copyright 2023 by Walter Daems <walter.daems@uantwerpen.be>
%
% This file may be distributed and/or modified
%
@@ -6169,6 +6215,7 @@ we-nl-ma-wiftw = Master of Science in wiskunde: financiële en toegepaste wiskun
\RequirePackage{tikz}
\RequirePackage{graphicx}
+\RequirePackage{graphbox}
\RequirePackage[export]{adjustbox}
\RequirePackage{environ}
@@ -6193,7 +6240,7 @@ we-nl-ma-wiftw = Master of Science in wiskunde: financiële en toegepaste wiskun
% \subsubsection{Beamer color theme}
% \begin{macrocode}
%<*bmrcolor>
-% Copyright 2022 by Walter Daems <walter.daems@uantwerpen.be>
+% Copyright 2023 by Walter Daems <walter.daems@uantwerpen.be>
%
% This file may be distributed and/or modified
%
@@ -6273,10 +6320,11 @@ we-nl-ma-wiftw = Master of Science in wiskunde: financiële en toegepaste wiskun
% \end{macrocode}
%
% \subsubsection{Beamer font theme}
+% \changes{v4.5}{2023/04/10}{robust font code for overleaf}
%
% \begin{macrocode}
%<*bmrfont>
-% Copyright 2022 by Walter Daems
+% Copyright 2023 by Walter Daems
%
% This file may be distributed and/or modified
%
@@ -6301,7 +6349,13 @@ we-nl-ma-wiftw = Master of Science in wiskunde: financiële en toegepaste wiskun
\usepackage{cmbright}
\usefonttheme{serif}
\usepackage{fontspec}
- \setmainfont{Calibri}
+ \setmainfont
+ [UprightFont = *,
+ BoldFont = *b,
+ ItalicFont = *i,
+ BoldItalicFont = *z,
+ ]
+ {calibri}
\usepackage{sansmathaccent}
\fi
\fi
@@ -6420,7 +6474,7 @@ we-nl-ma-wiftw = Master of Science in wiskunde: financiële en toegepaste wiskun
%
% \begin{macrocode}
%<*bmrinner>
-% Copyright 2022 by Walter Daems <walter.daems@uantwerpen.be>
+% Copyright 2023 by Walter Daems <walter.daems@uantwerpen.be>
%
% This file may be distributed and/or modified
%
@@ -6513,7 +6567,7 @@ we-nl-ma-wiftw = Master of Science in wiskunde: financiële en toegepaste wiskun
%
% \begin{macrocode}
%<*bmrouter>
-% Copyright 2022 by Walter Daems <walter.daems@uantwerpen.be>
+% Copyright 2023 by Walter Daems <walter.daems@uantwerpen.be>
%
% This file may be distributed and/or modified
%
diff --git a/macros/latex/contrib/uantwerpendocs/uantwerpendocs.pdf b/macros/latex/contrib/uantwerpendocs/uantwerpendocs.pdf
index 1fe0d9c12f..51fd4bedc5 100644
--- a/macros/latex/contrib/uantwerpendocs/uantwerpendocs.pdf
+++ b/macros/latex/contrib/uantwerpendocs/uantwerpendocs.pdf
Binary files differ
diff --git a/macros/latex/contrib/uantwerpendocs/uantwerpenexam-example1.pdf b/macros/latex/contrib/uantwerpendocs/uantwerpenexam-example1.pdf
index dcdcb43bca..7f38b50174 100644
--- a/macros/latex/contrib/uantwerpendocs/uantwerpenexam-example1.pdf
+++ b/macros/latex/contrib/uantwerpendocs/uantwerpenexam-example1.pdf
Binary files differ
diff --git a/macros/latex/contrib/uantwerpendocs/uantwerpenexam-example2.pdf b/macros/latex/contrib/uantwerpendocs/uantwerpenexam-example2.pdf
index 249c7c4c0a..50e83e8bf0 100644
--- a/macros/latex/contrib/uantwerpendocs/uantwerpenexam-example2.pdf
+++ b/macros/latex/contrib/uantwerpendocs/uantwerpenexam-example2.pdf
Binary files differ
diff --git a/macros/latex/contrib/uantwerpendocs/uantwerpenletter-example.pdf b/macros/latex/contrib/uantwerpendocs/uantwerpenletter-example.pdf
index 1686b41312..94aee6fd0e 100644
--- a/macros/latex/contrib/uantwerpendocs/uantwerpenletter-example.pdf
+++ b/macros/latex/contrib/uantwerpendocs/uantwerpenletter-example.pdf
Binary files differ
diff --git a/macros/latex/contrib/uantwerpendocs/uantwerpenphdthesis-example1.pdf b/macros/latex/contrib/uantwerpendocs/uantwerpenphdthesis-example1.pdf
index 25881ced4a..5a9ef71bb3 100644
--- a/macros/latex/contrib/uantwerpendocs/uantwerpenphdthesis-example1.pdf
+++ b/macros/latex/contrib/uantwerpendocs/uantwerpenphdthesis-example1.pdf
Binary files differ
diff --git a/macros/latex/contrib/uantwerpendocs/uantwerpenphdthesis-example2.pdf b/macros/latex/contrib/uantwerpendocs/uantwerpenphdthesis-example2.pdf
index 7721657306..1b162e92b7 100644
--- a/macros/latex/contrib/uantwerpendocs/uantwerpenphdthesis-example2.pdf
+++ b/macros/latex/contrib/uantwerpendocs/uantwerpenphdthesis-example2.pdf
Binary files differ
diff --git a/macros/latex/contrib/uantwerpendocs/uantwerpenreport-example.pdf b/macros/latex/contrib/uantwerpendocs/uantwerpenreport-example.pdf
index 077d6c187d..aa384e2266 100644
--- a/macros/latex/contrib/uantwerpendocs/uantwerpenreport-example.pdf
+++ b/macros/latex/contrib/uantwerpendocs/uantwerpenreport-example.pdf
Binary files differ
diff --git a/macros/luatex/generic/luatexja/README b/macros/luatex/generic/luatexja/README
index 3d22e5b989..8f5f043144 100644
--- a/macros/luatex/generic/luatexja/README
+++ b/macros/luatex/generic/luatexja/README
@@ -1,4 +1,4 @@
-The LuaTeX-ja Package 20230211.0
+The LuaTeX-ja Package 20230409.0
--------------------------------
Copyright (c) 2011--2023 The LuaTeX-ja project
License: modified BSD (see COPYING)
@@ -42,9 +42,9 @@ Installation
2. If you must/want to install manually:
a. Download the source archive from CTAN,
- or tagged as 20230211.0 in the Git repository by
+ or tagged as 20230409.0 in the Git repository by
<http://git.osdn.jp/view?p=luatex-ja/luatexja.git
- ;a=snapshot;h=refs/tags/20230211.0;sf=tgz>
+ ;a=snapshot;h=refs/tags/20230409.0;sf=tgz>
b. Extract the archive and process following three files by LuaLaTeX
to generate classes for Japanese typesetting:
@@ -93,4 +93,4 @@ Notes
This file and ltj-kinsoku.lua are not used anymore.
(Do not remove ltj-kinsoku.tex.)
-Last commit date: Sat Feb 11 18:49:41 2023 +0900
+Last commit date: Sun Apr 9 08:12:48 2023 +0900
diff --git a/macros/luatex/generic/luatexja/doc/luatexja-en.pdf b/macros/luatex/generic/luatexja/doc/luatexja-en.pdf
index eefcf7ec7e..47df10cd7d 100644
--- a/macros/luatex/generic/luatexja/doc/luatexja-en.pdf
+++ b/macros/luatex/generic/luatexja/doc/luatexja-en.pdf
Binary files differ
diff --git a/macros/luatex/generic/luatexja/doc/luatexja-ja.pdf b/macros/luatex/generic/luatexja/doc/luatexja-ja.pdf
index f073b1b74c..0cad34ccec 100644
--- a/macros/luatex/generic/luatexja/doc/luatexja-ja.pdf
+++ b/macros/luatex/generic/luatexja/doc/luatexja-ja.pdf
Binary files differ
diff --git a/macros/luatex/generic/luatexja/doc/luatexja.dtx b/macros/luatex/generic/luatexja/doc/luatexja.dtx
index 864306f916..a6139ec9c2 100644
--- a/macros/luatex/generic/luatexja/doc/luatexja.dtx
+++ b/macros/luatex/generic/luatexja/doc/luatexja.dtx
@@ -3526,7 +3526,10 @@ causes a error. We denote control sequences which are defined in
%<*en>
\begin{description}
\item[\meta{JFM name}]
- The name of a (horizontal) JFM. \LuaTeX-ja searches and loads \texttt{jfm-\meta{JFM name}.lua}.
+ The name of a (horizontal) JFM. \LuaTeX-ja searches and loads \texttt{jfm-\meta{JFM name}.lua}
+ \footnote{When \LuaTeX-ja (version~20230409 or later)
+ is used under \LaTeXe, \LuaTeX-ja searches a JFM also in directories
+ which are specified in \cs{input@path}.}.
\item[\meta{JFM features}]
An optional comma-separated list of JFM options.
Enclosing braces (\verb+{}+) are optional, but this does not escape any characters.
@@ -3552,7 +3555,9 @@ because their \meta{identifier} are different.
%<*ja>
\begin{description}
\item[\meta{JFM name}]
- (横組用)JFMの名称.\LuaTeX-jaは\texttt{jfm-\meta{JFM name}.lua}というファイルを探索して読み込む.
+ (横組用)JFMの名称.\LuaTeX-jaは\texttt{jfm-\meta{JFM name}.lua}というファイルを探索して読み込む
+ \footnote{\LuaTeX-ja 20230409.0以降では,\LaTeXe 下で読み込まれた場合には
+ \cs{input@path}で指定された箇所も加えてJFMを探索する.}.
\item[\meta{JFM features}]
省略可能なコンマ区切りリスト.全体を囲む \verb+{}+ は省略可能であるが,
囲ったからといって\meta{JFM features}の中で使用可能な文字が増えるわけではない.
@@ -3859,7 +3864,7 @@ JFM中における\texttt{kanjiskip\_natural}, \texttt{kanjiskip\_stretch},\
「JFM由来のグルーの他に,\Param{kanjiskip}の自然長/伸び量/縮み量の一部が
同じ場所に挿入される」という状況が起こりうる.
この機能を無効化し,バージョン20150922.0以前と同じような組版を得るためには,
-他のOpenType機能と同じように\texttt{-ltjksp}指定を行えば良い(\autoref{fig:ltjksp}参照).
+他のOpenType機能と同じように\>\mbox{\texttt{-ltjksp}}\>指定を行えば良い(\autoref{fig:ltjksp}参照).
なお,
\begin{lstlisting}
\jfont\G=HaranoAjiMincho-Regular:jfm=ujis;-ltjksp;+ltjksp at \zw
@@ -3875,7 +3880,7 @@ JFM中における\texttt{kanjiskip\_natural}, \texttt{kanjiskip\_stretch},\
\texttt{kanjiskip\_shrink} keys (Page~\pageref{pg:ksp_nat}) makes tha
\LuaTeX-ja inserts not only a glue which is specified by a JFM, and also
the natural width/stretch part/shrink part of \Param{kanjiskip}.
-This functionality is disabled by \texttt{-ltjksp} specification,
+This functionality is disabled by \mbox{\texttt{-ltjksp}} specification,
as shown in~\autoref{fig:ltjksp}.
%</en>
\begin{figure}
@@ -3888,10 +3893,56 @@ as shown in~\autoref{fig:ltjksp}.
\G\leavevmode%
\vrule\hbox to 15\zw{あ「い」う,えお}\vrule
\end{LTXexample}
-\caption{\texttt{ltjksp} `feature''}
+\caption{\texttt{ltjksp} ``feature''}
\label{fig:ltjksp}
\end{figure}
+%<*ja>
+\paragraph{\texttt{ltjpci}「機能」}
+\label{pg:ltjpci}
+\Pkg{luaotfload}~v3.19以降では,標準でUnicode(文字から作られるノードたち)がNFCに正規化される
+ようになっている.これにより,ソース中でたとえば「か」と合成用濁点(\texttt{U+3099})を続けて入力した場合,
+両者それぞれからノードが生成されるが,結果的には「が」を表す1ノードになるわけである.
+
+しかし,NFCに正規化することで,
+たとえば「\UTF{FA19}」(\texttt{U+FA19})が「神」(\texttt{U+795E})にというふうに,
+CJK互換漢字がCJK統合漢字に変換されてしまうという問題がある.
+異体字セレクタを用いればこのようなことは起きないが,古くからあるフォントでは異体字セレクタをサポートしていない.
+
+以上の事情に対応するため,\LuaTeX-jaでは,標準で
+\emph{CJK互換漢字・CJK互換漢字補助の文字には\Pkg{luaotfload}パッケージによる処理は働かない}ようにしている.
+この機能を無効化するには,他のOpenType機能と同じように\texttt{-ltjpci}指定を行えば良い(\autoref{fig:ltjpci}参照).
+\texttt{ltjksp}と同様に,\texttt{-ltjpci}, \texttt{+ltjpci}を複数回指定した場合は,
+最後に指定したものが有効となる.
+%</ja>
+%<*en>
+\paragraph{\texttt{ltjpci} ``feature''}
+\label{pg:ltjpci}
+By default, The \Pkg{luaotfload} package (since v3.19) normalizes Unicode sequences to NFC.
+However, this normalization converts CJK compatibility ideographs to their canonical equivalents,
+such as ``\UTF{FA19}''~(\texttt{U+FA19}) to ``神''. One can use variation selectors,
+but old fonts does not support them.
+
+So, \emph{\LuaTeX-ja now protects CJK compatibility ideographs from processing
+ by the \Pkg{luaotfload} package by defualt}.
+This functionality is disabled by \mbox{\texttt{-ltjpci}} specification,
+as shown in~\autoref{fig:ltjpci}.
+%</en>
+\begin{figure}
+\begin{LTXexample}[width=12\zw]
+\def\TEST{\leavevmode\char"FA10\char"FA12\char"FA15
+ \char"FA19.か\char"3099.は\char"309A.\par}
+\jfont\A=HaranoAjiMincho-Regular:jfm=ujis; at 15pt
+\A\TEST % default
+\jfont\G=HaranoAjiMincho-Regular:jfm=ujis;-ltjpci at 15pt
+\G\TEST % ltjpci off
+\jfont\H=HaranoAjiMincho-Regular:jfm=ujis;-normalize at 15pt
+\H\TEST % normalization off
+\end{LTXexample}
+\caption{\texttt{ltjpci} ``feature''}
+\label{fig:ltjpci}
+\end{figure}
+
%<en>\subsection{\cs{tfont}}
%<ja>\subsection{\cs{tfont} 命令}
\label{ssec:tfont}
@@ -9978,101 +10029,10 @@ u
その行はそこで改行するようにした方がいいだろう.
%</ja>
-\begin{table}[t]
-%<ja> \caption{「基底文字+合成用濁点・半濁点」から合成済み文字への変換をサポートする組み合わせ}
-%<en> \caption{Normalization of Kana Character Sequences with Combining (Semi)-voiced Sound Mark}\medskip
- \label{tab:kana_composite}
- \def\D#1{%
- {\fboxsep0pt\fcolorbox{cyan}{white}%
- {\hbox to 1\zw{\hss#1}}}} %"
- \def\DC#1{\D{\unitlength=1\zw
- \begin{picture}(1,0)
- \put(0.5,0.38){\arc[0,15]{0.25}}\put(0.5,0.38){\arc[30,45]{0.25}}\put(0.5,0.38){\arc[60,75]{0.25}}
- \put(0.5,0.38){\arc[90,105]{0.25}}\put(0.5,0.38){\arc[120,135]{0.25}}\put(0.5,0.38){\arc[150,165]{0.25}}
- \put(0.5,0.38){\arc[180,195]{0.25}}\put(0.5,0.38){\arc[210,225]{0.25}}\put(0.5,0.38){\arc[240,255]{0.25}}
- \put(0.5,0.38){\arc[270,285]{0.25}}\put(0.5,0.38){\arc[300,315]{0.25}}\put(0.5,0.38){\arc[330,345]{0.25}}
- \end{picture}\llap{#1\kern-.7\zw}}}
- \def\CDJ#1#2{$\mbox{\D{\char"#1}}+\mbox{\DC{゛}}\rightarrow \mbox{\D{\char"#2}}$}
- \def\CHJ#1#2{$\mbox{\D{\char"#1}}+\mbox{\DC{゜}}\rightarrow \mbox{\D{\char"#2}}$}
- \small\centering
- \begin{tabular}{@{}llllll@{}}
- \CDJ{3046}{3094}&
- \CDJ{304B}{304C}&
- \CDJ{304D}{304E}&
- \CDJ{304F}{3050}&
- \CDJ{3051}{3052}&
- \CDJ{3053}{3054}\\
- \CDJ{3055}{3056}&
- \CDJ{3057}{3058}&
- \CDJ{3059}{305A}&
- \CDJ{305B}{305C}&
- \CDJ{305D}{305E}&
- \CDJ{305F}{3060}\\
- \CDJ{3061}{3062}&
- \CDJ{3064}{3065}&
- \CDJ{3066}{3067}&
- \CDJ{3068}{3069}&
- \CDJ{306F}{3070}&
- \CDJ{3072}{3073}\\
- \CDJ{3075}{3076}&
- \CDJ{3078}{3079}&
- \CDJ{307B}{307C}&
- \CDJ{309D}{309E}&
- \CDJ{30A6}{30F4}&
- \CDJ{30AB}{30AC}\\
- \CDJ{30AD}{30AE}&
- \CDJ{30AF}{30B0}&
- \CDJ{30B1}{30B2}&
- \CDJ{30B3}{30B4}&
- \CDJ{30B5}{30B6}&
- \CDJ{30B7}{30B8}\\
- \CDJ{30B9}{30BA}&
- \CDJ{30BB}{30BC}&
- \CDJ{30BD}{30BE}&
- \CDJ{30BF}{30C0}&
- \CDJ{30C1}{30C2}&
- \CDJ{30C4}{30C5}\\
- \CDJ{30C6}{30C7}&
- \CDJ{30C8}{30C9}&
- \CDJ{30CF}{30D0}&
- \CDJ{30D2}{30D3}&
- \CDJ{30D5}{30D6}&
- \CDJ{30D8}{30D9}\\
- \CDJ{30DB}{30DC}&
- \CDJ{30EF}{30F7}&
- \CDJ{30F0}{30F8}&
- \CDJ{30F1}{30F9}&
- \CDJ{30F2}{30FA}&
- \CDJ{30FD}{30FE}\\
- \CHJ{306F}{3071}&
- \CHJ{3072}{3074}&
- \CHJ{3075}{3077}&
- \CHJ{3078}{307A}&
- \CHJ{307B}{307D}&
- \CHJ{30CF}{30D1}\\
- \CHJ{30D2}{30D4}&
- \CHJ{30D5}{30D7}&
- \CHJ{30D8}{30DA}&
- \CHJ{30DB}{30DD}
- \end{tabular}
-\end{table}
-%<*en>
-\subsection{Composition of Kana from Combining Character Sequences}
-In (u)\pTeX, Hiragana and Katakana in the NFD form%
-\footnote{namely, character sequences which contains
- ``COMBINING KATAKANA-HIRAGANA VOICED SOUND MARK''~(\texttt{U+3099}) and
- ``COMBINING KATAKANA-HIRAGANA SEMI-VOICED SOUND MARK''~(\texttt{U+309A}).}
-are normalized to precomposed characters before (u)\pTeX\ looks into the input line.
-Character sequences which are involved in this normalization are shown in \autoref{tab:kana_composite}.
-
-The above normalization process is also performed in \LuaTeX-ja version~20220103.0 or later, because
-fonts might not have these transformation as an OpenType feature.
-%</en>
-
%<*ja>
-\subsection{濁点・半濁点付き仮名文字の正規化}
+\subsection{濁点・半濁点付き仮名の正規化→\Pkg{luaotfload}~v3.19以降ではそちらで}
\TeX~Live~2016以降の(u)\pTeX では,合成用濁点(\texttt{U+3099})・合成用半濁点(\texttt{U+309A})を用いて
-表現された平仮名・片仮名を合成済み文字に変換する(具体的には\autoref{tab:kana_composite}の組み合わせ)という処理を行っている.
+表現された平仮名・片仮名を合成済み文字に変換するという処理を行っている.
この処理を行っている要因としては,
\begin{itemize}
\item 無用なトラブルを避けるため.
@@ -10082,14 +10042,14 @@ fonts might not have these transformation as an OpenType feature.
合成用濁点・半濁点は利用できない.そのため上記の変換処理はさらに前から行われていた.
\end{itemize}
-一方,\LuaTeX(-ja)では入力の変換は基本的に行わず,文字の合成は使用しているフォントのOpenType機能に委ねるという立場である.
-しかし,\autoref{tab:kana_composite}に挙げた変換はUnicode正規化の範疇であり,この内容を持っているフォントは多くない.
-よって,前段落で述べた2つの理由(と\upTeX との互換性という意味も込めて)も考慮して,
-バージョン20220103.0以降では,\LuaTeX-jaは入力行に対して\autoref{tab:kana_composite}の変換を行う.
+\LuaTeX(-ja)では入力の変換は基本的に行わず,
+文字の合成は使用しているフォントのOpenType機能に委ねるという立場であったが,
+\Pkg{luaotfload}~v3.19以降では,標準でNFCへのUnicode正規化を行っている.
+そのため,バージョン2023****.0以降では,\LuaTeX-jaによる自前の変換\footnote{バージョン20220103.0で実装した.}は
+行わないようにしている.
%</ja>
-
-%<*ja>
+%<*ja>
%<en>\section{Insertion of JFM glues, \Param{kanjiskip} and \Param{xkanjiskip}}
%<ja>\section{JFMグルーの挿入,\Param{kanjiskip}と\Param{xkanjiskip}}
\label{sec-jfmglue}
diff --git a/macros/luatex/generic/luatexja/src/ltj-base.lua b/macros/luatex/generic/luatexja/src/ltj-base.lua
index 4a95616777..2af3908554 100644
--- a/macros/luatex/generic/luatexja/src/ltj-base.lua
+++ b/macros/luatex/generic/luatexja/src/ltj-base.lua
@@ -285,12 +285,17 @@ do
end
end
+ local compress, decompress = gzip.compress, gzip.decompress
local function save_cache(filename, t)
local fullpath = savepath .. '/' .. filename .. '.lua.gz'
local s = serialize(t, 'return', false, serial_spec)
if s then
- gzip.save(fullpath, s, 1)
- texio.write('log', '(save cache: ' .. fullpath .. ')')
+ local f = io.open(fullpath, 'wb')
+ if f then
+ f:write(compress(s, 31))
+ texio.write('log', '(save cache: ' .. fullpath .. ')')
+ f:close()
+ end
save_cache_luc(filename, t, s)
end
end
@@ -302,7 +307,8 @@ do
if isreadable(fn) then
texio.write('log','(load cache: ' .. filename .. ')')
if compressed then
- result = loadstring(gzip.load(fn))
+ local f = io.open(fn, 'rb'); result = f:read'*a'; f:close()
+ result = loadstring(decompress(result, 31))
else
result = loadfile(fn)
end
diff --git a/macros/luatex/generic/luatexja/src/ltj-direction.lua b/macros/luatex/generic/luatexja/src/ltj-direction.lua
index 0fbe0c664c..6576ace2cf 100644
--- a/macros/luatex/generic/luatexja/src/ltj-direction.lua
+++ b/macros/luatex/generic/luatexja/src/ltj-direction.lua
@@ -1008,8 +1008,8 @@ do
local n = h; h = node_remove(h,h)
node_free(n)
end
- for box_rule in traverse(h) do
- if getid(box_rule)<id_rule then
+ for box_rule, bi in traverse(h) do
+ if bi<id_rule then
h = insert_before(h, box_rule, dir_pool[list_dir]())
end
end
@@ -1129,8 +1129,7 @@ do
tex.setattribute(attr_dir, 0)
finalize_inner = function (box)
- for n in traverse(getlist(box)) do
- local nid = getid(n)
+ for n, nid in traverse(getlist(box)) do
if (nid==id_hlist or nid==id_vlist) then
local ndir = get_box_dir(n, dir_yoko)
if ndir>=dir_node_auto then -- n is dir_node
diff --git a/macros/luatex/generic/luatexja/src/ltj-inputbuf.lua b/macros/luatex/generic/luatexja/src/ltj-inputbuf.lua
index dc6ec46a56..66a466ec0c 100644
--- a/macros/luatex/generic/luatexja/src/ltj-inputbuf.lua
+++ b/macros/luatex/generic/luatexja/src/ltj-inputbuf.lua
@@ -14,6 +14,10 @@ local ltjc_is_japanese_char_curlist = ltjc.is_japanese_char_curlist
local cnt_lineend = luatexbase.registernumber 'ltjlineendcomment'
local substituter
do
+if tonumber(luaotfload.version) < 3.19 then
+ ltjb.package_info_no_line('luatexja',
+ 'We are using luaotfload <v3.19, so I compose kana from combining character sequences manually'
+ )
local uchar = utf.char
local cd, cp = uchar(0x3099), uchar(0x309A)
substituter = (utf.substituter or utf.subtituter) -- typo in lualibs?
@@ -47,8 +51,10 @@ do
['ワ'..cd] = uchar(0x30F7), ['ヰ'..cd] = uchar(0x30F8),
['ヱ'..cd] = uchar(0x30F9), ['ヲ'..cd] = uchar(0x30FA),
}
+else
+ substituter = function(s) return s end
+end
end
-
--- the following function is modified from jafontspec.lua (by K. Maeda).
--- Instead of "%", we use U+FFFFF for suppressing spaces.
--DEBUG require"socket"
diff --git a/macros/luatex/generic/luatexja/src/ltj-jfont.lua b/macros/luatex/generic/luatexja/src/ltj-jfont.lua
index a14edd2b79..26c76d88a1 100644
--- a/macros/luatex/generic/luatexja/src/ltj-jfont.lua
+++ b/macros/luatex/generic/luatexja/src/ltj-jfont.lua
@@ -3,7 +3,7 @@
--
luatexbase.provides_module({
name = 'luatexja.jfont',
- date = '2022-08-20',
+ date = '2023-04-06',
description = 'Loader for Japanese fonts',
})
@@ -43,7 +43,7 @@ local font_metric_table = ltju.font_metric_table -- [font number] -> jfm_name, j
luatexbase.create_callback("luatexja.load_jfm", "data", function (ft, jn) return ft end)
-local jfm_spec, jfm_name, jfm_var, jfm_ksp
+local jfm_spec, jfm_name, jfm_var, jfm_ksp, jfm_pci
local defjfm_res
local jfm_dir, is_def_jfont, vert_activated, auto_enable_vrt2
@@ -288,7 +288,7 @@ do
jfm_name, jfm_spec = 'ujis', 'ujis'
end
for j,v in ipairs(metrics) do if v.name==jfm_spec then return j end end
- luatexja.load_lua('jfm-' .. jfm_name .. '.lua')
+ defjfm_res=nil; luatexja.load_lua('jfm-' .. jfm_name .. '.lua')
if defjfm_res then
defjfm_res.name = jfm_spec; table.insert(metrics, defjfm_res)
return #metrics
@@ -323,7 +323,7 @@ do
update_jfm_cache(j, f.size); check_callback_order()
local sz = metrics[j].size_cache[f.size]
local fmtable = { jfm = j, size = f.size, var = jfm_var,
- with_kanjiskip = jfm_ksp,
+ with_kanjiskip = jfm_ksp, protect_compat_ig = jfm_pci,
zw = sz.zw, zh = sz.zh,
chars = sz.chars, char_type = sz.char_type,
kanjiskip = sz.kanjiskip, xkanjiskip = sz.xkanjiskip,
@@ -397,20 +397,31 @@ do
local jf_field = C(jf_field_char^1)
local jf_assignment = jf_field * ws * equals * ws * jf_field
local jf_switch = P'-' * jf_field * Cc(false) + P'+'^-1 * jf_field * Cc(true)
- local jf_feature_expr = Cg(jf_assignment + jf_switch) * ws * comma^0 * ws
+ local jf_feature_expr =
+ P{
+ 'FE',
+ FE = Cg(V'AT'+ jf_assignment + jf_switch) * ws * comma^0 * ws,
+ AT = jf_field * ws * equals * ws * Cf(Ct'' * P'{' * ws * (V'FE')^0 * P'}', rawset),
+ }
local jf_feature_list = ws * ( P'{' * ws * jf_feature_expr^0 * P'}' + jf_feature_expr^0 )
local jf_list = C((1-slash)^1) * (slash * Cf(Ct'' * jf_feature_list, rawset))^-1
local jf_value = (1 - semicolon)^1
+ local norm
+ norm = function (t)
+ local flag
+ if type(t)=='table' then
+ for i,v in pairs(t) do
+ flag=true
+ if v=='true' then t[i]=true elseif v=='false' then t[i]=false
+ elseif type(v)=='table' then norm(v) end
+ end
+ return flag and t
+ end
+ end
local function rem(name,value)
if name=='jfm' then
- local flag, t; jfm_name, t = lpegmatch(jf_list, value)
- if type(t)=='table' then
- for i,v in pairs(t) do
- flag=true
- if v=='true' then t[i]=true elseif v=='false' then t[i]=false end
- end
- end
- luatexja.jfont.jfm_feature = flag and t
+ local t; jfm_name, t = lpegmatch(jf_list, value)
+ luatexja.jfont.jfm_feature = norm(t)
elseif name=='jfmvar' then jfm_var = value end
return ''
end
@@ -451,6 +462,7 @@ do
-- print('NN>', name)
end
jfm_ksp = (is_feature_specified(name,'ltjksp')~=false)
+ jfm_pci = (is_feature_specified(name,'ltjpci')~=false)
if jfm_dir == 'tate' then
vert_activated = (is_feature_specified(name,'vert')~=false) and (is_feature_specified(name,'vrt2')~=false)
auto_enable_vrt2
@@ -619,11 +631,23 @@ function luatexja.jfont.clear_alt_font(bfnt)
end
------ used in ltjp.suppress_hyphenate_ja callback
-function luatexja.jfont.replace_altfont(pf, pc)
- local a = alt_font_table[pf]
- return a and a[pc] or pf
+do
+ local compat_ig = {}
+ for i=0xf900, 0xfaff do compat_ig[i] = true end
+ for i=0x2f800, 0x2fa1f do compat_ig[i] = true end
+ local protect_glyph = node.direct.protect_glyph
+--
+ local getfont, setfont = node.direct.getfont, node.direct.setfont
+ function luatexja.jfont.replace_altfont(a, pc, p)
+ local pf = get_attr(p, a); pf = (pf and pf>0 and pf) or getfont(p)
+ local af = alt_font_table[pf]
+ pf = af and af[pc] or pf; setfont(p, pf)
+ if compat_ig[pc] and font_metric_table[pf].protect_compat_ig then
+ protect_glyph(p)
+ end
+ return pf
+ end
end
-
------ for LaTeX interface
local alt_font_table_latex = {}
diff --git a/macros/luatex/generic/luatexja/src/ltj-pretreat.lua b/macros/luatex/generic/luatexja/src/ltj-pretreat.lua
index 508de5bb99..43ecac806c 100644
--- a/macros/luatex/generic/luatexja/src/ltj-pretreat.lua
+++ b/macros/luatex/generic/luatexja/src/ltj-pretreat.lua
@@ -110,10 +110,7 @@ do
setfield(b, 'type', 100); setfield(b, 'user_id', JA_AL_BDD);
insert_before(head, p, b)
end
- local pf = get_attr(p, attr_curjfnt)
- pf = (pf and pf>0 and pf) or getfont(p)
- setfont(p, ltjf_replace_altfont(pf, pc))
- setlang(p, lang_ja)
+ setlang(p, lang_ja);
ltjs_orig_char_table[p], prev_chartype = pc, 2
elseif prev_chartype==2 then
local b = node_new(id_whatsit,sid_user);
@@ -140,8 +137,7 @@ local set_box_stack_level
do
local ltjs_report_stack_level = ltjs.report_stack_level
local ltjf_font_metric_table = ltjf.font_metric_table
-local font_getfont = font.getfont
-local traverse_id = node.direct.traverse_id
+local traverse_glyph = node.direct.traverse_glyph
local cnt_stack = luatexbase.registernumber 'ltj@@stack'
local texget, getvalue = tex.get, node.direct.getdata
function set_box_stack_level(head, mode)
@@ -158,16 +154,20 @@ function set_box_stack_level(head, mode)
ltjs_report_stack_level(getcount(cnt_stack) + box_set)
for _,p in pairs(wtd) do node_free(p) end
if ltjs.list_dir == dir_tate then
- for p in traverse_id(id_glyph,to_direct(head)) do
- if has_attr(p, attr_icflag, 0) and getlang(p)==lang_ja then
- local nf = ltjf_replace_altfont( get_attr(p, attr_curtfnt) or getfont(p) , ltjs_orig_char_table[p])
- setfont(p, nf)
- if ltjf_font_metric_table[nf].vert_activated then
- local pc = getchar(p); pc = ltjf_font_metric_table[nf].vform[pc]
- if pc then setchar(p, pc) end
+ for p in traverse_glyph(to_direct(head)) do
+ if getlang(p)==lang_ja and has_attr(p, attr_icflag, 0) then
+ local pf = ltjf_replace_altfont(attr_curtfnt, getchar(p), p)
+ if ltjf_font_metric_table[pf].vert_activated then
+ local pc = ltjf_font_metric_table[pf].vform[pc]; if pc then setchar(p, pc) end
end
end
end
+ else
+ for p in traverse_glyph(to_direct(head)) do
+ if getlang(p)==lang_ja and has_attr(p, attr_icflag, 0) then
+ ltjf_replace_altfont(attr_curjfnt, getchar(p), p)
+ end
+ end
end
return head
end
diff --git a/macros/luatex/generic/luatexja/src/ltj-rmlgbm.lua b/macros/luatex/generic/luatexja/src/ltj-rmlgbm.lua
index 36fb7f7877..ee43ca8595 100644
--- a/macros/luatex/generic/luatexja/src/ltj-rmlgbm.lua
+++ b/macros/luatex/generic/luatexja/src/ltj-rmlgbm.lua
@@ -3,9 +3,19 @@
--
luatexja.load_module 'base'; local ltjb = luatexja.base
+local get_modtime
+do
+ local find_file = kpse.find_file
+ local lfs = require"lfs"
+ local file_attributes = lfs.attributes
+ get_modtime = function (f)
+ f = f and find_file(f, 'cmap files')
+ return f and file_attributes(f, 'modification')
+ end
+end
local cidfont_data = {}
local cache_chars = {}
-local cache_ver = 11
+local cache_ver = 12
local identifiers = fonts.hashes.identifiers
local cid_reg, cid_order, cid_supp, cid_name
@@ -213,7 +223,11 @@ do
k.characters[46].width = math.floor(655360/14);
end
ltjb.save_cache("ltj-cid-auto-" .. string.lower(cid_name),
- {version = cache_ver, k})
+ {version = cache_ver,
+ cid2ucs_modtime = get_modtime(cid_name..'-UCS2'),
+ ucs2cid = kx[1]..'-H',
+ ucs2cid_modtime = get_modtime(kx[1]..'-H'),
+ k})
k.shared.rawdata.resources=k.resources
k.shared.rawdata.descriptions=k.descriptions
end
@@ -222,7 +236,7 @@ end
--
local cidf_vert_processor
do
- local traverse_id, is_node = node.direct.traverse_id, node.is_node
+ local traverse_glyph, is_node = node.direct.traverse_glyph, node.is_node
local to_direct = node.direct.todirect
local id_glyph = node.id 'glyph'
local getfont = node.direct.getfont
@@ -235,10 +249,9 @@ do
if head and luatexja.jfont.font_metric_table[fnum] and luatexja.jfont.font_metric_table[fnum].vert_activated then
local vt = fontdata.ltj_vert_table
local nh = is_node(head) and to_direct(head) or head
- for n in traverse_id(id_glyph, head) do
- if getfont(n)==fnum then
- local c = getchar(n); setchar(n, vt[c] or c)
- end
+ for n in traverse_glyph(head) do
+ local c = getchar(n)
+ if getfont(n)==fnum then setchar(n, vt[c] or c) end
end
return head, false
end
@@ -249,7 +262,11 @@ end
local dummy_vht, dummy_vorg = {}, {}
setmetatable(dummy_vht, {__index = function () return 1 end } )
setmetatable(dummy_vorg, {__index = function () return 0.88 end } )
-local function cid_cache_outdated(t) return t.version~=cache_ver end
+local function cid_cache_outdated(t)
+ return (t.version~=cache_ver)
+ or (t.cid2ucs_modtime ~= get_modtime(cid_name..'-UCS2'))
+ or (t.ucs2cid_modtime ~= get_modtime(t.ucs2cid))
+end
local function read_cid_font()
local dat = ltjb.load_cache("ltj-cid-auto-" .. string.lower(cid_name),
cid_cache_outdated)
diff --git a/macros/luatex/generic/luatexja/src/ltj-setwidth.lua b/macros/luatex/generic/luatexja/src/ltj-setwidth.lua
index dd83d7e3d5..38dec61d2e 100644
--- a/macros/luatex/generic/luatexja/src/ltj-setwidth.lua
+++ b/macros/luatex/generic/luatexja/src/ltj-setwidth.lua
@@ -33,7 +33,6 @@ local setheight = node.direct.setheight
local setdepth = node.direct.setdepth
local setlist = node.direct.setlist
-local node_traverse_id = node.direct.traverse_id
local node_traverse = node.direct.traverse
local node_copy = node.direct.copy
local node_remove = node.direct.remove
@@ -281,8 +280,7 @@ end
-- 数式の位置補正
function luatexja.setwidth.apply_ashift_math(head, last, attr_ablshift)
- for p in node_traverse(head) do
- local pid = getid(p)
+ for p, pid in node_traverse(head) do
if p==last then
return
elseif (get_attr(p, attr_icflag) or 0) ~= PROCESSED then
@@ -309,11 +307,12 @@ do
local attr_tablshift = luatexbase.attributes['ltj@tablshift']
local attr_ablshift
local disc, tex_dir
+ local traverse_glyph = node.direct.traverse_glyph
local function ashift_disc_inner(field)
local head = getfield(disc, field)
if not head then return end
local y_adjust, node_depth, adj_depth = 0, 0, 0
- for lp in node_traverse_id(id_glyph, head) do
+ for lp in traverse_glyph(head) do
y_adjust = get_attr(lp,attr_ablshift) or 0
local ld = getdepth(lp)
node_depth = max(ld + min(y_adjust, 0), node_depth)
diff --git a/macros/luatex/generic/luatexja/src/luatexja-core.sty b/macros/luatex/generic/luatexja/src/luatexja-core.sty
index 15d02be31b..b0c5c805c0 100644
--- a/macros/luatex/generic/luatexja/src/luatexja-core.sty
+++ b/macros/luatex/generic/luatexja/src/luatexja-core.sty
@@ -65,7 +65,7 @@
\expandafter\let\csname ifltj@in@latex\expandafter\endcsname
\csname iftrue\endcsname
\NeedsTeXFormat{LaTeX2e}
- \ProvidesPackage{luatexja-core}[2023-02-11 Core of LuaTeX-ja]
+ \ProvidesPackage{luatexja-core}[2023-04-06 Core of LuaTeX-ja]
\fi %</LaTeX>
%% Load prerequisite packages.
@@ -221,22 +221,24 @@
\luadef\ltj@@start@time@measure\ltj@@start@time@measure@inner
\luadef\ltj@@stop@time@measure\ltj@@stop@time@measure@inner
+\let\ltj@@convert@input@path@to@lua\relax % defined in LaTeX only (ltj-latex.sty)
+
%%%%%%%% \jfont\CS={...:...;jfm=metric;...}, \globaljfont
-\protected\def\jfont#1{%
- \def\ltj@temp{#1}\afterassignment\ltj@@jfont\directlua{luatexja.jfont.jfontdefX(false, 'yoko')}}
-\protected\def\globaljfont#1{%
- \def\ltj@temp{#1}\afterassignment\ltj@@jfont\directlua{luatexja.jfont.jfontdefX(true, 'yoko')}}
+%%%%%%%% \tfont\CS={...:...;jfm=metric;...}, \globaltfont
+\begingroup
+\def\ltj@@jfdef#1#2#3{%
+ \protected\gdef#1##1{%
+ \ltj@@convert@input@path@to@lua\def\ltj@temp{##1}%
+ \afterassignment\ltj@@jfont\directlua{luatexja.jfont.jfontdefX(#2, '#3')}}}
+\ltj@@jfdef\jfont{false}{yoko}\ltj@@jfdef\globaljfont{true}{yoko}
+\ltj@@jfdef\tfont{false}{tate}\ltj@@jfdef\globaltfont{true}{tate}
+\endgroup
\newluafunction\ltj@@jfont@inner
\directlua{
(lua.get_functions_table())[\the\ltj@@jfont@inner] = luatexja.jfont.jfontdefY
}
\def\ltj@@jfont{\expandafter\expandafter\expandafter\luafunction\expandafter\ltj@@jfont@inner\ltj@temp}
-%%%%%%%% \tfont\CS={...:...;jfm=metric;...}, \globaltfont
-\protected\def\tfont#1{%
- \def\ltj@temp{#1}\afterassignment\ltj@@jfont\directlua{luatexja.jfont.jfontdefX(false, 'tate')}}
-\protected\def\globaltfont#1{%
- \def\ltj@temp{#1}\afterassignment\ltj@@jfont\directlua{luatexja.jfont.jfontdefX(true, 'tate')}}
%%%%%%%% \zw, \zh
\newluafunction\ltj@zw@inner
diff --git a/macros/luatex/generic/luatexja/src/luatexja.lua b/macros/luatex/generic/luatexja/src/luatexja.lua
index 31bd0662b3..f4536580e3 100644
--- a/macros/luatex/generic/luatexja/src/luatexja.lua
+++ b/macros/luatex/generic/luatexja/src/luatexja.lua
@@ -1,14 +1,23 @@
require 'lualibs'
------------------------------------------------------------------------
-local function load_lua(fn)
- local found = kpse.find_file(fn, 'tex')
- if not found then
+do
+ local ipath = {}
+ function luatexja.input_path_clear() for i in ipairs(ipath) do ipath[i]=nil end end
+ function luatexja.input_path_add(s) ipath[#ipath+1]=s end
+ function luatexja.load_lua(fn)
+ local found = kpse.find_file(fn, 'tex')
+ if not found then
+ for _,v in ipairs(ipath) do
+ found = kpse.find_file(v .. fn, 'tex'); if found then break end
+ end
+ end
+ if not found then
tex.error("LuaTeX-ja error: File `" .. fn .. "' not found")
- else
+ else
texio.write_nl('(' .. found .. ')'); dofile(found)
- end
+ end
+ end
end
-luatexja.load_lua = load_lua
function luatexja.load_module(name) require('ltj-' .. name.. '.lua') end
do
@@ -100,9 +109,9 @@ dir_table.dir_utod = dir_table.dir_tate + dir_table.dir_math_mod
local load_module = luatexja.load_module
load_module 'base'; local ltjb = luatexja.base
if tex.outputmode==0 then
- ltjb.package_error('luatexja',
- 'DVI output is not supported in LuaTeX-ja',
- 'Use lua*tex instead dvilua*tex.')
+ ltjb.package_error('luatexja',
+ 'DVI output is not supported in LuaTeX-ja',
+ 'Use lua*tex instead dvilua*tex.')
end
load_module 'rmlgbm'; local ltjr = luatexja.rmlgbm -- must be 1st
if luatexja_debug then load_module 'debug' end
@@ -350,21 +359,28 @@ end
-- lastnodechar
do
- local getnest = tex.getnest
- local id_glyph = node.id 'glyph'
- function luatexja.pltx_composite_last_node_char()
- local n = getnest().tail
- local r = '-1'
- if n then
- if n.id==id_glyph then
- while n.components and n.subtype and n.subtype%4 >= 2 do
- n = node.tail(n)
- end
- r = tostring(n.char)
- end
+ local get_attr, traverse_glyph = node.get_attribute, node.traverse_glyph
+ local getnest = tex.getnest
+ local id_hlist = node.id 'hlist'
+ local id_glyph = node.id 'glyph'
+ local PACKED, PROCESSED_BEGIN_FLAG = icflag_table.PACKED, icflag_table.PROCESSED_BEGIN_FLAG
+ function luatexja.pltx_composite_last_node_char()
+ local n = getnest().tail
+ local r = '-1'
+ if n then
+ if n.id==id_hlist
+ and (get_attr(n, attr_icflag) or 0) % PROCESSED_BEGIN_FLAG == PACKED then
+ for i in traverse_glyph(n.head) do n = i; break end
end
- tex.sprint(-2, r)
- end
+ if n.id==id_glyph then
+ while n.components and n.subtype and n.subtype%4 >= 2 do
+ n = node.tail(n)
+ end
+ r = tostring(n.char)
+ end
+ end
+ tex.sprint(-2, r)
+ end
end
do
@@ -580,24 +596,24 @@ local function debug_show_node_X(p,print_fn, limit, inner_depth)
p=node_next(p)
end
function luatexja.ext_show_node_list(head,depth,print_fn, lim)
- prefix = depth
- inner_depth = 0
- if head then
- while head do
- debug_show_node_X(head, print_fn, lim or 1/0, inner_depth); head = node_next(head)
- end
- else
- print_fn(prefix .. ' (null list)')
- end
+ prefix = depth
+ inner_depth = 0
+ if head then
+ while head do
+ debug_show_node_X(head, print_fn, lim or 1/0, inner_depth); head = node_next(head)
+ end
+ else
+ print_fn(prefix .. ' (null list)')
+ end
end
function luatexja.ext_show_node(head,depth,print_fn, lim)
- prefix = depth
- inner_depth = 0
- if head then
- debug_show_node_X(head, print_fn, lim or 1/0, inner_depth)
- else
- print_fn(prefix .. ' (null list)')
- end
+ prefix = depth
+ inner_depth = 0
+ if head then
+ debug_show_node_X(head, print_fn, lim or 1/0, inner_depth)
+ else
+ print_fn(prefix .. ' (null list)')
+ end
end
end
diff --git a/macros/luatex/generic/luatexja/src/patches/lltjcore.sty b/macros/luatex/generic/luatexja/src/patches/lltjcore.sty
index af49aef7fa..fff34327c7 100644
--- a/macros/luatex/generic/luatexja/src/patches/lltjcore.sty
+++ b/macros/luatex/generic/luatexja/src/patches/lltjcore.sty
@@ -3,7 +3,7 @@
%
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{lltjcore}[2022-05-30 Patch to LaTeX2e Kernel for LuaTeX-ja]
+\ProvidesPackage{lltjcore}[2023-02-26 Patch to LaTeX2e Kernel for LuaTeX-ja]
\RequirePackage{etoolbox}
%%% expl3
@@ -201,6 +201,20 @@
\patchcmd\@outputpage{\reset@font}{\@tombowreset@@paper\reset@font}{}{}
\patchcmd\@outputpage{\@begindvi}{\@begindvi\@outputtombow}{}{}
+%
+\pretocmd\@floatboxreset{\pltx@save@float@dir}{}{}
+\patchcmd\@endfloatbox{\outer@nobreak}{\outer@nobreak\pltx@check@float@dir}{}{}
+\def\pltx@save@float@dir{%
+ \edef\pltx@float@dir@first{\ltjgetparameter{direction}}}
+\def\pltx@check@float@dir{%
+ \ifx\pltx@float@dir@first\@undefined\else
+ \ifnum\ltjgetparameter{direction}=\pltx@float@dir@first\else
+ \pltx@err@float@dir
+ \fi
+ \fi}
+\def\pltx@err@float@dir{%
+ \@latex@error{Direction change inside float!?\MessageBreak
+ Use \noexpand\layoutcaption provided in \string\usepackage{lltjext}}\@ehc}
%%% Remove extra xkanjiskip
\renewcommand\@makefnmark{%
\unless\ifnum\ltjgetparameter{direction}=3
diff --git a/macros/luatex/generic/luatexja/src/patches/lltjfont.sty b/macros/luatex/generic/luatexja/src/patches/lltjfont.sty
index f1435f7152..f86dec1de6 100644
--- a/macros/luatex/generic/luatexja/src/patches/lltjfont.sty
+++ b/macros/luatex/generic/luatexja/src/patches/lltjfont.sty
@@ -3,7 +3,7 @@
%
\NeedsTeXFormat{LaTeX2e}
-\ProvidesPackage{lltjfont}[2021-05-26 Patch to NFSS2 for LuaTeX-ja]
+\ProvidesPackage{lltjfont}[2023-04-06 Patch to NFSS2 for LuaTeX-ja]
%%%%%%%% LaTeX2e version detection
\newcount\ltj@@latex@plv \ltj@@latex@plv=-1
@@ -1433,4 +1433,18 @@
\ltj@@getjfontnumber#1%
\directlua{luatexja.jfont.pickup_alt_font_b(\the\ltj@tempcntc,'\luatexluaescapestring{#2}')}%
}
+
+%%%% send \input@path data to lua
+\def\ltj@@convert@input@path@to@lua{%
+ \ltj@@cipath@clear
+ \ifdefined\input@path
+ \expandafter\@tfor\expandafter\ltj@temp\expandafter:\expandafter=\input@path\do{\ltj@@cipath@add{\ltj@temp}}%
+ \fi
+}
+\newluafunction\ltj@@cipath@clear@inner
+\directlua{
+ (lua.get_functions_table())[\the\ltj@@cipath@clear@inner] = luatexja.input_path_clear
+}
+\protected\luadef\ltj@@cipath@clear\ltj@@cipath@clear@inner
+\def\ltj@@cipath@add#1{\directlua{luatexja.input_path_add('\luatexluaescapestring{#1}')}}
\endinput