Hi, I’m publishing a book with R bookdown in Estonian and would need to have the quotation marks styled as „...“.
I have set lang: et in YAML header of the index.Rmd and tried different options of adding \usepackage{csquotes} to the preamble.tex, e.g.:
The attempt to define the marks manually
\usepackage{csquotes}
\MakeOuterQuote{"}
% Manually redefine primary quotes to Estonian style: „...“
\DeclareRobustCommand{\openquote}{\quotedblbase}
\DeclareRobustCommand{\closequote}{\textquotedblright}
I’ve tried various options suggested by chatgpt but the attempts have no effect, seems that the straight quotations are converted to this “...” before my rules are applied.
Seems that I got it sorted, I'm pasting the solution here, as maybe someone else is also struggling with this. What helped was to add a lua filter to convert the quotes:
-- csquotes.lua
-- convert Pandoc quotes to LaTeX \enquote
if FORMAT:match('latex') then
function Quoted(el)
local open = (el.quotetype == 'SingleQuote') and [[\enquote*{]] or [[\enquote{]]
local out = { pandoc.RawInline('latex', open) }
for _, c in ipairs(el.content) do out[#out+1] = c end
out[#out+1] = pandoc.RawInline('latex', [[}]])
return out
end
end