emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Mistake in LaTeX syntax not detected, strange pdf generated
@ 2022-11-29 10:28 Alain.Cochard
  2022-11-29 10:40 ` Fraga, Eric
  0 siblings, 1 reply; 8+ messages in thread
From: Alain.Cochard @ 2022-11-29 10:28 UTC (permalink / raw)
  To: Org Mode List


I have file debug3.org which contains only 

   * strange
   #+begin_export latex 
   \[
     \text{a_b}
   \]
   #+end_export

Upon latex export (C-c C-e l o) the generated pdf shows a sequence of
4 "a subscript b" in a row (with 3 font sizes).

Result observed with various Org versions including

Org mode version 9.4.4 (release_9.4.4 @
/usr/share/emacs/27.2/lisp/org/)

with 'emacs -Q'.

NB: If I run pdflatex on the .tex created:

   pdflatex debug3.tex

I get

   ! Missing $ inserted.
   <inserted text> 
                   $
   l.31   \text{a_b}

and no pdf is generated.

-- 
EOST (École et Observatoire des Sciences de la Terre) 
ITE (Institut Terre & Environnement) | alain.cochard@unistra.fr
5 rue René Descartes   [bureau 110]  | Phone: +33 (0)3 68 85 50 44 
F-67084 Strasbourg Cedex, France     | [ slot available for rent ]



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

* Re: Mistake in LaTeX syntax not detected, strange pdf generated
  2022-11-29 10:28 Mistake in LaTeX syntax not detected, strange pdf generated Alain.Cochard
@ 2022-11-29 10:40 ` Fraga, Eric
  2022-11-29 11:11   ` Alain.Cochard
  0 siblings, 1 reply; 8+ messages in thread
From: Fraga, Eric @ 2022-11-29 10:40 UTC (permalink / raw)
  To: Alain.Cochard@unistra.fr; +Cc: Org Mode List

On Tuesday, 29 Nov 2022 at 11:28, Alain.Cochard@unistra.fr wrote:
>    #+begin_export latex
>    \[
>      \text{a_b}
>    \]
>    #+end_export

You cannot use a subscript within \text{}.  Try \text{a}_{\text{b}}
instead?

-- 
: Eric S Fraga, with org release_9.5.5-1068-gbd4681 in Emacs 29.0.50

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

* Re: Mistake in LaTeX syntax not detected, strange pdf generated
  2022-11-29 10:40 ` Fraga, Eric
@ 2022-11-29 11:11   ` Alain.Cochard
  2022-11-29 11:16     ` Fraga, Eric
  0 siblings, 1 reply; 8+ messages in thread
From: Alain.Cochard @ 2022-11-29 11:11 UTC (permalink / raw)
  To: Fraga, Eric; +Cc: Alain.Cochard@unistra.fr, Org Mode List

Fraga, Eric writes on Tue 29 Nov 2022 10:40:

 > You cannot use a subscript within \text{}.

Yes.  My point was that Org did not spot this mistake and generates
something ridiculous.


-- 
EOST (École et Observatoire des Sciences de la Terre) 
ITE (Institut Terre & Environnement) | alain.cochard@unistra.fr
5 rue René Descartes   [bureau 110]  | Phone: +33 (0)3 68 85 50 44 
F-67084 Strasbourg Cedex, France     | [ slot available for rent ]



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

* Re: Mistake in LaTeX syntax not detected, strange pdf generated
  2022-11-29 11:11   ` Alain.Cochard
@ 2022-11-29 11:16     ` Fraga, Eric
  2022-11-29 11:33       ` Alain.Cochard
  0 siblings, 1 reply; 8+ messages in thread
From: Fraga, Eric @ 2022-11-29 11:16 UTC (permalink / raw)
  To: Alain.Cochard@unistra.fr; +Cc: Org Mode List

On Tuesday, 29 Nov 2022 at 12:11, Alain.Cochard@unistra.fr wrote:
> Yes.  My point was that Org did not spot this mistake and generates
> something ridiculous.

Ah, okay.  I think having the expectation that org will parse within
LaTeX blocks may be a little unrealistic.  But, also, what should it do?
I would not want org to start manipulating my LaTeX code.

-- 
: Eric S Fraga, with org release_9.5.5-1068-gbd4681 in Emacs 29.0.50

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

* Re: Mistake in LaTeX syntax not detected, strange pdf generated
  2022-11-29 11:16     ` Fraga, Eric
