Alternative rendering process (generating latex - pdf)?

Hi there,

I’d like to create a module to generate latex files. There I need to do an alternative liquid rendering.

For example jekyll-scholar implements the cite tag. {% cite foobar %} gets rendered to <a class="citation" href="#foobar">(Foobar, 1997)</a> - because of a well implemented liquid tag.

but for me I want to render {% cite foobar %} as \textcite{foobar} - so not as html but as latex source, for later to use kramdown for latex creation. When i register the liquid tag cite new for my modul, it renders latex fine, but the html version is wrong.

What can I do here?

I would like to avoid the default liquid and markdown rendering steps and do my own thing (if you don’t suggest another way). Where to start best?