前缀“图”并给出图的引用

前缀“图”并给出图的引用

为包含的图像添加标题时,是否可以调整前缀 Figure 的字体大小?此外,是否可以不使用标题以有意义的方式引用图片;我试过了,但没有数字归属于图片,我得到的是两个 ??。顺便说一下,我正在使用 \hypcap 包。

谢谢

梅威瑟:

\documentclass{beamer}

\mode<presentation> {
}
\makeatletter
\let\insertsupervisor\relax
\newcommand\supervisortitle{Supervisor}
\mode<all>
{
    \newcommand\supervisor[1]{\def\insertsupervisor{#1}}
    \titlegraphic{}
}
\defbeamertemplate*{title page}{supdefault}[1][]
{
    \vbox{}
    \vfill
    \begingroup
    \centering
    \begin{beamercolorbox}[sep=8pt,center,#1]{title}
        \usebeamerfont{title}\inserttitle\par%
        \ifx\insertsubtitle\@empty\relax%
        \else%
        \vskip0.25em%
        {\usebeamerfont{subtitle}\usebeamercolor[fg]{subtitle}\insertsubtitle\par}%
        \fi%     
    \end{beamercolorbox}%
    \vskip1em\par
    \begin{beamercolorbox}[sep=8pt,center,#1]{author}
        \usebeamerfont{author}\insertauthor
    \end{beamercolorbox}
    \ifx\insertsupervisor\relax\relax\else
    \begin{beamercolorbox}[sep=8pt,center,#1]{author}
        \usebeamerfont{author}\supervisortitle:~\insertsupervisor
    \end{beamercolorbox}\fi
    \begin{beamercolorbox}[sep=8pt,center,#1]{institute}
        \usebeamerfont{institute}\insertinstitute
    \end{beamercolorbox}
    \begin{beamercolorbox}[sep=8pt,center,#1]{date}
        \usebeamerfont{date}\insertdate
    \end{beamercolorbox}\vskip0.5em
    {\usebeamercolor[fg]{titlegraphic}\inserttitlegraphic\par}
    \endgroup
    \vfill
}
\setbeamertemplate{title page}[supdefault][colsep=-4bp,rounded=true,shadow=\beamer@themerounded@shadow]\makeatother

\usepackage{graphicx} % Allows including images
\usepackage{booktabs} % Allows the use of \toprule, \midrule and \bottomrule in tables
\usepackage[utf8]{inputenc}
\usepackage{color}
\usepackage{hyperref}
\usepackage{siunitx}
\usepackage{hypcap}
\usepackage{amsmath}
\usepackage{pgf}
\usepackage[font={scriptsize}]{caption}
\usetheme{CambridgeUS}
\usecolortheme{seagull}
\setbeamertemplate{bibliography item}[text]
\begin{document}
\begin{frame}
    \frametitle{Cooling power measurements}
    \begin{columns}[c]
        \column{.5\textwidth}
        \begin{figure}
            \vspace{-.5cm}
            \includegraphics[width=.9\linewidth]{fig5a.png}\label{fig:5a}
        \end{figure}
        \footnotesize
        \begin{enumerate}
            \item He-Rb mixture with 200 bar He
            \item About 5 mW of cooling power
        \end{enumerate}
        \column{.5\textwidth}
        \begin{figure}
            \vspace{-.5cm}
            \includegraphics[width=.9\linewidth]{fig5b.png}\label{fig:5b}
        \end{figure}
        \footnotesize
        \begin{enumerate}
            \item Ar-Rb mixture with 230 bar Ar
            \item Order of magnitude larger CP
        \end{enumerate}
    \end{columns}
    \footnotesize
    \begin{itemize}
        \centering
        \item Expected cooling power red crosses
        \item Observed deflection angle blue crosses
    \end{itemize}
\end{frame}
\begin{frame}
    \frametitle{Temperature Gradient}
    \footnotesize
    Using a heat transfer model \cite{24}, after a cooling time $t$, the expected temperature gradient profile is:
    \begin{equation}
        \frac{dT}{dr}=-\frac{P_{cool}}{2\pi \kappa}\frac{e^{-\alpha z}}{r}\left[ \exp\left(\frac{2r^2}{\omega^2}\right)-\exp\left(\frac{2r^2}{\omega^2-8Dt}\right)\right]
    \end{equation}
    \begin{description}
        \item[Cooling]Probe beam deflected towards the cooling beam\ref{fig:5a}
        \item[Heating]Probe beam deflected away from the cooling beam\ref{fig:5b}
    \end{description}
\end{frame}
\end{document} 

答案1

在演示文稿中用数字编号或引用的图表有些奇怪,因为观众无法像在文章中那样翻阅它。但是,有些演示文稿可能会分发给观众(例如在课堂环境中,学生可以通过讲师下载演示文稿)。

这里有一个选项,使用\figcaption[*][<opt>]{<text>}可在文本中显示带有标题<text>(和前缀;带星号的版本会删除前缀)的图形标题。此外,[<opt>]还可用于调整参考文献的命名方式。以下 MWE 中的参考文献应解释可能的用法:

在此处输入图片描述

\documentclass{beamer}
\let\Tiny\tiny% http://tex.stackexchange.com/q/58087/5764
\usepackage{xparse}
\makeatletter
\NewDocumentCommand{\figcaption}{s o m}{%
  \par\IfBooleanF{#1}{\refstepcounter{figure}}% Step figure counter
  {\footnotesize\IfBooleanF{#1}{\alert{Figure~\thefigure}: }#3\par}%
  \xdef\@currentlabelname{\IfNoValueTF{#2}{#3}{#2}}%
}
\makeatother

\mode<presentation> {
}
\makeatletter
\let\insertsupervisor\relax
\newcommand\supervisortitle{Supervisor}
\mode<all>
{
    \newcommand\supervisor[1]{\def\insertsupervisor{#1}}
    \titlegraphic{}
}
\defbeamertemplate*{title page}{supdefault}[1][]
{
    \vbox{}
    \vfill
    \begingroup
    \centering
    \begin{beamercolorbox}[sep=8pt,center,#1]{title}
        \usebeamerfont{title}\inserttitle\par%
        \ifx\insertsubtitle\@empty\relax%
        \else%
        \vskip0.25em%
        {\usebeamerfont{subtitle}\usebeamercolor[fg]{subtitle}\insertsubtitle\par}%
        \fi%     
    \end{beamercolorbox}%
    \vskip1em\par
    \begin{beamercolorbox}[sep=8pt,center,#1]{author}
        \usebeamerfont{author}\insertauthor
    \end{beamercolorbox}
    \ifx\insertsupervisor\relax\relax\else
    \begin{beamercolorbox}[sep=8pt,center,#1]{author}
        \usebeamerfont{author}\supervisortitle:~\insertsupervisor
    \end{beamercolorbox}\fi
    \begin{beamercolorbox}[sep=8pt,center,#1]{institute}
        \usebeamerfont{institute}\insertinstitute
    \end{beamercolorbox}
    \begin{beamercolorbox}[sep=8pt,center,#1]{date}
        \usebeamerfont{date}\insertdate
    \end{beamercolorbox}\vskip0.5em
    {\usebeamercolor[fg]{titlegraphic}\inserttitlegraphic\par}
    \endgroup
    \vfill
}
\setbeamertemplate{title page}[supdefault][colsep=-4bp,rounded=true,shadow=\beamer@themerounded@shadow]
\makeatother

\usepackage{graphicx} % Allows including images
\usepackage{booktabs} % Allows the use of \toprule, \midrule and \bottomrule in tables
\usepackage[utf8]{inputenc}
\usepackage{xcolor,amsmath,pgf,siunitx}
\usepackage{hyperref}
\usepackage{hypcap}
\usetheme{CambridgeUS}
\usecolortheme{seagull}
\setbeamertemplate{bibliography item}[text]
\begin{document}
\begin{frame}
    \frametitle{Cooling power measurements}
    \begin{columns}[c]
        \column{.5\textwidth}
        \begin{figure}
            \vspace{-.5cm}
            \includegraphics[width=.9\linewidth]{example-image-a}
            \figcaption{ABC}\label{fig:5a}
        \end{figure}
        \footnotesize
        \begin{enumerate}
            \item He-Rb mixture with 200 bar He
            \item About 5 mW of cooling power
        \end{enumerate}
        \column{.5\textwidth}
        \begin{figure}
            \vspace{-.5cm}
            \includegraphics[width=.9\linewidth]{example-image-b}
            \figcaption*{BCD}\label{fig:5b}
        \end{figure}
        \footnotesize
        \begin{enumerate}
            \item Ar-Rb mixture with 230 bar Ar
            \item Order of magnitude larger CP
        \end{enumerate}
    \end{columns}
    \footnotesize
    \begin{itemize}
        \centering
        \item Expected cooling power red crosses
        \item Observed deflection angle blue crosses
    \end{itemize}
\end{frame}
\begin{frame}
    \frametitle{Temperature Gradient}
    \footnotesize
    Using a heat transfer model \cite{24}, after a cooling time $t$, the expected temperature gradient profile is:
    \begin{equation}
        \frac{dT}{dr}=-\frac{P_{cool}}{2\pi \kappa}\frac{e^{-\alpha z}}{r}\left[ \exp\left(\frac{2r^2}{\omega^2}\right)-\exp\left(\frac{2r^2}{\omega^2-8Dt}\right)\right]
    \end{equation}
    \begin{description}
        \item[Cooling]Probe beam deflected towards the cooling beam (see Figure~\ref{fig:5a})
        \item[Heating]Probe beam deflected away from the cooling beam (see \hyperlink{fig:5b}{\nameref{fig:5b}})
    \end{description}
\end{frame}
\end{document}

相关内容