forked from muzimuzhi/latex-examples
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfootnote-chinese-style.tex
46 lines (35 loc) · 1.12 KB
/
footnote-chinese-style.tex
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
\documentclass{ctexart}
\usepackage{xpatch}
\usepackage{xunicode-addon}
% set char class and font for circled numbers
% ref: https://stone-zeng.github.io/2019-02-09-circled-numbers
\xeCJKDeclareCharClass{Default}{"24EA, "2460->"2473, "3251->"32BF}
\newfontfamily\EnclosedNumbers{Source Han Serif SC}
% patch \textcircled
\AtBeginUTFCommand[\textcircled]{\begingroup\EnclosedNumbers}
\AtEndUTFCommand[\textcircled]{\endgroup}
\makeatletter
% add wrapper \textcircled,
% adapted from latex.ltx, line 6380:
\renewcommand\thefootnote{\textcircled{\@arabic\c@footnote}}
% use separate footnote mark command
\xpatchcmd\@makefntext
{\hb@[email protected]{\hss\@makefnmark}}
{\hb@[email protected]{\hss\@makefnmarkNormal}\space}
{}{\fail}
% use non-suprescript style with lower baseline
% adapted from latex.ltx, line 6383:
\def\@makefnmarkNormal{\lower .3ex \hbox{\normalfont\@thefnmark}}
% make footnote rule shorter
\xpatchcmd\footnoterule
{.4\columnwidth}
{1in}
{}{\fail}
\makeatother
\begin{document}
一二三\footnote{text}
\addtocounter{footnote}{20}
四五六\footnote{text}
\addtocounter{footnote}{20}
七八九\footnote{text}
\end{document}