2

Minimal example is posted under this question How to Convert XeTeX to 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]

Above shown text is one verse, my document has hundreds of such units.

My question: Is it possible to put some sort of delimiters to let LaTeX know about the start and the end of each verse unit and then convert each unit into a PDF or HTML. The name of the output file can start from 001 and increment by one. Currently there are no delimiters but if it works for one then I can insert the delimiters later.

David Carlisle
  • 757,742
Aku
  • 11,026
  • This is probably possible using the TikZ external library. Each verse would have to be in a tikzpicture environment. – qubyte Feb 14 '12 at 14:44
  • 1
    The preview package should be helpful here. It can produce a PDF which has every verse on a single, tightly cropped page. You can then split the multi-page PDF into multiple single-page PDFs using a tool like pdftk. – Martin Scharrer Feb 14 '12 at 14:46
  • http://tex.stackexchange.com/q/1507/2036 – Aku Feb 14 '12 at 16:57

1 Answers1

2

I suppose that every verse starts with bv, then you can redefine this command that it also does a \newpage.

\let\BV\bv
\def\bv{\newpage\BV}

Then you'll get one verse per page. With \pagestyle{empty} you can crop all the whitespace from every page with running pdfcrop <file>. With pdftk or any other pdf tool you can extract all pages to single pdf files.