pandoc / lua-filters

A collection of lua filters for pandoc
MIT License
611 stars 166 forks source link

Author-names extend beyond pdf bounds (docx works fine) #34

Closed andreas-paul closed 5 years ago

andreas-paul commented 6 years ago

Hi,

I am having the issue of author names extending beyond the bounds of the respective pdf output. This is the command I use: pandoc --lua-filter=./lua/scholarly-metadata.lua --lua-filter=./lua/author-info-blocks.lua --filter pandoc-citeproc title.md studyarea.md references.md -s -o manuscript.pdf

Output to docx and html work just fine. Is there any easy solution to this? Or is it related to the default.latex template?

pdf-bounds

tarleb commented 6 years ago

Thank you for the report. This is indeed a problem with one of the filters. I'll take a look.

tarleb commented 6 years ago

The list of authors is passed to LaTeX as a single author, which causes the problem. Could you try to replace the following lines close to the end of author-info-blocks.lua

      meta.author = pandoc.MetaInlines(
        create_authors_inlines(doc.meta.author, mark)
      )

with

      meta.author = pandoc.MetaList(
        List:new(doc.meta.author):map(author_inline_generator(mark))
      )

This should let LaTeX do the actual author rendering. I got better results this way.

I forgot why the filter works the way it does right now. It's probably for consistency across formats. If the above works for you, then we could change the filter to use the above method when the output is LaTeX.

andreas-paul commented 5 years ago

This works as expected, thank you. :)