From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ista Zahn Subject: Re: Exporting LaTeX source blocks with HTML backend Date: Mon, 3 Mar 2014 14:55:27 -0500 Message-ID: References: <5314BF2E.9020102@gmail.com> <87ob1nozlb.fsf@berkeley.edu> <5314DA7A.7030703@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:57555) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WKYxr-0003OP-Kl for emacs-orgmode@gnu.org; Mon, 03 Mar 2014 14:55:53 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WKYxp-00007G-Tf for emacs-orgmode@gnu.org; Mon, 03 Mar 2014 14:55:51 -0500 Received: from mail-pa0-x22b.google.com ([2607:f8b0:400e:c03::22b]:45320) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WKYxp-000078-1k for emacs-orgmode@gnu.org; Mon, 03 Mar 2014 14:55:49 -0500 Received: by mail-pa0-f43.google.com with SMTP id bj1so4132872pad.2 for ; Mon, 03 Mar 2014 11:55:47 -0800 (PST) In-Reply-To: <5314DA7A.7030703@gmail.com> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Xavier Garrido Cc: Richard Lawrence , "emacs-orgmode@gnu.org" Hi Xavier, I think #+begin_src latex :results drawer :exports results \begin{align*} x&=3Dx\\ y&=3Dy \end{align*} #+end_src will give both syntax highlighting (in the code block) as well as properly displayed equations in both latex and html export. Best, Ista On Mon, Mar 3, 2014 at 2:39 PM, Xavier Garrido w= rote: > Hi Richard, > > Le 03/03/2014 20:24, Richard Lawrence a =C3=A9crit : > >>> I am facing one issue when I am exporting from orgmode to html. I like >>> to write LaTeX code within #+BEGIN_SRC latex ... #+END_SRC block mainly >>> to take benefit/advantage of the syntax highlighting (debugging long >>> LaTeX equations is "simpler"). The problem is that these code blocks ar= e >>> not exported at all by the html export backend whereas the LaTeX backen= d >>> does. Of course, an easy solution will be to remove the >>> #+BEGIN_SRC/#+END_SRC lines and both latex and html exporters will just >>> do it right. But, as I said, syntax highlighting is really useful and I >>> can't imagine living without it. >> >> I don't quite understand what you're looking for here. Are you wanting >> these blocks to be exported as source code? Or do you want them to be >> interpreted somehow? > > > I would like to get them interpreted as raw LaTeX code in such way MathJa= x > can reinterpret them as you said. > > >> Removing the BEGIN_SRC/END_SRC lines will just result in raw LaTeX code >> getting dumped into your HTML, and a browser won't know what to do with >> that (at least not without help...are you wanting MathJax to interpret >> it?). >> >>> As a summary I would like to do the following >>> >>> #+BEGIN_SRC org >>> * Test LaTeX block >>> Syntax highlighting is always nice but the following block is not >>> exported in html. An option will be to remove the #+BEGIN_SRC >>> latex/#+END_SRC lines >>> >>> #+BEGIN_SRC latex >>> \begin{align*} >>> x&=3Dx\\ >>> y&=3Dy >>> \end{align*} >>> #+END_SRC >> >> When I export this using the HTML exporter, the LaTeX code is wrapped in >> a
with class=3D"org-src-container", and the actual code appears >> inside a
 tag.  Is this the behavior you see?  Is that not what you
>> want?
>
> In my case, the code is not even wrapped into org-src-container class, it
> just does not appear at all.
>
>
>
>>
>> If you are instead looking to get something in your HTML output that
>> looks like the result of compiling the LaTeX code, I am not exactly sure
>> how to accomplish this, but it looks like there is some useful
>> information in the section "Math formatting in HTML export" in the Org
>> manual about either using MathJax or preprocessing LaTeX code into
>> images with dvipng.
>
>
> Actually, I just want to get the LaTeX code translated into raw code. As =
I
> wrote, there is one solution, pretty easy to implement and may be used by
> most of the org users : write raw LaTeX inside org document and use MathJ=
ax
> for example, to interpret it in a convenient way. It is going to work for
> both exporter html and latex. The point here is that using raw LaTeX code
> makes me lose the syntax highlighting which is really useful for debuggin=
g
> long LaTeX equation.
>
> Cheers,
> Xavier
>
>> Hope that helps,
>> Richard
>>
>>
>> (If possible, please encrypt your reply to me using my PGP key:
>> Key ID: CF6FA646
>> Fingerprint: 9969 43E1 CF6F A646.
>> See http://www.ocf.berkeley.edu/~rwl/encryption.html for more
>> information.)
>
>
>