我正在尝试使用 make 制作一个遵循梵文字母顺序的索引texindy
。imakeidx
我正在使用 XeLaTeX。
我创建了一个自定义.xdy
样式文件,作为 的一个选项texindy
,它为所有罗马字母(其中许多字母有变音符号)设置字母组,并定义了所有字母组相对于彼此的顺序,如下例所示http://www.xindy.org/doc/tutorial-3.html(第 3.3 节)。
但是,生成的索引似乎只是遵循标准的拉丁字母顺序(尽管它将带变音符号的字符索引在没有变音符号的字符之前)。例如,因为“dh”与“d”是不同的字母,在梵语中“d”跟在“d”后面,所以所有以“dh”开头的单词都应位于以“d”+任何其他字母开头的所有单词之后。例如,“drapsa-”应位于“dhanvan-”之前(注意,“h”也是一个字母,但它是字母表中的最后一个字母,因此“dhanvan-”无论如何都会位于“drapsa-”之后,即使在“dh”中未定义为字母组)。如果您需要有关我对索引的期望的更多详细信息,请询问我,但我认为.xdy
下面的文字应该可以相当清楚地说明我的意图。
下面我给出了:1) 我的.tex
代码和一些要索引的示例词;2) 我的.xdy
文件;3) 编译时与索引相关的日志文本.tex
。我怀疑问题可能出在一些用于处理索引的自动模块上,但我不知道如何在不解除某些所需组件的情况下解除它们。
1)
\documentclass[titlepage,letterpaper,twoside,12pt]{book}
\usepackage{fontspec}
\usepackage{xunicode}
\usepackage{xltxtra}
\usepackage{fontenc}[utf8x]
\setmainfont{Brill}
\usepackage{imakeidx}
\makeindex[program=texindy, options=-M skt2]
\newcommand\IndexR[1]{#1\index{#1}}
\begin{document}
\IndexR{amhas-} \IndexR{ám̐has-}, \IndexR{áti}, \IndexR{āsúr-}, \IndexR{íṣṭa-},
\IndexR{krátu-}, \IndexR{devī́-}, \IndexR{devī́nām}, \IndexR{dhánvan-},
\IndexR{drapsá-}, \IndexR{áśva-}, \IndexR{ohas-}, \IndexR{itá-}, \IndexR{īhate}
\printindex
\end{document}
2)
(require "tex/inputenc/utf8.xdy")
;; Here follow all letter-groups.
(define-letter-groups
("ṃ" "m̐" " "ḥ" "a" "ā" "i" "ī" "u" "ū" "e" "o" "ai" "au" "r̥" "r̥̄" "k" "kh"
"g" "gh" "ṅ" "c" "ch" "j" "jh" "n͂" "t" "th" "d" "dh" "n" "ṭ" "ṭh" "ḍ" "ḍh"
"ṇ" "p" "ph" "b" "bh" "m" "y" "r" "l" "v" "ś" "ṣ" "s" "h"))
(define-letter-group "ṃ" :before "m̐")
(define-letter-group "m̐" :after "ṃ" :before "ḥ")
(define-letter-group "ḥ" :after "m̐" :before "a")
(define-letter-group "a" :after "ḥ" :before "ā")
(define-letter-group "ā" :after "a" :before "i")
(define-letter-group "i" :after "ā" :before "ī")
(define-letter-group "ī" :after "i" :before "u")
(define-letter-group "u" :after "ī" :before "ū")
(define-letter-group "ū" :after "u" :before "e")
(define-letter-group "e" :after "ū" :before "o")
(define-letter-group "o" :after "e" :before "ai")
(define-letter-group "ai" :after "o" :before "au")
(define-letter-group "au" :after "ai" :before "r̥")
(define-letter-group "r̥" :after "au" :before "r̥̄")
(define-letter-group "r̥̄" :after "r̥" :before "k")
(define-letter-group "k" :after "r̥̄" :before "kh")
(define-letter-group "kh" :after "k" :before "g")
(define-letter-group "g" :after "kh" :before "gh")
(define-letter-group "gh" :after "g" :before "c")
(define-letter-group "ṅ" :after "gh" :before "c")
(define-letter-group "c" :after "ṅ" :before "ch")
(define-letter-group "ch" :after "c" :before "j")
(define-letter-group "j" :after "ch" :before "jh")
(define-letter-group "jh" :after "j" :before "n͂")
(define-letter-group "n͂" :after "jh" :before "t")
(define-letter-group "t" :after "n͂" :before "th")
(define-letter-group "th" :after "t" :before "d")
(define-letter-group "d" :after "th" :before "dh")
(define-letter-group "dh" :after "d" :before "n")
(define-letter-group "n" :after "dh" :before "ṭ")
(define-letter-group "ṭ" :after "n" :before "ṭh")
(define-letter-group "ṭh" :after "ṭ" :before "ḍ")
(define-letter-group "ḍ" :after "ṭh" :before "ḍh")
(define-letter-group "ḍh" :after "ḍ" :before "ṇ")
(define-letter-group "ṇ" :after "ḍh" :before "p")
(define-letter-group "p" :after "ṇ" :before "ph")
(define-letter-group "ph" :after "p" :before "b")
(define-letter-group "b" :after "ph" :before "bh")
(define-letter-group "bh" :after "b" :before "m")
(define-letter-group "m" :after "bh" :before "y")
(define-letter-group "y" :after "m" :before "r")
(define-letter-group "r" :after "y" :before "l")
(define-letter-group "l" :after "r" :before "v")
(define-letter-group "v" :after "l" :before "ś")
(define-letter-group "ś" :after "v" :before "ṣ")
(define-letter-group "ṣ" :after "ś" :before "s")
(define-letter-group "s" :after "ṣ" :before "h")
(define-letter-group "h" :after "s")
(markup-letter-group :open-head "~n {\bf " :close-head "}")
;;
;; The sort-rules map all letters to their lowercase counterpart.
;;
(sort-rule "A" "a")
(sort-rule "B" "b")
(sort-rule "C" "c")
(sort-rule "D" "d")
(sort-rule "E" "e")
(sort-rule "F" "f")
(sort-rule "G" "g")
(sort-rule "H" "h")
(sort-rule "I" "i")
(sort-rule "J" "j")
(sort-rule "K" "k")
(sort-rule "L" "l")
(sort-rule "M" "m")
(sort-rule "N" "n")
(sort-rule "O" "o")
(sort-rule "P" "p")
(sort-rule "Q" "q")
(sort-rule "R" "r")
(sort-rule "S" "s")
(sort-rule "T" "t")
(sort-rule "U" "u")
(sort-rule "V" "v")
(sort-rule "W" "w")
(sort-rule "X" "x")
(sort-rule "Y" "y")
(sort-rule "Z" "z")
;; Accented Sorting
(sort-rule "á" "a")
(sort-rule "ā́" "ā")
(sort-rule "í" "i")
(sort-rule "ī́" "ī")
(sort-rule "ú" "u")
(sort-rule "ū" "ū")
(sort-rule "é" "e")
(sort-rule "ó" "o")
(sort-rule "ái" "ai")
(sort-rule "áu" "au")
(sort-rule "ŕ̥" "r̥")
(sort-rule "r̥̄́" "r̥̄")
3)
Reading indexstyle...
Loading module "/var/folders/1t/1by7npx95zdfkspc6fp0w8nm0000gn/T/jN96RZb09V"...
Loading module "lang/general/latin9-lang.xdy"...
Loading module "lang/general/latin9.xdy"...
Finished loading module "lang/general/latin9.xdy".
Finished loading module "lang/general/latin9-lang.xdy".
Loading module "tex/inputenc/latin.xdy"...
Finished loading module "tex/inputenc/latin.xdy".
Loading module "texindy.xdy"...
Loading module "numeric-sort.xdy"...
Finished loading module "numeric-sort.xdy".
Loading module "latex.xdy"...
Loading module "tex.xdy"...
Finished loading module "tex.xdy".
Finished loading module "latex.xdy".
Loading module "latex-loc-fmts.xdy"...
Finished loading module "latex-loc-fmts.xdy".
Loading module "makeindex.xdy"...
Finished loading module "makeindex.xdy".
Finished loading module "texindy.xdy".
Loading module "page-ranges.xdy"...
Finished loading module "page-ranges.xdy".
Loading module "word-order.xdy"...
Finished loading module "word-order.xdy".
Loading module "skt2.xdy"...
Finished loading module "skt2.xdy".
Finished loading module "/var/folders/1t/1by7npx95zdfkspc6fp0w8nm0000gn/T/jN96RZb09V".
Finished reading indexstyle.
Finalizing indexstyle... (done)
Reading raw-index "/var/folders/1t/1by7npx95zdfkspc6fp0w8nm0000gn/T/SQs8on3FCq"...
Finished reading raw-index.
Processing index... [10%] [20%] [30%] [40%] [50%] [60%] [70%] [80%] [90%] [100%]
Finished processing index.
Writing markup... [10%] [20%] [30%] [40%] [50%] [60%] [70%] [80%] [90%] [100%]
Markup written into file "./IndexTest2.ind".
(./IndexTest2.ind) [3] (./IndexTest2.aux) )
Output written on IndexTest2.pdf (3 pages).
Transcript written on IndexTest2.log.
答案1
实验性;第一个版本(IAST 方案)
我正在尝试设置这个音译辛迪。我使用小写字母表示字母组,但这在欧洲语言中并不常见。我使用合并规则表示大写字母,我们也不这样使用这些规则。因此我们只能在此步骤之后看到Shiva
not 。shiva
我不喜欢拉丁现代语中几个双重音字母的呈现,因此我使用Code2000
xelatex
字体。我们可以在和中运行字母列表和示例lualatex
。我使用的是维基百科验证字母的顺序梵语键盘在线之后,我又使用了几种字母组合,但看起来弊大于利,所以我撤回了它们。
首先,我附上字母表:
% run: {xe|lua}latex typesetme.tex
\documentclass[a4paper]{article}
\pagestyle{empty}
\usepackage{fontspec}
\setmainfont{Code2000}
\newenvironment{alphabet}{\begin{tabular}{*{16}{l}}}{\end{tabular}}
\addtolength{\voffset}{-0.5in}
\addtolength{\textheight}{1in}
\begin{document}
\section{Sanskrit (transliteration)}
\subsection{Alphabet}
\begin{alphabet}
a\,A & á\,Á\\
ā\,Ā & ā́\,Ā́\\
i\,I & í\,Í\\
ī\,Ī & ī́\,Ī́\\
u\,U & ú\,Ú\\
ū\,Ū\\
ṛ\,Ṛ & r̥\,R̥ & ŕ̥\,Ŕ̥\\
ṝ\,Ṝ & r̥̄\,R̥̄ & r̥̄́\,R̥̄́\\
ḷ\,Ḷ\\
ḹ\,Ḹ\\
e\,E & é\,É\\
ai\,AI & ái\,ÁI\\
o\,O & ó\,Ó\\
au\,AU & áu\,ÁU\\
ṃ\,Ṃ\\
m̐\,M̐\\
ḥ\,Ḥ\\
k\,K\\
kh\,KH\\
g\,G\\
gh\,GH\\
ṅ\,Ṅ\\
c\,C\\
ch\,CH\\
j\,J\\
jh\,JH\\
ñ\,Ñ\\
ṭ\,Ṭ\\
ṭh\,ṬH\\
ḍ\,Ḍ\\
ḍh\,ḌH\\
ṇ\,Ṇ\\
t\,T\\
th\,TH\\
d\,D\\
dh\,DH\\
n\,N\\
p\,P\\
ph\,PH\\
b\,B\\
bh\,BH\\
m\,M\\
y\,Y\\
r\,R\\
l\,L\\
v\,V\\
ś\,Ś\\
ṣ\,Ṣ\\
s\,S\\
h\,H
\end{alphabet}
\ifx\relax
\subsection{Ligatures}
\begin{flushleft}
None.
\end{flushleft}
\subsubsection{Upper-/lowercase words}
Capitalized or uppercase words are sorted \emph{before} otherwise equal lowercase words.
\subsubsection{Special characters}
The order of special characters and letters is:
\begin{flushleft}
?\hspace{4mm}!\hspace{4mm}.\hspace{4mm}letters\hspace{4mm}-\hspace{4mm}'
\end{flushleft}
\fi
\end{document}
用法
请将这两个文件下载到您的工作目录:
获得http://striz7.fame.utb.cz/tex-sx/sa/version1/utf8.pl-sa.in.xdy
获得http://striz7.fame.utb.cz/tex-sx/sa/version1/utf8.pl-sa.in-test.xdy
如果您想比较矢量版本,请也下载以下四个文件:
获得http://striz7.fame.utb.cz/tex-sx/sa/version1/typesetme.pdf
获得http://striz7.fame.utb.cz/tex-sx/sa/version1/typesetme.tex
获得http://striz7.fame.utb.cz/tex-sx/sa/version1/mal-sanskrit.pdf
获得http://striz7.fame.utb.cz/tex-sx/sa/version1/mal-sanskrit.tex
我附上了运行这三个命令后得到的 PDF 文件的一个例子和预览:
lualatex mal-sanskrit.tex
xindy -M texindy -M utf8.pl-sa.in-test -M bonus mal-sanskrit.idx
lualatex mal-sanskrit.tex
% run: xelatex or lualatex
%lualatex mal-sanskrit.tex
%xindy -M texindy -M utf8.pl-sa.in-test -M bonus mal-sanskrit.idx
%lualatex mal-sanskrit.tex
\documentclass[a4paper]{article}
\pagestyle{empty}
%\usepackage{luatextra} % for lualatex
%\usepackage{xltxtra} % xelatex
\usepackage{fontspec}
\newfontfamily{\codetwo}{Code2000}% Brill
\usepackage[noautomatic]{imakeidx}
\indexsetup{firstpagestyle=empty}
\usepackage[colorlinks]{hyperref}
\makeindex
\newcommand\IndexR[1]{{\codetwo#1}\index{#1}}
\usepackage{filecontents}
\def\malformat#1{{\Large#1}\smallskip}
\begin{filecontents*}{bonus.xdy}
(markup-letter-group :open-head "~n \malformat{" :close-head "}")
(merge-rule "A" "a")
(merge-rule "Á" "á")
(merge-rule "Ā" "ā")
(merge-rule "Ā́" "ā́")
(merge-rule "I" "i")
(merge-rule "Í" "í")
(merge-rule "Ī" "ī")
(merge-rule "Ī́" "ī́")
(merge-rule "U" "u")
(merge-rule "Ú" "ú")
(merge-rule "Ū" "ū")
(merge-rule "Ṛ" "ṛ")
(merge-rule "R̥" "r̥")
(merge-rule "Ŕ̥" "ŕ̥")
(merge-rule "Ṝ" "ṝ")
(merge-rule "R̥̄" "r̥̄")
(merge-rule "R̥̄́" "r̥̄́")
(merge-rule "Ḷ" "ḷ")
(merge-rule "Ḹ" "ḹ")
(merge-rule "E" "e")
(merge-rule "É" "é")
(merge-rule "AI" "ai")
(merge-rule "ÁI" "ái")
(merge-rule "O" "o")
(merge-rule "Ó" "ó")
(merge-rule "AU" "au")
(merge-rule "ÁU" "áu")
(merge-rule "Ṃ" "ṃ")
(merge-rule "M̐" "m̐")
(merge-rule "Ḥ" "ḥ")
(merge-rule "K" "k")
(merge-rule "KH" "kh")
(merge-rule "G" "g")
(merge-rule "GH" "gh")
(merge-rule "Ṅ" "ṅ")
(merge-rule "C" "c")
(merge-rule "CH" "ch")
(merge-rule "J" "j")
(merge-rule "JH" "jh")
(merge-rule "Ñ" "ñ")
(merge-rule "Ṭ" "ṭ")
(merge-rule "ṬH" "ṭh")
(merge-rule "Ḍ" "ḍ")
(merge-rule "ḌH" "ḍh")
(merge-rule "Ṇ" "ṇ")
(merge-rule "T" "t")
(merge-rule "TH" "th")
(merge-rule "D" "d")
(merge-rule "DH" "dh")
(merge-rule "N" "n")
(merge-rule "P" "p")
(merge-rule "PH" "ph")
(merge-rule "B" "b")
(merge-rule "BH" "bh")
(merge-rule "M" "m")
(merge-rule "Y" "y")
(merge-rule "R" "r")
(merge-rule "L" "l")
(merge-rule "V" "v")
(merge-rule "ś" "Ś")
(merge-rule "Ṣ" "ṣ")
(merge-rule "S" "s")
(merge-rule "H" "h")
\end{filecontents*}
\begin{document}
Text before.
% From TeX.SX...
\IndexR{amhas-} \IndexR{ám̐has-}, \IndexR{áti}, \IndexR{āsúr-}, \IndexR{íṣṭa-},
\IndexR{krátu-}, \IndexR{devī́-}, \IndexR{devī́nām}, \IndexR{dhánvan-},
\IndexR{drapsá-}, \IndexR{áśva-}, \IndexR{ohas-}, \IndexR{itá-}, \IndexR{īhate}
% From Wikipedia...
\newpage
\IndexR{ārṣa}, \IndexR{saṃskṛtám}, \IndexR{paścimottarī},
\IndexR{madhyadeśī}, \IndexR{pūrvi}, \IndexR{dakṣiṇī},
\IndexR{prākṛta-}, \IndexR{Pāṇini}, \IndexR{Pāṇinian},
\IndexR{Janani}, \IndexR{Janmabhūmisca}, \IndexR{Svargādapi},
\IndexR{garīyasi}, \IndexR{Aṣṭādhyāyī}, \IndexR{vyākaraṇa},
\IndexR{Aṣṭādhyāyī}, \IndexR{Pāṇini}, \IndexR{Patañjali},
\IndexR{Mahābhāṣya},\IndexR{Aṣṭādhyāyī},\IndexR{Trimuni},
\IndexR{Vyākarana},\IndexR{Vārtikas},\IndexR{Jayaditya},
\IndexR{Vāmana}, \IndexR{Shiva},\IndexR{shiva}
\IndexR{Kāsikā}, \IndexR{Pāṇinian}, \IndexR{pāṇinian},
% Numbers
\newpage
\IndexR{éka-}, \IndexR{dva-}, \IndexR{tri-}, \IndexR{catúr-},
\IndexR{páñcan-}, \IndexR{ṣáṣ-}, \IndexR{saptán-}, \IndexR{aṣṭá-}, \IndexR{návan-}, \IndexR{dáśan-}
Text after.
\begingroup
\codetwo
\printindex
\endgroup
\end{document}
答案2
我会添加“-I omega”。Omega 是一个在 Unicode 中内部工作的 TeX 系统。XeLaTeX 的功能完全相同。将输入标记设置为 omega 的效果是假定使用 UTF-8,并且禁用用于处理输入的不必要的模块。前段时间,我计划支持印度语。我只懂印地语,如果没有其他人的帮助,我无法继续我的工作。我对印地语的支持如下: http://icebearsoft.euweb.cz/xindy-devanagari/ 我需要更多的测试文件和一些人来验证结果。