From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dov Grobgeld Subject: Re: Inline LaTeX fragments in emacs buffer Date: Mon, 14 May 2012 17:47:14 +0300 Message-ID: References: <87mx5ddnl0.fsf@gmail.com> <4faff586.f122340a.54ab.6470@mx.google.com> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=14dae93998cd6c0e4a04c0002953 Return-path: Received: from eggs.gnu.org ([208.118.235.92]:41478) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1STwYZ-0008UJ-TC for emacs-orgmode@gnu.org; Mon, 14 May 2012 10:47:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1STwYR-0005Hp-PS for emacs-orgmode@gnu.org; Mon, 14 May 2012 10:47:27 -0400 Received: from mail-ob0-f169.google.com ([209.85.214.169]:42949) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1STwYR-0005HA-Fu for emacs-orgmode@gnu.org; Mon, 14 May 2012 10:47:19 -0400 Received: by obbwd18 with SMTP id wd18so9380409obb.0 for ; Mon, 14 May 2012 07:47:14 -0700 (PDT) In-Reply-To: <4faff586.f122340a.54ab.6470@mx.google.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: Darlan Cavalcante Moreira Cc: Daimrod , emacs-orgmode@gnu.org --14dae93998cd6c0e4a04c0002953 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Thanks for the help. It makes my coursera ml-class notes easier to read. One issue I had when I tried exporting to HTML with the dvnpng option the following equation: \[ J(\theta) =3D - \frac{1}{m} \left[\sum_{i=3D1} ^m y^{(i)} \log h_\theta(x^{(i)})+(1-y^{(i)})\log(1-h_\theta(x^{(i)}))\right] + \frac{\lambda}{2m}\sum_{j=3D1} ^n \theta_j ^2 \] in the png output I got the following trailing text:ORG-LIST-END-MARKER . Is this a known bug? Regards, Dov On Sun, May 13, 2012 at 8:55 PM, Darlan Cavalcante Moreira < darcamo@gmail.com> wrote: > > org-preview-latex-fragment is really great but what is even better is tha= t > it also works outside org-mode! This makes my life a lot easier. > > I set "C-c P" as a global key-binding for org-preview-latex-fragment and > "C-c p" to org-ctrl-c-ctrl-c. Then I can preview equations all equations = in > ANY buffer with "C-u C-u C-c P". It's great to write equations in comment= s > of some programming buffer (no matter which programming language) and bei= ng > able to render the equations right there. > > -- > Darlan > > At Sun, 13 May 2012 00:46:51 +0200, > Daimrod wrote: > > > > Dov Grobgeld writes: > > > > > Is there any way of getting org-mode to display inline LaTeX fragment= s > > > in the emacs buffer? E.g. I would like to be able to type: > > > > > > The size of the hypotenuse is $\sqrt{a^2+b^2}$ > > > > > > and then the buffer immediately shows: > > > > > > The size of the hypotenuse is =E2=88=9Aa=C2=B2+b=C2=B2 > > > > > > where =E2=88=9Aa=C2=B2+b=C2=B2 is a png image rendered via dvipng. > > > > > > I assume a toggle would switch between either seeing the formula or > > > seeing the source of the formula, just like for the display of inline > > > images. Also, pressing a backspace when the cursor is at the end of > > > the formula should erase the trailing $ sign, and turn off image > > > display of the formula, just like for [[links][name]]. > > > > > > Has anything like this been implemented? > > > > > > Thanks! > > > Dov > > > > Yes, you can produce a preview image with C-c C-x C-l. > > > > See > > (info "(org) Previewing LaTeX fragments") > > and > > (info "(org) Embedded LaTeX") > > > > > > > > --14dae93998cd6c0e4a04c0002953 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Thanks for the h= elp. It makes my coursera ml-class notes easier to read.

One issue = I had when I tried exporting to HTML with the dvnpng option the following e= quation:

\[
J(\theta) =3D - \frac{1}{m} \left[\sum_{i=3D1} ^m y^{(i)} \log h_= \theta(x^{(i)})+(1-y^{(i)})\log(1-h_\theta(x^{(i)}))\right]
=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 + \frac{\lambda}{2m}\sum_{j= =3D1} ^n \theta_j ^2
\]

in the png output I got the following tra= iling text:ORG-LIST-END-MARKER . Is this a known bug?

Regards,
Dov

On Sun, May 13= , 2012 at 8:55 PM, Darlan Cavalcante Moreira <darcamo@gmail.com> wrote:

org-preview-latex-fragment is really great but what is even better is that<= br> it also works outside org-mode! This makes my life a lot easier.

I set "C-c P" as a global key-binding for org-preview-latex-fragm= ent and
"C-c p" to org-ctrl-c-ctrl-c. Then I can preview equations all eq= uations in
ANY buffer with "C-u C-u C-c P". It's great to write equation= s in comments
of some programming buffer (no matter which programming language) and being=
able to render the equations right there.

--
Darlan

At Sun, 13 May 2012 00:46:51 +0200,
Daimrod <daimrod@gmail.com> wrote:
>
> Dov Grobgeld <dov.grobgel= d@gmail.com> writes:
>
> > Is there any way of getting org-mode to display inline LaTeX frag= ments
> > in the emacs buffer? E.g. I would like to be able to type:
> >
> > The size of the hypotenuse is $\sqrt{a^2+b^2}$
> >
> > and then the buffer immediately shows:
> >
> > The size of the hypotenuse is =E2=88=9Aa=C2=B2+b=C2=B2
> >
> > where =E2=88=9Aa=C2=B2+b=C2=B2 is a png image rendered via dvipng= .
> >
> > I assume a toggle would switch between either seeing the formula = or
> > seeing the source of the formula, just like for the display of in= line
> > images. Also, pressing a backspace when the cursor is at the end = of
> > the formula should erase the trailing $ sign, and turn off image<= br> > > display of the formula, just like for [[links][name]].
> >
> > Has anything like this been implemented?
> >
> > Thanks!
> > Dov
>
> Yes, you can produce a preview image with C-c C-x C-l.
>
> See
> (info "(org) Previewing LaTeX fragments")
> and
> (info "(org) Embedded LaTeX")
>
>
>


=
--14dae93998cd6c0e4a04c0002953--