"Jacob S. Gordon" <[email protected]> writes:

> Thank you! I’ve attached a patch series that:
>
> 1. Fixes the description of 'org-odt-with-latex' to match the export
>    behaviour.
>
> 2. Allows any symbol from 'org-preview-latex-process-alist', just like
>    'org-html-with-latex'. This way, 'xelatex' and any future additions
>    are allowed, including user-defined symbols.
>
> 3. Replaces the hard-coded 'ltxmathml' directory with a variable.

Thanks! And sorry for the late review.

> Subject: [PATCH v1 2/3] ox-odt: Allow LaTeX fragment conversion from any
>  preview method
> +SYMBOL         Convert the LaTeX fragments to images using any symbol
> +               defined in `org-preview-latex-process-alist', e.g.,
> +               `dvipng'.
>  `verbatim'     Keep everything in verbatim.
>  
>  If the desired converter is not available or any other symbol is
> @@ -742,9 +739,7 @@ provided, process as `verbatim'."
>    :type '(choice
>         (const :tag "Do not process math in any way" nil)
>         (const :tag "Convert fragments to MathML" mathml)
> -       (const :tag "Use dvipng to make images" dvipng)
> -       (const :tag "Use imagemagick to make images" imagemagick)
> -       (const :tag "Use dvisvgm to make images" dvisvgm)
> +       (symbol :tag "Convert fragments to images" :value dvipng)
>         (const :tag "Leave math verbatim" verbatim)))

After this change, type specification will not longer be accurate.
Also, we need to mark the change in the variable meaning via :package-version.
  
> +      ((and s
> +         (guard (memq s preview-symbols))
> +         (let ext-commands
> +           (plist-get
> +            (cdr (assq s org-preview-latex-process-alist))
> +            :programs))
> +         (let ext-commands-check
> +           (seq-reduce (lambda (result cmd)
> +                         (and result
> +                              (not (null
> +                                    (org-check-external-command cmd "" t)))))
> +                       ext-commands t)))
> +       (unless ext-commands-check
> +      (setq warning "`org-odt-with-latex': LaTeX to image converter not 
> available.  Falling back to verbatim.")

This clause looks overengineered.
Why not simply leaving the guard check and then putting the rest into
the body? 

> +(defcustom org-latex-mathml-directory "ltxmathml/"
> +  "Path to store MathML files converted from LaTeX fragments.
> +A relative path here creates many directories relative to the
> +processed Org files paths.  An absolute path puts all files
> +in the same place."
> +  :group 'org-latex
> +  :version "31.1"

:package-version, not :version. :version should only be used for
internal Emacs libraries.

Also, please add a record announcing the new custom option in etc/ORG-NEWS.

-- 
Ihor Radchenko // yantar92,
Org mode maintainer,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>

Reply via email to