Jump to content

Splitting a document with custom pandoc lua writer

Recommended Posts

I would like to split a LaTeX document into several pandoc markdown documents. The split should happen at each \section{section_name} and the section name should be used as output name for the corresponding markdown file. So a latex file like

\section{name1}
some text
\section{name2}
more text

should be split into two markdown documents with names name1.md and name2.md. Is this possible with a pandoc custom writer in Lua at all? I couldn't find any useful example in the documentation https://pandoc.org/custom-writers.html#new-stylesite on how to approach this or if it is even possible with custom writers to generate multiple output files from a single input file.

Link to comment
  • Replies 1
  • Views 229
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

On 7/19/2022 at 2:12 PM, reece43 said:

I would like to split a LaTeX document into several pandoc markdown documents. The split should happen at each \section{section_name} and the section name should be used as output name for the corresponding markdown file. So a latex file like

\section{name1}
some text
\section{name2}
more text

should be split into two markdown documents with names name1.md and name2.md. Is this possible with a pandoc custom writer in Lua at all? I couldn't find any useful example in the documentation https://pandoc.org/custom-writers.html#new-stylesite on how to approach this or if it is even possible with custom writers to generate multiple output files from a single input file.

Do you have any examples or screenshot to describe more detail about your requirement?

BeyondSpace - Squarespace Website Developer

🖼️ Lightbox Studio (Enable Pinch/Zoom on lightbox)
🗓️ Delivery Date Picker (Squarespace Date picker form field)
💫 Gallery block 7.1 workaround
🥳 Sparkplugin Customisations Browsers (Browse +100 Spark plugin customisations)
🥳 Elfsight Template Browsers (Browse +1000 Elfsight widget Templates)

If you find my answer useful, let's leave a like or upvote so others with the same issue can find their solution. Thank you!

 

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.