emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Math formatting in HTML export - The Org Manual
@ 2014-10-12  8:17 Joseph Vidal-Rosset
  2014-10-13  0:45 ` Grant Rettke
  0 siblings, 1 reply; 12+ messages in thread
From: Joseph Vidal-Rosset @ 2014-10-12  8:17 UTC (permalink / raw)
  To: Liste-emacs-orgmode@gnu.org

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

http://orgmode.org/manual/Math-formatting-in-HTML-export.html

Hello the list,

Unfortunately, I do not know how to use Mathjax in order to convert any
mathematical symbol or any proof in html. Therefore the only solution that
I see is to use imagemagick.
But the line

 #+OPTIONS: tex:imagemagick

in my setup gives always corrupted png images and I do not succeed to
understand why.
I would be thankful if someone could tell me how to configure my emacs
in order to use imagemagick to convert any proof in png image to
export it in html.

Thanks !

Jo.

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

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

* Re: Math formatting in HTML export - The Org Manual
  2014-10-12  8:17 Math formatting in HTML export - The Org Manual Joseph Vidal-Rosset
@ 2014-10-13  0:45 ` Grant Rettke
  2014-10-13  7:45   ` Joseph Vidal-Rosset
  0 siblings, 1 reply; 12+ messages in thread
From: Grant Rettke @ 2014-10-13  0:45 UTC (permalink / raw)
  To: Joseph Vidal-Rosset; +Cc: Liste-emacs-orgmode@gnu.org

What version of Emacs and org mode are you using?

What is your configuration?

What action did you perform on what document?

What did you want and expect to have happen with that action?

What happened instead?

On Sun, Oct 12, 2014 at 3:17 AM, Joseph Vidal-Rosset
<joseph.vidal.rosset@gmail.com> wrote:
> http://orgmode.org/manual/Math-formatting-in-HTML-export.html
>
> Hello the list,
>
> Unfortunately, I do not know how to use Mathjax in order to convert any
> mathematical symbol or any proof in html. Therefore the only solution that I
> see is to use imagemagick.
> But the line
>
>  #+OPTIONS: tex:imagemagick
>
> in my setup gives always corrupted png images and I do not succeed to
> understand why.
> I would be thankful if someone could tell me how to configure my emacs in
> order to use imagemagick to convert any proof in png image to export it in
> html.
>
> Thanks !
>
> Jo.
>
>



-- 
Grant Rettke
gcr@wisdomandwonder.com | http://www.wisdomandwonder.com/
“Wisdom begins in wonder.” --Socrates
((λ (x) (x x)) (λ (x) (x x)))
“Life has become immeasurably better since I have been forced to stop
taking it seriously.” --Thompson

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

* Re: Math formatting in HTML export - The Org Manual
  2014-10-13  0:45 ` Grant Rettke
@ 2014-10-13  7:45   ` Joseph Vidal-Rosset
  2014-10-13 11:45     ` Eric S Fraga
  0 siblings, 1 reply; 12+ messages in thread
From: Joseph Vidal-Rosset @ 2014-10-13  7:45 UTC (permalink / raw)
  To: Grant Rettke, Liste-emacs-orgmode@gnu.org


