OSDN Git Service

Adds scripts for missing sw.
[dianzhuhui/script.git] / bd2tex.rtex
1 % TeX用テンプレートファイル
2
3 \documentclass[a4paper,twoside]{bxjsarticle}
4 \usepackage{fontspec}
5 \usepackage{myjapanese}
6 %\setmainfont{HanaMin}
7 \setmainfont{HAN NOM A}
8 \setsansfont{IPAゴシック}
9 \setmonofont{IPAゴシック}
10
11 \newfontfamily\jarm{IPA明朝}
12 \newfontfamily\ebas{EBAS}
13 \newfontfamily\sw{SW}
14 \newfontfamily\ext{HAN NOM B}
15
16 \topmargin=-40pt
17 %\textheight=712pt
18 \textheight=692pt
19 \oddsidemargin=-5pt
20 \evensidemargin=-5pt
21 \textwidth=462pt
22
23 \pagestyle{plain}
24 \renewcommand{\thepage}{\texttt{\arabic{page}}}
25 \renewcommand\thefootnote{\texttt{*}\kern1pt\texttt{\arabic{footnote}}}
26 %\newcommand{\wordindex}[2]{\raisebox{1.5em}{{\footnotesize #1~#2}}\hspace{-3em}}
27 \newcommand{\wordindex}[2]{{\small (#1) \hspace{-2em}}\raisebox{1.5em}{{\footnotesize #2}}}
28
29 % 標点
30 \newcommand{\book}[1]{《#1》}
31 \newcommand{\chap}[1]{〈#1〉}
32 \newcommand{\pers}[1]{\underline{#1}}
33 \newcommand{\fanqie}[1]{#1}
34 \newcommand{\rime}[1]{#1}
35 \newcommand{\seal}[1]{{\sw #1}}
36 \newcommand{\xiaozi}[1]{( #1 )}
37 \newcommand{\dzhnote}[1]{\footnote{#1}}
38
39 \begin{document}
40 \begin{flushright}
41 {\jarm「点注会」校注\\\today}
42 \end{flushright}
43 \begin{center}
44 \Large\textrm{<%= @title %>}\vspace{2em}
45 \end{center}
46
47 <% @wordlist.each do |word| %>
48    <% (spec, content) = word %>%
49    <% if spec == 'part' then %>%
50      \hspace{4em}%
51    <% elsif spec == 'volume' then %>%
52      \hspace{2em}%
53    <% else %>%
54      <% (type, ext_word, char, wordid) = spec %>%
55      <% if type == 'ebas' then %>%
56        {\Huge\ebas <%= char %>}%
57      <% else %>%
58        {\Huge\sw <%= char %>}%
59      <% end %>%
60      \wordindex{<%= ext_word %>}{<%= wordid %>}
61    <% end %>%
62    <% if content then %>%
63    <% content.each do |line| %>%
64      <% if line.has_key?('ex') then %>%
65        {\Large <%= line['ex'] %>}%
66      <% elsif line.has_key?('dn') then %>%
67        <%= line['dn'] %>%
68      <% end %>%
69    <% end %>\\
70    <% end %>%
71 <% end %>
72 \end{document}