emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* LaTeX fragments not being generated due to extra * in tikz env
@ 2020-12-08 20:57 10cadr
  2020-12-09 18:16 ` Jeremie Juste
  0 siblings, 1 reply; 4+ messages in thread
From: 10cadr @ 2020-12-08 20:57 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 551 bytes --]

I was trying out the new option tex:dvipng. The HTML result was a image
with the tikz code.

Turns out, debugging and telling the fragment processor not to delete the
files, what org generates for the tikz fragment is:

\begin{tikzpicture*}

Removing the astherisk would make it work without any workarounds.

How I got around this was

#+LATEX_HEADER: \usepackage{environ,amsmath,multicol}
#+LATEX_HEADER:
\NewEnviron{tikzpicture*}[1][]{\begin{tikzpicture}[#1]\BODY\end{tikzpicture}}

Possibly fixing this issue, will make cross formats much easier.

[-- Attachment #2: Type: text/html, Size: 694 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: LaTeX fragments not being generated due to extra * in tikz env
  2020-12-08 20:57 LaTeX fragments not being generated due to extra * in tikz env 10cadr
@ 2020-12-09 18:16 ` Jeremie Juste
  2020-12-18  0:30   ` Thibault Marin
  0 siblings, 1 reply; 4+ messages in thread
From: Jeremie Juste @ 2020-12-09 18:16 UTC (permalink / raw)
  To: 10cadr; +Cc: emacs-orgmode

Hello,

Thanks for reporting. Indeed this is an issue that hasn't been fixed
yet. This is the case for most latex environments  

My solution is here
https://www.mail-archive.com/emacs-orgmode@gnu.org/msg129974.html

but consider also the idea behind the star
https://www.mail-archive.com/emacs-orgmode@gnu.org/msg129976.html

I will try to submit a patch soon.

Best regards,
Jeremie

On Tuesday,  8 Dec 2020 at 20:57, 10cadr wrote:
> I was trying out the new option tex:dvipng. The HTML result was a image
> with the tikz code.
>
> Turns out, debugging and telling the fragment processor not to delete the
> files, what org generates for the tikz fragment is:
>
> \begin{tikzpicture*}
>
> Removing the astherisk would make it work without any workarounds.
>
> How I got around this was
>
> #+LATEX_HEADER: \usepackage{environ,amsmath,multicol}
> #+LATEX_HEADER:
> \NewEnviron{tikzpicture*}[1][]{\begin{tikzpicture}[#1]\BODY\end{tikzpicture}}
>
> Possibly fixing this issue, will make cross formats much easier.

-- 
Jeremie Juste


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: LaTeX fragments not being generated due to extra * in tikz env
  2020-12-09 18:16 ` Jeremie Juste
@ 2020-12-18  0:30   ` Thibault Marin
  2020-12-19 12:55     ` Jeremie Juste
  0 siblings, 1 reply; 4+ messages in thread
From: Thibault Marin @ 2020-12-18  0:30 UTC (permalink / raw)
  To: Jeremie Juste, 10cadr; +Cc: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 1344 bytes --]


Hi,

I introduced the change that broke the behavior.  The attached patch
seems to fix the issue for me, does it look reasonable?

Thanks,

thibault

