emacs-orgmode@gnu.org archives
help / color / mirror / code / Atom feed
* equation numbering in html and latex export
@ 2011-06-14  6:48 Samuel Sinayoko
2011-06-16  7:53  Eric S Fraga
From: Samuel Sinayoko @ 2011-06-14  6:48 UTC (permalink / raw)
To: emacs-orgmode

Dear list,

I've been trying to write short scientific reports that I can export to
both LaTeX$$and$$HTML. So far I've managed to figure out how to include
equations, images, references,$$and$$how to include labels$$and$$cross
reference between all these things.

The only problem I have is that I can't get numbered equations in both
LaTeX$$and$$HTML. Using the snippet below, I'm able to get a numbered
equation in HTML but not in LaTeX. I've put
in jsMath/easy/load.js. If I replace the $$by $$and$$, I get a numbered equation in LaTeX but not in HTML. How can I get numbered equations in both HTML$$and$$LaTeX? Thanks, Sam ------- #+TITLE: A simple equation #+STYLE: <SCRIPT SRC="jsMath/easy/load.js"></SCRIPT> #+OPTIONS: LaTeX:verbatim * A simple equation This is to test writing equations with org-mode. Hopefully MathJax is going to be used.$$
\label{eq:1}
x_{1,2} = \frac{-b \pm \sqrt{\Delta}}{2a}
$$Equation \ref{eq:1} gives the roots of a polynomial of order 2. ^ permalink raw reply [flat|nested] 6+ messages in thread * Re: equation numbering in html and latex export 2011-06-14 6:48 equation numbering in html and latex export Samuel Sinayoko @ 2011-06-16 7:53  Eric S Fraga 2011-06-16 10:36  Samuel Sinayoko  (2 more replies) 0 siblings, 3 replies; 6+ messages in thread From: Eric S Fraga @ 2011-06-16 7:53 UTC (permalink / raw) To: Samuel Sinayoko; +Cc: emacs-orgmode Samuel Sinayoko <s.sinayoko@soton.ac.uk> writes: > Dear list, > > I've been trying to write short scientific reports that I can export to > both LaTeX$$and$$HTML. So far I've managed to figure out how to include > equations, images, references,$$and$$how to include labels$$and$$cross > reference between all these things. > > The only problem I have is that I can't get numbered equations in both > LaTeX$$and$$HTML. Using the snippet below, I'm able to get a numbered > equation in HTML but not in LaTeX. I've put > loadFiles: ["extensions/eqn-number.js"], > in jsMath/easy/load.js. If I replace the$$ by
> $$and$$, I get a numbered equation in LaTeX
> but not in HTML.
>
> How can I get numbered equations in both HTML$$and$$LaTeX?

I can't help you wish HTML unfortunately but I can summarise the issue
in LaTeX.

With the standard document class (article say), equations can be either
"displayed" or "inline".  Only displayed equations are numbered and then
only if you use =equation= (or =align=, =eqnarray=, etc).  $$...$$ is
equivalent to $...$ which is essentially equivalent to the
unnumbered version of  (aka \begin{equation*}).

The trick would be to get the HTML exporter to apply the same processing
to  ...  as it does to $$...$$, I guess?
--
: Eric S Fraga (GnuPG: 0xC89193D8FFFCF67D) in Emacs 24.0.50.1
: using Org-mode version 7.5 (release_7.5.399.g01eb)

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

* Re: equation numbering in html and latex export
2011-06-16  7:53  Eric S Fraga
@ 2011-06-16 10:36    Samuel Sinayoko
2011-06-16 11:46    Samuel Sinayoko
2011-06-16 14:37    Darlan Cavalcante Moreira
2 siblings, 0 replies; 6+ messages in thread
From: Samuel Sinayoko @ 2011-06-16 10:36 UTC (permalink / raw)
To:emacs-orgmode

ThanksEric.Ithinkyou'reright.Itwouldmakesensetouse
withHTMLexporttonumberequations.
I'veputaminimalexamplebelowshowingwhatishappening.

--
#+TITLE:Equationnumbering
#+STYLE:<SCRIPTSRC="jsMath/easy/load.js"></SCRIPT>

*NumberedinHTMLexport/NotnumberedinLaTeX
EquationisnumberedandcanbereferencedinHTMLexport.Equationis
*not*numberedinLaTeXexport.
$$\label{eq:1} y=ax+b$$
Equation\ref{eq:1}isapolynomialoforder1.

*NotnumberedinHTML/NumberedinLaTeX
EquationisnotnumberedbutcanbereferencedinHTMLexport.Equation
isnumberedinLaTeXexport.

\label{eq:1}
y=ax+b

Equation\ref{eq:1}isnotnumberedbutcanbereferencedinHTML
export.ItisnumberedinLaTeXexport.
--

Ialsothinktherightbehaviourwouldbetohaveanumberedequationin
thesecondcaseinbothHTMLandLaTeX,andanunnumberedequationin
thefirstcaseinbothHTMLandLaTeX.Doeseveryoneagree?

