[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] Equation references in HTML export

From: Thibault Marin
Subject: Re: [O] Equation references in HTML export
Date: Tue, 16 Jan 2018 22:39:39 -0600
User-agent: mu4e 0.9.18; emacs 25.2.2

Hi, thanks for the review.  Please find attached an updated patch.

> I guess so. OTOH, I assume latex environments are always math
> environments. One can use LaTex export blocks for "regular" LaTeX.
I left the math check in the attached patch for now.  Please let me know
if you would like me to remove it.

> Nitpick: since this is a predicate, it should be named
> `org-html--math-environment-p'.

> Meanwhile, I think the implementation is a bit convoluted. What about
> the following?
>     (replace-regexp-in-string
>      "\\`[ \t]*\\\\begin{\\([^*]+?\\)}"
>      "\\1*"
>      (replace-regexp-in-string "^[ \t]*\\\\end{\\([^*]+?\\)}[ \r\t\n]*\\'"
>                                "\\1*"
>                                latex-frag nil nil 1)
>      nil nil 1)

> IMO, this doesn't deserve to be a function, you can just use something
> like this:
>     (if (org-string-nw-p label)
>         (replace-regexp-in-string "\\`.*"
>                                   (format "\\&\n\\\\label{%s}" label)
>                                   latex-frag)
>       latex-frag)



Attachment: 0001-ox-html.el-Add-label-and-number-to-equations-in-HTML.patch
Description: Text Data

reply via email to

[Prev in Thread] Current Thread [Next in Thread]