From fac21618bdcd44d7ca47228c8b856488b12ee6a2 Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Wed, 26 Oct 2022 03:00:55 +0000 Subject: CTAN sync 202210260300 --- macros/luatex/generic/penlight/penlight.pdf | Bin 59406 -> 59499 bytes macros/luatex/generic/penlight/penlight.sty | 12 +- macros/luatex/generic/penlight/penlight.tex | 2 +- macros/luatex/generic/penlight/penlightextras.lua | 7 +- macros/luatex/latex/luaquotes/README | 3 +- .../latex/luaquotes/luaquotes-documentation.pdf | Bin 107332 -> 110314 bytes .../latex/luaquotes/luaquotes-documentation.tex | 147 +++++++++++++++++++-- macros/luatex/latex/luaquotes/luaquotes.sty | 23 +++- 8 files changed, 170 insertions(+), 24 deletions(-) (limited to 'macros/luatex') diff --git a/macros/luatex/generic/penlight/penlight.pdf b/macros/luatex/generic/penlight/penlight.pdf index 586bfa8dbf..d8a0ac2f15 100644 Binary files a/macros/luatex/generic/penlight/penlight.pdf and b/macros/luatex/generic/penlight/penlight.pdf differ diff --git a/macros/luatex/generic/penlight/penlight.sty b/macros/luatex/generic/penlight/penlight.sty index 5af886786e..8180a839ac 100644 --- a/macros/luatex/generic/penlight/penlight.sty +++ b/macros/luatex/generic/penlight/penlight.sty @@ -1,5 +1,5 @@ % Kale Ewasiuk (kalekje@gmail.com) -% 2022-10-22 +% 2022-10-24 % Copyright (C) 2021-2022 Kale Ewasiuk % % Permission is hereby granted, free of charge, to any person obtaining a copy @@ -22,19 +22,19 @@ % OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE % OR OTHER DEALINGS IN THE SOFTWARE. -\ProvidesPackage{penlight}[2022-10-22] +\ProvidesPackage{penlight}[2022-10-24] \RequirePackage{luacode} -\IfFileExists{luakeys.lua}{}{\PackageError{penlight}{This package requires that luakeys be installed}{help text}} +\IfFileExists{luakeys.lua}{}{\PackageError{penlight}{This package requires that luakeys be installed}{}} \DeclareOption{pl}{\luadirect{ - pl = require('penlight') + pl = require'penlight' __PENLIGHT__ = 'pl' }} \DeclareOption{penlight}{\luadirect{ - penlight = require('penlight') + penlight = require'penlight' __PENLIGHT__ = 'penlight' }} @@ -52,7 +52,7 @@ \luadirect{ if __PENLIGHT__ == nil then - tex.print('\\PackageError{penlight}{penlight or pl option must be passed to penlight as the first option}{}') + tex.sprint('\\PackageError{penlight}{"penlight" or "pl" option must be passed to penlight as the first option}{}') end } diff --git a/macros/luatex/generic/penlight/penlight.tex b/macros/luatex/generic/penlight/penlight.tex index f3ee02f2ec..dad50c7be2 100644 --- a/macros/luatex/generic/penlight/penlight.tex +++ b/macros/luatex/generic/penlight/penlight.tex @@ -1,5 +1,5 @@ % Kale Ewasiuk (kalekje@gmail.com) -% 2022-10-22 +% 2022-10-24 % Copyright (C) 2021-2022 Kale Ewasiuk % % Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/macros/luatex/generic/penlight/penlightextras.lua b/macros/luatex/generic/penlight/penlightextras.lua index a6a5c1ff0a..7d0a7eb6b5 100644 --- a/macros/luatex/generic/penlight/penlightextras.lua +++ b/macros/luatex/generic/penlight/penlightextras.lua @@ -1,5 +1,5 @@ --% Kale Ewasiuk (kalekje@gmail.com) ---% 2022-10-22 +--% 2022-10-24 --% Copyright (C) 2021-2022 Kale Ewasiuk --% --% Permission is hereby granted, free of charge, to any person obtaining a copy @@ -775,10 +775,7 @@ end - - - -if _PL_GLOBALS__ then +if pl.hasval(__PL_GLOBALS__) then __PL_EXTRAS__ = 2 -- iterators kpairs = pl.utils.kpairs diff --git a/macros/luatex/latex/luaquotes/README b/macros/luatex/latex/luaquotes/README index 1fd076cfac..162a742f06 100644 --- a/macros/luatex/latex/luaquotes/README +++ b/macros/luatex/latex/luaquotes/README @@ -1,6 +1,6 @@ luaquotes - smart quotes with lua -version: 1.0.2 +version: 1.1.0 This package automatically creates smart quotes using lua filters and provides auxiliary commands for typesetting specific lua punctuation @@ -12,6 +12,7 @@ For suggestions, feature requests, and bug reports, please use the project's GitHub site: https://github.com/ezgranet/luaquotes Version history: +25/10/2022—support for elision 30/08/2022—resolving bug with language versions 28/08/2022—resolving bug with language versions 24/08/2022 —package creation diff --git a/macros/luatex/latex/luaquotes/luaquotes-documentation.pdf b/macros/luatex/latex/luaquotes/luaquotes-documentation.pdf index 22014a7ade..f0d7e414d1 100644 Binary files a/macros/luatex/latex/luaquotes/luaquotes-documentation.pdf and b/macros/luatex/latex/luaquotes/luaquotes-documentation.pdf differ diff --git a/macros/luatex/latex/luaquotes/luaquotes-documentation.tex b/macros/luatex/latex/luaquotes/luaquotes-documentation.tex index 739edba838..d5bf6ed5ef 100644 --- a/macros/luatex/latex/luaquotes/luaquotes-documentation.tex +++ b/macros/luatex/latex/luaquotes/luaquotes-documentation.tex @@ -50,7 +50,11 @@ Don\sqoneright t!\sqoneright% \end{tabular} \end{center} + \section{Smart quotes} + + + \subsection{Options} The default option, for English quotation marks, is called by: \begin{minted}[ @@ -77,6 +81,23 @@ breaklines, \usepackage[fr]{luaquotes} %French \usepackage[de]{luaquotes} % German \end{minted} +\subsubsection{English Features} +The English features are designed to smartly recognise English punctuation: +\begin{center} +\renewcommand{\arraystretch}{2} +\begin{tabular}{ccc} +\ttfamily Feature & User input & Output\\ + Double Quotes & \LARGE\texttt{"Salut!"}% +& +\LARGE "Hello"\\ +Single Quotes& \LARGE\texttt{'Hello!'}% +& \LARGE 'Hello' \\ +Contractions & \LARGE \texttt{Don't} & \LARGE Don't\\ +Elision & \LARGE\texttt{'ello} & \LARGE 'ello \\ + + +\end{tabular} +\end{center} \subsubsection{French option} The French option produces the following output, including the extra space around punctuation prescribed by French typography: @@ -255,9 +276,9 @@ breaklines, firstnumber=last ] {latex} -\def\luaquotesversionnumber{1.0.2} -\ProvidesPackage{luaquotes} - [2022/08/01\luaquotesversionnumber smart quotes with lua] +\def\luaquotesversionnumber{1.1} +\ProvidesPackage{dev-lua} + [2022/10/25\luaquotesversionnumber smart quotes with lua] % !TeX program = lualatex % !TeX encoding = utf8 % This work may be distributed and/or modified under the @@ -474,7 +495,39 @@ firstnumber=last ] {latex} } - + \luaexec{ + \begin{minted}[ +frame=lines, +framesep=2mm, +baselinestretch=1.2, +bgcolor=LightGray, +fontsize=\footnotesize, +linenos, +breaklines, +firstnumber=last +] +{lua} + + +function abbrevsingle ( s ) + return ( s:gsub ( " '(..-) " , " ’\%1 " ) ) + end + \end{minted} + \begin{minted}[ +frame=lines, +framesep=2mm, +baselinestretch=1.2, +bgcolor=LightGray, +fontsize=\footnotesize, +linenos, +breaklines, +firstnumber=last +] +{latex} + + } + + \luaexec{ \end{minted} \begin{minted}[ @@ -579,6 +632,74 @@ firstnumber=last ] {latex} }} +\newcommand\abbrevsingleon{\directlua{ + \end{minted} + \begin{minted}[ +frame=lines, +framesep=2mm, +baselinestretch=1.2, +bgcolor=LightGray, +fontsize=\footnotesize, +linenos, +breaklines, +firstnumber=last +] +{lua} + + +luatexbase.add_to_callback ( + "process_input_buffer" , + abbrevsingle , + "abbrevsingle" ) + \end{minted} + \begin{minted}[ +frame=lines, +framesep=2mm, +baselinestretch=1.2, +bgcolor=LightGray, +fontsize=\footnotesize, +linenos, +breaklines, +firstnumber=last +] +{latex} + + + }} +\newcommand\abbrevsingleoff{\directlua{ + \end{minted} + \begin{minted}[ +frame=lines, +framesep=2mm, +baselinestretch=1.2, +bgcolor=LightGray, +fontsize=\footnotesize, +linenos, +breaklines, +firstnumber=last +] +{lua} + +luatexbase.remove_from_callback ( + "process_input_buffer" , + "abbrevsingle" ) + \end{minted} + \begin{minted}[ +frame=lines, +framesep=2mm, +baselinestretch=1.2, +bgcolor=LightGray, +fontsize=\footnotesize, +linenos, +breaklines, +firstnumber=last +] +{latex} + + }} + + + \newcommand\singlequotelinestarton{\directlua{ \end{minted} \begin{minted}[ @@ -685,8 +806,11 @@ firstnumber=last \newcommand{\smartquotes}{% \doublequoteson% \singlequotelinestarton% +\abbrevsingleon% \singlequoteson} - \newcommand{\dumbquotes}{\doublequotesoff + \newcommand{\dumbquotes}{ + \doublequotesoff +\abbrevsingleoff \singlequotelinestartoff \singlequotesoff} \end{minted} @@ -1381,16 +1505,23 @@ firstnumber=last \end{minted} \section{Version History} -\subsection{\texttt{1.0.1}} + +\subsection{\normalfont\texttt{1.1.0}} +\ttfamily 25 October 2022: Added support for elision + + +\subsection{\normalfont\texttt{1.0.1}} + + \ttfamily 30 August 2022: Further corrections to bug preventing non-English usage -\subsection{\texttt{1.0.1}} +\subsection{\normalfont\texttt{1.0.1}} \ttfamily 28 August 2022: Change bug preventing non-English usage -\subsection{\texttt{1.0.0}} +\subsection{\normalfont\texttt{1.0.0}} \ttfamily 21 August 2022: Package creation diff --git a/macros/luatex/latex/luaquotes/luaquotes.sty b/macros/luatex/latex/luaquotes/luaquotes.sty index 15801e9ba2..87ef2eb7cd 100644 --- a/macros/luatex/latex/luaquotes/luaquotes.sty +++ b/macros/luatex/latex/luaquotes/luaquotes.sty @@ -1,6 +1,6 @@ -\def\luaquotesversionnumber{1.0.2} -\ProvidesPackage{luaquotes} - [2022/08/30\luaquotesversionnumber smart quotes with lua] +\def\luaquotesversionnumber{1.1} +\ProvidesPackage{dev-lua} + [2022/10/25\luaquotesversionnumber smart quotes with lua] % !TeX program = lualatex % !TeX encoding = utf8 % This work may be distributed and/or modified under the @@ -92,6 +92,13 @@ function doublequotes ( s ) return (s:gsub ("^'","‘" ) ) end} + + +\luaexec{ +function abbrevsingle ( s ) + return ( s:gsub ( " '(..-) " , " ’\%1 " ) ) + end} + \luaexec{function singlequotes ( s ) return ( s:gsub ( " '"," ‘" ) ) end} @@ -107,6 +114,14 @@ function doublequotes ( s ) \newcommand\doublequotesoff{\directlua{luatexbase.remove_from_callback ( "process_input_buffer" , "doublequotes" )}} +\newcommand\abbrevsingleon{\directlua{luatexbase.add_to_callback ( + "process_input_buffer" , + abbrevsingle , + "abbrevsingle" )}} +\newcommand\abbrevsingleoff{\directlua{luatexbase.remove_from_callback ( + "process_input_buffer" , + "abbrevsingle" )}} + \newcommand\singlequotelinestarton{\directlua{ luatexbase.add_to_callback ( "process_input_buffer" , singlequotelinestart , "singlequotelinestart" ) @@ -129,9 +144,11 @@ luatexbase.add_to_callback ( \newcommand{\smartquotes}{% \doublequoteson% \singlequotelinestarton% +\abbrevsingleon% \singlequoteson} \newcommand{\dumbquotes}{ \doublequotesoff +\abbrevsingleoff \singlequotelinestartoff \singlequotesoff} -- cgit v1.2.3