@ 2022-11-29 11:33       ` Alain.Cochard
  2022-11-29 11:51         ` Alain.Cochard
  0 siblings, 1 reply; 8+ messages in thread
From: Alain.Cochard @ 2022-11-29 11:33 UTC (permalink / raw)
  To: Fraga, Eric; +Cc: Alain.Cochard@unistra.fr, Org Mode List

Fraga, Eric writes on Tue 29 Nov 2022 11:16:

 > I think having the expectation that org will parse within LaTeX
 > blocks may be a little unrealistic.

Org, no, but (pdf)latex yes.

 > But, also, what should it do?

I would expect that the mistake be reported in the *Org PDF LaTeX
Output* Compilation buffer.  So far, what I saw in that buffer was
essentially what shows up when I run 'pdflatex org_generated_file.tex'
from a terminal.  Not this time: the "regular" pdflatex compiles
correctly, not the pdflatex that Org uses internally.

I thought what Org did was simply run pdflatex+bibtex+etc. just as
what one would do manually, but apparently there is some difference.

-- 
EOST (École et Observatoire des Sciences de la Terre) 
ITE (Institut Terre & Environnement) | alain.cochard@unistra.fr
5 rue René Descartes   [bureau 110]  | Phone: +33 (0)3 68 85 50 44 
F-67084 Strasbourg Cedex, France     | [ slot available for rent ]



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

* Re: Mistake in LaTeX syntax not detected, strange pdf generated
  2022-11-29 11:33       ` Alain.Cochard
@ 2022-11-29 11:51         ` Alain.Cochard
  2022-11-29 12:20           ` Dominik Schrempf
  0 siblings, 1 reply; 8+ messages in thread
From: Alain.Cochard @ 2022-11-29 11:51 UTC (permalink / raw)
  To: alain.cochard; +Cc: Fraga, Eric, Org Mode List

Alain.Cochard@unistra.fr writes on Tue 29 Nov 2022 12:33:

 > I would expect that the mistake be reported in the *Org PDF LaTeX
 > Output* Compilation buffer.  So far, what I saw in that buffer was
 > essentially what shows up when I run 'pdflatex org_generated_file.tex'
 > from a terminal.  Not this time: the "regular" pdflatex compiles
 > correctly, not the pdflatex that Org uses internally.

 > I thought what Org did was simply run pdflatex+bibtex+etc. just as
 > what one would do manually, but apparently there is some difference.

Hum, I correct myself here: the compilation buffer does report the
mistake (I hadn't looked at it).  Also, the manual compilation with

   pdflatex org_generated_file.tex

does generate the same pdf provided that I hit <return> many times.
Also, I see that the message

   PDF file produced with errors.

appears in the *Messages* buffer.

So perhaps Org could display this message in the minibuffer instead of

   Running /usr/bin/xdg-open /home/cochard/Org/debug3.pdf...done

which leads to the impression that the compilation is OK.


-- 
EOST (École et Observatoire des Sciences de la Terre) 
ITE (Institut Terre & Environnement) | alain.cochard@unistra.fr
5 rue René Descartes   [bureau 110]  | Phone: +33 (0)3 68 85 50 44 
F-67084 Strasbourg Cedex, France     | [ slot available for rent ]



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

* Re: Mistake in LaTeX syntax not detected, strange pdf generated
  2022-11-29 11:51         ` Alain.Cochard
@ 2022-11-29 12:20           ` Dominik Schrempf
  2022-11-29 12:54             ` Immanuel Litzroth
  0 siblings, 1 reply; 8+ messages in thread
From: Dominik Schrempf @ 2022-11-29 12:20 UTC (permalink / raw)
  To: alain.cochard; +Cc: Fraga, Eric, emacs-orgmode

Hi!

I wanted to chime in here, because sometimes I do have a similar
problem.

Whenever I export to LaTeX + PDF, it is pretty difficult to see if the
compilation actually worked (or not). This is, because the compilation
happens asynchronously, and so, the message about the compilation
results in the modeling vanishes fast.

Usually, I open the LaTeX compilation buffer manually, but I think it
would be great if Org Mode was a bit more verbose about the result of
the compilation (not the actual export). Not sure how this would work
though... (Not very helpful, I know).

Thank you!
Dominik

Alain.Cochard@unistra.fr writes:

