summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/dirtytalk
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
committerNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
commite0c6872cf40896c7be36b11dcc744620f10adf1d (patch)
tree60335e10d2f4354b0674ec22d7b53f0f8abee672 /macros/latex/contrib/dirtytalk
Initial commit
Diffstat (limited to 'macros/latex/contrib/dirtytalk')
-rw-r--r--macros/latex/contrib/dirtytalk/README13
-rw-r--r--macros/latex/contrib/dirtytalk/dirtytalk.dtx252
-rw-r--r--macros/latex/contrib/dirtytalk/dirtytalk.ins22
-rw-r--r--macros/latex/contrib/dirtytalk/dirtytalk.pdfbin0 -> 413454 bytes
4 files changed, 287 insertions, 0 deletions
diff --git a/macros/latex/contrib/dirtytalk/README b/macros/latex/contrib/dirtytalk/README
new file mode 100644
index 0000000000..55d565faea
--- /dev/null
+++ b/macros/latex/contrib/dirtytalk/README
@@ -0,0 +1,13 @@
+dirtytalk is a LaTeX package for typesetting quotations easier
+
+Files:
+README this file
+dirtytalk.ins batch file, run through latex
+dirtytalk.dtx docstrip file, run through latex or pdflatex
+dirtytalk.sty LaTeX package, will be created from dirtytalk.ins
+dirtytalk.pdf manual and source code documentation,
+ will be created from dirtytalk.dtx
+
+Author: Moritz Klammler, 2010
+E-Mail: moritz <dot> klammler <at> student <dot> kit <dot> edu
+License: public domain \ No newline at end of file
diff --git a/macros/latex/contrib/dirtytalk/dirtytalk.dtx b/macros/latex/contrib/dirtytalk/dirtytalk.dtx
new file mode 100644
index 0000000000..3eacbb24e2
--- /dev/null
+++ b/macros/latex/contrib/dirtytalk/dirtytalk.dtx
@@ -0,0 +1,252 @@
+% \iffalse % This section (iffalse to fi) won't appear in the source code
+% documentation. It is irrelevant for the package and only includes the "driver"
+% for the documentation. it will be stripped off by docstrip when producing the
+% .sty file.
+%<*driver>
+\documentclass{article}
+\usepackage[T1]{fontenc} % character encoding
+\usepackage[ngerman, english]{babel} % to demonstrate \glqq etc.
+\usepackage{doc} % to create the documentation file
+\usepackage{dirtytalk} % the package we're talking about
+\usepackage{booktabs} % nicer tables
+\usepackage[colorlinks]{hyperref} % click able links in PDF and PDF meta data
+\usepackage{lmodern} % font used
+\EnableCrossrefs
+\CodelineIndex
+\newcommand{\mdash}{\,---\,}
+
+% the following weired code is to obfuscate my e-mail address and so hide it
+% from spam bots:
+\newcommand{\partone}{mori$\mathrm{t}$z.kla}
+\newcommand{\parttwo}{mmler$\,\!$$\partial$stud}
+\newcommand{\partthree}{ent.$\mathrm{kit.}$edu}
+\newcommand{\myemail}{\partone\parttwo\partthree}
+\newcommand{\humanproof}{(If you felt sad when Littlefoot's mother died in the%
+original \textit{Land Before Time} you'll know what the $\partial$ means\dots)}
+
+\parskip.5em
+\title{The \textsf{dirtytalk} Package}
+\author{M. Klammler\footnote{\myemail\newline\humanproof}}
+\date{\today}
+
+\hypersetup{%
+ pdftitle={The dirtytalk Package},%
+ pdfauthor={M. Klammler},%
+ pdfsubject={LaTeX},%
+ pdfkeywords={LaTeX, package, dirtytalk, quotes, quoting, quotations}%
+}%
+
+\begin{document}
+ \DocInput{dirtytalk.dtx}
+\end{document}
+%</driver>
+% \fi
+
+% \maketitle
+% \begin{abstract}
+% This document explains the usage of the \textsf{dirtytalk} package for
+% \LaTeXe. It can be used to typeset \say{quotations} more comfortable. The source
+% code is also explained.
+% \end{abstract}
+% \tableofcontents
+% \clearpage{}
+% \paragraph{Who should use this package?} Everybody who feels typesetting
+% quotes in \LaTeX{} could be more comfortable.
+% \paragraph{Who should \textit{really} use this package?} Everybody who
+% typesets German texts using \verb+\glqq{}Hallo Welt\grqq{}+ for a simple
+% \glqq{}Hallo Welt\grqq{} or\mdash even worse\mdash those who already started
+% writing a text using the same glyphs for nested quotations and soon after find
+% themselves in the embarrassing position of replacing them while being no
+% \textsf{regexp} whiz.
+% \section{Usage}
+% \subsection{Loading}
+% Put \verb+\usepackage{dirtytalk}+ in the preamble of your document.
+% \subsection{Macros}\DescribeMacro{\say}
+% Loaded the package you can typeset quotations by \verb+\say{hello world}+ to
+% get \say{hello world}. Nested quotations are recognized as in:
+%
+% \begin{tabular}{p{50.mm}p{50.mm}}
+% \verb+Alice said: \say{Why did+\linebreak%
+% \verb+you do that, Bob?}+%
+% &Alice said: \say{Why did you do that, Bob?}\\[\parskip]
+% \verb+And Bob answered: \say{+\linebreak%
+% \verb+What do you mean with+\linebreak%
+% \verb+\say{that}, dear Alice?}+%
+% &And Bob answered: \say{What do you mean with \say{that}, dear Alice?}\\
+% \end{tabular}
+% \subsection{Options}
+% The package can be loaded with a couple of options to alter the glyphs being
+% used. These are given in the \texttt{key=value} style.
+% \begin{table}[ht]
+% \begin{center}
+% \begin{tabular}{lll}
+% \toprule
+% key &default value &glyph\\
+% \midrule
+% \texttt{left} &\verb+``+ &``\\
+% \texttt{right} &\verb+''+ &''\\
+% \texttt{leftsub} &\verb+`+ &`\\
+% \texttt{rightsub} &\verb+'+ &'\\
+% \bottomrule
+% \end{tabular}
+% \caption{Options for the \textsf{dirtytalk} package.}
+% \end{center}
+% \end{table}
+%
+% So my fellow German citizens might load the package with
+% \begin{verbatim}
+% \usepackage[%
+% left = \glqq,%
+% right = \grqq,%
+% leftsub = \glq,%
+% rightsub = \grq%
+% ]{dirtytalk}
+% \end{verbatim}
+%
+% to get German glyphs. Pleas note that the package does \textit{not} check your
+% document language to alter the symbols used. It depends on you as the author to
+% specify those you want.
+%
+% Happy \LaTeX ing!
+%
+% \section{Source Code Documentation}
+% This section shows and explains the entire code of the package. (It is
+% intended for \LaTeX{} programmers only.)
+% \subsection{Identification}
+% \begin{macrocode}
+\NeedsTeXFormat{LaTeX2e}
+\ProvidesPackage{dirtytalk}[2010/11/21 A package making "quoting" easier]
+% \end{macrocode}
+% \subsection{Preliminary Declarations}
+% We use options from the \texttt{key=value} type so we need to load a package
+% supporting this:
+% \begin{macrocode}
+\RequirePackage{kvoptions}
+% \end{macrocode}
+% Define the glyphs that will enclose the phrases. We initially define them for
+% English which will probably be the most requested standard. If the package is
+% loaded with options, the following macros will be redefined.
+%
+% \begin{macro}{\dirtytalk@lqq}
+% Outer opening (left) quotation mark glyph.
+% \begin{macrocode}
+\newcommand{\dirtytalk@lqq}{``}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\dirtytalk@rqq}
+% Outer closing (right) quotation mark glyph.
+% \begin{macrocode}
+\newcommand{\dirtytalk@rqq}{''}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\dirtytalk@lq}
+% Inner opening (left) quotation mark glyph.
+% \begin{macrocode}
+\newcommand{\dirtytalk@lq}{`}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\dirtytalk@rq}
+% Inner closing (right) quotation mark glyph.
+% \begin{macrocode}
+\newcommand{\dirtytalk@rq}{'}
+% \end{macrocode}
+% \end{macro}
+% \subsection{Options}
+% We allow the author to specify own quotation mark glyphs instead of those
+% defined above by passing them as options.
+% \begin{macrocode}
+\DeclareStringOption{left}
+\DeclareStringOption{right}
+\DeclareStringOption{leftsub}
+\DeclareStringOption{rightsub}
+% \end{macrocode}
+% \begin{macrocode}
+\ProcessKeyvalOptions*
+% \end{macrocode}
+% \subsection{More Declarations}
+% After processing the options (in case of the \textsf{kvoptions}' string
+% options that means a macro has been defined holding the key value) we check if
+% they are empty and, if not so, redefine the default glyphs. For this task we
+% need the \textsf{ifthen} package.
+% \begin{macrocode}
+\RequirePackage{ifthen}
+% \end{macrocode}
+% \begin{macrocode}
+\ifthenelse%
+ {\equal{\dirtytalk@left}{}}%
+ {}%
+ {\renewcommand{\dirtytalk@lqq}{\dirtytalk@left}}
+% \end{macrocode}
+% \begin{macrocode}
+\ifthenelse%
+ {\equal{\dirtytalk@right}{}}%
+ {}%
+ {\renewcommand{\dirtytalk@rqq}{\dirtytalk@right}}
+% \end{macrocode}
+% \begin{macrocode}
+\ifthenelse%
+ {\equal{\dirtytalk@leftsub}{}}%
+ {}%
+ {\renewcommand{\dirtytalk@lq}{\dirtytalk@leftsub}}
+% \end{macrocode}
+% \begin{macrocode}
+\ifthenelse%
+ {\equal{\dirtytalk@rightsub}{}}%
+ {}%
+ {\renewcommand{\dirtytalk@rq}{\dirtytalk@rightsub}}
+% \end{macrocode}
+% And we define a counter that represents the depth to which a quotation is
+% nested. However, we will only distinguish between \say{not nested} and
+% \say{nested} (\texttt{dirtytalk@qdepth} $>$ 1). Since there is no convention for
+% sub-sub-quotes. (At least, I don't know any.)
+% \begin{macrocode}
+\newcounter{dirtytalk@qdepth}
+% \end{macrocode}
+% Using this counter, we can now determine which glyph we have to use.
+% \begin{macro}{\dirtytalk@lsymb}
+% We define one macro for opening quotes:
+% \begin{macrocode}
+\newcommand%
+ {\dirtytalk@lsymb}%
+ {\ifthenelse%
+ {\value{dirtytalk@qdepth}>1}%
+ {\dirtytalk@lq}%
+ {\dirtytalk@lqq}%
+ }%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\dirtytalk@rsymb}
+% And one for closing quotes:
+% \begin{macrocode}
+\newcommand{\dirtytalk@rsymb}%
+ {\ifthenelse%
+ {\value{dirtytalk@qdepth}>1}%
+ {\dirtytalk@rq}%
+ {\dirtytalk@rqq}%
+ }
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\say}
+% And so finally we can declare the only macro this package provides to the
+% author. On opening quotes we increment the \texttt{dirtytalk@qdepth} counter and
+% decrement it on closing ones. The appropriate glyph is obtained form
+% \verb+\dirtytalk@lsymb+ or \verb+\dirtytalk@rsymb+ respectively.
+% \begin{macrocode}
+\providecommand{\say}[1]%
+ {%
+ \addtocounter{dirtytalk@qdepth}{1}%
+ \dirtytalk@lsymb%
+ #1%
+ \dirtytalk@rsymb%
+ \addtocounter{dirtytalk@qdepth}{-1}%
+ }
+% \end{macrocode}
+% \end{macro}
+% \section{Copyright Statement}
+% I, the copyright holder of this work, release the source code of the
+% \textsf{dirtytalk} package as well as this documentation into the \textbf{public
+% domain}. This applies worldwide.
+%
+% In some countries this may not be legally possible; if so: I grant anyone the
+% right to use this work for any purpose, without any conditions, unless such
+% conditions are required by law. \ No newline at end of file
diff --git a/macros/latex/contrib/dirtytalk/dirtytalk.ins b/macros/latex/contrib/dirtytalk/dirtytalk.ins
new file mode 100644
index 0000000000..b1560a1274
--- /dev/null
+++ b/macros/latex/contrib/dirtytalk/dirtytalk.ins
@@ -0,0 +1,22 @@
+\input docstrip
+
+\preamble
+
+M. Klammler, 2010
+
+I, the copyright holder of this work, release the source code of the dirtytalk
+package as well as the accompaining documentation into the public domain. This
+applies worldwide.
+
+In some countries this may not be legally possible; if so: I grant anyone the
+right to use this work for any purpose, without any conditions, unless such
+conditions are required by law.
+
+\endpreamble
+
+\keepsilent
+% \usedir{tex/latex/base}
+
+\generateFile{dirtytalk.sty}{t}{\from{dirtytalk.dtx}{package}}
+
+\endbatchfile \ No newline at end of file
diff --git a/macros/latex/contrib/dirtytalk/dirtytalk.pdf b/macros/latex/contrib/dirtytalk/dirtytalk.pdf
new file mode 100644
index 0000000000..699063f20a
--- /dev/null
+++ b/macros/latex/contrib/dirtytalk/dirtytalk.pdf
Binary files differ