I'dbehappytotryandchangethebehaviouroftheHTMLexportif
someonecanpointmeintherightdirection.

Cheers,

Sam

On16/06/1108:53,EricSFragawrote:
> Samuel Sinayoko <s.sinayoko@soton.ac.uk> writes:
>
>
>> Dear list,
>>
>> I've been trying to write short scientific reports that I can export to
>> both LaTeX$$and$$HTML. So far I've managed to figure out how to include
>> equations, images, references,$$and$$how to include labels$$and$$cross
>> reference between all these things.
>>
>> The only problem I have is that I can't get numbered equations in both
>> LaTeX$$and$$HTML. Using the snippet below, I'm able to get a numbered
>> equation in HTML but not in LaTeX. I've put
>> in jsMath/easy/load.js. If I replace the by >> $$and$$, I get a numbered equation in LaTeX >> but not in HTML. >> >> How can I get numbered equations in both HTML$$and$$LaTeX? >> > I can't help you wish HTML unfortunately but I can summarise the issue > in LaTeX. > > With the standard document class (article say), equations can be either > "displayed" or "inline". Only displayed equations are numbered$$and$$then > only if you use =equation= (or =align=, =eqnarray=, etc). ... $$is > equivalent to $...$ which is essentially equivalent to the > unnumbered version of (aka \begin{equation*}). > > The trick would be to get the HTML exporter to apply the same processing > to ... as it does to$$ ... $$, I guess? > ^ permalink raw reply [flat|nested] 6+ messages in thread * Re: equation numbering in html and latex export 2011-06-16 7:53  Eric S Fraga 2011-06-16 10:36  Samuel Sinayoko @ 2011-06-16 11:46  Samuel Sinayoko 2011-06-16 14:37  Darlan Cavalcante Moreira 2 siblings, 0 replies; 6+ messages in thread From: Samuel Sinayoko @ 2011-06-16 11:46 UTC (permalink / raw) To:emacs-orgmode ThanksEric.Ithinkyou'reright.Itwouldmakesensetouse withHTMLexporttonumberequations. I'veputaminimalexamplebelowshowingwhatishappening. -- #+TITLE:Equationnumbering #+STYLE:<SCRIPTSRC="jsMath/easy/load.js"></SCRIPT> *NumberedinHTMLexport/NotnumberedinLaTeX EquationisnumberedandcanbereferencedinHTMLexport.Equationis *not*numberedinLaTeXexport.$$
\label{eq:1}
y=ax+b
$$Equation\ref{eq:1}isapolynomialoforder1. *NotnumberedinHTML/NumberedinLaTeX EquationisnotnumberedbutcanbereferencedinHTMLexport.Equation isnumberedinLaTeXexport. \label{eq:1} y=ax+b Equation\ref{eq:1}isnotnumberedbutcanbereferencedinHTML export.ItisnumberedinLaTeXexport. -- Ialsothinktherightbehaviourwouldbetohaveanumberedequationin thesecondcaseinbothHTMLandLaTeX,andanunnumberedequationin thefirstcaseinbothHTMLandLaTeX.Doeseveryoneagree? I'dbehappytotryandchangethebehaviouroftheHTMLexportif someonecanpointmeintherightdirection. Cheers, Sam ^ permalink raw reply [flat|nested] 6+ messages in thread * Re: equation numbering in html and latex export 2011-06-16 7:53  Eric S Fraga 2011-06-16 10:36  Samuel Sinayoko 2011-06-16 11:46  Samuel Sinayoko @ 2011-06-16 14:37  Darlan Cavalcante Moreira 2011-06-16 15:39  Samuel Sinayoko 2 siblings, 1 reply; 6+ messages in thread From: Darlan Cavalcante Moreira @ 2011-06-16 14:37 UTC (permalink / raw) To: Samuel Sinayoko, emacs-orgmode Using the org-special-blocks library org-mode will recognize blocks in the form : #+begin_something : bla bla bla : #+end_something Then you could write : #+begin_equation$$: y=ax+b :$$#+end_equation in org-mode. It would be translated to : $$: y=ax+b :$$ in latex and : <div class="equation">$$: y=ax+b :$$</div> in html. Can mathjax be configured to process anything inside <div class="equation">? If not, maybe the #+begin_equation should be a built-in block in org-mode, also with a fast template (maybe "<eq"). -- Darlan Cavalcante At Thu, 16 Jun 2011 08:53:24 +0100, Eric S Fraga <e.fraga@ucl.ac.uk> wrote: > > Samuel Sinayoko <s.sinayoko@soton.ac.uk> writes: > > > Dear list, > > > > I've been trying to write short scientific reports that I can export to > > both LaTeX$$and$$HTML. So far I've managed to figure out how to include > > equations, images, references,$$and$$how to include labels$$and$$cross > > reference between all these things. > > > > The only problem I have is that I can't get numbered equations in both > > LaTeX$$and$$HTML. Using the snippet below, I'm able to get a numbered > > equation in HTML but not in LaTeX. I've put > > loadFiles: ["extensions/eqn-number.js"], > > in jsMath/easy/load.js. If I replace the$$ by
> > $$and$$, I get a numbered equation in LaTeX
> > but not in HTML.
> >
> > How can I get numbered equations in both HTML$$and$$LaTeX?
>
> I can't help you wish HTML unfortunately but I can summarise the issue
> in LaTeX.
>
> With the standard document class (article say), equations can be either
> "displayed" or "inline".  Only displayed equations are numbered$$and$$then
> only if you use =equation= (or =align=, =eqnarray=, etc).  $$...$$ is
> equivalent to $...$ which is essentially equivalent to the
> unnumbered version of  (aka \begin{equation*}).
>
> The trick would be to get the HTML exporter to apply the same processing
> to  ...  as it does to $$...$$, I guess?
> --
> : Eric S Fraga (GnuPG: 0xC89193D8FFFCF67D) in Emacs 24.0.50.1
> : using Org-mode version 7.5 (release_7.5.399.g01eb)
>

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

