Discussion:
[AUCTeX] beamer
g***@gmail.com
2018-02-28 22:53:12 UTC
Permalink
I have two files, test1.tex

\documentclass{beamer}
\begin{document}
\begin{frame}
\[ a = \begin{bmatrix} 2 & 4 \\ 7 & 3 \end{bmatrix} \]
\end{frame}
\end{document}

and test2.tex (* note that here I load preview.sty and use one of the
commands here defined *)

\documentclass{beamer}
\usepackage{preview}
\PreviewEnvironment*{frame}
\begin{document}
\begin{frame}
\[ a = \begin{bmatrix} 2 & 4 \\ 7 & 3 \end{bmatrix} \]
\end{frame}
\end{document}

When I hit C-c C-p C-d (preview-document) in the buffer of test1 I have
that the image representing the displayed equation is produced, but it
is not correctly placed --- it is placed instead at the end of the frame
source

When I hit C-c C-p C-d (preview-document) in the buffer of test2 I have
the following message in the minibuffer

error in process sentinel: LaTeX found no preview images

and a longish output from latex that I'm going to append at the end of
my post.

The first version (test1) is known to be buggy, the second one was
suggested by someone on the list to tell preview.sty how to fix the
problem with beamer frames and has worked for years. I don't know
exactly when the problem started because I use beamer two months each
year...

Any help will be appreciated, thank you in advance ፨ g

Here follows the log of the preview compilation
vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
Running `Preview-LaTeX' on `test' with ``pdflatex -file-line-error --synctex=1 "\nonstopmode\nofiles\PassOptionsToPackage{active,tightpage,auctex}{preview}\AtBeginDocument{\ifx\ifPreview\undefined\RequirePackage[displaymath,floats,graphics,textmath,sections,footnotes]{preview}[2004/11/05]\fi}" "\input" test.tex''
This is pdfTeX, Version 3.14159265-2.6-1.40.18 (TeX Live 2017/Debian) (preloaded format=pdflatex)
restricted \write18 enabled.
entering extended mode
LaTeX2e <2017-04-15>
Babel <3.18> and hyphenation patterns for 56 language(s) loaded.

No auxiliary output files.

