summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/latex/biblatex-apa/biblatex-apa-test.tex
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/doc/latex/biblatex-apa/biblatex-apa-test.tex')
-rw-r--r--Master/texmf-dist/doc/latex/biblatex-apa/biblatex-apa-test.tex48
1 files changed, 45 insertions, 3 deletions
diff --git a/Master/texmf-dist/doc/latex/biblatex-apa/biblatex-apa-test.tex b/Master/texmf-dist/doc/latex/biblatex-apa/biblatex-apa-test.tex
index a6db225eeeb..90310e25e7d 100644
--- a/Master/texmf-dist/doc/latex/biblatex-apa/biblatex-apa-test.tex
+++ b/Master/texmf-dist/doc/latex/biblatex-apa/biblatex-apa-test.tex
@@ -47,8 +47,38 @@
\setlength{\parskip}{3ex}
\makeatletter
-\def\apaex#1{\hbox{\hspace{-4em}\texttt{\small\expandafter\zap@space\detokenize{#1} \@empty}}\\$\rcurvearrowse$ \textbf{#1}}
-\def\apaexs#1{\hbox{\texttt{\footnotesize\expandafter\zap@space\detokenize{#1} \@empty}} \textbf{\small #1}}
+% This solution to detokenize leaving a space after the command and
+% arguments is due to Bruno Le Floch on T.SE
+\long\def\apaexi#1%
+ {%
+ \catcode64=11
+ \begingroup
+ % Ensure that every character is preserved by \lowercase.
+ \count@\z@
+ \loop\ifnum\count@<256
+ \lccode\count@\z@
+ \advance\count@\@ne
+ \repeat
+ % Except spaces, changed to ^^A
+ \lccode32=\@ne
+ \lowercase
+ {%
+ \endgroup
+ \expandafter\test@\detokenize{#1}\relax%
+ \catcode64=12
+ }%
+ }
+% Then map {^^A => space, space =>} onto the string.
+\def\test@#1%
+ {%
+ \ifx#1\relax\test@end\fi
+ \ifnum`#1=\@ne\space\else#1\fi
+ \test@
+ }
+\def\test@end\fi#1\test@{\fi}
+
+\def\apaex#1{\hbox{\hspace{-4em}\texttt{\small\apaexi{#1}}}\\$\rcurvearrowse$ \textbf{#1}}
+\def\apaexs#1{\hbox{\texttt{\footnotesize\apaexi{#1}}} \textbf{\small #1}}
\makeatother
% This just makes it easier to find a specific (APA 7.x) example in the
@@ -308,18 +338,30 @@ expanding to be properly disambiguated. Truncating either would be ambiguous.\\
\noindent Some misc citation cases\\
\apaex{\textcite{6.16c,6.16d,6.16e}}\\
+\apaex{\textcite{6.16f,6.16g,6.16h}}\\
\apaex{\textcite{6.16f,6.16g,6.16h,6.16i,6.16j}}\\
+Note here that the multicite delimiter is a comma as in running text, a
+semi-colon would be strange:
+\apaex{\textcites{6.16f}{6.16g}{6.16h}{6.16i}{6.16j}}\\
\apaex{\cite{6.16f,6.16g,6.16h,6.16i,6.16j}}\\
\apaex{\cite{6.16k,6.16l}}\\
\apaex{\fullcite{FC1}}\\
\apaex{\fullcitebib{FC1}}
+\noindent Testing «with»\\
+\apaex{\cite{with1}}\\
+\apaex{\textcite{with1}}
+
+\noindent Testing author name citing\\
+\apaex{\citeauthor{ca1}}\\
+\apaex{\citeauthor{ca1}}
+
\end{refsection}
\begin{refsection}[biblatex-apa-test-references]
\nocite{*}
\end{refsection}
\newpage
-% Just (APA 7.x) real references examples here
+% Just (APA 7.x) real references and related entry examples here
\printbibliography[section=2]
\newpage
% Include a references section for citation examples just so hyperref