pandoc / lua-filters

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

reduce the space between authors to fit 5 authors in 1 line #198

Closed DS-Rodrigues closed 3 years ago

DS-Rodrigues commented 3 years ago

Hi,

Thanks again for creating this tool. I am using scholarly-metadata.lua and author-info-blocks.lua as per the example below:

---
title: "My title"
author:
  - Mario Modesto-Mata:
      email: paleomariomm@gmail.com
      institute: [astro, med]
      correspondence: true
  - name: Christopher
    institute: astro
  - name: Seaghán Mhartain
    institute: med
  - name: Rita Yuri Ynoue
    institute: astro
  - name: Test test
    institute: astro
institute:
  - astro: Instituto de Astronomía, Geofísica e Ciências Atmosféricas, Universidade de São Paulo
  - med: Faculdade de Medicina, Universidade de São Paulo
date: "1 October 2018"
output: 
  pdf_document: 
    number_sections: yes
    toc: no
    toc_depth: 4
    pandoc_args:
      - '--lua-filter=scholarly-metadata.lua'
      - '--lua-filter=author-info-blocks.lua'
  word_document:
    toc: yes
    pandoc_args:
      - '--lua-filter=scholarly-metadata.lua'
      - '--lua-filter=author-info-blocks.lua'
---

We have 5 authors, and right now one drops to the 2nd line. I think the space between authors could be reduced, is it possible to do that?

Thank you!

tarleb commented 3 years ago

I don't know, sorry; formatting details are out of scope for these filter.

Maybe there exists a simple command that can be inserted via header-includes; a LaTeX site like https://tex.stackexchange.com might be able to help.

DS-Rodrigues commented 3 years ago

Thanks @tarleb Albert Krewinkel, I've just done that. Can I just confirm - Changing the font size of authors' names is also part of formatting details and not really something to be set in these filters, correct?

tarleb commented 3 years ago

Yes, that's correct.

DS-Rodrigues commented 3 years ago

Hi @tarleb - I got some feedback to this at https://tex.stackexchange.com/questions/621821/how-to-reduce-space-between-authors-via-header-includes/623107#623107. Would pandoc accept this suggestion? Do you know how I could include this information in R Markdown?

tarleb commented 3 years ago

Hi @DS-Rodrigues, I believe adding the following to the YAML header should do what you need (untested):

header-includes:
  - |
    ```{=latex}
    \makeatletter
    \DeclareRobustCommand\and{% % \begin{tabular}
      \end{tabular}%
      \hskip -.5em \@plus.17fil%
      \begin{tabular}[t]{c}}%   % \end{tabular}
    \makeatother


The alternative solution given in that answer is a bit more difficult to use with RMarkdown, as it would require a custom LaTeX template.
DS-Rodrigues commented 3 years ago

It worked perfectly, thanks very much @tarleb !!

tarleb commented 3 years ago

That's great! :+1: :relaxed:

I hope this software will serve you well.