(./test.tex (/usr/share/texlive/texmf-dist/tex/latex/beamer/beamer.cls
Document Class: beamer 2018/02/20 v3.50 A class for typesetting presentations
(/usr/share/texlive/texmf-dist/tex/latex/beamer/beamerbasemodes.sty (/usr/share/texlive/texmf-dist/tex/latex/etoolbox/etoolbox.sty) (/usr/share/texlive/texmf-dist/tex/latex/beamer/beamerbasedecode.sty)) (/usr/share/texlive/texmf-dist/tex/generic/oberdiek/ifpdf.sty) (/usr/share/texlive/texmf-dist/tex/latex/beamer/beamerbaseoptions.sty (/usr/share/texlive/texmf-dist/tex/latex/graphics/keyval.sty)) (/usr/share/texlive/texmf-dist/tex/latex/geometry/geometry.sty (/usr/share/texlive/texmf-dist/tex/generic/oberdiek/ifvtex.sty) (/usr/share/texlive/texmf-dist/tex/generic/ifxetex/ifxetex.sty)) (/usr/share/texlive/texmf-dist/tex/latex/base/size11.clo) (/usr/share/texlive/texmf-dist/tex/latex/pgf/basiclayer/pgfcore.sty (/usr/share/texlive/texmf-dist/tex/latex/graphics/graphicx.sty (/usr/share/texlive/texmf-dist/tex/latex/graphics/graphics.sty (/usr/share/texlive/texmf-dist/tex/latex/graphics/trig.sty) (/usr/share/texlive/texmf-dist/tex/latex/graphics-cfg/graphics.cfg)
(/usr/share/texlive/texmf-dist/tex/latex/graphics-def/pdftex.def))) (/usr/share/texlive/texmf-dist/tex/latex/pgf/systemlayer/pgfsys.sty (/usr/share/texlive/texmf-dist/tex/latex/pgf/utilities/pgfrcs.sty (/usr/share/texlive/texmf-dist/tex/generic/pgf/utilities/pgfutil-common.tex (/usr/share/texlive/texmf-dist/tex/generic/pgf/utilities/pgfutil-common-lists.tex)) (/usr/share/texlive/texmf-dist/tex/generic/pgf/utilities/pgfutil-latex.def (/usr/share/texlive/texmf-dist/tex/latex/ms/everyshi.sty)) (/usr/share/texlive/texmf-dist/tex/generic/pgf/utilities/pgfrcs.code.tex)) (/usr/share/texlive/texmf-dist/tex/generic/pgf/systemlayer/pgfsys.code.tex (/usr/share/texlive/texmf-dist/tex/generic/pgf/utilities/pgfkeys.code.tex (/usr/share/texlive/texmf-dist/tex/generic/pgf/utilities/pgfkeysfiltered.code.tex)) (/usr/share/texlive/texmf-dist/tex/generic/pgf/systemlayer/pgf.cfg) (/usr/share/texlive/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-pdftex.def
(/usr/share/texlive/texmf-dist/tex/generic/pgf/systemlayer/pgfsys-common-pdf.def))) (/usr/share/texlive/texmf-dist/tex/generic/pgf/systemlayer/pgfsyssoftpath.code.tex) (/usr/share/texlive/texmf-dist/tex/generic/pgf/systemlayer/pgfsysprotocol.code.tex)) (/usr/share/texlive/texmf-dist/tex/latex/xcolor/xcolor.sty (/usr/share/texlive/texmf-dist/tex/latex/graphics-cfg/color.cfg)) (/usr/share/texlive/texmf-dist/tex/generic/pgf/basiclayer/pgfcore.code.tex (/usr/share/texlive/texmf-dist/tex/generic/pgf/math/pgfmath.code.tex (/usr/share/texlive/texmf-dist/tex/generic/pgf/math/pgfmathcalc.code.tex (/usr/share/texlive/texmf-dist/tex/generic/pgf/math/pgfmathutil.code.tex) (/usr/share/texlive/texmf-dist/tex/generic/pgf/math/pgfmathparser.code.tex) (/usr/share/texlive/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.code.tex (/usr/share/texlive/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.basic.code.tex) (/usr/share/texlive/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.trigonometric.code.tex)
(/usr/share/texlive/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.random.code.tex) (/usr/share/texlive/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.comparison.code.tex) (/usr/share/texlive/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.base.code.tex) (/usr/share/texlive/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.round.code.tex) (/usr/share/texlive/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.misc.code.tex) (/usr/share/texlive/texmf-dist/tex/generic/pgf/math/pgfmathfunctions.integerarithmetics.code.tex))) (/usr/share/texlive/texmf-dist/tex/generic/pgf/math/pgfmathfloat.code.tex)) (/usr/share/texlive/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepoints.code.tex) (/usr/share/texlive/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepathconstruct.code.tex) (/usr/share/texlive/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepathusage.code.tex) (/usr/share/texlive/texmf-dist/tex/generic/pgf/basiclayer/pgfcorescopes.code.tex)
(/usr/share/texlive/texmf-dist/tex/generic/pgf/basiclayer/pgfcoregraphicstate.code.tex) (/usr/share/texlive/texmf-dist/tex/generic/pgf/basiclayer/pgfcoretransformations.code.tex) (/usr/share/texlive/texmf-dist/tex/generic/pgf/basiclayer/pgfcorequick.code.tex) (/usr/share/texlive/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreobjects.code.tex) (/usr/share/texlive/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepathprocessing.code.tex) (/usr/share/texlive/texmf-dist/tex/generic/pgf/basiclayer/pgfcorearrows.code.tex) (/usr/share/texlive/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreshade.code.tex) (/usr/share/texlive/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreimage.code.tex (/usr/share/texlive/texmf-dist/tex/generic/pgf/basiclayer/pgfcoreexternal.code.tex)) (/usr/share/texlive/texmf-dist/tex/generic/pgf/basiclayer/pgfcorelayers.code.tex) (/usr/share/texlive/texmf-dist/tex/generic/pgf/basiclayer/pgfcoretransparency.code.tex)
(/usr/share/texlive/texmf-dist/tex/generic/pgf/basiclayer/pgfcorepatterns.code.tex))) (/usr/share/texlive/texmf-dist/tex/latex/pgf/utilities/xxcolor.sty) (/usr/share/texlive/texmf-dist/tex/generic/oberdiek/atbegshi.sty (/usr/share/texlive/texmf-dist/tex/generic/oberdiek/infwarerr.sty) (/usr/share/texlive/texmf-dist/tex/generic/oberdiek/ltxcmds.sty)) (/usr/share/texlive/texmf-dist/tex/latex/hyperref/hyperref.sty (/usr/share/texlive/texmf-dist/tex/generic/oberdiek/hobsub-hyperref.sty (/usr/share/texlive/texmf-dist/tex/generic/oberdiek/hobsub-generic.sty)) (/usr/share/texlive/texmf-dist/tex/latex/oberdiek/auxhook.sty) (/usr/share/texlive/texmf-dist/tex/latex/oberdiek/kvoptions.sty) (/usr/share/texlive/texmf-dist/tex/latex/hyperref/pd1enc.def) (/usr/share/texlive/texmf-dist/tex/latex/latexconfig/hyperref.cfg) (/usr/share/texlive/texmf-dist/tex/latex/url/url.sty)

Package hyperref Message: Stopped early.

) (/usr/share/texlive/texmf-dist/tex/latex/hyperref/hpdftex.def (/usr/share/texlive/texmf-dist/tex/latex/oberdiek/rerunfilecheck.sty)) (/usr/share/texlive/texmf-dist/tex/latex/beamer/beamerbaserequires.sty (/usr/share/texlive/texmf-dist/tex/latex/beamer/beamerbasecompatibility.sty) (/usr/share/texlive/texmf-dist/tex/latex/beamer/beamerbasefont.sty (/usr/share/texlive/texmf-dist/tex/latex/amsfonts/amssymb.sty (/usr/share/texlive/texmf-dist/tex/latex/amsfonts/amsfonts.sty)) (/usr/share/texlive/texmf-dist/tex/latex/sansmathaccent/sansmathaccent.sty (/usr/share/texlive/texmf-dist/tex/latex/filehook/filehook.sty))) (/usr/share/texlive/texmf-dist/tex/latex/beamer/beamerbasetranslator.sty (/usr/share/texlive/texmf-dist/tex/latex/translator/translator.sty)) (/usr/share/texlive/texmf-dist/tex/latex/beamer/beamerbasemisc.sty) (/usr/share/texlive/texmf-dist/tex/latex/beamer/beamerbasetwoscreens.sty) (/usr/share/texlive/texmf-dist/tex/latex/beamer/beamerbaseoverlay.sty)
(/usr/share/texlive/texmf-dist/tex/latex/beamer/beamerbasetitle.sty) (/usr/share/texlive/texmf-dist/tex/latex/beamer/beamerbasesection.sty) (/usr/share/texlive/texmf-dist/tex/latex/beamer/beamerbaseframe.sty) (/usr/share/texlive/texmf-dist/tex/latex/beamer/beamerbaseverbatim.sty) (/usr/share/texlive/texmf-dist/tex/latex/beamer/beamerbaseframesize.sty) (/usr/share/texlive/texmf-dist/tex/latex/beamer/beamerbaseframecomponents.sty) (/usr/share/texlive/texmf-dist/tex/latex/beamer/beamerbasecolor.sty) (/usr/share/texlive/texmf-dist/tex/latex/beamer/beamerbasenotes.sty) (/usr/share/texlive/texmf-dist/tex/latex/beamer/beamerbasetoc.sty) (/usr/share/texlive/texmf-dist/tex/latex/beamer/beamerbasetemplates.sty (/usr/share/texlive/texmf-dist/tex/latex/beamer/beamerbaseauxtemplates.sty (/usr/share/texlive/texmf-dist/tex/latex/beamer/beamerbaseboxes.sty))) (/usr/share/texlive/texmf-dist/tex/latex/beamer/beamerbaselocalstructure.sty (/usr/share/texlive/texmf-dist/tex/latex/tools/enumerate.sty))
(/usr/share/texlive/texmf-dist/tex/latex/beamer/beamerbasenavigation.sty) (/usr/share/texlive/texmf-dist/tex/latex/beamer/beamerbasetheorems.sty (/usr/share/texlive/texmf-dist/tex/latex/amsmath/amsmath.sty
For additional information on amsmath, use the `?' option.
(/usr/share/texlive/texmf-dist/tex/latex/amsmath/amstext.sty (/usr/share/texlive/texmf-dist/tex/latex/amsmath/amsgen.sty)) (/usr/share/texlive/texmf-dist/tex/latex/amsmath/amsbsy.sty) (/usr/share/texlive/texmf-dist/tex/latex/amsmath/amsopn.sty)) (/usr/share/texlive/texmf-dist/tex/latex/amscls/amsthm.sty)) (/usr/share/texlive/texmf-dist/tex/latex/beamer/beamerbasethemes.sty)) (/usr/share/texlive/texmf-dist/tex/latex/beamer/beamerthemedefault.sty (/usr/share/texlive/texmf-dist/tex/latex/beamer/beamerfontthemedefault.sty) (/usr/share/texlive/texmf-dist/tex/latex/beamer/beamercolorthemedefault.sty) (/usr/share/texlive/texmf-dist/tex/latex/beamer/beamerinnerthemedefault.sty) (/usr/share/texlive/texmf-dist/tex/latex/beamer/beamerouterthemedefault.sty))) (/home/boffi/.emacs.d/elpa/auctex-12.1.0/latex/preview.sty (/usr/share/texlive/texmf-dist/tex/generic/luatex85/luatex85.sty) (/home/boffi/.emacs.d/elpa/auctex-12.1.0/latex/prtightpage.def)
(/home/boffi/.emacs.d/elpa/auctex-12.1.0/latex/prauctex.def
No auxiliary output files.


(/home/boffi/.emacs.d/elpa/auctex-12.1.0/latex/prauctex.cfg))) (./test.aux)
*geometry* driver: auto-detecting
*geometry* detected driver: pdftex
(/usr/share/texlive/texmf-dist/tex/context/base/mkii/supp-pdf.mkii
[Loading MPS to PDF converter (version 2006.09.02).]
) (/usr/share/texlive/texmf-dist/tex/latex/oberdiek/epstopdf-base.sty (/usr/share/texlive/texmf-dist/tex/latex/oberdiek/grfext.sty) (/usr/share/texlive/texmf-dist/tex/latex/latexconfig/epstopdf-sys.cfg)) ABD: EveryShipout initializing macros (/usr/share/texlive/texmf-dist/tex/latex/hyperref/nameref.sty (/usr/share/texlive/texmf-dist/tex/generic/oberdiek/gettitlestring.sty)) (./test.out) (./test.out) (/usr/share/texlive/texmf-dist/tex/latex/translator/translator-basic-dictionary-English.dict) (/usr/share/texlive/texmf-dist/tex/latex/translator/translator-bibliography-dictionary-English.dict) (/usr/share/texlive/texmf-dist/tex/latex/translator/translator-environment-dictionary-English.dict) (/usr/share/texlive/texmf-dist/tex/latex/translator/translator-months-dictionary-English.dict) (/usr/share/texlive/texmf-dist/tex/latex/translator/translator-numbers-dictionary-English.dict) (/usr/share/texlive/texmf-dist/tex/latex/translator/translator-theorem-dictionary-English.dict)
Preview: Fontsize 10.95pt
Preview: PDFoutput 1
(./test.nav) (/usr/share/texlive/texmf-dist/tex/latex/amsfonts/umsa.fd) (/usr/share/texlive/texmf-dist/tex/latex/amsfonts/umsb.fd) (/usr/share/texlive/texmf-dist/tex/latex/sansmathaccent/ot1mathkerncmss.fd) )
No pages of output.
Transcript written on test.log.

TeX Output finished with nothing to show at Wed Feb 28 23:42:34
LaTeX: LaTeX found no preview images
Mosè Giordano
2018-03-01 15:29:27 UTC
Permalink
Ciao Giacomo,
Post by g***@gmail.com
I have two files, test1.tex
\documentclass{beamer}
\begin{document}
\begin{frame}
\[ a = \begin{bmatrix} 2 & 4 \\ 7 & 3 \end{bmatrix} \]
\end{frame}
\end{document}
and test2.tex (* note that here I load preview.sty and use one of the
commands here defined *)
\documentclass{beamer}
\usepackage{preview}
\PreviewEnvironment*{frame}
\begin{document}
\begin{frame}
\[ a = \begin{bmatrix} 2 & 4 \\ 7 & 3 \end{bmatrix} \]
\end{frame}
\end{document}
When I hit C-c C-p C-d (preview-document) in the buffer of test1 I have
that the image representing the displayed equation is produced, but it
is not correctly placed --- it is placed instead at the end of the frame
source
Using the test1 file, try adding the following snippet to your Emacs init file:

(with-eval-after-load "preview"
(add-to-list 'preview-default-preamble
"\\PreviewEnvironment*{frame}" t))

In the attached image you can see how it's rendered for me with this code.

Bye,
MosÚ
Arash Esbati
2018-03-03 16:32:17 UTC
Permalink
Post by Mosè Giordano
Post by g***@gmail.com
I have two files, test1.tex
\documentclass{beamer}
\begin{document}
\begin{frame}
\[ a = \begin{bmatrix} 2 & 4 \\ 7 & 3 \end{bmatrix} \]
\end{frame}
\end{document}
and test2.tex (* note that here I load preview.sty and use one of the
commands here defined *)
\documentclass{beamer}
\usepackage{preview}
\PreviewEnvironment*{frame}
\begin{document}
\begin{frame}
\[ a = \begin{bmatrix} 2 & 4 \\ 7 & 3 \end{bmatrix} \]
\end{frame}
\end{document}
When I hit C-c C-p C-d (preview-document) in the buffer of test1 I have
that the image representing the displayed equation is produced, but it
is not correctly placed --- it is placed instead at the end of the frame
source
(with-eval-after-load "preview"
(add-to-list 'preview-default-preamble
"\\PreviewEnvironment*{frame}" t))
In the attached image you can see how it's rendered for me with this code.
Hi Mosè,

I'm not sure if we have an issue with the manual of preview here, but
IIRC, one must pass the environments option(s) explicitly to preview.sty
if loaded in .tex file, `active' alone doesn't suffice. This code
produces the desired result:

\documentclass{beamer}

\usepackage[textmath,displaymath,sections,active]{preview}
\PreviewEnvironment*{frame}

\begin{document}
\begin{frame}
\[
a = \begin{bmatrix} 2 & 4 \\ 7 & 3 \end{bmatrix}
\]
\end{frame}
\end{document}

Best, Arash
g***@gmail.com
2018-03-03 23:10:30 UTC
Permalink
Post by Arash Esbati
I'm not sure if we have an issue with the manual of preview here, but
IIRC, one must pass the environments option(s) explicitly to preview.sty
if loaded in .tex file, `active' alone doesn't suffice. This code
\documentclass{beamer}
\usepackage[textmath,displaymath,sections,active]{preview}
\PreviewEnvironment*{frame}
Ciao Arash,

the documentation of the latex side of preview has

*active* is the most essential option. If this option is not
specified, the preview package will be inactive and the document
will be typeset as if the preview package were not loaded, except
that all declarations and environments defined by the package are
still legal but have no effect. This allows defining previewing
characteristics in your document, and only activating them by
calling LaTeX as

latex ’\PassOptionsToPackage{active}{preview}\input{filename}’

my understanding is that you manually specify "active" only in the
relatively rare case in which you want to extract. e.g., the formulas
from a document as a set of png files --- in all the other cases, in
which you want to normally process the .tex file and just want to modify
the behavior of preview, e.g., with respect to beamer's "frame"
environments, you DO NOT put "active" in the latex source, because it's
the job of preview the elisp package to correctly invoke latex.

I have to add that the behavior described in the manual is no more what
happens using preview.el these days.

Thank you for the interest in my post ፨ g
Arash Esbati
2018-03-05 20:44:04 UTC
Permalink
Post by g***@gmail.com
Post by Arash Esbati
I'm not sure if we have an issue with the manual of preview here, but
IIRC, one must pass the environments option(s) explicitly to preview.sty
if loaded in .tex file, `active' alone doesn't suffice. This code
\documentclass{beamer}
\usepackage[textmath,displaymath,sections,active]{preview}
\PreviewEnvironment*{frame}
Ciao Arash,
the documentation of the latex side of preview has
*active* is the most essential option. If this option is not
specified, the preview package will be inactive and the document
will be typeset as if the preview package were not loaded, except
that all declarations and environments defined by the package are
still legal but have no effect. This allows defining previewing
characteristics in your document, and only activating them by
calling LaTeX as
latex ’\PassOptionsToPackage{active}{preview}\input{filename}’
my understanding is that you manually specify "active" only in the
relatively rare case in which you want to extract. e.g., the formulas
from a document as a set of png files --- in all the other cases, in
which you want to normally process the .tex file and just want to modify
the behavior of preview, e.g., with respect to beamer's "frame"
environments, you DO NOT put "active" in the latex source, because it's
the job of preview the elisp package to correctly invoke latex.
Hi Giacomo,

yes, you're right in this respect; `active' is not necessary in a .tex
file; I should have checked more carefully.

But my point was a different one: If you load preview as a package in
your .tex file, you must pass options like `displaymath' to the package.
preview.sty doesn't set any defaults as it doesn't have a
\ExecuteOptions{...} in the .sty file. This is the reason why your
test2.tex didn't work.
Post by g***@gmail.com
I have to add that the behavior described in the manual is no more what
happens using preview.el these days.
Can you please elaborate?

Best, Arash

g***@gmail.com
2018-03-03 22:50:39 UTC
Permalink
Ciao Mosè,

thank you for the working solution
Post by Mosè Giordano
(with-eval-after-load "preview"
(add-to-list 'preview-default-preamble
"\\PreviewEnvironment*{frame}" t))
that you have posted. Preview's info manual suggests to customize the
"preview-default-preamble" variable but it's more or less equivalent,
isn't it?.

I didn't know of this elisp mechanism to influence the behaviour of
preview, the latex package.

Is it possible that the breakage of my "test2.tex" file, that used to
work perfectly, is connected to the emacs side of preview manipulating
the latex side?

Again, thank you for the code ፨ g
Loading...