auctex
[Top][All Lists]
Advanced

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

Re: [AUCTeX] beamer


From: Arash Esbati
Subject: Re: [AUCTeX] beamer
Date: Sat, 03 Mar 2018 17:32:17 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3

Mosè Giordano <address@hidden> writes:

> 2018-02-28 23:53 GMT+01:00  <address@hidden>:
>> 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.

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

Attachment: x.png
Description: PNG image


reply via email to

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