Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- \documentclass{article}
- \usepackage[T1]{fontenc}
- \usepackage[dvipsnames]{xcolor}
- \usepackage[style=authoryear-comp]{biblatex}
- \addbibresource{biblatex-examples.bib}
- \makeatletter
- \newcount\testgl
- \testgl=0
- \begingroup
- \obeylines
- \long\gdef\test{%
- \begingroup
- \testgl=1 %
- \obeylines\@test}
- \long\gdef\@test^^M#1^^M#2^^M{%
- \ttfamily%
- \def\scr@tch{}%
- #1\par%
- \color{Red}#2 %
- \ifnum\pdfstrcmp{\expandafter\trimspaces\expandafter{\scr@tch}}{\strip@ltr#2}=0 %
- \color{Green}OK!%
- \else%
- \color{Red}No :/%
- \fi\par%
- \hrulefill%
- \gdef\scr@tch{}%
- \endgroup%
- }
- \endgroup
- \def\trimspaces#1{%
- \if\relax\detokenize{#1}\relax
- \expandafter\@gobble
- \else
- \expandafter\strip@trailing@spaces
- \fi
- {#1}}
- \def\strip@ltr#1 {}
- \def\tmpa#1{%
- \def\strip@trailing@spaces##1{%
- \strip@trailing##1\qnil\strip@trailing#1\qnil\strip@qnil}}
- \tmpa{ }
- \def\strip@qnil#1\qnil#2\qnil#3{#1}
- \def\strip@trailing#1 \qnil#2{%
- #2#1\qnil\strip@trailing}
- \def\scr@tch{}%
- \renewbibmacro*{cite}{%
- \edef\tmpa{%
- (\the\numexpr\currentgrouplevel-\testgl\relax)%
- <\the\value{overallcitecount}/\the\value{overallcitetotal}>%
- [\the\value{citecount}/\the\value{citetotal}] }\tmpa
- \xdef\scr@tch{\scr@tch\tmpa}}
- \usepackage{unravel}
- \unravelsetup{
- max-action = 500,
- max-output = 3000,
- max-input = 3000,
- }
- \begin{document}
- % leaking counts with \cite (probably the smuggling?)
- \test
- A \cite{sigfridsson,worman,nussbaum}
- A (3)<1/3>[1/3] (3)<2/3>[2/3] (3)<3/3>[3/3]
- \test
- B \cite{sigfridsson}
- B (3)<1/1>[1/1]
- \test
- C \cites{sigfridsson,sigfridsson}
- C (5)<1/1>[1/1]
- \test
- D \cites{sigfridsson}{worman}
- D (5)<1/2>[1/1] (5)<2/2>[1/1]
- \test
- D \cites{sigfridsson,sigfridsson}{worman,sigfridsson}
- D (5)<1/3>[1/1] (5)<2/3>[1/2] (5)<3/3>[2/2]
- \test
- E \cites{sigfridsson,sigfridsson}
- E (5)<1/1>[1/1]
- \test
- A \cites{sigfridsson}{worman}{geer}
- A (5)<1/3>[1/1] (5)<2/3>[1/1] (5)<3/3>[1/1]
- \test
- B \cite{sigfridsson}
- B (3)<1/1>[1/1]
- \test
- C \cite{sigfridsson,worman}
- C (3)<1/2>[1/2] (3)<2/2>[2/2]
- \test
- D \cite{sigfridsson}
- D (3)<1/1>[1/1]
- \test
- A \cites{sigfridsson,worman,sigfridsson}
- A (5)<1/2>[1/2] (5)<2/2>[2/2]
- \end{document}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement