jgm / citeproc

CSL citation processing library in Haskell
BSD 2-Clause "Simplified" License
154 stars 17 forks source link

Font size for citations #59

Closed dhicks closed 3 years ago

dhicks commented 3 years ago

I'm transitioning from LaTeX to R Markdown (and so Pandoc and so citeproc) to write Beamer slides. I'm the kind of academic who uses lots of citations, including as in-line author-date citations on my slides. To reduce visual clutter, I then set the font of the in-line citations as small as possible, eg, \tiny. I'm trying to figure out whether this is possible in my new workflow.

I've looked into whether a custom CSL style would work. However, in this Zotero thread from 2008, a CSL developer indicates that CSL doesn't support font size styling, arguing that it should be handled downstream so that it matches the surrounding document. I haven't been able to find any more recent discussions of font size and CSL.

My next idea was to check out how citations are represented in the TeX file; if they're getting turned into \cite commands or some such, then maybe I could put a wrapper around that command in the preamble. (This is basically what I did with the biblatex commands when I wrote the LaTeX directly.) But it appears the citations just become plain text strings.

So is there any way I can intervene between the CSL styling and the generated TeX file to get something whose font size I can control?

badumont commented 3 years ago

Simply run this as a Lua filter:

function Cite(citation) return { pandoc.RawInline('latex', '{\tiny '), citation, pandoc.RawInline('latex', '}') } end

Le Wednesday 10 March 2021 à 09:05:39AM, Dan Hicks a écrit :

I'm transitioning from LaTeX to R Markdown (and so Pandoc and so citeproc) to write Beamer slides. I'm the kind of academic who uses lots of citations, including as in-line author-date citations on my slides. To reduce visual clutter, I then set the font of the in-line citations as small as possible, eg, \tiny. I'm trying to figure out whether this is possible in my new workflow.

I've looked into whether a custom CSL style would work. However, in this Zotero thread from 2008, a CSL developer indicates that CSL doesn't support font size styling, arguing that it should be handled downstream so that it matches the surrounding document. I haven't been able to find any more recent discussions of font size and CSL.

My next idea was to check out how citations are represented in the TeX file; if they're getting turned into \cite commands or some such, then maybe I could put a wrapper around that command in the preamble. (This is basically what I did with the biblatex commands when I wrote the LaTeX directly.) But it appears the citations just become plain text strings.

So is there any way I can intervene between the CSL styling and the generated TeX file to get something whose font size I can control?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.*