Hi Matt, Matt Huszagh <huszaghm...@gmail.com> writes:
> Matt Huszagh <huszaghm...@gmail.com> writes: > >> I've added a few changes to the patch that additionally allow custom the >> begin and end document environments. The purpose here is to allow latex >> code within the document environment that is ignored by the body >> export. For instance, I can set the page color with >> {\color{some-color}...} and this doesn't mess up latex exports. > > I've fixed a minor bug with the previous patch. Thanks -- that'd be for after 9.4 of course. > From 1bcd1d28dde6625d0c648c92243260b46433e1eb Mon Sep 17 00:00:00 2001 > From: Matt Huszagh <huszaghm...@gmail.com> > Date: Fri, 28 Aug 2020 22:26:05 -0700 > Subject: [PATCH] ob-latex.el: Make latex to svg compilation very customizable > > * lisp/ob-latex.el (org-babel-latex-preamble): Add latex preamble > customization. > (org-babel-latex-begin-env): Add latex document environment begin > customization. > (org-babel-latex-end-env): Add latex document environment end > customization. > (org-babel-latex-pdf-svg-process): Add customization for converting a > pdf to svg. > (org-babel-execute:latex): Add specific case for svg generation from > latex block. Prefer * lisp/ob-latex.el (org-babel-latex-preamble): New option for LaTeX preamble customization. "New option" is quite standard, an "option" being a customizable variable. In this case, "New option" would probably be enough, given the name of the option is quite self-explanatory. Also, some find it pedantic, but "LaTeX" is the correct spelling in a changelog I guess. > +(defcustom org-babel-latex-preamble > + (lambda (_) > + "\\documentclass[preview]{standalone} > +\\def\\pgfsysdriver{pgfsys-tex4ht.def} > +") > + "Closure which evaluates at runtime to the latex preamble. It > +takes 1 argument which is the parameters of the source block." > + :group 'org-babel > + :type 'function) The first line of the docstring should contain a sentence, so you'd need to have a new paragraph after "runtime to the LaTeX preamble." > +(defcustom org-babel-latex-pdf-svg-process > + "inkscape --pdf-poppler %f -T -l -o %O" > + "Command used to convert a PDF file to an SVG file when > +executing a latex source block." > + :group 'org-babel > + :type 'string) What for users who don't have inkscape? Thanks, -- Bastien