Re: displaying equations with ob-latex

2021-05-06 Thread michael-franzese
Another downside is that you got to slam "C-c C-x C-l" for every equation one 
writes
in the drawer.  The solution is not very usable but at least I could display 
equations
as I do with texinfo from org.  But for serious work, I need to be fast.  
Currently
it will be frustrating enough for users.

> Sent: Friday, May 07, 2021 at 3:14 PM
> From: "Ihor Radchenko" 
> To: michael-franz...@gmx.com
> Cc: "Berry, Charles" , "Help Emacs Orgmode" 
> 
> Subject: Re: displaying equations with ob-latex
>
> michael-franz...@gmx.com writes:
>
> > Ok, I got some progress, I did "C-C C-x C-l" and got the equation.
> >
> > The equation in extremely small though.
>
> By default, it should have the same height with you text line.
> You can change it though. I have the following snippet in my config:
>
> (setq org-format-latex-options
>   (quote
>(:foreground default :background default :scale 2.0 :justify center 
> :html-foreground "Black" :html-background "Transparent" :html-scale 1.0 
> :matchers
>   ("begin" "$1" "$" "$$" "\\(" "\\[";; 2x height of 
> formulas
>



Re: displaying equations with ob-latex

2021-05-06 Thread michael-franzese
Would people help me have a keybinding that changes the scale in
cyclic sequence, e.g. 2 3 4 5 4 3 2

Regards

> Sent: Friday, May 07, 2021 at 3:18 PM
> From: "Berry, Charles" 
> To: "michael-franz...@gmx.com" 
> Cc: "Help Emacs Orgmode" 
> Subject: Re: displaying equations with ob-latex
>
>
>
> > On May 6, 2021, at 7:39 PM, michael-franz...@gmx.com wrote:
> >
> > Ok, I got some progress, I did "C-C C-x C-l" and got the equation.
> >
>
> Great!
>
>
> > The equation in extremely small though.
> >
>
>
> Try customizing `org-format-latex-options'. The :scale element controls size. 
> I tried 2.0 and it seems like a good value for my screen.
>
> Best,
>
> Chuck
>
> >> Sent: Friday, May 07, 2021 at 1:36 PM
> >> From: "Berry, Charles" 
> >> To: "michael-franz...@gmx.com" 
> >> Cc: "Help Emacs Orgmode" 
> >> Subject: Re: displaying equations with ob-latex
> >>
> >>
> >>
> >>> On May 6, 2021, at 4:20 PM, michael-franz...@gmx.com wrote:
> >>>
> >>> After I do "C-c C-c", I just get a message saying "Code block evaluation 
> >>> complete."
> >>>
> >>
> >>
> >> Are you doing this in a buffer that has ONLY the text between the `cut 
> >> here' lines and exactly that?
> >>
> >> If not, please try it in such a buffer.
> >>
> >> It may help to copy and paste as typos in header names or values can be 
> >> unnoticed and drastically alter behavior. If your mail client reformats 
> >> text, maybe try copy and paste from the mail list archive.
> >>
> >> Also, check with point in the src block using C-c C-v C-i that the header 
> >> args got processed properly. You should see lines like these in the *Help* 
> >> buffer:
> >>
> >> :  :exportsnone
> >>
> >> :  :resultsdrawer replace
> >>
> >>
> >> If you did it in such a buffer and the buffer is unaltered but still 
> >> displays the message, I have to admit that I cannot tell from here what 
> >> the problem might be.
> >>
> >> On my setup, things behave just as outlined.
> >>
> >> When I start emacs with -q, then M-S-; (require 'ob-latex) RET, then paste 
> >> the text to *scratch* and delete the lisp comment at the top, then M-x 
> >> org-mode RET, then C-c C-c with point in the src block, answer 'y e s RET' 
> >> to the query, I get the equation displayed in the results drawer. And the 
> >> export goes OK.
> >>
> >> I am using org-version 9.4.5.
> >>
> >> HTH,
> >>
> >> Chuck
> >>
> >>
> >>
>
>
>



Re: displaying equations with ob-latex

2021-05-06 Thread michael-franzese
The default does not work very well because as I zoom the text, the equation
remains the same height.

Could this playing around with drawers be eliminated, so things will behave as 
when
using texinfo with @display using mathjax.  It also allows you to zoom in and 
out
hard without any harm.


> Sent: Friday, May 07, 2021 at 3:14 PM
> From: "Ihor Radchenko" 
> To: michael-franz...@gmx.com
> Cc: "Berry, Charles" , "Help Emacs Orgmode" 
> 
> Subject: Re: displaying equations with ob-latex
>
> michael-franz...@gmx.com writes:
>
> > Ok, I got some progress, I did "C-C C-x C-l" and got the equation.
> >
> > The equation in extremely small though.
>
> By default, it should have the same height with you text line.
> You can change it though. I have the following snippet in my config:
>
> (setq org-format-latex-options
>   (quote
>(:foreground default :background default :scale 2.0 :justify center 
> :html-foreground "Black" :html-background "Transparent" :html-scale 1.0 
> :matchers
>   ("begin" "$1" "$" "$$" "\\(" "\\[";; 2x height of 
> formulas
>



Re: displaying equations with ob-latex

2021-05-06 Thread Berry, Charles



> On May 6, 2021, at 7:39 PM, michael-franz...@gmx.com wrote:
> 
> Ok, I got some progress, I did "C-C C-x C-l" and got the equation.
> 

Great!


> The equation in extremely small though.
> 


Try customizing `org-format-latex-options'. The :scale element controls size. I 
tried 2.0 and it seems like a good value for my screen.

Best,

Chuck

>> Sent: Friday, May 07, 2021 at 1:36 PM
>> From: "Berry, Charles" 
>> To: "michael-franz...@gmx.com" 
>> Cc: "Help Emacs Orgmode" 
>> Subject: Re: displaying equations with ob-latex
>> 
>> 
>> 
>>> On May 6, 2021, at 4:20 PM, michael-franz...@gmx.com wrote:
>>> 
>>> After I do "C-c C-c", I just get a message saying "Code block evaluation 
>>> complete."
>>> 
>> 
>> 
>> Are you doing this in a buffer that has ONLY the text between the `cut here' 
>> lines and exactly that?
>> 
>> If not, please try it in such a buffer.
>> 
>> It may help to copy and paste as typos in header names or values can be 
>> unnoticed and drastically alter behavior. If your mail client reformats 
>> text, maybe try copy and paste from the mail list archive.
>> 
>> Also, check with point in the src block using C-c C-v C-i that the header 
>> args got processed properly. You should see lines like these in the *Help* 
>> buffer:
>> 
>> ::exportsnone
>> 
>> ::resultsdrawer replace
>> 
>> 
>> If you did it in such a buffer and the buffer is unaltered but still 
>> displays the message, I have to admit that I cannot tell from here what the 
>> problem might be.
>> 
>> On my setup, things behave just as outlined.
>> 
>> When I start emacs with -q, then M-S-; (require 'ob-latex) RET, then paste 
>> the text to *scratch* and delete the lisp comment at the top, then M-x 
>> org-mode RET, then C-c C-c with point in the src block, answer 'y e s RET' 
>> to the query, I get the equation displayed in the results drawer. And the 
>> export goes OK.
>> 
>> I am using org-version 9.4.5.
>> 
>> HTH,
>> 
>> Chuck
>> 
>> 
>> 





Re: displaying equations with ob-latex

2021-05-06 Thread Ihor Radchenko
michael-franz...@gmx.com writes:

> Ok, I got some progress, I did "C-C C-x C-l" and got the equation.
>
> The equation in extremely small though.

By default, it should have the same height with you text line.
You can change it though. I have the following snippet in my config:

(setq org-format-latex-options
  (quote
   (:foreground default :background default :scale 2.0 :justify center 
:html-foreground "Black" :html-background "Transparent" :html-scale 1.0 
:matchers
("begin" "$1" "$" "$$" "\\(" "\\[";; 2x height of 
formulas



Re: displaying equations with ob-latex

2021-05-06 Thread michael-franzese
Ok, I got some progress, I did "C-C C-x C-l" and got the equation.

The equation in extremely small though.

> Sent: Friday, May 07, 2021 at 1:36 PM
> From: "Berry, Charles" 
> To: "michael-franz...@gmx.com" 
> Cc: "Help Emacs Orgmode" 
> Subject: Re: displaying equations with ob-latex
>
>
>
> > On May 6, 2021, at 4:20 PM, michael-franz...@gmx.com wrote:
> >
> > After I do "C-c C-c", I just get a message saying "Code block evaluation 
> > complete."
> >
>
>
> Are you doing this in a buffer that has ONLY the text between the `cut here' 
> lines and exactly that?
>
> If not, please try it in such a buffer.
>
> It may help to copy and paste as typos in header names or values can be 
> unnoticed and drastically alter behavior. If your mail client reformats text, 
> maybe try copy and paste from the mail list archive.
>
> Also, check with point in the src block using C-c C-v C-i that the header 
> args got processed properly. You should see lines like these in the *Help* 
> buffer:
>
> : :exportsnone
>
> : :resultsdrawer replace
>
>
> If you did it in such a buffer and the buffer is unaltered but still displays 
> the message, I have to admit that I cannot tell from here what the problem 
> might be.
>
> On my setup, things behave just as outlined.
>
> When I start emacs with -q, then M-S-; (require 'ob-latex) RET, then paste 
> the text to *scratch* and delete the lisp comment at the top, then M-x 
> org-mode RET, then C-c C-c with point in the src block, answer 'y e s RET' to 
> the query, I get the equation displayed in the results drawer. And the export 
> goes OK.
>
> I am using org-version 9.4.5.
>
> HTH,
>
> Chuck
>
>
>



Re: displaying equations with ob-latex

2021-05-06 Thread michael-franzese
I get

#+RESULTS: eqn1
:results:
\(y = x\beta + \epsilon\)
:end:



> Sent: Friday, May 07, 2021 at 1:36 PM
> From: "Berry, Charles via General discussions about Org-mode." 
> 
> To: "michael-franz...@gmx.com" 
> Cc: "Help Emacs Orgmode" 
> Subject: Re: displaying equations with ob-latex
>
>
>
> > On May 6, 2021, at 4:20 PM, michael-franz...@gmx.com wrote:
> >
> > After I do "C-c C-c", I just get a message saying "Code block evaluation 
> > complete."
> >
>
>
> Are you doing this in a buffer that has ONLY the text between the `cut here' 
> lines and exactly that?
>
> If not, please try it in such a buffer.
>
> It may help to copy and paste as typos in header names or values can be 
> unnoticed and drastically alter behavior. If your mail client reformats text, 
> maybe try copy and paste from the mail list archive.
>
> Also, check with point in the src block using C-c C-v C-i that the header 
> args got processed properly. You should see lines like these in the *Help* 
> buffer:
>
> : :exportsnone
>
> : :resultsdrawer replace
>
>
> If you did it in such a buffer and the buffer is unaltered but still displays 
> the message, I have to admit that I cannot tell from here what the problem 
> might be.
>
> On my setup, things behave just as outlined.
>
> When I start emacs with -q, then M-S-; (require 'ob-latex) RET, then paste 
> the text to *scratch* and delete the lisp comment at the top, then M-x 
> org-mode RET, then C-c C-c with point in the src block, answer 'y e s RET' to 
> the query, I get the equation displayed in the results drawer. And the export 
> goes OK.
>
> I am using org-version 9.4.5.
>
> HTH,
>
> Chuck
>
>
>
>



Re: displaying equations with ob-latex

2021-05-06 Thread Berry, Charles



> On May 6, 2021, at 4:20 PM, michael-franz...@gmx.com wrote:
> 
> After I do "C-c C-c", I just get a message saying "Code block evaluation 
> complete."
> 


Are you doing this in a buffer that has ONLY the text between the `cut here' 
lines and exactly that?

If not, please try it in such a buffer.

It may help to copy and paste as typos in header names or values can be 
unnoticed and drastically alter behavior. If your mail client reformats text, 
maybe try copy and paste from the mail list archive.

Also, check with point in the src block using C-c C-v C-i that the header args 
got processed properly. You should see lines like these in the *Help* buffer:

:   :exportsnone

:   :resultsdrawer replace


If you did it in such a buffer and the buffer is unaltered but still displays 
the message, I have to admit that I cannot tell from here what the problem 
might be.

On my setup, things behave just as outlined.

When I start emacs with -q, then M-S-; (require 'ob-latex) RET, then paste the 
text to *scratch* and delete the lisp comment at the top, then M-x org-mode 
RET, then C-c C-c with point in the src block, answer 'y e s RET' to the query, 
I get the equation displayed in the results drawer. And the export goes OK.

I am using org-version 9.4.5.

HTH,

Chuck





Re: displaying equations with ob-latex

2021-05-06 Thread michael-franzese



> Sent: Friday, May 07, 2021 at 10:52 AM
> From: "Berry, Charles via General discussions about Org-mode." 
> 
> To: "michael-franz...@gmx.com" 
> Cc: "Help Emacs Orgmode" 
> Subject: Re: displaying equations with ob-latex
>
>
>
> > On May 6, 2021, at 3:08 PM, michael-franz...@gmx.com wrote:
> >
> > 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.
> >
>
> Yes, the one equation was displayed as a preview.
>
> Maybe I was not clear in my directions so try this bit:
>
> --8<---cut here---start->8---
>
> 1. Copy the text between the `cut here' lines to its own org buffer.
> 2. Place cursor in the eqn1 src block.
> 3. Type ~C-c C-c~ and respond to any prompt about evaluating with ~y~.
> 4. An eqn1 results block should appear with a :results: drawer
>containing an equation in it.
> 5. Type ~C-c C-x C-l~.
> 6. The equation should be previewed in the :results: drawer.
> 7. Export to LaTeX Buffer with ~C-c C-e C-b l L y~
> 8. Only an enumerate environment and the equation should appear in the
>LaTeX buffer.
>
> #+name: eqn1
> #+begin_src latex :exports none :results drawer
>   \(y = x\beta + \epsilon\)
> #+end_src
>
> #+call: eqn1() :results latex
>
> --8<---cut here---end--->8---
>
>
>
>
> > Can I export on a window that is to right window of the code window?
>
> IIUC, the question is
>
> :  when I export (as in item 5 in the list above), will the LaTeX buffer
> :  open in a window to the right of the one containing the org buffer?
>
> This is what happens in my setup when I have the org buffer displayed in a 
> frame with just one window.
>
> But how windows are displayed depends on many factors. See (info "(emacs) 
> Windows") for some of the details. So you may need to customize or resize 
> your frame to get the same behavior.
>
>
> >  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.
> >
>
> Um, I don't see how this gets to the original question.

It is a side problem after the task of math display is achieved.

> > 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).
>
> There are probably a lot of opinions in the org community about how well org 
> handles previewing output. For me it works well. YMMV.

Surely you are right, but it is a problem of use case.  The lot of opinions 
suggest to me that
there should be various functionalities that can handle different approaches.

> HTH,
>
> Chuck
>
>



Re: displaying equations with ob-latex

2021-05-06 Thread michael-franzese
After I do "C-c C-c", I just get a message saying "Code block evaluation 
complete."

> Sent: Friday, May 07, 2021 at 10:52 AM
> From: "Berry, Charles" 
> To: "michael-franz...@gmx.com" 
> Cc: "Help Emacs Orgmode" 
> Subject: Re: displaying equations with ob-latex
>
>
>
> > On May 6, 2021, at 3:08 PM, michael-franz...@gmx.com wrote:
> >
> > 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.
> >
>
> Yes, the one equation was displayed as a preview.
>
> Maybe I was not clear in my directions so try this bit:
>
> --8<---cut here---start->8---
>
> 1. Copy the text between the `cut here' lines to its own org buffer.
> 2. Place cursor in the eqn1 src block.
> 3. Type ~C-c C-c~ and respond to any prompt about evaluating with ~y~.
> 4. An eqn1 results block should appear with a :results: drawer
>containing an equation in it.
> 5. Type ~C-c C-x C-l~.
> 6. The equation should be previewed in the :results: drawer.
> 7. Export to LaTeX Buffer with ~C-c C-e C-b l L y~
> 8. Only an enumerate environment and the equation should appear in the
>LaTeX buffer.
>
> #+name: eqn1
> #+begin_src latex :exports none :results drawer
>   \(y = x\beta + \epsilon\)
> #+end_src
>
> #+call: eqn1() :results latex
>
> --8<---cut here---end--->8---
>
>
>
>
> > Can I export on a window that is to right window of the code window?
>
> IIUC, the question is
>
> :  when I export (as in item 5 in the list above), will the LaTeX buffer
> :  open in a window to the right of the one containing the org buffer?
>
> This is what happens in my setup when I have the org buffer displayed in a 
> frame with just one window.
>
> But how windows are displayed depends on many factors. See (info "(emacs) 
> Windows") for some of the details. So you may need to customize or resize 
> your frame to get the same behavior.
>
>
> >  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.
> >
>
> Um, I don't see how this gets to the original question.
>
> > 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).
>
> There are probably a lot of opinions in the org community about how well org 
> handles previewing output. For me it works well. YMMV.
>
> HTH,
>
> Chuck
>



Re: displaying equations with ob-latex

2021-05-06 Thread Berry, Charles



> On May 6, 2021, at 3:08 PM, michael-franz...@gmx.com wrote:
> 
> 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.
> 

Yes, the one equation was displayed as a preview. 

Maybe I was not clear in my directions so try this bit:

--8<---cut here---start->8---

1. Copy the text between the `cut here' lines to its own org buffer.
2. Place cursor in the eqn1 src block.
3. Type ~C-c C-c~ and respond to any prompt about evaluating with ~y~.
4. An eqn1 results block should appear with a :results: drawer
   containing an equation in it.
5. Type ~C-c C-x C-l~.
6. The equation should be previewed in the :results: drawer.
7. Export to LaTeX Buffer with ~C-c C-e C-b l L y~ 
8. Only an enumerate environment and the equation should appear in the
   LaTeX buffer.

#+name: eqn1
#+begin_src latex :exports none :results drawer 
  \(y = x\beta + \epsilon\)
#+end_src

#+call: eqn1() :results latex

--8<---cut here---end--->8---




> Can I export on a window that is to right window of the code window?

IIUC, the question is 

:  when I export (as in item 5 in the list above), will the LaTeX buffer
:  open in a window to the right of the one containing the org buffer?

This is what happens in my setup when I have the org buffer displayed in a 
frame with just one window.

But how windows are displayed depends on many factors. See (info "(emacs) 
Windows") for some of the details. So you may need to customize or resize your 
frame to get the same behavior.


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

Um, I don't see how this gets to the original question.

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

There are probably a lot of opinions in the org community about how well org 
handles previewing output. For me it works well. YMMV.

HTH,

Chuck



Re: displaying equations with ob-latex

2021-05-06 Thread michael-franzese
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." 
> 
> To: "michael-franz...@gmx.com" 
> Cc: "Help Emacs Orgmode" 
> Subject: Re: displaying equations with ob-latex
>
>
>
> > On May 6, 2021, at 12:50 AM, michael-franz...@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
>
>
>
>
>



Re: displaying equations with ob-latex

2021-05-06 Thread Christopher Dimech
It would please many users if ob-latex was made to behave like other code 
blocks.
One can parse and show equations in emacs using mathjax as has been recently
implemented in texinfo using @display.

Regards
Christopher



> Sent: Friday, May 07, 2021 at 6:14 AM
> From: "Berry, Charles via General discussions about Org-mode." 
> 
> To: "michael-franz...@gmx.com" 
> Cc: "Help Emacs Orgmode" 
> Subject: Re: displaying equations with ob-latex
>
>
>
> > On May 6, 2021, at 12:50 AM, michael-franz...@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
>
>
>
>
>

-
Christopher Dimech
General Administrator - Naiad Informatics - GNU Project (Geocomputation)
- Geophysical Simulation
- Geological Subsurface Mapping
- Disaster Preparedness and Mitigation
- Natural Resource Exploration and Production
- Free Software Advocacy



Re: displaying equations with ob-latex

2021-05-06 Thread Berry, Charles



> On May 6, 2021, at 12:50 AM, michael-franz...@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






Re: displaying equations with ob-latex

2021-05-06 Thread pietru
I've got the same problem.




> Sent: Thursday, May 06, 2021 at 9:54 PM
> From: michael-franz...@gmx.com
> To: "Help Emacs Orgmode" 
> Subject: displaying equations with ob-latex
>
>
> 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".
>
>
>
>
>
>



Re: displaying equations with ob-latex

2021-05-06 Thread Christopher Dimech
I am unsure about this, but mathjax could be able to display
math format in emacs.  Never tried this in emacs though, using
ob-latex.  Had a go, but the display is not right.


> Sent: Thursday, May 06, 2021 at 9:54 PM
> From: michael-franz...@gmx.com
> To: "Help Emacs Orgmode" 
> Subject: displaying equations with ob-latex
>
>
> 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".
>
>
>
>
>
>