pandoc / lua-filters

A collection of lua filters for pandoc
MIT License
614 stars 167 forks source link

author-info-blocks and pdfauthor #226

Open twsh opened 2 years ago

twsh commented 2 years ago

When I add this to my metadata:

author:
  - Jane Doe:
      institute: Nice Place

The resulting LaTeX file includes the following in \hypersetup: pdfauthor={Jane Doe1}, and this ends up in the PDFs author field. Is there a way to avoid the unnecessary '1'?

Here is a complete command pandoc --standalone --output foo.tex --lua-filter scholarly-metadata.lua --lua-filter author-info-blocks.lua foo.md.

jgm commented 2 years ago

Pandoc really expects author to be string content or a list of strings. What pandoc version are you using? When I try this I get nothing for author in hypersetup, and in the author field of the pdf I get true.

twsh commented 2 years ago

I'm using Pandoc 2.18.

I probably should have mentioned that I'm using the scholarly-metadata filter too, which is required for the author-info-blocks filter. (I will update my issue.)

iandol commented 2 years ago

I assume the 1 is the resultant numbering for the institute you've added?

twsh commented 2 years ago

@iandol Yes, that's my understanding. In the LaTeX file the \author is: \author{Jane Doe\textsuperscript{1}}.

iandol commented 2 years ago

In my own scholarly metadata filter written in Ruby via Paru (here), I separate this info so the PDF metadata just contains the author names. I'm sure the same can be done for the Lua filter shared here, although it may need a change in the LaTeX template as IIRC it uses author-meta rather than author. @tarleb would be the expert on this.

tarleb commented 2 years ago

@iandol is right, the filter should be changed.

I'm considering to make bigger changes, too. Quarto is set to introduce a system that's similar to the one we have here, but cleaner and a bit more principled. I'll likely change the filter to use their schema, but may keep some of the current behavior for compatibility.

iandol commented 2 years ago

@tarleb -- yes I saw Quarto was going to support academic metadata too, it would be great to standardise (or if they are open source, to fork and save you some effort?) and thank you for your original filter which I think provided a good base for Quarto's devs to build from!

tarleb commented 2 years ago

There's a good chance that the Quarto filter will be published as a separate filter within the next weeks. I'll deprecate my filter if/when that happens.

I currently don't have the resources to work on the filter, so I have to ask everyone to be patient for a little longer.

twsh commented 2 years ago

@tarleb Thanks for letting me know about Quarto.

kapsner commented 1 year ago

There's a good chance that the Quarto filter will be published as a separate filter within the next weeks. I'll deprecate my filter if/when that happens.

I currently don't have the resources to work on the filter, so I have to ask everyone to be patient for a little longer.

Hi @tarleb , any updates on the quarto adjustments? If you need help, maybe I could also have a look on this! I also tried to adjust scholarly-metadata and author-info-block for quarto, but no success so far. It would be really really great to have these working with quarto / docx.

tarleb commented 1 year ago

@kapsner No updates yet, life interfered. I'd be grateful for any help. Feel free to message me with any question, or if you'd like to schedule a short call.