0
定製LateXML規則我想一個乳膠文件轉換爲使用LateXML(0.8.2版本)XML。 作爲LateXML沒有(還)有轉換規則爲包ledmac,我試着寫 他們自己,但到目前爲止,我沒有。寫乳膠包ledmac
ledmac的一個典型的用例將像
\edtext{some text}{\lemma{text}\Afootnote{some explanation}}
我想獲得結果
<edtext>
some text
</edtext>
<lemma>
text
</lemma>
<Afootnote>
some explanation
</Afootnote>
文件test1.tex:
\documentclass{article}
\usepackage{ledmac}
\begin{document}
\section{First Section}
Et et possimus non delectus et id dolor fugiat. Nemo aperiam in vitae atque.
Qui \edtext{pariatur ut fuga}{\lemma{fuga} \Afootnote{quaerat ratione dolorem ex dicta}}.
Sapiente hic est nobis eum. Rerum odit consectetur possimus et quaerat aut veritatis quae.
\end{document}
我嘗試到目前爲止,已在同一個目錄test1.tex寫入文件ledmac.sty.ltxml。 它具有以下內容:
package LaTeXML::Package::Pool;
use strict;
use LaTeXML::Package;
use warnings;
#RegisterNamespace('scr'=>"http://bla.com/scr");
DefConstructor('\edtext{}', "<edtext>#1</edtext>");
DefConstructor('\lemma{}', "<lemma>#1</lemma>");
DefConstructor('\Afootnote{}',"<Afootnote>#1</Afootnote>");
Tag('edtext', autoClose=>1);
Tag('lemma', autoClose=>1);
Tag('Afootnote', autoClose=>1);
1;
然而,這導致每個我嘗試轉換的命令發生
Error:malformed:edtext <edtext> isn't allowed here
at /media/sf_Dokumente/Leibniz/LeibnizFiles/LateXML-Leibniz/test1.tex; line 6 col 3
Currently in XMLDocument[54493616]<ltx:document _box="LaTeXML::Core::Whatsit=HASH(0x..." _font="Font[serif,medium,upright,10,b..." xmlns="http://dlmf.nist.gov/LaTeXML">...<ltx:section _box="LaTeXML::Core::Whatsit=HASH(0x..." _font="Font[serif,medium,upright,10,b..." refnum="1" xml:id="S1" _ID_counter_p_="1">...<ltx:para _box="LaTeXML::Core::Box=ARRAY(0x344f300)" _font="Font[serif,medium,upright,10,b..." xml:id="S1.p1">...<ltx:p _box="LaTeXML::Core::Box=ARRAY(0x344f300)" _font="Font[serif,medium,upright,10,b...">...
In Core::Document[@0x34474b8] at /media/sf_Dokumente/Leibniz/LeibnizFiles/LateXML-Leibniz/test1.tex; line 6 col 3
<= Core::Definition::Constructor[\edtext... <= Whatsit[\edtext,Core::List[Box[p],Box... <= Core::Document[@0x34474b8] <= ...
Error:malformed:edtext Attempt to close </edtext>, which isn't open
at /media/sf_Dokumente/Leibniz/LeibnizFiles/LateXML-Leibniz/test1.tex; line 6 col 3
Currently in XMLDocument[54493616]<ltx:document _box="LaTeXML::Core::Whatsit=HASH(0x..." _font="Font[serif,medium,upright,10,b..." xmlns="http://dlmf.nist.gov/LaTeXML">...<ltx:section _box="LaTeXML::Core::Whatsit=HASH(0x..." _font="Font[serif,medium,upright,10,b..." refnum="1" xml:id="S1" _ID_counter_p_="1">...<ltx:para _box="LaTeXML::Core::Box=ARRAY(0x344f300)" _font="Font[serif,medium,upright,10,b..." xml:id="S1.p1">...<ltx:p _box="LaTeXML::Core::Box=ARRAY(0x344f300)" _font="Font[serif,medium,upright,10,b...">...
In Core::Document[@0x34474b8] at /media/sf_Dokumente/Leibniz/LeibnizFiles/LateXML-Leibniz/test1.tex; line 6 col 3
<= Core::Definition::Constructor[\edtext... <= Whatsit[\edtext,Core::List[Box[p],Box... <= Core::Document[@0x34474b8] <= ...
這些錯誤形式的六大誤區。
如果有人用LateXML專業知識可以給我一個提示,如何從這裏出發,我會很感激!
編輯:在LateXML郵件列表中發佈我的問題後,我被告知必須向LateXML提供RelaxNG方案。因此,這似乎是錯誤消息的原因。