HTML 到 Latex:将 CSS 样式转换为相应的 LaTeX 函数

HTML 到 Latex:将 CSS 样式转换为相应的 LaTeX 函数

我正在使用 HTML 到 LaTeX 程序来转换大量 HTML 文件。典型示例:

<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<title>Title</title>
 <style type="text/css">
.poem {
    margin-left:10%;
    margin-right:10%;
    text-align: left;
}

.poem .stanza {margin: 1em 0em 1em 0em;}

.poem span.i0 {
    display: block;
    margin-left: 0em;
    padding-left: 3em;
    text-indent: -3em;
}

.poem span.i2 {
    display: block;
    margin-left: 2em;
    padding-left: 3em;
    text-indent: -3em;
}
    </style>

</head>
<body>

<h1>Chapter One</h1>

<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</p>

<div class="poem"><div class="stanza">
<span class="i0">"I pass'd without the city gate,<br /></span>
<span class="i2">I linger'd by the way;<br /></span>
<span class="i0">The palm was bending to her mate,<br /></span>
<span class="i2">And thus I heard her say,<br /></span>
</div></div>

<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</p>

</body>
</html>

转换过程由config.xml查看此处

对于<elements>转换,它的效果非常好,例如<h1> <blockqoute>等等。

但是,如上面的示例所示,我想将诗歌转换为 LaTeX 的Verse。在属性中,我设置了以下内容:

    <property name='margin'>
  <value name='1em 0em 1em 0em' start='\begin{verse}' end='\end{verse}' />
</property>

输出根本没有诗句标签,但是这样:

\\I linger'd by the way;
\\The palm was bending to her mate,
\\And thus I heard her say,
\\

我尝试了一下 DIV 标签,但仍然没有成功。有什么建议吗?

相关内容