summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/biblatex-ms/latex/bbx/debug-ms.bbx
blob: 6c479a6e4363e9b191dd70eec98f2c574fed9333 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
\ProvidesFile{debug-ms.bbx}
[\abx@bbxid]

\ExecuteBibliographyOptions{sorting=debug}
\DeclareFieldFormat{entrykey}{\ttfamily[#1]}
\DeclareFieldFormat{shorthandwidth}{#1}

\defbibenvironment{bibliography}
  {\list
     {}
     {\setlength{\leftmargin}{8em}%
      \setlength{\itemindent}{-\leftmargin}%
      \setlength{\itemsep}{0pt}%
      \setlength{\parsep}{0pt}%
      \interlinepenalty\@M
      \raggedbottom\raggedright
      \frenchspacing
      \normalfont\footnotesize}}
  {\endlist}
  {\item}

\defbibenvironment{shorthand}
  {\list
     {\printfield[shorthandwidth]{shorthand}}
     {\setlength{\labelwidth}{8em}%
      \setlength{\leftmargin}{\labelwidth}%
      \addtolength{\labelwidth}{-\labelsep}%
      \setlength{\itemsep}{0pt}%
      \setlength{\parsep}{0pt}%
      \renewcommand*{\makelabel}[1]{##1\hss}%
      \interlinepenalty\@M
      \raggedbottom\raggedright
      \frenchspacing
      \normalfont\footnotesize}}
  {\endlist}
  {\item}

\@ifpackageloaded{biblatex_legacy}
  {\DeclareNameFormat{debug}{%
     \bbx@mklabel{\currentname}%
     \ifblank{#3}{}{\detokenize{#3}\space}%
     \ifblank{#5}{}{\detokenize{#5}\ifpunctmark{'}{}{\space}}%
     \detokenize{#1}%
     \ifblank{#7}{}{\space\detokenize{#7}}%
     \ifblank{#3}{}{\bbx@mksublabel{given}\detokenize{#3}}%
     \ifblank{#1}{}{\bbx@mksublabel{family}\detokenize{#1}}%
     \ifblank{#5}{}{\bbx@mksublabel{prefix}\detokenize{#5}}%
     \ifblank{#7}{}{\bbx@mksublabel{affix}\detokenize{#7}}%
     \bbx@mksublabel{inits}%
     \ifblank{#4}{}{\detokenize{#4}\space}%
     \ifblank{#6}{}{\detokenize{#6}\ifpunctmark{'}{}{\space}}%
     \detokenize{#2}%
     \ifblank{#8}{}{\space\detokenize{#8}}}}
  {\DeclareNameFormat{debug}{%
     \bbx@mklabel{\currentname}%
     \ifdefvoid{\namepartgiven}{}{\expandafter\detokenize\expandafter{\namepartgiven}\space}%
     \ifdefvoid{\namepartprefix}{}{\expandafter\detokenize\expandafter{\namepartprefix}\ifpunctmark{'}{}{\space}}%
     \expandafter\detokenize\expandafter{\namepartfamily}%
     \ifdefvoid{\namepartsuffix}{}{\expandafter\space\expandafter\detokenize\expandafter{\namepartsuffix}}%
     \ifdefvoid{\namepartgiven}{}{\bbx@mksublabel{given}\expandafter\detokenize\expandafter{\namepartgiven}}%
     \ifdefvoid{\namepartfamily}{}{\bbx@mksublabel{family}\expandafter\detokenize\expandafter{\namepartfamily}}%
     \ifdefvoid{\namepartprefix}{}{\bbx@mksublabel{prefix}\expandafter\detokenize\expandafter{\namepartprefix}}%
     \ifdefvoid{\namepartsuffix}{}{\bbx@mksublabel{suffix}\expandafter\detokenize\expandafter{\namepartsuffix}}%
     \bbx@mksublabel{inits}%
     \ifdefvoid{\namepartgiveni}{}{\expandafter\detokenize\expandafter{\namepartgiveni}\space}%
     \ifdefvoid{\namepartprefixi}{}{\expandafter\detokenize\expandafter{\namepartprefixi}\ifpunctmark{'}{}{\space}}%
     \expandafter\detokenize\expandafter{\namepartfamilyi}%
     \ifdefvoid{\namepartsuffixi}{}{\expandafter\space\expandafter\detokenize\expandafter{\namepartsuffixi}}}}

\DeclareListFormat{debug}{%
  \bbx@mklabel{\currentlist}%
  \detokenize{#1}}

\DeclareFieldFormat{debug}{%
  \bbx@mklabel{\currentfield}%
  \detokenize{#1}}

\newcommand*{\bbx@mklabel}[1]{%
  \item
  \makebox[\leftmargin][l]{\ttfamily [#1]}}

\newcommand*{\bbx@mksublabel}[1]{%
  \par\nobreak
  \makebox[6em][l]{\ttfamily [#1]}}

\DeclareBibliographyDriver{debug}{%
  \item\begingroup\ttfamily\leavevmode
  \xleaders\hbox to 0.75em{\hss-\hss}\hfill\kern\z@
  \space\printfield{entrykey}\space
  \xleaders\hbox to 0.75em{\hss-\hss}\hfill\kern\z@
  \endgroup
  \def\do{\printnames[debug][-\value{listtotal}]}%
  \abx@donames
  \def\do{\printlist[debug][-\value{listtotal}]}%
  \abx@dolists
  \def\do{\printfield[debug]}%
  \abx@dointernalfields
  \abx@dofields\do{options}\do{execute}%
  \item\begingroup\ttfamily\leavevmode
  \xleaders\hbox to 0.75em{\hss-\hss}\hfill\kern\z@
  \endgroup
  \clearpage}

\def\do#1{\DeclareBibliographyAlias{#1}{debug}}
\abx@doentrytypes
\do{*}

\DeclareBibliographyDriver{shorthand}{%
  \texttt{\printfield{entrykey}}}

\endinput