emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Carsten Dominik <carsten.dominik@gmail.com>
To: mail@christianmoe.com
Cc: emacs-orgmode@gnu.org
Subject: Re: Verbatim LaTeX inside delimiters in HTML export with jsMath?
Date: Thu, 1 Jul 2010 10:32:28 +0200	[thread overview]
Message-ID: <47BB48EE-E3E0-4F05-8E26-55785A952D10@gmail.com> (raw)
In-Reply-To: <4C2C415A.5030608@christianmoe.com>


On Jul 1, 2010, at 9:18 AM, Christian Moe wrote:

> Hi, Carsten,
>
> Sorry it took me so long to get back to you.
>
> The patch does exactly what I hoped for: Allows one to set an option  
> to get LaTeX math passed verbatim into HTML for jsMath to process,  
> while keeping the use of the ^:t TeX:t options. I've tested it on  
> various documents.

OK, I have applied it.

>
> I noticed the following behavior: A comment line starting with "#"  
> immediately before a \begin{equation} environment is passed verbatim  
> as well. I don't think it counts as a bug, since there should  
> probably be a blank line before \begin anyway.

This is a bug, unrelated to this patch.  Thanks for finding it!

This is not yet fixed....

>
> I can now scrap the workaround I thought up last weekend, which  
> involved a preprocessing hook to put = signs or #+BEGIN_EXAMPLE  
> blocks around anything found by org-latex-regexps, and a  
> postprocessing hook to get rid of <PRE> tags in the HTML output. It  
> worked, if inelegantly, but I think it makes better sense to have  
> the LaTeX:verbatim option built in.
>
> Thanks!

Cheers!

>
> I'll see about updating the Worg page -- but I'm a Git novice and  
> will be on a 56K modem for a bit, so it won't happen immediately.

If you want, just get the source file from

http://repo.or.cz/w/Worg.git/blob_plain/HEAD:/org-tutorials/org-jsmath.org

edit it, and send me a patch of the changed version.

Thanks!

- Carsten

