From 01441a8585dd4a70d0fcfd6147f5d6d1b7ef7f69 Mon Sep 17 00:00:00 2001 From: Yihui Xie Date: Mon, 27 May 2024 11:55:29 -0500 Subject: [PATCH] there are packages that rely on \hlstr and \hlstd commands (such as FuzzyNumbers and pandocfilters), so define them for backward compatibility --- R/header.R | 2 ++ 1 file changed, 2 insertions(+) diff --git a/R/header.R b/R/header.R index 5705bddccf..d696b44094 100644 --- a/R/header.R +++ b/R/header.R @@ -17,6 +17,8 @@ make_header_latex = function(doc) { h = one_string(c( header_latex_packages(doc), .header.maxwidth, opts_knit$get('header'), + if (length(grep('\\hlstd', doc, fixed = TRUE))) '\\let\\hlstd\\hldef', + if (length(grep('\\hlstr', doc, fixed = TRUE))) '\\let\\hlstr\\hlsng', if (getOption('OutDec') != '.') '\\usepackage{amsmath}', if (out_format('latex')) '\\usepackage{alltt}' ))