diff options
author | Karl Berry <karl@freefriends.org> | 2011-09-08 22:44:07 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2011-09-08 22:44:07 +0000 |
commit | 02871b0d86e21ea1537b193d7fbb2d34114eb32a (patch) | |
tree | 77257c0e2bbbbaf39631fe2249493ccf69de89be | |
parent | 404295945338957d9a80eaa874eb850d1e689be7 (diff) |
quoting (8sep11)
git-svn-id: svn://tug.org/texlive/trunk@23875 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r-- | Master/texmf-dist/doc/latex/quoting/README | 5 | ||||
-rw-r--r-- | Master/texmf-dist/doc/latex/quoting/quoting.pdf | bin | 286734 -> 294508 bytes | |||
-rw-r--r-- | Master/texmf-dist/source/latex/quoting/quoting.dtx | 89 | ||||
-rw-r--r-- | Master/texmf-dist/tex/latex/quoting/quoting.sty | 47 |
4 files changed, 105 insertions, 36 deletions
diff --git a/Master/texmf-dist/doc/latex/quoting/README b/Master/texmf-dist/doc/latex/quoting/README index 593d04af3bd..fa7a704dbb3 100644 --- a/Master/texmf-dist/doc/latex/quoting/README +++ b/Master/texmf-dist/doc/latex/quoting/README @@ -1,6 +1,6 @@ The quoting package Thomas Titz -2011/08/08 +2011/09/08 __________________ Overview @@ -15,6 +15,9 @@ after the environment. __________________ Change history +Version 0.1a (2011/09/08) +- New option "indentfirst" + Version 0.1 (2011/08/08) - Initial public release diff --git a/Master/texmf-dist/doc/latex/quoting/quoting.pdf b/Master/texmf-dist/doc/latex/quoting/quoting.pdf Binary files differindex 036c023d396..85fa0e3fd6a 100644 --- a/Master/texmf-dist/doc/latex/quoting/quoting.pdf +++ b/Master/texmf-dist/doc/latex/quoting/quoting.pdf diff --git a/Master/texmf-dist/source/latex/quoting/quoting.dtx b/Master/texmf-dist/source/latex/quoting/quoting.dtx index 94fb880630c..a89e3d8d9d1 100644 --- a/Master/texmf-dist/source/latex/quoting/quoting.dtx +++ b/Master/texmf-dist/source/latex/quoting/quoting.dtx @@ -49,7 +49,7 @@ % % \fi % -% \CheckSum{120} +% \CheckSum{154} % % \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 @@ -75,6 +75,7 @@ % \DoNotIndex{\ifbool,\item,\@M,\NeedsTeXFormat,\newbool,\newcommand} % \DoNotIndex{\newenvironment,\newlength,\par,\ProvidesPackage,\relax} % \DoNotIndex{\RequirePackage,\setlength,\z@} +% \DoNotIndex{\else,\fi,\ifcase,\ifcsname,\or} % % \title{The \quo/ package\thanks{This document corresponds to % \quo/~\fileversion, dated \filedate.}} @@ -185,6 +186,21 @@ % % \begin{description}[font=\sffamily] % +% \changes{v0.1a}{2011/09/08}{New option \textsf{indentfirst}} +% +% \item[indentfirst]\SpecialOptIndex{indentfirst} An option that allows +% to override \quo/'s indentation mechanism and to manually switch +% on/off first-line indentation. The permitted values are \textsf{auto}, +% \textsf{true}, and \textsf{false}. The default value is +% \textsf{auto}.\footnote{The \textsf{indentfirst} option may act as a +% fallback solution for cases where \quo/'s indentation mechanism fails. +% Currently, first lines will always be indented a)~immediately after +% \texttt{\textbackslash begin\{document\}} b)~after a +% \textsf{sloppypar}, \textsf{center}, \textsf{flushleft}, or +% \textsf{flushright} environment. Thanks to Enrico Gregorio for +% pointing out \quo/'s behaviour with respect to \textsf{sloppypar}, +% \textsf{center} \& friends.} +% % \item[font]\SpecialOptIndex{font} The font used for typesetting the % contents of a \quo/ environment. Permitted values are the names % (without preceding backslash) of \LaTeX's font-switching/formatting @@ -256,6 +272,12 @@ % \url{http://www.tug.org/texlive/Contents/live/texmf-dist/doc/latex/base/source2e.pdf} % (accessed August 2, 2011). % +% \bibitem{dec09} +% ``\textbackslash DeclareStringOption''. +% Series of messages on \textsf{comp.text.tex}, December 14, 2009. +% \url{http://groups.google.com/group/comp.text.tex/browse_thread/thread/1fb53938ac0026c5} +% (accessed September 6, 2011). +% % \bibitem{Fis95} % Fischel, William~A. % \emph{Regulatory takings: Law, economics, and politics}. @@ -297,7 +319,7 @@ % \begin{macrocode} \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{quoting} - [2011/08/08 v0.1 Consolidated environment for displayed text] + [2011/09/08 v0.1a Consolidated environment for displayed text] % \end{macrocode} % We require the packages \textsf{kvoptions} (to conveniently specify % options as key--value pairs) and \textsf{etoolbox} (e.\,g. for length @@ -310,6 +332,25 @@ % \begin{macrocode} \SetupKeyvalOptions{family=quo,prefix=quo@} % \end{macrocode} +% \begin{macro}{\quo@indentfirsttype} +% The key \textsf{indentfirst} takes a list of three values with +% associated functions and yields an error message if an unknown value +% is given. We use code snippets presented by Heiko Oberdiek and Joseph +% Wright in a series of messages on \textsf{comp.text.tex} \cite{dec09}. +% \begin{macrocode} +\def\quo@in@false{\def\quo@indentfirsttype{0}} +\def\quo@in@true{\def\quo@indentfirsttype{1}} +\def\quo@in@auto{\def\quo@indentfirsttype{2}} +\define@key{quo}{indentfirst}{% + \ifcsname quo@in@#1\endcsname + \csname quo@in@#1\expandafter\endcsname + \else + \PackageError{quoting}{Unknown value #1 for option indentfirst}% + \fi +} +\setkeys{quo}{indentfirst=auto} +% \end{macrocode} +% \end{macro} % \begin{macro}{\quotingfont} % The \textsf{keyval} command |\define@key| is used to define the keys % \textsf{font} and \textsf{font+}. We convert their value to a command @@ -450,8 +491,11 @@ }% % \end{macrocode} % The length |\itemindent| is responsible for the first-line indentation -% of \quo/. |\itemindent| will be set to |\parindent| if the following -% conditions are met: +% of \quo/. Its value (0\,pt or |\parindent|) is controlled first and +% foremost by the state of the key \textsf{indentfirst} (\textsf{false}, +% \textsf{true}, or \textsf{auto}). In case automatic first-line +% indentation is enabled, |\itemindent| will be set to |\parindent| +% if the following conditions are met: % \begin{itemize} % % \item We are in vertical mode (which usually means that a blank line @@ -467,31 +511,36 @@ % both |@nobreak| and |@afterindent| are set to true. % % \end{itemize} -% Otherwise, |\itemindent| will be set to 0\,pt. % \begin{macrocode} - \setlength{\itemindent}{% - \ifbool{vmode}{% - \ifbool{quo@afterquo}{% - \z@ - }{% - \ifbool{@nobreak}{% - \ifbool{@afterindent}{% - \parindent + \ifcase\quo@indentfirsttype\relax + \setlength{\itemindent}{\z@}% + \or + \setlength{\itemindent}{\parindent}% + \or + \setlength{\itemindent}{% + \ifbool{vmode}{% + \ifbool{quo@afterquo}{% + \z@ + }{% + \ifbool{@nobreak}{% + \ifbool{@afterindent}{% + \parindent + }{% + \z@ + }% }{% - \z@ + \parindent }% - }{% - \parindent }% + }{% + \z@ }% - }{% - \z@ }% - }% + \fi % \end{macrocode} % The lengths |\leftmargin|, |\rightmargin|, |\listparindent|, and % |\parsep| are set, the latter two in accordance with the settings for -% normal running text. +% the surrounding text. % \begin{macrocode} \setlength{\leftmargin}{\quo@leftmargin}% \setlength{\rightmargin}{\quo@rightmargin}% diff --git a/Master/texmf-dist/tex/latex/quoting/quoting.sty b/Master/texmf-dist/tex/latex/quoting/quoting.sty index 15066be7d1d..4d177b91d41 100644 --- a/Master/texmf-dist/tex/latex/quoting/quoting.sty +++ b/Master/texmf-dist/tex/latex/quoting/quoting.sty @@ -19,9 +19,20 @@ %% \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{quoting} - [2011/08/08 v0.1 Consolidated environment for displayed text] + [2011/09/08 v0.1a Consolidated environment for displayed text] \RequirePackage{etoolbox,kvoptions} \SetupKeyvalOptions{family=quo,prefix=quo@} +\def\quo@in@false{\def\quo@indentfirsttype{0}} +\def\quo@in@true{\def\quo@indentfirsttype{1}} +\def\quo@in@auto{\def\quo@indentfirsttype{2}} +\define@key{quo}{indentfirst}{% + \ifcsname quo@in@#1\endcsname + \csname quo@in@#1\expandafter\endcsname + \else + \PackageError{quoting}{Unknown value #1 for option indentfirst}% + \fi +} +\setkeys{quo}{indentfirst=auto} \newcommand*{\quotingfont}{} \define@key{quo}{font}{% \def\quotingfont{\csname #1\endcsname}% @@ -78,25 +89,31 @@ \setlength{\topsep}{\quo@vskip}% \setlength{\partopsep}{\z@}% }% - \setlength{\itemindent}{% - \ifbool{vmode}{% - \ifbool{quo@afterquo}{% - \z@ - }{% - \ifbool{@nobreak}{% - \ifbool{@afterindent}{% - \parindent + \ifcase\quo@indentfirsttype\relax + \setlength{\itemindent}{\z@}% + \or + \setlength{\itemindent}{\parindent}% + \or + \setlength{\itemindent}{% + \ifbool{vmode}{% + \ifbool{quo@afterquo}{% + \z@ + }{% + \ifbool{@nobreak}{% + \ifbool{@afterindent}{% + \parindent + }{% + \z@ + }% }{% - \z@ + \parindent }% - }{% - \parindent }% + }{% + \z@ }% - }{% - \z@ }% - }% + \fi \setlength{\leftmargin}{\quo@leftmargin}% \setlength{\rightmargin}{\quo@rightmargin}% \setlength{\listparindent}{\parindent}% |