在 beamer 中添加 Tikz 图片

在 beamer 中添加 Tikz 图片

我是一个新的 Beamer 用户,当我尝试在 Beamer 演示文稿的幻灯片上添加 Tikz 图片时,我不知道出了什么问题,它一直在与我想要的不同的帧(即幻灯片)上显示。我该如何解决这个问题?

\begin{frame}
\frametitle{Introduction} % Table of contents slide, comment this block out to remove it
\tableofcontents % Throughout your presentation, if you choose to use \section{} and \subsection{} commands, these will automatically be printed on this slide as an overview of your presentation
\end{frame}

%----------------------------------------------------------------------------------------
%   PRESENTATION SLIDES
%----------------------------------------------------------------------------------------

%------------------------------------------------
\begin{frame}
\section{Section 1} 

\subsection{Description.}


\begin{tikzpicture}[
        dot/.style={circle,fill, inner sep=1.5pt, outer sep=0pt},
every label/.style={inner sep=0pt}] 
\newdimen\R \R=1cm

\foreach \i [count=\j] in { 1,2,3,4,5,6}
{
\node (n\j) [dot, label=60*\j:$\i$] at (60*\j:\R) {};
\draw[blue,thick]  (0,0) -- (n\j);
}



{
\foreach \i in {1,2,...,6}
    \foreach \j in {\i,...,6}
    \draw (n\i) -- (n\j);
}
    \end{tikzpicture}



\section{Section 2} 


\end{frame}


在此处输入图片描述

答案1

\section为了帮助解决这个问题,我整理了一个 MWE 来展示分段命令(和\subsection)和框架标题之间的区别。

此外,如何article从投影仪演示文稿(演示模式)中制作文档、类别(文章模式),并隐藏一些框架。

编译代码将产生一个由 6 个框架 (F1 到 F6) 组成的投影仪演示:标题 (F1)、概述 (F2)(显示章节和小节的结构 \tableofcontents,但不是框架列表!)和 4 个带有内容的附加框架。

F4 Connectionstikz 图形位于子部分下的框架中Description

代码处于 beamer 模式。请注意,\section\subsection命令是在框架环境之外使用的。

要切换到文章模式,请对 和 进行评论 并\documentclass{beamer}取消评论 。\documentclass{article}\usepackage{beamerarticle}

第 5 帧被标记为,\mode <presentation>因此它将在模式演示中显示,但不会在模式文章中显示。

结果是一篇三页的文章:标题页、显示章节和小节的目录以及框架中使用的标题F2 Overview,以及包含内容的页面,其中框架标题显示为,\paragraph因为每个框架都会发出一个\paragraph*{<frame title>}

正如预期的那样,第 5 帧没有出现在第 2 节下。

请注意,\newpage\bigskip命令在文章模式下很有用,但在演示模式下无效。

要在 beamer 模式下生成帧列表,请参见https://tex.stackexchange.com/a/56541/161015

演示结构

前任

Beamer 框架 #2 使用\tableofcontents

b2

Beamer 框架 #4,tikz 图形

b4

文章模式,目录

a2

文章模式,内容

a3

% !TeX TS-program = pdflatex

\documentclass{beamer} %Un-comment to produce a presentation

%\documentclass{article} %Comment  to produce a presentation
%\usepackage{beamerarticle} %Comment to produce a presentation

\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern}

\usepackage{tikz}
\usepackage{graphicx} % for logo

\usetheme{Madrid}
\usecolortheme{beaver}

\renewcommand{\contentsname}{} % use the frame name

\begin{document}
    
    \author{The author name}
    \title{F1 Beamer template}
    \logo{\includegraphics[height=0.8cm]{example-grid-100x100pt}}
%   \setbeamertemplate{navigation symbols}{} % hide navigation symbols

    \begin{frame}[plain] % cover F1
        \maketitle
        \newpage % works only in  article mode
    \end{frame}
    
\begin{frame}
    \frametitle{F2 Overview} % Table of contents slide
    \tableofcontents % Throughout your presentation, if you choose to use \section{} and \subsection{} commands, these will automatically be printed on this slide as an overview of your presentation
    \newpage % works only in  article mode
\end{frame}

\section{Section 1} 

\begin{frame}{F3 in Section 1}
    \bigskip% for article mode
    As any dedicated reader can clearly see, the Ideal of
    practical reason is a representation of, as far as I know, the things
    in themselves; as I have shown elsewhere, the phenomena should only be
    used as a canon for our understanding.
    
\end{frame} 

\subsection{Description}

\begin{frame}{F4 Connections}
    \centering
    \bigskip% for article mode
\begin{tikzpicture}[
    dot/.style={circle,fill, inner sep=1.5pt, outer sep=0pt},
    every label/.style={inner sep=0pt}] 
    \newdimen\R \R=1cm  
    \foreach \i [count=\j] in { 1,2,3,4,5,6}
    {\node (n\j) [dot, label=60*\j:$\i$] at (60*\j:\R) {};
        \draw[blue,thick]  (0,0) -- (n\j);
    }   
    {\foreach \i in {1,2,...,6}
        \foreach \j in {\i,...,6}
        \draw (n\i) -- (n\j);
    }
\end{tikzpicture}
\end{frame}

\section{Section 2}

\mode<presentation>{ % % Only shown in presentation,
\begin{frame}{F5 in Section 2}  
    Shown only in mode presentation.
\end{frame} 
}

\begin{frame}{F6 in Section 2}  
    \bigskip % for article mode
     As I have shown elsewhere, Aristotle tells
    us that the objects in space and time, in the full sense of these
    terms, would be falsified.  
\end{frame}     

\end{document}

相关内容