Re: [O] Block level specification for tex code html export method

2015-09-05 Thread Nicolas Goaziou
Andreas Leha writes: > The same protection as in the previous version seems to take effect > here: > > (defmacro by-backend ( body) > `(case (if (boundp 'org-export-current-backend) > org-export-current-backend nil) ,@body)) > > Are there any issues

Re: [O] Block level specification for tex code html export method

2015-09-04 Thread Andreas Leha
Hi Nicolas, Nicolas Goaziou writes: > Hello, > > Andreas Leha writes: > >> This macro is from Eric Schulte initially. And I guess I would be out >> of luck adapting it to new Org mode versions as well. > > What about > > (defmacro

Re: [O] Block level specification for tex code html export method

2015-09-04 Thread Nicolas Goaziou
Andreas Leha writes: > Seems to work fine! > > Just note, that it works for me only after exporting > (when tested under emacs -Q). `org-export-current-backend' is set when exporting a document, much like `backend'. > What about including that into org?

Re: [O] Block level specification for tex code html export method

2015-09-04 Thread Andreas Leha
Nicolas Goaziou writes: > Andreas Leha writes: > >> Seems to work fine! >> >> Just note, that it works for me only after exporting >> (when tested under emacs -Q). > > `org-export-current-backend' is set when exporting a document, much

Re: [O] Block level specification for tex code html export method

2015-09-04 Thread Haochen Xie
Hi Eric, It's very likely due to this problem as both Andreas and I mentioned in earlier mails: Also please follow this link [1] to fix a > ​bug > in htlatex as mentioned in Andreas's mail, or your html export will fail > silently (showing success on emacs, but no images generated). > > ​​ >

Re: [O] Block level specification for tex code html export method

2015-09-04 Thread Eric S Fraga
On Thursday, 3 Sep 2015 at 23:38, Nicolas Goaziou wrote: [...] > What about > > (defmacro by-backend ( body) > `(case org-export-current-backend ,@body)) Nicolas, this seems to work! I thought I had tried something like this but I must have got one of the ,@` wrong along the way... I

Re: [O] Block level specification for tex code html export method

2015-09-04 Thread Eric S Fraga
On Friday, 4 Sep 2015 at 15:23, Haochen Xie wrote: > Hi Eric, > > It's very likely due to this problem as both Andreas and I mentioned in > earlier mails: Thanks. I did notice the bits about htlatex but didn't pay much attention. I don't actually need svg as I use png for my web pages! -- :

Re: [O] Block level specification for tex code html export method

2015-09-04 Thread Alan Schmitt
Thanks to everyone, I now have this working. Here is the final version. --8<---cut here---start->8--- #+LATEX_HEADER: \usepackage{tikz} First execute the second code block, to define the convenience macro and to set the required new variables in ob-latex.el.

Re: [O] Block level specification for tex code html export method

2015-09-03 Thread Andreas Leha
Hi Haochen, Thanks for following that up! Haochen Xie writes: > ​Hello > Alan, > > I'm not 100% sure, but I think the distorted PNG file is generated by dvipng. > It seems that dvipng cannot handle tikz blocks very well, and one must use > imagemagick for those blocks. I >

Re: [O] Block level specification for tex code html export method

2015-09-03 Thread Nicolas Goaziou
Hello, Andreas Leha writes: > This macro is from Eric Schulte initially. And I guess I would be out > of luck adapting it to new Org mode versions as well. What about (defmacro by-backend ( body) `(case org-export-current-backend ,@body)) ? Regards,

Re: [O] Block level specification for tex code html export method

2015-09-03 Thread Eric S Fraga
On Thursday, 3 Sep 2015 at 13:30, Andreas Leha wrote: > Hi Alan, > > Glad you like the example. > > Three things: > 1. It still works for me ;-) Andreas, the example doesn't work for me with a quite recent org (updated within the past week) and with -Q. By the way, with emacs -Q, I need to

