odkr / pandoc-quotes.lua

Pandoc filter that adapts quotation marks.
MIT License
7 stars 3 forks source link

French quotes (guillemets) and non-breaking spaces #8

Open fuhrmanator opened 1 year ago

fuhrmanator commented 1 year ago

In French, guillemets usually have a non-breaking space « inside them ». That is, the line:

    fr          = {'«',  '»',     '‹',  '›'    },

produces a change of quotes to «inside them» (no spaces). Non-breaking is important so you don't get a line wrap with a single guillemet as a word.

So, the line could probably be:

    fr          = {'« ',' »',     '‹',  '›'    },

(the line actually has non-breaking spaces). This is how Microsoft Word works, as well as LaTeX's babel (and csquotes) if I'm not mistaken.

The change works great in a copy of the filter I installed, and I wonder if it should be changed here (I've begun using git submodules for the pandoc filters so it's easier to update them in my projects). Interestingly, I didn't see in csquotes that it's handled for any other languages: https://github.com/josephwright/csquotes/blob/bfd47ca66d07dc939d3ce37c3aefe1348996470c/csquotes.def#L594-L625

I also realize I could just override it with the YAML option, but haven't tried it.

badumont commented 11 months ago

Actually, it should be:

fr          = {'« ',' »',     '“',  '”'    }
odkr commented 11 months ago

Thanks for letting me know!