在我的投影仪海报中,我喜欢为图像添加标题,并以书面形式进行交叉引用,就像我的论文一样(“图 2.1:文本” 像这样)
。
但是当我使用下面的代码时,我发现(“图:文本”像这样)
并在交叉引用位置显示“图 1”。 -我喜欢将标题写成“图 A:文本”,并在交叉引用中写成“(图 A)”。可以这样做吗?
\documentclass[final, 12pt]{beamer}
\usepackage[size=custom,width=120,height=120,scale=1.7,orientation=portrait]{beamerposter}
\usepackage[english]{babel}
\usepackage{graphicx}
\usepackage{wrapfig,color,pgf}
\usepackage{array,booktabs,tabularx,amsthm,multirow,amsmath}
\usepackage[absolute,overlay]{textpos}
\usepackage{fancybox}
\usepackage{mdframed}
\usepackage{tikz}
\usepackage{pifont}
\usepackage{multicol}
\usepackage{listings}
\newenvironment<>{varblock}[2][\textwidth]{%
\setlength{\textwidth}{#1}
\begin{actionenv}#3%
\def\insertblocktitle{ \centering#2\par}%
\par%
\usebeamertemplate{block begin}}
{\par%
\usebeamertemplate{block end}%
\end{actionenv}}
\begin{document}
\begin{frame}
\begin{textblock}{}(0.2,6.2)%
\begin{varblock}[57cm]{}
\begin{figure}
\includegraphics{Figure/LB.jpg}
\caption{TExt}
\label{LB}
\end{figure}
\end{varblock}
\end{textblock}
\begin{textblock}{}(4.15,8.7)%
\begin{varblock}[28cm]{\textbf{Location B}}
\ref{LB} shows...
\end{varblock}
\end{textblock}
\end{frame}
\end{document}
答案1
设置caption
模板的编号,然后您就可以交叉引用您的图形:
\setbeamertemplate{caption}[numbered]
您的代码:
\documentclass[final, 12pt]{beamer}
\usepackage[size=custom,width=120,height=120,scale=1.7,orientation=portrait]{beamerposter}
\usepackage[english]{babel}
\usepackage{graphicx}
\usepackage{wrapfig,color,pgf}
\usepackage{array,booktabs,tabularx,amsthm,multirow,amsmath}
\usepackage[absolute,overlay]{textpos}
\usepackage{fancybox}
\usepackage{mdframed}
\usepackage{tikz}
\usepackage{pifont}
\usepackage{multicol}
\usepackage{listings}
\setbeamertemplate{caption}[numbered]
\newenvironment<>{varblock}[2][\textwidth]{%
\setlength{\textwidth}{#1}
\begin{actionenv}#3%
\def\insertblocktitle{ \centering#2\par}%
\par%
\usebeamertemplate{block begin}}
{\par%
\usebeamertemplate{block end}%
\end{actionenv}}
\begin{document}
\begin{frame}
\begin{textblock}{}(0.2,6.2)%
\begin{varblock}[57cm]{}
\begin{figure}
\includegraphics{Figure/LB.jpg}
\caption{TExt}
\label{LB}
\end{figure}
\end{varblock}
\end{textblock}
\begin{textblock}{}(4.15,8.7)%
\begin{varblock}[28cm]{\textbf{Location B}}
Figure~\ref{LB} shows...
\end{varblock}
\end{textblock}
\end{frame}
\end{document}