Re: [O] Block level specification for tex code html export method

2015-09-03 Thread Andreas Leha
Hi Eric, Thanks for following that up! Eric S Fraga writes: > On Thursday, 3 Sep 2015 at 13:30, Andreas Leha wrote: >> Hi Alan, >> >> Glad you like the example. >> >> Three things: >> 1. It still works for me ;-) > > Andreas, > > the example doesn't work for me with a quite

Re: [O] Block level specification for tex code html export method

2015-09-03 Thread Alan Schmitt
Hello Andreas, I’m slowly catching up on the org mailing list, and I found your example very interesting. I tried to run it and it does not seem to work here. Here is what I did: - I copied the code below to a file - I evaluated the last block - I made sure that latex was one of the

Re: [O] Block level specification for tex code html export method

2015-09-03 Thread Haochen Xie
​Hello Alan, I'm not 100% sure, but I think the distorted PNG file is generated by dvipng. It seems that dvipng cannot handle tikz blocks very well, and one must use imagemagick for those blocks. I think this line: #+header: :imagemagick :iminoptions -density 600 :imoutoptions -geometry 800

Re: [O] Block level specification for tex code html export method

2015-09-03 Thread Andreas Leha
Hi Alan, Glad you like the example. Three things: 1. It still works for me ;-) 2. The distorted png might come from the bug in htlatex I mentioned in this thread [1]. 3. It seems that the by-backend does not work properly for you. I am not sure about the reason for that. What org-mode version

Re: [O] Block level specification for tex code html export method

2015-08-12 Thread Andreas Leha
Hi Haochen, You can render svg from latex through org directly. Here is a complete example including a tikz diagram that that works on my system (once I tackle a bug in PGF [1]). It renders - png by default (and for inlining the image into the org document) - nothing for latex (directly include

Re: [O] Block level specification for tex code html export method

2015-08-12 Thread Haochen Xie
Hi Andreas, Thank you for your code example. I've tried almost the same code which I saw from the thread you referred (with the htlatex initialization, which I'm doing in my .emacs), and indeed got a svg file as expected. But the problem is that when I try to browse the HTML page in chrome, the

Re: [O] Block level specification for tex code html export method

2015-08-12 Thread Andreas Leha
Hi Haochen, Sorry for not being clearer. There is no imagemagick involved in the svg generation if everything is setup correctly. Instead the command defined in org-babel-latex-htlatex is used. My test file sets this to to htlatex from tex4th [1]. At the time of the thread I linked to there

Re: [O] Block level specification for tex code html export method

2015-08-11 Thread Fabrice Popineau
2015-08-11 10:47 GMT+02:00 Haochen Xie haoch...@acm.org: Hi Andreas, Thank you for your reply. I've read the whole thread, and found your example (the second link) very useful. Although for some reason, SVG image is not working well on my machine (not being displayed in chrome, nor on IE. I

Re: [O] Block level specification for tex code html export method

2015-08-11 Thread Haochen Xie
Hi Andreas, Thank you for your reply. I've read the whole thread, and found your example (the second link) very useful. Although for some reason, SVG image is not working well on my machine (not being displayed in chrome, nor on IE. I don't have firefox installed), but since the SVG image

Re: [O] Block level specification for tex code html export method

2015-08-11 Thread Haochen Xie
Hi Fabrice, Thank you for mentioning dvisvgm. I did some researches on it, and it seems that as for now, the only way to invoke dvisvgm is to first export the latex part to dvi, and call dvisvgm manually to convert it to svg, then include it in the org file, which, is too troublesome for me. Is

Re: [O] Block level specification for tex code html export method

2015-08-10 Thread Andreas Leha
Hi Haochen, Haochen Xie haoc...@xie.name writes: Hi, I'm trying to include a diagram drawn with tikz in a document, but couldn't find an elegant way to conditionally export it as png when generating HTML output and raw TeX code when generating PDF. It is possible to use #+OPTIONS: