diff options
author | Karl Berry <karl@freefriends.org> | 2023-02-22 23:32:04 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2023-02-22 23:32:04 +0000 |
commit | 7861f11c60e2cc066cae8bdd9ab933afd42faabb (patch) | |
tree | a98cb25829491fd3156f04bc25ca2e03b0b4bcae /Master/texmf-dist/source | |
parent | 30a86aaeada0b51a8348c74e3dd68affbd32e41a (diff) |
ragged2e (23feb23) (branch)
git-svn-id: svn://tug.org/texlive/branches/branch2022.final@66070 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/source')
-rw-r--r-- | Master/texmf-dist/source/latex/ragged2e/ragged2e.dtx | 126 | ||||
-rw-r--r-- | Master/texmf-dist/source/latex/ragged2e/ragged2e.ins | 2 |
2 files changed, 76 insertions, 52 deletions
diff --git a/Master/texmf-dist/source/latex/ragged2e/ragged2e.dtx b/Master/texmf-dist/source/latex/ragged2e/ragged2e.dtx index ecc4ff40a3d..817f1d66760 100644 --- a/Master/texmf-dist/source/latex/ragged2e/ragged2e.dtx +++ b/Master/texmf-dist/source/latex/ragged2e/ragged2e.dtx @@ -2,7 +2,7 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % Copyright (C) Martin Schröder, 1996–2019 -% Marei Peischl (peiTeX) <marei@peitex.de>, 2021–2022 +% Marei Peischl (peiTeX) <marei@peitex.de>, 2021–2023 % % This work may be distributed and/or modified under the % conditions of the LaTeX Project Public License, either version 1.3c @@ -31,7 +31,7 @@ % \iffalse \NeedsTeXFormat{LaTeX2e}[2021/06/01] %<package>\ProvidesPackage{ragged2e} -%<package> [2022/11/13 v3.2 ragged2e Package] +%<package> [2023/02/22 v3.3 ragged2e Package] % %<*driver> \documentclass[a4paper]{ltxdoc} @@ -41,6 +41,11 @@ \usepackage{url} \usepackage{array} \usepackage{tabularx} +\makeatletter +\IfFileExists{gitHeadInfo.gin}{ + \newcommand*{\GI@githeadinfo@file}{gitHeadInfo.gin} +}{} +\makeatother \usepackage{gitinfo2} \usepackage{geometry} \usepackage{booktabs} @@ -76,7 +81,7 @@ \end{document} %</driver> % \fi -% \CheckSum{490} +% \CheckSum{518} % %% \CharacterTable %% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z @@ -134,7 +139,7 @@ % \title{\unskip % The \textsf{ragged2e}-package^^A % \thanks{^^A -% The version number of this file is \fileversion, +% The version number of this file is \fileversion, % revision~\#\gitAbbrevHash, last revised \protect\gitAuthorIsoDate.}^^A % } % \author{Martin Schröder\\\url{https://gitlab.com/TeXhackse/ragged2e}\thanks{maintained by Marei Peischl}} @@ -144,7 +149,7 @@ % ^^A ----------------------------- % % \begin{abstract} -% This package provides new commands and environments for setting +% This package provides new commands and environments for setting % ragged text which are easy to configure to allow hyphenation. % An earlier attempt to do this was the style % \package{raggedright}\,\cite{raggedri} by the same author. @@ -167,11 +172,11 @@ % \changes{v3.0}{2021/02/05}{Change maintenance status} % \section{The problem} % ^^A -% \LaTeX{} has three commands (\cs{centering}, \cs{raggedleft}, and +% \LaTeX{} has three commands (\cs{centering}, \cs{raggedleft}, and % \cs{raggedright}) and three environments (\env{center}, % \env{flushleft}, and \env{flushright}) to typeset ragged text. % The environments are based upon the commands (\env{center} uses -% \cs{centering}, \env{flushleft} \cs{raggedright}, and +% \cs{centering}, \env{flushleft} \cs{raggedright}, and % \env{flushright} \cs{raggedleft}). % % These commands have, however, one serious flaw: they render @@ -287,8 +292,8 @@ % \DescribeMacro{\Centering} % \DescribeMacro{\RaggedLeft} % \DescribeMacro{\RaggedRight} -% \cs{Centering}, \cs{RaggedLeft}, and \cs{RaggedRight} can be used in -% the same way as \cs{centering}, \cs{raggedleft}, and +% \cs{Centering}, \cs{RaggedLeft}, and \cs{RaggedRight} can be used in +% the same way as \cs{centering}, \cs{raggedleft}, and % \cs{raggedright}: % Just type the command, and after that the whole text will be set % centered, ragged-left or ragged-right. @@ -320,23 +325,23 @@ % \cs{RaggedXSpaceskip}}% % \begin{tabularx}{\linewidth}{lX}\toprule % Command & Uses\tabularnewline \midrule -% \cs{Centering} & \cs{CenteringLeftskip}, +% \cs{Centering} & \cs{CenteringLeftskip}, % \cs{CenteringRightskip}, % \cs{CenteringParfillskip}, % \cs{CenteringParindent} % \tabularnewline -% \cs{RaggedLeft} & \cs{RaggedLeftLeftskip}, +% \cs{RaggedLeft} & \cs{RaggedLeftLeftskip}, % \cs{RaggedLeftRightskip}, % \cs{RaggedLeftParfillskip}, % \cs{RaggedLeftParindent} % \tabularnewline -% \cs{RaggedRight} & \cs{RaggedRightLeftskip}, +% \cs{RaggedRight} & \cs{RaggedRightLeftskip}, % \cs{RaggedRightRightskip}, % \cs{RaggedRightParfillskip}, % \cs{RaggedRightParindent} % \tabularnewline -% \cs{justifying} & \cs{JustifyingParfillskip}, -% \cs{JustifyingParindent} +% \cs{justifying} & \cs{JustifyingParfillskip}, +% \cs{JustifyingParindent} % \tabularnewline % \bottomrule % \end{tabularx} @@ -350,7 +355,7 @@ % \DescribeMacro{\CenteringLeftskip} % \DescribeMacro{\RaggedLeftLeftskip} % \DescribeMacro{\RaggedRightLeftskip} -% These are the \cs{leftskip}s inserted by \cs{Centering}, +% These are the \cs{leftskip}s inserted by \cs{Centering}, % \cs{RaggedLeft}, and \cs{RaggedRight}. % \begin{Quote} % \setlength{\tabcolsep}{.25em} @@ -394,8 +399,8 @@ % \cite[p.~274]{KnuthTeXa} % \end{tabularx} % \end{Quote} -% The normal setting for \cs{parfillskip} is |0pt plus 1fil|; the -% parameters are provided for testing combinations of +% The normal setting for \cs{parfillskip} is |0pt plus 1fil|; the +% parameters are provided for testing combinations of % \cs{}\{|left|$\mid$|right|\}|skip| and \cs{parfillskip}. % % \DescribeMacro{\CenteringParindent} @@ -492,29 +497,29 @@ % This package has the following options: % \changes{v2.00}{2003/01/04}{Allow all-lowercase versions of % options and removed documentation of -% mixed-case versions.} +% mixed-case versions.} % \nopagebreak % \begin{description} % \item[\normalfont\option{originalcommands}] -% The \LaTeX-commands \cs{centering}, \cs{raggedleft}, and -% \cs{raggedright} and the \LaTeX-environments \env{center}, +% The \LaTeX-commands \cs{centering}, \cs{raggedleft}, and +% \cs{raggedright} and the \LaTeX-environments \env{center}, % \env{flushleft}, and \env{flushright} remain unchanged.\newline % It is the default. % \item[\normalfont\option{newcommands}] -% The \LaTeX-commands \cs{centering}, \cs{raggedleft}, and -% \cs{raggedright} and the \LaTeX-environments \env{center}, +% The \LaTeX-commands \cs{centering}, \cs{raggedleft}, and +% \cs{raggedright} and the \LaTeX-environments \env{center}, % \env{flushleft}, and \env{flushright} are set equal to their % counterparts defined by \package{ragged2e}. % Thus \cs{raggedright} invokes \cs{RaggedRight}. -% The original commands can be accessed unter the Names +% The original commands can be accessed unter the Names % \cs{LaTeX}\meta{original name}, e.\,g.\ \cs{LaTeXraggedright}. % \item[\normalfont\option{originalparameters}] -% The parameters used by the commands implemented by -% \package{ragged2e} are initialized with the default settings +% The parameters used by the commands implemented by +% \package{ragged2e} are initialized with the default settings % used by \LaTeX. % \item[\normalfont\option{newparameters}] -% The parameters used by the commands implemented by -% \package{ragged2e} are initialized with the default settings +% The parameters used by the commands implemented by +% \package{ragged2e} are initialized with the default settings % defined by \package{ragged2e}.\newline % It is the default. % \item[\normalfont\option{raggedrightboxes}] @@ -583,7 +588,7 @@ % (\url{rsieger@awi-bremerhaven.de}) this package might not % be.\newline % Markus Kohm (\url{markus.kohm@gmx.de}) provided the code for -% \cs{@gnewline}.\newline +% \cs{@gnewline}.\newline % Frank Mittelbach (\url{frank.mittelbach@latex-project.org}) % provided the impetus for version~2.00.\newline % Rolf Niepraschk (\url{Rolf.Niepraschk@gmx.de}) and Hubert Gäßlein @@ -661,7 +666,7 @@ % ^^A ----------------------------- % % \section{The implementation} -% \changes{v2.00}{2003/01/10}{Removed spaces and unneeded braces +% \changes{v2.00}{2003/01/10}{Removed spaces and unneeded braces % from \cs{setlength}; replaced % \texttt{plus} with \cs{@plus}} % \changes{v2.02}{2003/02/24}{Removed \cs{setlength}} @@ -677,7 +682,7 @@ % \subsection{Initial Code} % ^^A % \begin{macro}{\if@raggedtwoe@originalcommands} -% \cs{if@raggedtwoe@originalcommands} is used to flag the use of the +% \cs{if@raggedtwoe@originalcommands} is used to flag the use of the % \option{originalcommands} or \option{newcommands} option. % \begin{macrocode} \newif\if@raggedtwoe@originalcommands @@ -685,7 +690,7 @@ % \end{macro} % % \begin{macro}{\if@raggedtwoe@originalparameters} -% \cs{if@raggedtwoe@originalparameters} is used to flag the use of the +% \cs{if@raggedtwoe@originalparameters} is used to flag the use of the % \option{originalparameters} or \option{newparameters} option. % \begin{macrocode} \newif\if@raggedtwoe@originalparameters @@ -711,7 +716,7 @@ % % \subsubsection{\option{originalcommands} option} % ^^A -% The \option{originalcommands} and \option{newcommands} options +% The \option{originalcommands} and \option{newcommands} options % control the meaning of the \LaTeX-commands for ragged text: % If \option{newcommands} is used the \LaTeX-commands are set equal % to the commands defined by \package{ragged2e}. @@ -749,7 +754,7 @@ % \changes{v2.00}{2003/01/04}{New option \option{raggedrightboxes}}% % The option \option{raggedrightboxes} sets all % \cs{parbox}es, \env{minipage}s, \cs{marginpar}s and |p|-columns of -% \env{tabular}s and \env{array}s using \cs{RaggedRight}. +% \env{tabular}s and \env{array}s using \cs{RaggedRight}. % This is done by redefining \cs{@arrayparboxrestore}. % \begin{macro}{\@raggedtwoe@raggedrightboxes@opt} % \cs{@raggedtwoe@raggedrightboxes@opt} is the code executed via @@ -771,9 +776,9 @@ \parindent\z@ \parskip\z@skip \everypar{}% \linewidth\hsize - \@totalleftmargin\z@ + \@totalleftmargin\z@ \leftskip\z@skip \rightskip\z@skip \@rightskip\z@skip - \parfillskip\@flushglue + \parfillskip\@flushglue \lineskip\normallineskip \lineskiplimit\normallineskiplimit \baselineskip\normalbaselineskip @@ -794,7 +799,7 @@ \parskip\z@skip \everypar{}% \linewidth\hsize - \@totalleftmargin\z@ + \@totalleftmargin\z@ \RaggedRight \lineskip\normallineskip \baselineskip\normalbaselineskip @@ -908,7 +913,7 @@ % % \subsection{Executing options} % ^^A -% The default options are \option{originalcommands} and +% The default options are \option{originalcommands} and % \option{newparameters}. % \begin{macrocode} \ExecuteOptions{originalcommands,newparameters} @@ -1043,7 +1048,7 @@ % % \subsection{Distinguishing between monospaced and proportional fonts} % ^^A -% To set ragged text with proportional fonts \emph{and} monospaced +% To set ragged text with proportional fonts \emph{and} monospaced % fonts correctly, we must distinguish between these two kinds of % fonts \emph{everytime} a font is loaded. % Otherwise the settings for e.\,g.\ a proportional fonts would be @@ -1059,14 +1064,14 @@ % We do the setting with the help of \package{everysel}\,\cite{everysel}, % which allows us to define code which is (hopefully) executed after % every fontchange in a \LaTeX{} document.\footnote{^^A -% It \emph{is} executed after every \cs{selectfont}, so if you stay -% within NFSS and don't declare your fonts with commands like +% It \emph{is} executed after every \cs{selectfont}, so if you stay +% within NFSS and don't declare your fonts with commands like % \cs{newfont} and then switch to them, it will work.} % % \begin{macro}{\if@raggedtwoe@spaceskip} % \cs{if@raggedtwoe@spaceskip} signals the use of commands defined by % \package{ragged2e} to the command inserted into \cs{selectfont}. -% It is set to true by these commands and restored to false by \TeX{} +% It is set to true by these commands and restored to false by \TeX{} % when the scope of them ends. % \begin{macrocode} \newif\if@raggedtwoe@spaceskip @@ -1074,7 +1079,7 @@ % \end{macro} % % \begin{macro}{\@raggedtwoe@everyselectfont} -% \cs{@raggedtwoe@everyselectfont} is our code inserted into +% \cs{@raggedtwoe@everyselectfont} is our code inserted into % \cs{selectfont}. % \changes{v2.00}{2003/01/26}{Completely redesigned and removed % \cs{RaggedSpaceskip} and @@ -1099,7 +1104,7 @@ \else % \end{macrocode} % For proportional fonts we make the interword space rigid by setting -% \cs{spaceskip} to \cs{fontdimen2}. +% \cs{spaceskip} to \cs{fontdimen2}. % \begin{macrocode} \spaceskip\fontdimen\tw@\font \fi @@ -1115,11 +1120,18 @@ % \end{macrocode} % If our kernel is new enough we use the kernel hook directly instead of the everysel macro. % \changes{v3.00}{2021/02/05}{Use kernel hook if available} +% \changes{v3.3}{2023/02/22}{Apply hook only when a ragged2e command is active.} % \begin{macrocode} +\newif\if@raggedtwoe@localhook \IfFormatAtLeastTF{2021/01/05} - {\AddToHook{selectfont}{\@raggedtwoe@everyselectfont}} + {\@raggedtwoe@localhooktrue} {\EverySelectfont{\@raggedtwoe@everyselectfont}} % \end{macrocode} +% We define a command to only add the local hook with the ragged2e commands. +% This will keep the impact local. +% \begin{macrocode} +\newcommand*{\@raggedtwoe@addlocalhook}{} +% \end{macrocode} % \end{macro} % % @@ -1137,7 +1149,7 @@ % % \begin{macro}{\@raggedtwoe@saved@gnewline} % \changes{v2.00}{2003/01/04}{New macro} -% We save the definition of \cs{@gnewline} in +% We save the definition of \cs{@gnewline} in % \cs{@raggedtwoe@saved@gnewline}. % \begin{macrocode} \let\@raggedtwoe@saved@gnewline\@gnewline @@ -1168,7 +1180,7 @@ % \begin{macrocode} \newcommand*{\@raggedtwoe@gnewline}[1]{% \ifvmode - \@nolnerr + \@nolnerr \else \unskip \ifmmode @@ -1207,6 +1219,9 @@ % and switch \cs{@gnewline}} % \begin{macrocode} \DeclareRobustCommand{\Centering}{% + \if@raggedtwoe@localhook + \AddToHook{selectfont}[ragged2e]{\@raggedtwoe@everyselectfont} + \fi \ifx\\\@raggedtwoe@savedcr \let\\\@raggedtwoe@centercrNoindent \fi @@ -1230,6 +1245,9 @@ % and switch \cs{@gnewline}} % \begin{macrocode} \DeclareRobustCommand{\RaggedLeft}{% + \if@raggedtwoe@localhook + \AddToHook{selectfont}[ragged2e]{\@raggedtwoe@everyselectfont} + \fi \ifx\\\@raggedtwoe@savedcr \let\\\@raggedtwoe@centercrNoindent \fi @@ -1253,6 +1271,9 @@ % and switch \cs{@gnewline}} % \begin{macrocode} \DeclareRobustCommand{\RaggedRight}{% + \if@raggedtwoe@localhook + \AddToHook{selectfont}[ragged2e]{\@raggedtwoe@everyselectfont} + \fi \ifx\\\@raggedtwoe@savedcr \let\\\@raggedtwoe@centercrNoindent \fi @@ -1275,6 +1296,9 @@ % \changes{v2.00}{2003/01/04}{New macro} % \begin{macrocode} \DeclareRobustCommand{\justifying}{% + \if@raggedtwoe@localhook + \AddToHook{selectfont}[ragged2e]{\@raggedtwoe@everyselectfont} + \fi \let\\\@raggedtwoe@savedcr \let\@gnewline\@raggedtwoe@saved@gnewline \leftskip\z@ @@ -1297,7 +1321,7 @@ % \begin{environment}{FlushLeft} % \begin{environment}{FlushRight} % The environments \env{Center}, \env{FlushLeft}, and \cs{FlushRight} -% are implemented like their counterparts in \LaTeX: Start a +% are implemented like their counterparts in \LaTeX: Start a % \env{trivlist} and switch on the right command. % \changes{v2.02}{2003/02/24}{Use \cs{trivlist} \ldots{} % \cs{endtrivlist} instead of @@ -1327,7 +1351,7 @@ % \end{environment} % \end{environment} % \begin{environment}{justify} -% \env{justify} is similar to the other environments: Start a +% \env{justify} is similar to the other environments: Start a % \env{trivlist} and use \cs{justifying}. % \changes{v2.00}{2003/01/04}{New environment} % \changes{v2.02}{2003/02/24}{Use \cs{trivlist} \ldots{} @@ -1349,7 +1373,7 @@ % % \subsection{Overloading the \LaTeX-commands} % ^^A -% If the option \option{newcommands} is used, we save the original +% If the option \option{newcommands} is used, we save the original % \LaTeX-commands and environments for ragged text and overload them. % \changes{v2.04}{2003/03/02}{Save more commands} % \changes{v2.1}{2003/10/08}{bugfix: \cs{Flushleft} instead of @@ -1364,13 +1388,13 @@ \let\raggedleft\RaggedLeft \let\raggedright\RaggedRight \let\LaTeXcenter\center - \let\endLaTeXcenter\endcenter + \let\endLaTeXcenter\endcenter \let\LaTeXflushleft\flushleft \let\endLaTeXflushleft\endflushleft \let\LaTeXflushright\flushright \let\endLaTeXflushright\endflushright \let\center\Center - \let\endcenter\endCenter + \let\endcenter\endCenter \let\flushleft\FlushLeft \let\endflushleft\endFlushLeft \let\flushright\FlushRight diff --git a/Master/texmf-dist/source/latex/ragged2e/ragged2e.ins b/Master/texmf-dist/source/latex/ragged2e/ragged2e.ins index 1b4945c821c..81513b52095 100644 --- a/Master/texmf-dist/source/latex/ragged2e/ragged2e.ins +++ b/Master/texmf-dist/source/latex/ragged2e/ragged2e.ins @@ -1,7 +1,7 @@ \input docstrip.tex \preamble -Copyright (C) 1996–2019 Martin Schröder, 2021–2022 Marei Peischl (peiTeX) <marei@peitex.de> +Copyright (C) 1996–2019 Martin Schröder, 2021–2023 Marei Peischl (peiTeX) <marei@peitex.de> This work may be distributed and/or modified under the conditions of the LaTeX Project Public License, either version 1.3c |