[-- Attachment #1.1: Type: text/plain, Size: 827 bytes --]

Thanks for your reply.

2014-10-13 2:45 GMT+02:00 Grant Rettke <gcr@wisdomandwonder.com>:

> What version of Emacs and org mode are you using?
>

GNU Emacs 24.3.1


> What is your configuration?
>

I'm using org from Elpa.

OS: At the moment Xubuntu 14.04 , but the same problem occurred with Debian
testing.


>
> What action did you perform on what document?
>

Here is a minimal document as example

#+OPTIONS: tex:imagemagick
#+TITLE: Minimal logic
#+AUTHOR: Joseph Vidal-Rosset


\begin{equation}
\neg A \to (A \to B)
\end{equation}




> What did you want and expect to have happen with that action?
>
>
The export to latex works well.

BUT the export to html  works BUT...


> What happened instead?
>

produces always a corrupted png image for the equation. See the attachment.

Thanks for your help

Best wiishes

Jo.

[-- Attachment #1.2: Type: text/html, Size: 2244 bytes --]

[-- Attachment #2: corrupted-image.png --]
[-- Type: image/png, Size: 705 bytes --]

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

* Re: Math formatting in HTML export - The Org Manual
  2014-10-13  7:45   ` Joseph Vidal-Rosset
@ 2014-10-13 11:45     ` Eric S Fraga
  2014-10-13 15:50       ` Joseph Vidal-Rosset
  0 siblings, 1 reply; 12+ messages in thread
From: Eric S Fraga @ 2014-10-13 11:45 UTC (permalink / raw)
  To: Joseph Vidal-Rosset; +Cc: Liste-emacs-orgmode@gnu.org, Grant Rettke

On Monday, 13 Oct 2014 at 09:45, Joseph Vidal-Rosset wrote:

[...]

> Here is a minimal document as example
>
> #+OPTIONS: tex:imagemagick
> #+TITLE: Minimal logic
>
> #+AUTHOR: Joseph Vidal-Rosset
>
> \begin{equation}
> \neg A \to (A \to B)
> \end{equation}

This works perfectly fine for me with both dvipng (my default choice)
and imagemagick.  The problem may be in your LaTeX installation: what
fonts are used etc.?

What does the PDF or DVI for this LaTeX file:

--8<---------------cut here---------------start------------->8---
% Created 2014-10-13 Mon 12:43
\documentclass{minimal}
\begin{document}
\begin{equation}
\neg A \to (A \to B)
\end{equation}
% Emacs 24.4.50.1 (Org mode 8.3beta)
\end{document}
--8<---------------cut here---------------end--------------->8---

look like?
-- 
: Eric S Fraga (0xFFFCF67D), Emacs 24.4.50.1, Org release_8.3beta-408-g39f5f0

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

* Re: Math formatting in HTML export - The Org Manual
  2014-10-13 11:45     ` Eric S Fraga
@ 2014-10-13 15:50       ` Joseph Vidal-Rosset
  2014-10-14  7:25         ` Eric S Fraga
  0 siblings, 1 reply; 12+ messages in thread
From: Joseph Vidal-Rosset @ 2014-10-13 15:50 UTC (permalink / raw)
  To: Grant Rettke; +Cc: Liste-emacs-orgmode@gnu.org

Le lun.  13 oct. 2014  à 01:45:28 ,  Eric S Fraga  <e.fraga@ucl.ac.uk> a
envoyé ce message:
> On Monday, 13 Oct 2014 at 09:45, Joseph Vidal-Rosset wrote:
>
> [...]
>
>> Here is a minimal document as example
>>
>> #+OPTIONS: tex:imagemagick
>> #+TITLE: Minimal logic
>>
>> #+AUTHOR: Joseph Vidal-Rosset
>>
>> \begin{equation}
>> \neg A \to (A \to B)
>> \end{equation}
>
> This works perfectly fine for me with both dvipng (my default choice)
> and imagemagick.  The problem may be in your LaTeX installation: what
> fonts are used etc.?


I have just tested 
and it works. I conclude that the problem comes from imagemagick. 

But dvipng does not succeed to make png images of proofs via bussproofs.sty. 

For example, I do not succeed to transform this proof into a png image: 

\begin{prooftree}
\def\fCenter{\ \Rightarrow\ }
\AxiomC{}
\RightLabel{\scriptsize{Ax.}}
\UnaryInf$A \to \bot, \bot \fCenter \bot$
\RightLabel{\scriptsize{$L\neg$def.}}
\UnaryInf$ \neg A, \bot \fCenter \bot$
\RightLabel{\scriptsize{$R\neg$}}
\UnaryInf$\bot \fCenter \neg \neg A$
\AxiomC{}
\RightLabel{\scriptsize{Ax.}}
\UnaryInf$A, \bot \fCenter \bot$
\RightLabel{\scriptsize{$R\neg$}}
\UnaryInf$\bot \fCenter \neg A$
\RightLabel{\scriptsize{$R\land$}}
\BinaryInf$\bot \fCenter \neg \neg A \land \neg A$
\end{prooftree}


I succeeded also to do it with Gnus by adding #+LaTeX_HEADERS:
\usepackage{bussproofs} on the top of the message, and no it does not no
more... that's another problem... 

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

* Re: Math formatting in HTML export - The Org Manual
  2014-10-13 15:50       ` Joseph Vidal-Rosset
@ 2014-10-14  7:25         ` Eric S Fraga
  2014-10-14 17:23           ` Joseph Vidal-Rosset
  0 siblings, 1 reply; 12+ messages in thread
From: Eric S Fraga @ 2014-10-14  7:25 UTC (permalink / raw)
  To: Joseph Vidal-Rosset; +Cc: Liste-emacs-orgmode@gnu.org, Grant Rettke

Have a look at the following variable and note the SNIPPET argument:

,----[ C-h v org-latex-packages-alist RET ]
| org-latex-packages-alist is a variable defined in `org.el'.
| Its value is (("" "xcolor")
|  ("" "tikz")
|  ("" "listings")
|  ("version=3" "mhchem")
|  ("" "amsmath" t))
| 
| Original value was nil
| 
| Documentation:
| Alist of packages to be inserted in every LaTeX header.
| 
| These will be inserted after `org-latex-default-packages-alist'.
| Each element is either a cell or a string.
| 
| A cell is of the format:
| 
|     ("options" "package" SNIPPET-FLAG)
| 
| SNIPPET-FLAG, when non-nil, indicates that this package is also
| needed when turning LaTeX snippets into images for inclusion into
| non-LaTeX output.
| 
| A string will be inserted as-is in the header of the document.
| 
| Make sure that you only list packages here which:
| 
|   - you want in every file;
|   - do not conflict with the setup in `org-format-latex-header';
|   - do not conflict with the default packages in
|     `org-latex-default-packages-alist'.
| 
| You can customize this variable.
`----


-- 
Eric S Fraga (GnuPG: 0xC89193D8FFFCF67D)

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

* Re: Math formatting in HTML export - The Org Manual
  2014-10-14  7:25         ` Eric S Fraga
@ 2014-10-14 17:23           ` Joseph Vidal-Rosset
  2014-10-14 17:51             ` Nick Dokos
  2014-10-14 19:09             ` Eric S Fraga
  0 siblings, 2 replies; 12+ messages in thread
From: Joseph Vidal-Rosset @ 2014-10-14 17:23 UTC (permalink / raw)
  To: Joseph Vidal-Rosset, Grant Rettke, Liste-emacs-orgmode@gnu.org

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

Thanks Eric.

I have tested this solution that works with imagemagick and html export. I
have added these lines in my init.el :

; Include the latex-exporter
(require 'ox-latex)
;; Add minted to the defaults packages to include when exporting.
;(add-to-list 'org-latex-packages-alist '("" "minted"))
;; Tell the latex export to use the minted package for source
;; code coloration.
(setq org-latex-listings 'minted)
;; Let the exporter use the -shell-escape option to let latex
;; execute external programs.
;; This obviously and can be dangerous to activate!
(setq org-latex-pdf-process
      '("xelatex -shell-escape -interaction nonstopmode -output-directory
%o %f"))

and it works.

But now it does not work in my Gnus if I want to include some png images of
proofs... I have to deleted these "dangerous lines"...

I do not understand why I need minted and shell-escape...

Best wishes

Jo.


2014-10-14 9:25 GMT+02:00 Eric S Fraga <e.fraga@ucl.ac.uk>:

> Have a look at the following variable and note the SNIPPET argument:
>
> ,----[ C-h v org-latex-packages-alist RET ]
> | org-latex-packages-alist is a variable defined in `org.el'.
> | Its value is (("" "xcolor")
> |  ("" "tikz")
> |  ("" "listings")
> |  ("version=3" "mhchem")
> |  ("" "amsmath" t))
> |
> | Original value was nil
> |
> | Documentation:
> | Alist of packages to be inserted in every LaTeX header.
> |
> | These will be inserted after `org-latex-default-packages-alist'.
> | Each element is either a cell or a string.
> |
> | A cell is of the format:
> |
> |     ("options" "package" SNIPPET-FLAG)
> |
> | SNIPPET-FLAG, when non-nil, indicates that this package is also
> | needed when turning LaTeX snippets into images for inclusion into
> | non-LaTeX output.
> |
> | A string will be inserted as-is in the header of the document.
> |
> | Make sure that you only list packages here which:
> |
> |   - you want in every file;
> |   - do not conflict with the setup in `org-format-latex-header';
> |   - do not conflict with the default packages in
> |     `org-latex-default-packages-alist'.
> |
> | You can customize this variable.
> `----
>
>
> --
> Eric S Fraga (GnuPG: 0xC89193D8FFFCF67D)
>

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

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

* Re: Math formatting in HTML export - The Org Manual
  2014-10-14 17:23           ` Joseph Vidal-Rosset
@ 2014-10-14 17:51             ` Nick Dokos
  2014-10-15  5:54               ` Joseph Vidal-Rosset
  2014-10-14 19:09             ` Eric S Fraga
  1 sibling, 1 reply; 12+ messages in thread
From: Nick Dokos @ 2014-10-14 17:51 UTC (permalink / raw)
  To: emacs-orgmode

Joseph Vidal-Rosset <joseph.vidal.rosset@gmail.com> writes:

> Thanks Eric.
>
> I have tested this solution that works with imagemagick and html export. I have added these lines in my init.el :
>
> ; Include the latex-exporter
> (require 'ox-latex)
> ;; Add minted to the defaults packages to include when exporting.
> ;(add-to-list 'org-latex-packages-alist '("" "minted"))
> ;; Tell the latex export to use the minted package for source
> ;; code coloration.
> (setq org-latex-listings 'minted)
> ;; Let the exporter use the -shell-escape option to let latex
> ;; execute external programs.
> ;; This obviously and can be dangerous to activate!
> (setq org-latex-pdf-process
>       '("xelatex -shell-escape -interaction nonstopmode -output-directory %o %f"))
>
> and it works.
>
> But now it does not work in my Gnus if I want to include some png
> images of proofs... I have to deleted these "dangerous lines"...
>
> I do not understand why I need minted and shell-escape...
>

I don't know why you need minted (I have not followed the conversation),
but to use minted you *need* -shell-escape: minted requires running an
external program (pygments), but tex does not like doing that for
security reasons - the -shell-escape option gives tex permission to run
such an external program.

Nick

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

* Re: Math formatting in HTML export - The Org Manual
  2014-10-14 17:23           ` Joseph Vidal-Rosset
  2014-10-14 17:51             ` Nick Dokos
@ 2014-10-14 19:09             ` Eric S Fraga
  2014-10-15  5:59               ` Joseph Vidal-Rosset
  1 sibling, 1 reply; 12+ messages in thread
From: Eric S Fraga @ 2014-10-14 19:09 UTC (permalink / raw)
  To: Joseph Vidal-Rosset; +Cc: Liste-emacs-orgmode@gnu.org

On Tuesday, 14 Oct 2014 at 19:23, Joseph Vidal-Rosset wrote:

[...]

> But now it does not work in my Gnus if I want to include some png images of
> proofs... I have to deleted these "dangerous lines"...

Sorry, I missed this the first time around.  What does gnus have to do
with this?  You were talking about exporting to HTML but never mentioned
gnus in the original post.

If you are trying to write an html based email, you should be looking at
different functionality than exporting.  Check out org-mime-htmlize, for
instance.  Exporting creates files which reference other files (for
images).  Messages are different.
-- 
: Eric S Fraga (0xFFFCF67D), Emacs 25.0.50.1, Org release_8.3beta-450-gbc9a58

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

* Re: Math formatting in HTML export - The Org Manual
  2014-10-14 17:51             ` Nick Dokos
@ 2014-10-15  5:54               ` Joseph Vidal-Rosset
  0 siblings, 0 replies; 12+ messages in thread
From: Joseph Vidal-Rosset @ 2014-10-15  5:54 UTC (permalink / raw)
  To: Nick Dokos; +Cc: Liste-emacs-orgmode@gnu.org

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

2014-10-14 19:51 GMT+02:00 Nick Dokos <ndokos@gmail.com>:

> I don't know why you need minted (I have not followed the conversation),
> but to use minted you *need* -shell-escape: minted requires running an
> external program (pygments), but tex does not like doing that for
> security reasons - the -shell-escape option gives tex permission to run
> such an external program.
>


Thanks for this explanatio Nick. I need minted, strangely, in order to get
png images in html export. If I try to avoid the use of minted, the png
images are corrupted...

Best wishes

Jo.

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

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

* Re: Math formatting in HTML export - The Org Manual
  2014-10-14 19:09             ` Eric S Fraga
@ 2014-10-15  5:59               ` Joseph Vidal-Rosset
  2014-10-15  7:21                 ` Eric S Fraga
  0 siblings, 1 reply; 12+ messages in thread
From: Joseph Vidal-Rosset @ 2014-10-15  5:59 UTC (permalink / raw)
  To: Joseph Vidal-Rosset, Liste-emacs-orgmode@gnu.org

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

2014-10-14 21:09 GMT+02:00 Eric S Fraga <e.fraga@ucl.ac.uk>:

> > But now it does not work in my Gnus if I want to include some png images
> of
> > proofs... I have to deleted these "dangerous lines"...
>
> Sorry, I missed this the first time around.  What does gnus have to do
> with this?  You were talking about exporting to HTML but never mentioned
> gnus in the original post.
>
> If you are trying to write an html based email, you should be looking at
> different functionality than exporting.  Check out org-mime-htmlize, for
> instance.  Exporting creates files which reference other files (for
> images).  Messages are different.



Yes, I'm using precisely org-mime-htmlize with gnus when want to send
messages with png images. But with minted in my setup (to export correctly
html), the preview function does not work and then org-mime-htmlize
fails...

Again thanks !

Best wishes

Jo.

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

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

* Re: Math formatting in HTML export - The Org Manual
  2014-10-15  5:59               ` Joseph Vidal-Rosset
@ 2014-10-15  7:21                 ` Eric S Fraga
  0 siblings, 0 replies; 12+ messages in thread
From: Eric S Fraga @ 2014-10-15  7:21 UTC (permalink / raw)
  To: Joseph Vidal-Rosset; +Cc: Liste-emacs-orgmode@gnu.org

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

On Wednesday, 15 Oct 2014 at 07:59, Joseph Vidal-Rosset wrote:

[...]

> Yes, I'm using precisely org-mime-htmlize with gnus when want to send
> messages with png images. But with minted in my setup (to export correctly
> html), the preview function does not work and then org-mime-htmlize
> fails...

Interesting.  The following has three LaTeX equations, one without any org LaTeX directives, one for inline use and one for LaTeX blocks.  Only the first works.

(please accept my apologies for sending an HTML formatted email to this list ;-)

* test

This is a test of the equations:

\begin{equation}
y = \sqrt{x}
\end{equation}

Alternatively, using LaTeX directives: first, the single line ~#+latex~ directive for an equation inline, say,
#+LATEX: y = f(x)
followed by a begin/end latex block:

* summary

The last one has disappeared completely.  The second is there in the raw email but has not been translated.  Only the first case works.  The export engine must work differently when exporting as a string?  It is indeed surprising that the whole begin/end latex block is removed from the raw text version, as you indicated in your OP.

This behaviour does seem rather strange.  Looking at org-mime.el, it is not obvious (to me) what is wrong.

-- 
: Eric S Fraga (0xFFFCF67D), Emacs 25.0.50.1, Org release_8.3beta-450-gbc9a58

[-- Attachment #2.1: Type: text/html, Size: 2235 bytes --]

[-- Attachment #2.2: latex2910f8Z_c8b273a09cc52bc7773376bcf189a21d680017cb.png --]
[-- Type: image/png, Size: 704 bytes --]

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

end of thread, other threads:[~2014-10-15  7:22 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-12  8:17 Math formatting in HTML export - The Org Manual Joseph Vidal-Rosset
2014-10-13  0:45 ` Grant Rettke
2014-10-13  7:45   ` Joseph Vidal-Rosset
2014-10-13 11:45     ` Eric S Fraga
2014-10-13 15:50       ` Joseph Vidal-Rosset
2014-10-14  7:25         ` Eric S Fraga
2014-10-14 17:23           ` Joseph Vidal-Rosset
2014-10-14 17:51             ` Nick Dokos
2014-10-15  5:54               ` Joseph Vidal-Rosset
2014-10-14 19:09             ` Eric S Fraga
2014-10-15  5:59               ` Joseph Vidal-Rosset
2014-10-15  7:21                 ` Eric S Fraga

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).