From 2cea258fda0365adce50be5a29fcd9d87fb6868f Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Fri, 12 Aug 2011 15:32:52 +0000 Subject: new latex package quoting (11aug11) git-svn-id: svn://tug.org/texlive/trunk@23512 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/tex/latex/quoting/quoting.sty | 124 ++++++++++++++++++++++++ 1 file changed, 124 insertions(+) create mode 100644 Master/texmf-dist/tex/latex/quoting/quoting.sty (limited to 'Master/texmf-dist/tex/latex/quoting') diff --git a/Master/texmf-dist/tex/latex/quoting/quoting.sty b/Master/texmf-dist/tex/latex/quoting/quoting.sty new file mode 100644 index 00000000000..15066be7d1d --- /dev/null +++ b/Master/texmf-dist/tex/latex/quoting/quoting.sty @@ -0,0 +1,124 @@ +%% +%% This is file `quoting.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% quoting.dtx (with options: `package') +%% +%% Copyright (C) 2011 by Thomas Titz +%% +%% Permission is granted to distribute and/or modify this work under the +%% terms of the LaTeX Project Public License (LPPL), version 1.3c or +%% later. +%% +%% The LPPL maintenance status of this work is "maintained". +%% +%% This work consists of the files quoting.dtx, quoting.ins and README +%% and the derived files quoting.pdf and quoting.sty. +%% +\NeedsTeXFormat{LaTeX2e} +\ProvidesPackage{quoting} + [2011/08/08 v0.1 Consolidated environment for displayed text] +\RequirePackage{etoolbox,kvoptions} +\SetupKeyvalOptions{family=quo,prefix=quo@} +\newcommand*{\quotingfont}{} +\define@key{quo}{font}{% + \def\quotingfont{\csname #1\endcsname}% +} +\define@key{quo}{font+}{% + \appto{\quotingfont}{\csname #1\endcsname}% +} +\DeclareStringOption[\leftmargin]{leftmargin} +\DeclareStringOption[\quo@leftmargin]{rightmargin} +\newlength{\quo@toppartop} +\deflength{\quo@toppartop}{\topsep + \partopsep} +\DeclareStringOption[\quo@toppartop]{vskip} +\DeclareBoolOption{listvskip} +\DeclareBoolOption{noorphanfirst} +\DeclareBoolOption{noorphanafter} +\define@key{quo}{noorphans}[true]{% + \setbool{quo@noorphanfirst}{#1}% + \setbool{quo@noorphanafter}{#1}% +} +\ProcessKeyvalOptions* +\newcommand*{\quotingsetup}[1]{\setkeys{quo}{#1}} +\newbool{quo@afterquo} +\newbool{quo@afterquoclub} +\newcommand*{\quo@doendquoclub}{% + \ifbool{quo@afterquoclub}{% + \clubpenalty=\@clubpenalty + \everypar{}% + }{% + \booltrue{quo@afterquoclub}% + \clubpenalty=\@M + }% +} +\newcommand*{\quo@doendquo}{% + \booltrue{@endpe}% + \def\par{% + \@restorepar + \everypar{\quo@doendquoclub}% + \par + \boolfalse{@endpe}% + \global\boolfalse{quo@afterquo}% + }% + \everypar{% + {\setbox\z@\lastbox}% + \quo@doendquoclub + \boolfalse{@endpe}% + \global\boolfalse{quo@afterquo}% + }% +} +\newenvironment{quoting}[1][]{% + \setkeys{quo}{#1}% + \list{}{% + \ifbool{quo@listvskip}{% + }{% + \setlength{\topsep}{\quo@vskip}% + \setlength{\partopsep}{\z@}% + }% + \setlength{\itemindent}{% + \ifbool{vmode}{% + \ifbool{quo@afterquo}{% + \z@ + }{% + \ifbool{@nobreak}{% + \ifbool{@afterindent}{% + \parindent + }{% + \z@ + }% + }{% + \parindent + }% + }% + }{% + \z@ + }% + }% + \setlength{\leftmargin}{\quo@leftmargin}% + \setlength{\rightmargin}{\quo@rightmargin}% + \setlength{\listparindent}{\parindent}% + \setlength{\parsep}{\parskip}% + }% + \item\relax + \ifbool{quo@noorphanfirst}{% + \global\booltrue{@nobreak}% + }{% + }% + \quotingfont +}{% + \endlist + \boolfalse{@endpe}% + \ifbool{quo@noorphanafter}{% + \aftergroup\quo@afterquoclubfalse + }{% + \aftergroup\quo@afterquoclubtrue + }% + \global\booltrue{quo@afterquo}% + \aftergroup\quo@doendquo +} +\endinput +%% +%% End of file `quoting.sty'. -- cgit v1.2.3