emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: displaying equations with ob-latex


From: michael-franzese
Subject: Re: displaying equations with ob-latex
Date: Fri, 7 May 2021 00:08:50 +0200

Did you manage to get the equations displayed, I have tried again and could not 
do
it.  It might be beneficial to give more details and some more examples on what 
to do.

Can I export on a window that is to right window of the code window?  I can one 
use plain
tex commands.  Texinfo mainly supports plain tex, org mode in basically latex, 
so the
two programs do not currently work well together.

Texinfo has the good feature to show equations (but only for plain tex) whereas 
org
is good with latex (but not very adept at displaying the output in an emacs 
window).



> Sent: Friday, May 07, 2021 at 6:14 AM
> From: "Berry, Charles via General discussions about Org-mode." 
> <emacs-orgmode@gnu.org>
> To: "michael-franzese@gmx.com" <michael-franzese@gmx.com>
> Cc: "Help Emacs Orgmode" <emacs-orgmode@gnu.org>
> Subject: Re: displaying equations with ob-latex
>
>
>
> > On May 6, 2021, at 12:50 AM, michael-franzese@gmx.com wrote:
> >
> >
> > I am trying to use ob-latex but equations are not being displayed in emacs
> > when I try to execute with "C-c C-c".
>
> Right. This is because `:results latex replace' is the default for latex src 
> blocks and the leads to wrapping everything in a latex export block.
>
> The context inside that block is `export-block' - i.e. it is not a 
> `greater-element' and cannot contain other elements.  AFAIK, there is not 
> previewer for export blocks - latex or otherwise.
>
> The context for an equation inside a greater-element is latex-fragment. And 
> those can be rendered via `org-latex-preview'.
>
> If you want to render equations for previewing, you could put them into a 
> drawer that is not repeated in the export.
>
> To make this work, you probably want something like this
>
> #+begin_src org
>
>   ,#+name: eqn1
>   ,#+begin_src latex :exports none :results drawer
>   \(y = x\beta + \epsilon\)
>   ,#+end_src
>
>
>   Here is the equation for export:
>
>   ,#+call: eqn1() :results latex
>
> #+end_src
>
> Evaluating the latex src block (C-c C-c) will create a `results' drawer line 
> this:
>
> #+RESULTS: eqn1
> :results:
> \(y = x\beta + \epsilon\)
> :end:
>
> but the `:exports none' will strip that out on export. The call line will 
> create this on export:
>
> #+RESULTS:
> #+begin_export latex
> \(y = x\beta + \epsilon\)
> #+end_export
>
>
> HTH,
>
> Chuck
>
>
>
>
>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]