![如何将每节经文转换为单独的 PDF](https://linux22.com/image/245864/%E5%A6%82%E4%BD%95%E5%B0%86%E6%AF%8F%E8%8A%82%E7%BB%8F%E6%96%87%E8%BD%AC%E6%8D%A2%E4%B8%BA%E5%8D%95%E7%8B%AC%E7%9A%84%20PDF.png)
最小的例子发布在这个问题下如何将 XeTeX 转换为 HTML
\bv
तपः स्वाध्यायनिरताम् तपस्वी वाग्विदाम् वरम् | \\
नारदम् परिपप्रच्छ वाल्मीकिर्मुनिपुङ्गवम् ॥ १.१.१ ॥
\ev
\bfns \blt \hline
तपस्वी & = & sagacious thinker & वाल्मीकि: & = & Sage [Poet] वाल्मीकि & तपः & = & in thoughtful-meditation \\
स्व अध्याय & = & in self, study of scriptures & निरतम् & = & always - who is eternally studious in scriptures& वाक् & = & in speaking [in enunciation] \\
विदाम् & = & among expert enunciators & वरम् & = & sublime one - with नारद & मुनि पुन्गवम् & = & with sage, paragon, with such a paragon sage Naarada \\
नारदम् & = & with [such a sage] Naarada & परिपप्रच्छ & = & verily [inquisitively,] inquired about
\elt \efns
सर्व गुण समिष्टि रूपम् पुरुषम् all, merited endowments, composite, in form - about such a man.]
A thoughtful-mediator, an eternally studious sage in scriptures about the Truth a ...[1-1-1]
上面显示的文本是一节诗句,我的文档有数百个这样的单元。
我的问题:是否可以添加某种分隔符,让 LaTeX 知道每个诗节单元的开始和结束,然后将每个单元转换为 PDF 或 HTML。输出文件的名称可以从 1 开始001
并以 1 为增量。目前没有分隔符,但如果可以使用一个分隔符,那么我可以稍后插入分隔符。
答案1
我认为每一节经文都以 开头bv
,那么您可以重新定义这个命令,它也会执行\newpage
。
\let\BV\bv
\def\bv{\newpage\BV}
然后,您将每页获得一节经文。\pagestyle{empty}
您可以使用 来裁剪每页的所有空白pdfcrop <file>
。使用pdftk
或任何其他 pdf 工具,您可以将所有页面提取到单个 pdf 文件中。