emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Richard Lawrence <richard.lawrence@berkeley.edu>
To: emacs-orgmode@gnu.org
Cc: Xavier Garrido <xavier.garrido@gmail.com>
Subject: Re: Exporting LaTeX source blocks with HTML backend
Date: Mon, 03 Mar 2014 11:24:00 -0800	[thread overview]
Message-ID: <87ob1nozlb.fsf@berkeley.edu> (raw)
In-Reply-To: 5314BF2E.9020102@gmail.com

Hi Xavier,

Xavier Garrido <xavier.garrido@gmail.com> writes:

> 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 are 
> not exported at all by the html export backend whereas the LaTeX backend 
> 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?

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&=x\\
>      y&=y
>      \end{align*}
>    #+END_SRC

When I export this using the HTML exporter, the LaTeX code is wrapped in
a <div> with class="org-src-container", and the actual code appears
inside a <pre> tag.  Is this the behavior you see?  Is that not what you
want?

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.

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

  reply	other threads:[~2014-03-03 19:26 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-03 17:43 Exporting LaTeX source blocks with HTML backend Xavier Garrido
2014-03-03 19:24 ` Richard Lawrence [this message]
2014-03-03 19:39   ` Xavier Garrido
2014-03-03 19:55     ` Ista Zahn
2014-03-03 23:31       ` Xavier Garrido
2014-03-07 21:37       ` Eric S Fraga
2014-03-03 20:54     ` Richard Lawrence
2014-03-03 23:33       ` Xavier Garrido
2014-03-08 11:39         ` Eric S Fraga

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87ob1nozlb.fsf@berkeley.edu \
    --to=richard.lawrence@berkeley.edu \
    --cc=emacs-orgmode@gnu.org \
    --cc=xavier.garrido@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).