summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/luatex
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2021-11-27 21:26:37 +0000
committerKarl Berry <karl@freefriends.org>2021-11-27 21:26:37 +0000
commit511ac6e5b1a3cf5bf3ecdb3085625a22cf0287b0 (patch)
treeedc222ed4b2ef8f0f226703aa1a16693dc1ae64b /Master/texmf-dist/source/luatex
parent995101497c4b94ca96b78714e873d0a5e3be89fa (diff)
lua-widow-control (27nov21)
git-svn-id: svn://tug.org/texlive/trunk@61174 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source/luatex')
-rw-r--r--Master/texmf-dist/source/luatex/lua-widow-control/lwc-documentation.mkxl82
-rw-r--r--Master/texmf-dist/source/luatex/lua-widow-control/lwc-documentation.tex26
2 files changed, 78 insertions, 30 deletions
diff --git a/Master/texmf-dist/source/luatex/lua-widow-control/lwc-documentation.mkxl b/Master/texmf-dist/source/luatex/lua-widow-control/lwc-documentation.mkxl
index a4d153de5b9..05d9d930f9d 100644
--- a/Master/texmf-dist/source/luatex/lua-widow-control/lwc-documentation.mkxl
+++ b/Master/texmf-dist/source/luatex/lua-widow-control/lwc-documentation.mkxl
@@ -32,6 +32,7 @@ fonts.handlers.otf.addfeature {
\setupalign[hz, hanging]
\definefontfeature[lining][onum=no,lnum=yes]
+\definefontfeature[allsmall][c2sc=yes, smcp=yes]
\define\lining{\feature[+][lining]}
\starttypescript[lwc-fonts]
@@ -78,7 +79,7 @@ fonts.handlers.otf.addfeature {
\setupstructure[state=start, method=auto]
% Bookmarks
-\placebookmarks[section, subsection, filename][section, subsection, filename][number=no]
+\placebookmarks[section, subsection][section, subsection][number=no]
\setupinteractionscreen[option=bookmark]
%%%%%%%%%%%%%%%%%%%%%%
@@ -91,7 +92,7 @@ fonts.handlers.otf.addfeature {
% Acronym styling
\definecharacterkerning[acronymkerning][factor=0.05]
-\definealternativestyle[acronymstyle][{\word\sc\switchtobodyfont[1.1em]\setcharacterkerning[acronymkerning]}][]
+\definealternativestyle[acronymstyle][{\feature[+][allsmall]\switchtobodyfont[1.1em]\setcharacterkerning[acronymkerning]}][]
\definehighlight[acronym][style=acronymstyle]
\startuniqueMPgraphic{warning}
@@ -146,9 +147,9 @@ setbounds currentpicture to boundingbox OverlayBox;
\startsetups[style:section]
\setcharacterkerning[titlekern]
\switchtobodyfont[adventor]
- \word
+ \WORD
\bfb
- \feature[+][smallcaps]
+ \feature[+][allsmall]
\interwordspace=0.4em
\veryraggedcenter
\stopsetups
@@ -169,26 +170,69 @@ setbounds currentpicture to boundingbox OverlayBox;
number=no,
]
-\definehead[filename][subsection][
- alternative=normal,
- style=\ssita,
- before={\blank[big, preference]},
-]
-
% TOC
-\define[3]\TOCcommand{
- \midaligned{
- \llap{#2}
- \hskip 1em
- \rlap{\color[\interactionparameter{color}]{\bf #3}}
- }
+\starttexdefinition protected SectionTOCcommand #1#2#3
+ \startcurrentlistentrywrapper % Make the whole line a link
+ \midaligned{ % Have the title and page number "glued" to the middle
+ \llap{\currentlistentrytitle}
+ \hskip 1em
+ \rlap{\color[\interactionparameter{color}]{\bf \currentlistentrypagenumber}}
+ }
+ \stopcurrentlistentrywrapper
+
+ \par
+
+ \setbox0=\vbox{\framedtext[ % Align the subsection titles under the section title
+ frame=off,
+ width=\dimexpr\textwidth/2 - 0.5em,
+ align={flushright, wide},
+ offset=none,
+ toffset=-\lineheight,
+ ]{
+ \global\firstsubsectiontrue
+ \placelist[subsection][criterium=local]
+ }}
+ \iffirstsubsection
+ \blank[quarterline] % No subsections here
+ \else
+ \box0
+ \fi
+\stoptexdefinition
+
+\newif\iffirstsubsection
+
+\define\tocspace{\hskip 0.5em plus 0.5em minus 0.2em\relax}
+
+\unexpanded\def\toc_link#1{%
+ \startcurrentlistentrywrapper%
+ \hbox{#1}%
+ \stopcurrentlistentrywrapper%
}
+\starttexdefinition protected SubsectionTOCcommand #1#2#3
+ \ss\itx
+ \dontleavehmode
+ \iffirstsubsection
+ \global\firstsubsectionfalse
+ \toc_link{#2}
+ \else
+ \discretionary{}{
+ \toc_link{#2} % No interpunct if the line splits here
+ }{
+ \tocspace{\bfa·}\tocspace\toc_link{#2}
+ }
+ \fi
+\stoptexdefinition
+
\setupcombinedlist[content][list=section]
\setuplist[section][
- alternative=interactive,
- command=\TOCcommand,
- after=\par
+ alternative=command,
+ command=\SectionTOCcommand,
+]
+
+\setuplist[subsection][
+ alternative=command,
+ command=\SubsectionTOCcommand,
]
%%%%%%%%%%%%%%%%%%%%%%%
diff --git a/Master/texmf-dist/source/luatex/lua-widow-control/lwc-documentation.tex b/Master/texmf-dist/source/luatex/lua-widow-control/lwc-documentation.tex
index 40923c3707a..a49ab00a535 100644
--- a/Master/texmf-dist/source/luatex/lua-widow-control/lwc-documentation.tex
+++ b/Master/texmf-dist/source/luatex/lua-widow-control/lwc-documentation.tex
@@ -37,20 +37,19 @@
\startdocument[
title=lua-widow-control,
author=Max Chernoff,
- version=1.1.0, %%version
+ version=1.1.1, %%version
github=https://github.com/gucci-on-fleek/lua-widow-control,
ctan=https://www.ctan.org/pkg/lua-widow-control,
]
\Lwc/ is a Plain~\TeX/\LaTeX/\ConTeXt{} package that removes \waos/ without any user intervention. Using the power of \LuaTeX{}, it does so \emph{without} stretching any glue or shortening any pages or columns. Instead, \lwc/ automatically lengthens a paragraph on a page or column where a \woo/ would otherwise occur.
-\subject{Contents}
-\placecontent[criterium=all]
-\page
-
\section{Quick Start}
Ensure that your \TeX~Live/Mik\TeX{} distribution is up-to-date. Then, \LaTeX{} users just need to place \inlineTEX{\usepackage{lua-widow-control}} in the preamble of your document. For more details, see the \goto{Installation and Usage sections}[sec:install].
+\subject{Contents}
+\placecontent[criterium=all]
+
\section{Motivation}
\TeX{} provides top-notch typesetting: even 40 years after its first release, no other program produces higher quality mathematical typesetting, and its paragraph-breaking algorithm is still state-of-the-art. However, its page breaking is not quite as sophisticated as its paragraph breaking and thus suffers from some minor issues.
@@ -198,7 +197,7 @@ Currently, \ConTeXt{} \acronym{MKXL} (\LuaMetaTeX{}) users must manually install
\subsection{Plain \TeX}
-\inlineTEX{\input lua-widow-control}
+\inlineTEX{\input lua-widow-control}
\subsection{\LaTeX}
@@ -314,25 +313,30 @@ Please note that a compiled document is \bold{not} considered to be an \q{Execut
\section[sec:implementation]{Implementation}
\setupbodyfont[10pt]
+\setuphead[subsection][
+ alternative=normal,
+ style=\ssita,
+ before={\blank[big, preference]},
+]
-\filename{lua-widow-control.lua}
+\subsection{lua-widow-control.lua}
\typeLUAfile{../source/lua-widow-control.lua}
-\filename{lua-widow-control.tex}
+\subsection{lua-widow-control.tex}
\typeTEXfile{../source/lua-widow-control.tex}
-\filename{lua-widow-control.sty}
+\subsection{lua-widow-control.sty}
\typeTEXfile{../source/lua-widow-control.sty}
\def\module{\tex{module}}
-\filename{t-lua-widow-control.mkxl}
+\subsection{t-lua-widow-control.mkxl}
\typeTEXfile{../source/t-lua-widow-control.mkxl}
-\filename{Demo from \in{Table}[tab:demo]}
+\subsection{Demo from \in{Table}[tab:demo]}
\typeTEXfile{lwc-documentation-demo-text.tmp}