Latex Beamer - onlyenv

2,003 views
Skip to first unread message

SyTpp

unread,
Jun 5, 2012, 8:34:48 PM6/5/12
to LaTeX Users Group
Hello,

I am using Latex Beamer and the \onlyenv{} environment to overlay
pictures over each other, or make them appear in a certain order. It
does work, however, in slideshow mode I realized that with every new
\onlyenv the figure shifts minimally to the right, which is for the
particle figure I am presenting very disturbing.
Here is the code for the slide, where all the 'sketch021_s' figures
have the same dimension and size.

I have a presentation on friday and would be very thankful for quick
help!
Thx!

\frame{
\frametitle{Error estimation of the model}
\begin{figure}
\begin{onlyenv}<1>
\includegraphics[width=10cm]{sketches/sketch021_s}
\end{onlyenv}
\begin{onlyenv}<2>
\includegraphics[width=10cm]{sketches/sketch021_t}
\end{onlyenv}
\begin{onlyenv}<3>
\includegraphics[width=10cm]{sketches/sketch021_u}
\end{onlyenv}
\begin{onlyenv}<4>
\includegraphics[width=10cm]{sketches/sketch021_v}
\end{onlyenv}
\begin{onlyenv}<5>
\includegraphics[width=10cm]{sketches/sketch021_w}
\end{onlyenv}
\begin{onlyenv}<6>
\includegraphics[width=10cm]{sketches/sketch021_x}
\end{onlyenv}
\begin{onlyenv}<7>
\includegraphics[width=10cm]{sketches/sketch021_y}
\end{onlyenv}
\begin{onlyenv}<8>
\includegraphics[width=10cm]{sketches/sketch021}
\end{onlyenv}
\end{figure}

\pause
\pause
\pause
\pause
\pause
\pause
\pause
\begin{itemize}
\item due to uncertainty in each measure it is not possible to
predict 100\% variance in mRNA level
\item maximal explained variance in mRNA level: \textbf{91\%}\\
\end{itemize}
}

Peter Flynn

unread,
Jun 6, 2012, 5:15:44 AM6/6/12
to latexus...@googlegroups.com
On Wed, Jun 6, 2012 at 1:34 AM, SyTpp <sylvia....@gmail.com> wrote:
Hello,

I am using Latex Beamer and the \onlyenv{} environment to overlay
pictures over each other, or make them appear in a certain order. It
does work, however, in slideshow mode I realized that with every new
\onlyenv the figure shifts minimally to the right, which is for the
particle figure I am presenting very disturbing.

I'd start by adding a % to the end of each line, eg

\begin{onlyenv}<1>%
\includegraphics[width=10cm]{sketches/sketch021_s}%

just in case the linebreaks are being interpreted as spaces.

///Peter

SyTpp

unread,
Jun 6, 2012, 5:51:00 AM6/6/12
to LaTeX Users Group
Yes, this was exactly the case - thank you so much!

On 6 Jun., 11:15, Peter Flynn <anglebrac...@gmail.com> wrote:

Daniel Pino Muñoz

unread,
Jun 6, 2012, 5:53:32 AM6/6/12
to latexus...@googlegroups.com
Thanks!!

I was also having the same problem!!!


Daniel PINO MUÑOZ
> --
> You received this message because you are subscribed to the Google Groups "LaTeX Users Group" group.
> To post to this group, send email to latexus...@googlegroups.com.
> To unsubscribe from this group, send email to latexusersgro...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/latexusersgroup?hl=en.
>

Peter Flynn

unread,
Jun 6, 2012, 6:13:14 AM6/6/12
to latexus...@googlegroups.com
On Wed, Jun 6, 2012 at 10:53 AM, Daniel Pino Muñoz <alpi...@gmail.com> wrote:
Thanks!!

I was also having the same problem!

A single newline in a LaTeX document is treated as a space. Normally this is exactly what you want, so that linebreaks in your .tex file don't affect the typesetting.

But that means that a single newline in a .sty or .cls file, or in your Preamble, is also treated as a space, and in those circumstances it is almost always not wanted. This is why you see lines ending in a % (comment) in those files, to prevent TeX from "seeing" the newline character and adding it to the macro as a space.

///Peter

Reply all
Reply to author
Forward
0 new messages