From 68f255213cd33a9ae99ad0ab87ea92e572c1e188 Mon Sep 17 00:00:00 2001 From: TEC Date: Wed, 12 Jul 2023 08:46:18 +0800 Subject: [PATCH] ox-latex: Introduce \codefont command * lisp/ox-latex.el (org-latex-engraved-preamble): Make it easier to customise the font used in engraved Code environments with a \codefont command (defaulting to \footnotesize). --- lisp/ox-latex.el | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lisp/ox-latex.el b/lisp/ox-latex.el index 19dec28b4..6257daa57 100644 --- a/lisp/ox-latex.el +++ b/lisp/ox-latex.el @@ -1277,9 +1277,10 @@ will produce % Define a Code environment to prettily wrap the fontified code. \\usepackage[breakable,xparse]{tcolorbox} +\\providecommand{\\codefont}{\\footnotesize} \\DeclareTColorBox[]{Code}{o}% {colback=EfD!98!EFD, colframe=EfD!95!EFD, - fontupper=\\footnotesize\\setlength{\\fboxsep}{0pt}, + fontupper=\\setlength{\\fboxsep}{0pt}\\codefont, colupper=EFD, IfNoValueTF={#1}% {boxsep=2pt, arc=2.5pt, outer arc=2.5pt, @@ -1303,7 +1304,9 @@ as long as it: In the default value the colors \"EFD\" and \"EfD\" are provided as they are respectively the foreground and background colors, just in case they aren't provided by the generated preamble, so -we can assume they are always set. +we can assume they are always set. The command \"\\codefont\" is +also provided (defaulting to \"\\footnotesize\"), to allow the +font used in \"Code\" environments to be easily tweaked. Within this preamble there are two recognized macro-like placeholders: