From b9f1af0e32ccc5a7ef1d735db15f2466960cf523 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Mon, 12 Dec 2022 21:02:03 +0000 Subject: luaquotes (12dec22) git-svn-id: svn://tug.org/texlive/trunk@65255 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/doc/lualatex/luaquotes/README | 3 +- .../lualatex/luaquotes/luaquotes-documentation.pdf | Bin 111052 -> 113378 bytes .../lualatex/luaquotes/luaquotes-documentation.tex | 320 ++++++++++++++++++++- .../tex/lualatex/luaquotes/luaquotes.sty | 58 +++- 4 files changed, 367 insertions(+), 14 deletions(-) (limited to 'Master/texmf-dist') diff --git a/Master/texmf-dist/doc/lualatex/luaquotes/README b/Master/texmf-dist/doc/lualatex/luaquotes/README index b4095e8a56c..963efc971d3 100644 --- a/Master/texmf-dist/doc/lualatex/luaquotes/README +++ b/Master/texmf-dist/doc/lualatex/luaquotes/README @@ -1,6 +1,6 @@ luaquotes - smart quotes with lua -version: 1.2.1 +version: 1.2.2 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: +12/12/2022-added degm function 23/11/2022-walking back automatic elision for now 25/10/2022—support for elision 30/08/2022—resolving bug with language versions diff --git a/Master/texmf-dist/doc/lualatex/luaquotes/luaquotes-documentation.pdf b/Master/texmf-dist/doc/lualatex/luaquotes/luaquotes-documentation.pdf index 4d5e961eace..991ae4c4618 100644 Binary files a/Master/texmf-dist/doc/lualatex/luaquotes/luaquotes-documentation.pdf and b/Master/texmf-dist/doc/lualatex/luaquotes/luaquotes-documentation.pdf differ diff --git a/Master/texmf-dist/doc/lualatex/luaquotes/luaquotes-documentation.tex b/Master/texmf-dist/doc/lualatex/luaquotes/luaquotes-documentation.tex index 3a92f1df05e..f77f8f956ad 100644 --- a/Master/texmf-dist/doc/lualatex/luaquotes/luaquotes-documentation.tex +++ b/Master/texmf-dist/doc/lualatex/luaquotes/luaquotes-documentation.tex @@ -80,6 +80,7 @@ breaklines, {latex} \usepackage[fr]{luaquotes} %French \usepackage[de]{luaquotes} % German +\usepackage[degm]{luaquotes} % German with French-style quotes \end{minted} \subsubsection{English Features} The English features are designed to smartly recognise English punctuation: @@ -110,7 +111,7 @@ The French option produces the following output, including the extra space aroun \end{tabular} \end{center} \subsubsection{The German option} -The German option produces the following outpu: +The German option produces the following output: \begin{center} \renewcommand{\arraystretch}{2} @@ -123,6 +124,20 @@ The German option produces the following outpu: \end{tabular} \end{center} +\subsubsection{The German (\texttt{degm}) option} +The German (\texttt{degm}) option produces the following output: + +\begin{center} +\renewcommand{\arraystretch}{2} +\begin{tabular}{cc} +\ttfamily User input &Output\\ +\LARGE\texttt{"Hallo!"}% +& \LARGE \degmdouble Hallo!\degmtr\\ +\LARGE\texttt{'Hallo!'}% +& \LARGE \degmsingle Hallo!\desgmtr\\ + +\end{tabular} +\end{center} @@ -140,6 +155,7 @@ breaklines, \dumbquotes %English \frdumbquotes %French \dedumbquotes %German +\degmdumbquotes %German with French-style quotes \end{minted} The following commands re-activate the smart quotes function: @@ -155,12 +171,13 @@ breaklines, \smartquotes %English \frsmartquotes %French \desmartquotes % German +\degmsmartquotes % German with French-style quotes \end{minted} A limitation on the (de-)activation of the package is that the Lua filters will not deactivate within the same paragraph, so the function can only be changed across paragraphs. \subsection{Monospace} -As a general rule, smart quotes are rather undesirable in monospace text, and therefore, within the \color{darkspringgreen}\verb! \texttt!\color{black} environment the package does not apply smart quotes. Thus, the same input produces in roman face \textcolor{darkspringgreen}{"Hello World"} but in monospace \texttt{"Hello World"}. +As a general rule, smart quotes are rather undesirable in monospace text, and therefore, within the \color{darkspringgreen} \verb!\texttt!\color{black}\ environment the package does not apply smart quotes. Thus, the same input produces in roman face \textcolor{darkspringgreen}{"Hello World"} but in monospace \texttt{"Hello World"}. As the example above shows, the default behaviour of this package forces straight quotes in monospace, and disables \TeX\ quote ligatures (but not other \TeX\ ligatures) to do so, on the assumption that any form of curved quotes are undesirable. @@ -201,10 +218,12 @@ Single low quote & \ttfamily U+201A & \verb!\desingle! & \Huge\desingle\thebox\\ Right double quote & \ttfamily U+201D & \verb!\sqtworight! & \Huge\thebox\sqtworight\\ Left guillemet [w/ space]& \ttfamily U+00AB & \verb!\glmtl! & \Huge\glmtl\thebox\\ Right guillemet [w/ space]& \ttfamily U+00BB & \verb!\glmtr! & \Huge\thebox\glmtr\\ -Single left guillemet [w/ space]& \ttfamily U+2039 & \verb!\sglmtl! & \Huge\sglmtl\thebox\\ - -Single right guillemet [w/ space]& \ttfamily U+203A & \verb!\sglmtr! & \Huge\thebox\sglmtr\\ - + \texttt{degm} left guillemet & \ttfamily U+00BB & \verb!\degmtl! & \Huge\degmtl\thebox\\ + \texttt{degm} right guillemet & \ttfamily U+00AB & \verb!\degmtr! & \Huge\thebox\degmtr\\ + Single left guillemet [w/ space]& \ttfamily U+2039 & \verb!\sglmtl! & \Huge\sglmtl\thebox\\ + Single right guillemet [w/ space]& \ttfamily U+203A & \verb!\sglmtr! & \Huge\thebox\sglmtr\\ + \texttt{degm} single left guillemet & \ttfamily U+203A & \verb!\desgmtl! & \Huge\desgmtl\thebox\\ + \texttt{degm} single right guillemet & \ttfamily U+2039 & \verb!\desgmtr! & \Huge\thebox\desgmtr\\ \end{longtable} \end{center} @@ -236,7 +255,7 @@ For typesetting US/Imperial measurements like feet and inches, the correct symbo -For certain Polynesian langauges, a letter called the \okina Okina is used; while this appears identical to a left single quotation mark in many fonts, it is encoded differently in Unicode because it is properly a letter, not a punctuation mark. +For certain Polynesian languages, a letter called the \okina Okina is used; while this appears identical to a left single quotation mark in many fonts, it is encoded differently in Unicode because it is properly a letter, not a punctuation mark. @@ -254,7 +273,7 @@ For certain Polynesian langauges, a letter called the \okina Okina is used; whil \section{Future Development and Localisation} - The package's online repository is the best place to report bugs, feature requests, or other contributions, and is located at: \\\url{github.com/ezgranet/luaquotes}. + The package's online repository is the best place to report bugs, feature requests, or other contributions, and is located at: \\\url{https://github.com/ezgranet/luaquotes}. One obvious point of future development is the addition of other language localisations; this is technologically easy in principle but difficult for me to accomplish without assistance because it requires detailed knowledge of typographic conventions for any given language standard, and therefore the aid of contributors and collaborators. \section{Licence} This project is licensed under the Latex Public Project Licence version 1.3\textit{c}. This documentation is copyright of the author but licensed under CC-BY-SA 3.0. @@ -829,7 +848,10 @@ firstnumber=last \frsmartquotes \frdumbquotes \desmartquotes -\dedumbquotes\smartquotes} +\dedumbquotes +\degmsmartquotes +\degmdumbquotes +\smartquotes} \renewcommand{\texttt}[1]{{\ttfamily\addfontfeature{RawFeature={+qtbye,-tlig}} #1}} } @@ -1193,6 +1215,283 @@ firstnumber=last \dumbquotes\dumbquotes \desmartquotes} \renewcommand{\texttt}[1]{{\ttfamily\addfontfeature{RawFeature={+qtbye,-tlig}} #1}} +} + \end{minted} + \subsection{The German with French-style quotes (\texttt{degm}) option} + \begin{minted}[ +frame=lines, +framesep=2mm, +baselinestretch=1.2, +bgcolor=LightGray, +fontsize=\footnotesize, +linenos, +breaklines, +firstnumber=last +] +{latex} + +%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%% +% SCHÖNERES DEUTSCH +%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%% +\luaexec{ + \end{minted} + \begin{minted}[ +frame=lines, +framesep=2mm, +baselinestretch=1.2, +bgcolor=LightGray, +fontsize=\footnotesize, +linenos, +breaklines, +firstnumber=last +] +{lua} +function degmdoublequotes ( 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}[ +frame=lines, +framesep=2mm, +baselinestretch=1.2, +bgcolor=LightGray, +fontsize=\footnotesize, +linenos, +breaklines, +firstnumber=last +] +{lua} +function degmsinglequotelinestart ( s ) + return (s:gsub ("^'","›" ) ) + 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}[ +frame=lines, +framesep=2mm, +baselinestretch=1.2, +bgcolor=LightGray, +fontsize=\footnotesize, +linenos, +breaklines, +firstnumber=last +] +{lua} +function degmsinglequotesclose( 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} + } + +%% Two utility macros to activate/deactivate the Lua function: +\newcommand\degmdoublequoteson{\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" , degmdoublequotes , "degmdoublequotes" ) + \end{minted} + \begin{minted}[ +frame=lines, +framesep=2mm, +baselinestretch=1.2, +bgcolor=LightGray, +fontsize=\footnotesize, +linenos, +breaklines, +firstnumber=last +] +{latex} + }} +\newcommand\degmdoublequotesoff{\directlua{luatexbase.remove_from_callback ( + "process_input_buffer" , "degmdoublequotes" ) + \end{minted} + \begin{minted}[ +frame=lines, +framesep=2mm, +baselinestretch=1.2, +bgcolor=LightGray, +fontsize=\footnotesize, +linenos, +breaklines, +firstnumber=last +] +{latex} +}} +\newcommand\degmsinglequotelinestarton{\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" , degmsinglequotelinestart , "degmsinglequotelinestart" )\end{minted} + \begin{minted}[ +frame=lines, +framesep=2mm, +baselinestretch=1.2, +bgcolor=LightGray, +fontsize=\footnotesize, +linenos, +breaklines, +firstnumber=last +] +{latex} + }} +\newcommand\degmsinglequotelinestartoff{\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" , "degmsinglequotelinestart" ) + \end{minted} + \begin{minted}[ +frame=lines, +framesep=2mm, +baselinestretch=1.2, +bgcolor=LightGray, +fontsize=\footnotesize, +linenos, +breaklines, +firstnumber=last +] +{latex} + }} +\newcommand\degmsinglequotescloseon{\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" , degmsinglequotesclose , "degmsinglequotesclose" ) + \end{minted} + \begin{minted}[ +frame=lines, +framesep=2mm, +baselinestretch=1.2, +bgcolor=LightGray, +fontsize=\footnotesize, +linenos, +breaklines, +firstnumber=last +] +{latex} + }} +\newcommand\degmsinglequotescloseoff{\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" , "degmsinglequotesclose" ) + \end{minted} + \begin{minted}[ +frame=lines, +framesep=2mm, +baselinestretch=1.2, +bgcolor=LightGray, +fontsize=\footnotesize, +linenos, +breaklines, +firstnumber=last +] +{latex} + }} + \newcommand{\degmsmartquotes}{\degmdoublequoteson +\degmsinglequotelinestarton +\degmsinglequotescloseon} + \newcommand{\degmdumbquotes}{\degmdoublequotesoff +\degmsinglequotelinestartoff +\degmsinglequotescloseoff} + \DeclareOption{degm}{ +\AtBeginDocument{ +\frsmartquotes +\frdumbquotes +\smartquotes +\dumbquotes\dumbquotes +\degmsmartquotes} +\renewcommand{\texttt}[1]{{\ttfamily\addfontfeature{RawFeature={+qtbye,-tlig}} #1}} } \end{minted} \subsection{The French option} @@ -1502,6 +1801,9 @@ firstnumber=last \end{minted} \section{Version History} +\subsection{\normalfont\texttt{1.2.2}} +\ttfamily Added the "degm" option + \subsection{\normalfont\texttt{1.2.1}} \ttfamily Suspended automatic elision support due to implementation issues diff --git a/Master/texmf-dist/tex/lualatex/luaquotes/luaquotes.sty b/Master/texmf-dist/tex/lualatex/luaquotes/luaquotes.sty index f26758b9092..c07785bcd69 100644 --- a/Master/texmf-dist/tex/lualatex/luaquotes/luaquotes.sty +++ b/Master/texmf-dist/tex/lualatex/luaquotes/luaquotes.sty @@ -1,6 +1,6 @@ -\def\luaquotesversionnumber{1.2.1} +\def\luaquotesversionnumber{1.2.2} \ProvidesPackage{luaquotes} - [2022/11/23\luaquotesversionnumber smart quotes with lua] + [2022/12/09\luaquotesversionnumber smart quotes with lua] % !TeX program = lualatex % !TeX encoding = utf8 % This work may be distributed and/or modified under the @@ -153,7 +153,7 @@ luatexbase.add_to_callback ( \singlequotesoff} \DeclareOption{en}{ -\AtBeginDocument{\frsmartquotes\frdumbquotes\desmartquotes\dedumbquotes\smartquotes} +\AtBeginDocument{\frsmartquotes\frdumbquotes\desmartquotes\dedumbquotes\degmsmartquotes\degmdumbquotes\smartquotes} \renewcommand{\texttt}[1]{{\ttfamily\addfontfeature{RawFeature={+qtbye,-tlig}} #1}} } @@ -180,6 +180,8 @@ luatexbase.add_to_callback ( %%%%%%%%%%%%%%%%%%%%%%%%%%% \newcommand{\desingle}{{\addfontfeature{RawFeature={-qtbye,-tlig}}\symbol{"201A}}} \newcommand{\dedouble}{{\addfontfeature{RawFeature={-qtbye,-tlig}}\symbol{"201E}}} +\newcommand{\degmsingle}{{\addfontfeature{RawFeature={-qtbye,-tlig}}\symbol{"203A}}} +\newcommand{\degmdouble}{{\addfontfeature{RawFeature={-qtbye,-tlig}}\symbol{"00BB}}} %%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%% % backtick @@ -227,6 +229,10 @@ luatexbase.add_to_callback ( \newcommand{\glmtr}{{\addfontfeature{RawFeature={-qtbye,-tlig}}\,»}} \newcommand{\sglmtl}{{\addfontfeature{RawFeature={-qtbye,-tlig}}‹\,}} \newcommand{\sglmtr}{{\addfontfeature{RawFeature={-qtbye,-tlig}}\,›}} +\newcommand{\degmtl}{{\addfontfeature{RawFeature={-qtbye,-tlig}}»}} +\newcommand{\degmtr}{{\addfontfeature{RawFeature={-qtbye,-tlig}}«}} +\newcommand{\desgmtl}{{\addfontfeature{RawFeature={-qtbye,-tlig}}›}} +\newcommand{\desgmtr}{{\addfontfeature{RawFeature={-qtbye,-tlig}}‹}} %%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%% % DEUTSCH @@ -271,6 +277,50 @@ return ( s:gsub ( " '(..-)'", " ‚\%1`" ) ) \renewcommand{\texttt}[1]{{\ttfamily\addfontfeature{RawFeature={+qtbye,-tlig}} #1}} } +%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%% +% SCHÖNERES DEUTSCH +%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%% +\luaexec{function degmdoublequotes ( s ) + return ( s:gsub ( '"(..-)"' , "»\%1«" ) ) + end} +\luaexec{function degmsinglequotelinestart ( s ) + return (s:gsub ("^'","›" ) ) + end} +\luaexec{function degmsinglequotesclose( s ) +return ( s:gsub ( " '(..-)'", " ‚\%1‹" ) ) + end} + +%% Two utility macros to activate/deactivate the Lua function: +\newcommand\degmdoublequoteson{\directlua{luatexbase.add_to_callback ( + "process_input_buffer" , degmdoublequotes , "degmdoublequotes" )}} +\newcommand\degmdoublequotesoff{\directlua{luatexbase.remove_from_callback ( + "process_input_buffer" , "degmdoublequotes" )}} +\newcommand\degmsinglequotelinestarton{\directlua{luatexbase.add_to_callback ( + "process_input_buffer" , degmsinglequotelinestart , "degmsinglequotelinestart" )}} +\newcommand\degmsinglequotelinestartoff{\directlua{luatexbase.remove_from_callback ( + "process_input_buffer" , "degmsinglequotelinestart" )}} + \newcommand\degmsinglequotescloseon{\directlua{luatexbase.add_to_callback ( + "process_input_buffer" , degmsinglequotesclose , "degmsinglequotesclose" )}} +\newcommand\degmsinglequotescloseoff{\directlua{luatexbase.remove_from_callback ( + "process_input_buffer" , "degmsinglequotesclose" )}} + \newcommand{\degmsmartquotes}{\degmdoublequoteson +\degmsinglequotelinestarton +\degmsinglequotescloseon} + \newcommand{\degmdumbquotes}{\degmdoublequotesoff +\degmsinglequotelinestartoff +\degmsinglequotescloseoff} + \DeclareOption{degm}{ +\AtBeginDocument{ +\frsmartquotes +\frdumbquotes +\smartquotes +\dumbquotes\dumbquotes +\degmsmartquotes} +\renewcommand{\texttt}[1]{{\ttfamily\addfontfeature{RawFeature={+qtbye,-tlig}} #1}} +} + %%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%% % Français @@ -308,7 +358,7 @@ return ( s:gsub ( " '(..-)'", " ‹\\,\%1\\,›" ) ) \frsinglequotelinestartoff \frsinglequotescloseoff} \DeclareOption{fr}{ -\AtBeginDocument{\desmartquotes\dedumbquotes\smartquotes\dumbquotes\dumbquotes\frsmartquotes} +\AtBeginDocument{\desmartquotes\dedumbquotes\degmsmartquotes\degmdumpquotes\smartquotes\dumbquotes\dumbquotes\frsmartquotes} \renewcommand{\texttt}[1]{{\ttfamily\addfontfeature{RawFeature={+qtbye,-tlig}} #1}} -- cgit v1.2.3