On 2020-12-09T13:16:19-0500, Jeremie Juste wrote:

  Hello,

  Thanks for reporting. Indeed this is an issue that hasn't been fixed
  yet. This is the case for most latex environments

  My solution is here
  https://www.mail-archive.com/emacs-orgmode@gnu.org/msg129974.html

  but consider also the idea behind the star
  https://www.mail-archive.com/emacs-orgmode@gnu.org/msg129976.html

  I will try to submit a patch soon.

  Best regards,
  Jeremie

  On Tuesday,  8 Dec 2020 at 20:57, 10cadr wrote:
  > I was trying out the new option tex:dvipng. The HTML result was a image
  > with the tikz code.
  >
  > Turns out, debugging and telling the fragment processor not to delete the
  > files, what org generates for the tikz fragment is:
  >
  > \begin{tikzpicture*}
  >
  > Removing the astherisk would make it work without any workarounds.
  >
  > How I got around this was
  >
  > #+LATEX_HEADER: \usepackage{environ,amsmath,multicol}
  > #+LATEX_HEADER:
  > \NewEnviron{tikzpicture*}[1][]{\begin{tikzpicture}[#1]\BODY\end{tikzpicture}}
  >
  > Possibly fixing this issue, will make cross formats much easier.

  --
  Jeremie Juste



[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Fix-non-math-environment-export.patch --]
[-- Type: text/x-diff, Size: 1259 bytes --]

From f5122a85b0170f17be103400b5f910030df806c4 Mon Sep 17 00:00:00 2001
From: thibault <thibault.marin@gmx.com>
Date: Thu, 10 Dec 2020 13:26:08 -0500
Subject: [PATCH] Fix non-math environment export

* ox-html.el (org-html-latex-environment): Prevent addition of * to
non-math environments.  Added * is used for math environments to
replace latex equation numbering by org labels for html linking.
---
 lisp/ox-html.el | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/lisp/ox-html.el b/lisp/ox-html.el
index d2f24f5c6..40024c70b 100644
--- a/lisp/ox-html.el
+++ b/lisp/ox-html.el
@@ -2933,7 +2933,9 @@ CONTENTS is nil.  INFO is a plist holding contextual information."
      ((assq processing-type org-preview-latex-process-alist)
       (let ((formula-link
              (org-html-format-latex
-              (org-html--unlabel-latex-environment latex-frag)
+	      (if (eq nil (org-html--math-environment-p latex-environment))
+		  latex-frag
+		(org-html--unlabel-latex-environment latex-frag))
               processing-type info)))
         (when (and formula-link (string-match "file:\\([^]]*\\)" formula-link))
           (let ((source (org-export-file-uri (match-string 1 formula-link))))
--
2.29.2


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: LaTeX fragments not being generated due to extra * in tikz env
  2020-12-18  0:30   ` Thibault Marin
@ 2020-12-19 12:55     ` Jeremie Juste
  0 siblings, 0 replies; 4+ messages in thread
From: Jeremie Juste @ 2020-12-19 12:55 UTC (permalink / raw)
  To: Thibault Marin; +Cc: emacs-orgmode, 10cadr

Hello Thibault,

Many thanks. This looks like a reasonable trade off for me.

Best regards,
Jeremie
On Thursday, 17 Dec 2020 at 19:30, Thibault Marin wrote:
> Hi,
>
> I introduced the change that broke the behavior.  The attached patch
> seems to fix the issue for me, does it look reasonable?
>
> Thanks,
>
> thibault
>
> On 2020-12-09T13:16:19-0500, Jeremie Juste wrote:
>
>   Hello,
>
>   Thanks for reporting. Indeed this is an issue that hasn't been fixed
>   yet. This is the case for most latex environments
>
>   My solution is here
>   https://www.mail-archive.com/emacs-orgmode@gnu.org/msg129974.html
>
>   but consider also the idea behind the star
>   https://www.mail-archive.com/emacs-orgmode@gnu.org/msg129976.html
>
>   I will try to submit a patch soon.
>
>   Best regards,
>   Jeremie
>
>   On Tuesday,  8 Dec 2020 at 20:57, 10cadr wrote:
>   > I was trying out the new option tex:dvipng. The HTML result was a image
>   > with the tikz code.
>   >
>   > Turns out, debugging and telling the fragment processor not to delete the
>   > files, what org generates for the tikz fragment is:
>   >
>   > \begin{tikzpicture*}
>   >
>   > Removing the astherisk would make it work without any workarounds.
>   >
>   > How I got around this was
>   >
>   > #+LATEX_HEADER: \usepackage{environ,amsmath,multicol}
>   > #+LATEX_HEADER:
>   > \NewEnviron{tikzpicture*}[1][]{\begin{tikzpicture}[#1]\BODY\end{tikzpicture}}
>   >
>   > Possibly fixing this issue, will make cross formats much easier.
>
>   --
>   Jeremie Juste
>
>
>

-- 
Jeremie Juste


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-12-19 12:56 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-12-08 20:57 LaTeX fragments not being generated due to extra * in tikz env 10cadr
2020-12-09 18:16 ` Jeremie Juste
2020-12-18  0:30   ` Thibault Marin
2020-12-19 12:55     ` Jeremie Juste

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).