> Alain.Cochard@unistra.fr writes on Tue 29 Nov 2022 12:33:
>
>  > I would expect that the mistake be reported in the *Org PDF LaTeX
>  > Output* Compilation buffer.  So far, what I saw in that buffer was
>  > essentially what shows up when I run 'pdflatex org_generated_file.tex'
>  > from a terminal.  Not this time: the "regular" pdflatex compiles
>  > correctly, not the pdflatex that Org uses internally.
>
>  > I thought what Org did was simply run pdflatex+bibtex+etc. just as
>  > what one would do manually, but apparently there is some difference.
>
> Hum, I correct myself here: the compilation buffer does report the
> mistake (I hadn't looked at it).  Also, the manual compilation with
>
>    pdflatex org_generated_file.tex
>
> does generate the same pdf provided that I hit <return> many times.
> Also, I see that the message
>
>    PDF file produced with errors.
>
> appears in the *Messages* buffer.
>
> So perhaps Org could display this message in the minibuffer instead of
>
>    Running /usr/bin/xdg-open /home/cochard/Org/debug3.pdf...done
>
> which leads to the impression that the compilation is OK.


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

* Re: Mistake in LaTeX syntax not detected, strange pdf generated
  2022-11-29 12:20           ` Dominik Schrempf
@ 2022-11-29 12:54             ` Immanuel Litzroth
  0 siblings, 0 replies; 8+ messages in thread
From: Immanuel Litzroth @ 2022-11-29 12:54 UTC (permalink / raw)
  To: Dominik Schrempf; +Cc: alain.cochard, Fraga, Eric, emacs-orgmode

Same problem here -- seeing mistakes in latex/pdf generation.
i

On Tue, Nov 29, 2022 at 1:27 PM Dominik Schrempf
<dominik.schrempf@gmail.com> wrote:
>
> Hi!
>
> I wanted to chime in here, because sometimes I do have a similar
> problem.
>
> Whenever I export to LaTeX + PDF, it is pretty difficult to see if the
> compilation actually worked (or not). This is, because the compilation
> happens asynchronously, and so, the message about the compilation
> results in the modeling vanishes fast.
>
> Usually, I open the LaTeX compilation buffer manually, but I think it
> would be great if Org Mode was a bit more verbose about the result of
> the compilation (not the actual export). Not sure how this would work
> though... (Not very helpful, I know).
>
> Thank you!
> Dominik
>
> Alain.Cochard@unistra.fr writes:
>
> > Alain.Cochard@unistra.fr writes on Tue 29 Nov 2022 12:33:
> >
> >  > I would expect that the mistake be reported in the *Org PDF LaTeX
> >  > Output* Compilation buffer.  So far, what I saw in that buffer was
> >  > essentially what shows up when I run 'pdflatex org_generated_file.tex'
> >  > from a terminal.  Not this time: the "regular" pdflatex compiles
> >  > correctly, not the pdflatex that Org uses internally.
> >
> >  > I thought what Org did was simply run pdflatex+bibtex+etc. just as
> >  > what one would do manually, but apparently there is some difference.
> >
> > Hum, I correct myself here: the compilation buffer does report the
> > mistake (I hadn't looked at it).  Also, the manual compilation with
> >
> >    pdflatex org_generated_file.tex
> >
> > does generate the same pdf provided that I hit <return> many times.
> > Also, I see that the message
> >
> >    PDF file produced with errors.
> >
> > appears in the *Messages* buffer.
> >
> > So perhaps Org could display this message in the minibuffer instead of
> >
> >    Running /usr/bin/xdg-open /home/cochard/Org/debug3.pdf...done
> >
> > which leads to the impression that the compilation is OK.
>


-- 
-- A man must either resolve to point out nothing new or to become a
slave to defend it. -- Sir Isaac Newton


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

end of thread, other threads:[~2022-11-29 12:55 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-29 10:28 Mistake in LaTeX syntax not detected, strange pdf generated Alain.Cochard
2022-11-29 10:40 ` Fraga, Eric
2022-11-29 11:11   ` Alain.Cochard
2022-11-29 11:16     ` Fraga, Eric
2022-11-29 11:33       ` Alain.Cochard
2022-11-29 11:51         ` Alain.Cochard
2022-11-29 12:20           ` Dominik Schrempf
2022-11-29 12:54             ` Immanuel Litzroth

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