>
> Yours,
> Christian
>
>
>
>
>
>
> Carsten Dominik wrote:
>> For John Wiegley: John, please do not yet apply the attached patch...
>> Hi Christian,
>> I am trying to get back to this issue.
>> I am attaching a patch, please apply it to your setup and then try
>> #+OPTIONS: ^:t TeX:t LaTeX:verbatim
>> if that works, can I then ask you to update http://orgmode.org/worg/org-tutorials/org-jsmath.php 
>>  ?
>> Thanks!
>> - Carsten
>> On Jun 18, 2010, at 12:58 PM, Christian Moe wrote:
>>> Hi, Carsten,
>>>
>>> Thanks for taking a look.
>>>
>>> Your example should be output exactly the same as it is currently  
>>> with the =LaTeX:nil= option, i. e. verbatim:
>>>
>>> <p>
>>> \begin{equation}
>>> a=b
>>> \end{equation}
>>> </p>
>>>
>>> - and this minimal example could be interpreted by jsMath without  
>>> any changes in Org-mode export, since it happens to contain no sub/ 
>>> superscripts or entities.
>>>
>>> What I'd like is for
>>>
>>> \begin{equation}
>>> \e=mc^2
>>> \end{equation}
>>>
>>> to be output equally verbatim as
>>>
>>> <p>
>>> \begin{equation}
>>> e=mc^2
>>> \end{equation}
>>> </p>
>>>
>>> *even when =^:t= is on*, so I could freely write e.g. m^2 in the  
>>> text and get it superscripted, but not get
>>>
>>> <p>
>>> \begin{equation}
>>> e=mc<sup>2</sup>
>>> \end{equation}
>>> </p>
>>>
>>> In other words, to have my cake and eat it, too. I hope it's  
>>> clearer now.
>>>
>>> Yours,
>>> Christian
>>>
>>>
>>> Carsten Dominik wrote:
>>> > Hi Christian,
>>> >
>>> > how should, in this case, a literal LaTeX environment like
>>> >
>>> > \begin{equation}
>>> > a=b
>>> > \end{equation}
>>> >
>>> > be handled?
>>> >
>>> > - Carsten
>>> >
>>> > On Jun 17, 2010, at 9:23 AM, Christian Moe wrote:
>>> >
>>> >> Hi,
>>> >>
>>> >> To display LaTeX math in Org html export with lovely jsMath, it  
>>> must be
>>> >> exported verbatim with
>>> >>
>>> >>  #+OPTIONS: ^:nil TeX:nil
>>> >>
>>> >> so one cannot use lazy superscripts/subscripts or Org entities  
>>> in the
>>> >> rest of the text.
>>> >>
>>> >> Is there a simple way to turn these options on, but protect  
>>> LaTeX where
>>> >> it appears *inside math delimiters* so it's exported verbatim?  
>>> I.e.
>>> >> inside $...$, $$...$$, \( ... \), \[ ... \], \begin ... \end ?
>>> >>
>>> >> I ask because I'm keeping a note file with much text and only a  
>>> few
>>> >> equations, but with frequent reference to e.g. CO_2 and m^2. It's
>>> >> possible to always write $CO_2$ and $m^2$, but less readable, and
>>> >> irksome when you've got used to an easier way. An inline  
>>> formula can
>>> >> be protected by surrounding it with verbatim markup, =$...$=,  
>>> but then
>>> >> it's only good for jsMath, not for LaTeX export.
>>> >>
>>> >> Yours,
>>> >> Christian
>>> >>
>>> >> _______________________________________________
>>> >> Emacs-orgmode mailing list
>>> >> Please use `Reply All' to send replies to the list.
>>> >> Emacs-orgmode@gnu.org
>>> >> http://lists.gnu.org/mailman/listinfo/emacs-orgmode
>>> >
>>> > - Carsten
>>> >
>>> >
>>> >
>>> >
>>>
>>>
>>> -- 
>>>
>>> Christian Moe
>>> E-mail:  mail@christianmoe.com
>>> Website: http://christianmoe.com
>>>
>>>
>>>
>>> Carsten Dominik wrote:
>>>> Hi Christian,
>>>> how should, in this case, a literal LaTeX environment like
>>>> \begin{equation}
>>>> a=b
>>>> \end{equation}
>>>> be handled?
>>>> - Carsten
>>>> On Jun 17, 2010, at 9:23 AM, Christian Moe wrote:
>>>>> Hi,
>>>>>
>>>>> To display LaTeX math in Org html export with lovely jsMath, it  
>>>>> must be
>>>>> exported verbatim with
>>>>>
>>>>> #+OPTIONS: ^:nil TeX:nil
>>>>>
>>>>> so one cannot use lazy superscripts/subscripts or Org entities  
>>>>> in the rest of the text.
>>>>>
>>>>> Is there a simple way to turn these options on, but protect  
>>>>> LaTeX where
>>>>> it appears *inside math delimiters* so it's exported verbatim?  
>>>>> I.e.
>>>>> inside $...$, $$...$$, \( ... \), \[ ... \], \begin ... \end ?
>>>>>
>>>>> I ask because I'm keeping a note file with much text and only a  
>>>>> few equations, but with frequent reference to e.g. CO_2 and m^2.  
>>>>> It's possible to always write $CO_2$ and $m^2$, but less  
>>>>> readable, and irksome when you've got used to an easier way. An  
>>>>> inline formula can be protected by surrounding it with verbatim  
>>>>> markup, =$...$=, but then it's only good for jsMath, not for  
>>>>> LaTeX export.
>>>>>
>>>>> Yours,
>>>>> Christian
>>>>>
>>>>> _______________________________________________
>>>>> Emacs-orgmode mailing list
>>>>> Please use `Reply All' to send replies to the list.
>>>>> Emacs-orgmode@gnu.org
>>>>> http://lists.gnu.org/mailman/listinfo/emacs-orgmode
>>>> - Carsten
>>>
>>>
>>
>
>
>

- Carsten

  reply	other threads:[~2010-07-01  8:32 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-05  0:21 Prevent Org timestamps breaking with paragraph fill? Jeff Kowalczyk
2010-05-14  7:18 ` Carsten Dominik
2010-06-17  7:23   ` Verbatim LaTeX inside delimiters in HTML export with jsMath? Christian Moe
2010-06-18  7:25     ` Carsten Dominik
2010-06-18 10:58       ` Christian Moe
2010-06-25 10:06         ` Carsten Dominik
2010-07-01  7:18           ` Christian Moe
2010-07-01  8:32             ` Carsten Dominik [this message]
2010-07-01 22:22               ` Christian Moe
2010-07-02  2:43                 ` Carsten Dominik

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=47BB48EE-E3E0-4F05-8E26-55785A952D10@gmail.com \
    --to=carsten.dominik@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=mail@christianmoe.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).