summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/biblatex/latex/blx-unicode.def
blob: 01009c028cac12633e72c0b89f7c140c576b9a6d (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
112
113
114
115
% This test should not be needed since biblatex.sty already checks
% if LuaTeX or XeTeX is used.
% Currently Unicode-aware engines are only XeTeX and LuaTeX,
% both of which define \Umathcode.
\ifx\Umathcode\undefined
  \expandafter\endinput
\fi

\begingroup
\openin\blx@bcfin=UnicodeData.txt %
\ifeof\blx@bcfin
\else
  \let\blx@setazcodes\@empty
  \def\Lu{Lu}
  \def\storedpar{\par}
  \def\blx@tempa#1;#2;#3;#4\relax{%
    \def\temp{#3}%
    \ifx\temp\Lu
      \xdef\blx@setazcodes{%
        \blx@setazcodes
        \sfcode"#1=\@m
      }
    \fi
  }
  \loop\unless\ifeof\blx@bcfin
    \read\blx@bcfin to \blx@tempb
    \unless\ifx\blx@tempb\storedpar
      \expandafter\blx@tempa\blx@tempb\relax
    \fi
  \repeat
\fi
\closein\blx@bcfin
\endgroup

\appto\blx@setfrcodes{%
  % … should probably have dot spacefactor, but pdfLaTeX
  % makes it a period, so we have this here for consistency
  \sfcode`\…=\blx@sf@period
}

\DeclarePrefChars*{’}
\DeclareRangeChars*{–—}

\def\blx@normrange@range#1\bibrangedash#2\bibrangedash#3&{%
  \ifblank{#3}
    {\blx@normrange@endash#1––&}
    {\ifblank{#2}
       {\begingroup
        \protected@edef\blx@tempc{\endgroup
          \blx@range@out@value{%
            \blx@range@out@item@process{\unexpanded{#1}}%
            \noexpand\bibrangedash}}%
        \blx@tempc}
       {\ifblank{#1}
          {\begingroup
           \protected@edef\blx@tempc{\endgroup
             \blx@range@out@value{%
               \noexpand\bibrangedash
               \blx@range@out@item@process{%
                 \unexpanded{#2}}}}%
           \blx@tempc}
          {\blx@range@process{#1}{#2}}}}}

\def\blx@normrange@endash#1–#2–#3&{%
  \ifblank{#3}
    {\blx@normrange@hyphen#1--&}
    {\ifblank{#2}
       {\begingroup
        \protected@edef\blx@tempc{\endgroup
          \blx@range@out@value{%
            \blx@range@out@item@process{\unexpanded{#1}}%
            \noexpand\bibrangedash}}%
        \blx@tempc}
       {\ifblank{#1}
          {\begingroup
           \protected@edef\blx@tempc{\endgroup
             \blx@range@out@value{%
               \noexpand\bibrangedash
               \blx@range@out@item@process{\unexpanded{#2}}}}%
           \blx@tempc}
          {\blx@range@process{#1}{#2}}}}}

\def\blx@firstpage@range#1\bibrangedash#2\bibrangedash#3&{%
  \ifblank{#3}
    {\blx@firstpage@endash#1––&}
    {\ifblank{#1}
       {\begingroup
        \protected@edef\blx@tempc{\endgroup
          \blx@range@out@value{%
            \noexpand\bibrangedash
            \blx@range@out@item@process{\unexpanded{#2}}}}%
        \blx@tempc}
       {\begingroup
        \protected@edef\blx@tempc{\endgroup
          \blx@range@out@value{%
            \blx@range@out@item@process{\unexpanded{#1}}}}%
        \blx@tempc}}}

\def\blx@firstpage@endash#1–#2–#3&{%
  \ifblank{#3}
    {\blx@firstpage@hyphen#1--&}
    {\ifblank{#1}
       {\begingroup
        \protected@edef\blx@tempc{\endgroup
          \blx@range@out@value{%
            \noexpand\bibrangedash
            \blx@range@out@item@process{\unexpanded{#2}}}}%
        \blx@tempc}
       {\begingroup
        \protected@edef\blx@tempc{\endgroup
          \blx@range@out@value{%
            \blx@range@out@item@process{\unexpanded{#1}}}}%
        \blx@tempc}}}

\endinput