Re: [AUCTeX] beamer

2018-03-03 Thread giacomo . boffi
Arash Esbati  writes:

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

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


___
auctex mailing list
auctex@gnu.org
https://lists.gnu.org/mailman/listinfo/auctex


Re: [AUCTeX] beamer

2018-03-03 Thread giacomo . boffi
Ciao Mosè,

thank you for the working solution

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


___
auctex mailing list
auctex@gnu.org
https://lists.gnu.org/mailman/listinfo/auctex


Re: [AUCTeX] beamer

2018-03-03 Thread Arash Esbati
Mosè Giordano  writes:

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

___
auctex mailing list
auctex@gnu.org
https://lists.gnu.org/mailman/listinfo/auctex