* Re: equation numbering in html and latex export
2011-06-16 14:37    Darlan Cavalcante Moreira
@ 2011-06-16 15:39      Samuel Sinayoko
0 siblings, 0 replies; 6+ messages in thread
From: Samuel Sinayoko @ 2011-06-16 15:39 UTC (permalink / raw)
To: Darlan Cavalcante Moreira; +Cc: emacs-orgmode, Sinayoko S.

Unfortunately this is not what jsMath expects. We get this in the html
file (see attached files for full source)

---
<p>This is what we want
$$\label{eq:1} y = ax + b$$
</p>

<p>This is what we get
<div class="EQUATION">
\label{eq:1}
y = ax + b
</div>
</p>
--

What we need to do is to replace $$...$$
with $$$$...$$$$ in the HTML export. Any idea of how to do this?

Sam

On 16/06/11 15:37, Darlan Cavalcante Moreira wrote:
> Using the org-special-blocks library org-mode will recognize blocks in the
> form
> : #+begin_something
> :   bla bla bla
> : #+end_something
>
> Then you could write
> : #+begin_equation$$> : y=ax+b > :$$#+end_equation
> in org-mode. It would be translated to
> : $$> : y=ax+b > :$$
> in latex and
> : <div class="equation">$$> : y=ax+b > :$$</div>
> in html.
>
> Can mathjax be configured to process anything inside <div class="equation">?
>
> If not, maybe the #+begin_equation should be a built-in block in org-mode,
> also with a fast template (maybe "<eq").
>
> --
> Darlan Cavalcante
>
> At Thu, 16 Jun 2011 08:53:24 +0100,
> Eric S Fraga <e.fraga@ucl.ac.uk> wrote:
>
>> Samuel Sinayoko <s.sinayoko@soton.ac.uk> writes:
>>
>>
>>> Dear list,
>>>
>>> I've been trying to write short scientific reports that I can export to
>>> both LaTeX$$and$$HTML. So far I've managed to figure out how to include
>>> equations, images, references,$$and$$how to include labels$$and$$cross
>>> reference between all these things.
>>>
>>> The only problem I have is that I can't get numbered equations in both
>>> LaTeX$$and$$HTML. Using the snippet below, I'm able to get a numbered
>>> equation in HTML but not in LaTeX. I've put
>>> in jsMath/easy/load.js. If I replace the by >>> $$and$$, I get a numbered equation in LaTeX >>> but not in HTML. >>> >>> How can I get numbered equations in both HTML$$and$$LaTeX? >>> >> I can't help you wish HTML unfortunately but I can summarise the issue >> in LaTeX. >> >> With the standard document class (article say), equations can be either >> "displayed" or "inline". Only displayed equations are numbered$$and$$then >> only if you use =equation= (or =align=, =eqnarray=, etc). ... $$is >> equivalent to $...$ which is essentially equivalent to the >> unnumbered version of (aka \begin{equation*}). >> >> The trick would be to get the HTML exporter to apply the same processing >> to ... as it does to$$ ... , I guess?
>> --
>> : Eric S Fraga (GnuPG: 0xC89193D8FFFCF67D) in Emacs 24.0.50.1
>> : using Org-mode version 7.5 (release_7.5.399.g01eb)
>>
>>

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

end of thread, other threads:[~2011-06-16 15:40 UTC | newest]

2011-06-14  6:48 equation numbering in html and latex export Samuel Sinayoko
2011-06-16  7:53  Eric S Fraga
2011-06-16 10:36    Samuel Sinayoko
2011-06-16 11:46    Samuel Sinayoko
2011-06-16 14:37    Darlan Cavalcante Moreira
2011-06-16 15:39      Samuel Sinayoko


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