无法更改图像大小,它没有出现在源代码中

无法更改图像大小,它没有出现在源代码中

我从这里下载了一个海报模板关联(得到.zip)。在使用 TeXmaker 时,我想更改徽标图像。据我所知,原始徽标可通过以下方式访问:

\graphicspath{{figures/}} % Location of the graphics files

我找不到包含 PDF 徽标的命令。但是,我在指示的文件夹中替换了我想要的徽标,得到了无法更改的图像大小。

我如何从源代码更改图像?

答案1

好吧,在文件中beamerthemeI6pd2.sty您可以找到 的定义\setbeamertemplate{headline}。在其中您可以找到需要更改的命令\includegraphics[width=.95\linewidth]{logo.png},例如更改为。我在那里使用了您需要安装但不必加载的包中的\includegraphics[width=5cm]{example-image.png}图像图片...example-image.pngMWE

使用以下 MWE

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Dreuw & Deselaer's Poster
% LaTeX Template
% Version 1.0 (11/04/13)
%
% Created by:
% Philippe Dreuw and Thomas Deselaers
% http://www-i6.informatik.rwth-aachen.de/~dreuw/latexbeamerposter.php
%
% This template has been downloaded from:
% http://www.LaTeXTemplates.com
%
% License:
% CC BY-NC-SA 3.0 (http://creativecommons.org/licenses/by-nc-sa/3.0/)
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%----------------------------------------------------------------------------------------
%   PACKAGES AND OTHER DOCUMENT CONFIGURATIONS
%----------------------------------------------------------------------------------------

\documentclass[final,hyperref={pdfpagelabels=false}]{beamer}

\usepackage[orientation=portrait,size=a0,scale=1.4]{beamerposter} % Use the beamerposter package for laying out the poster with a portrait orientation and an a0 paper size

\usetheme{I6pd2} % Use the I6pd2 theme supplied with this template

\usepackage[english]{babel} % English language/hyphenation

\usepackage{amsmath,amsthm,amssymb,latexsym} % For including math equations, theorems, symbols, etc

%\usepackage{times}\usefonttheme{professionalfonts}  % Uncomment to use Times as the main font
%\usefonttheme[onlymath]{serif} % Uncomment to use a Serif font within math environments

\boldmath % Use bold for everything within the math environment

\usepackage{booktabs} % Top and bottom rules for tables

\graphicspath{{figures/}} % Location of the graphics files

\usecaptiontemplate{\small\structure{\insertcaptionname~\insertcaptionnumber: }\insertcaption} % A fix for figure numbering


\setbeamertemplate{headline}{  
  \leavevmode

  \begin{beamercolorbox}[wd=\paperwidth]{headline}
    \begin{columns}[T]
      \begin{column}{.02\paperwidth}
      \end{column}
      \begin{column}{.7\paperwidth}
        \vskip4ex
        \raggedleft
        \usebeamercolor{title in headline}{\color{fg}\textbf{\LARGE{\inserttitle}}\\[1ex]}
        \usebeamercolor{author in headline}{\color{fg}\large{\insertauthor}\\[1ex]}
        \usebeamercolor{institute in headline}{\color{fg}\large{\insertinstitute}\\[1ex]}     
      \end{column}
      \begin{column}{.25\paperwidth}
        \vskip8ex
        \begin{center}
%         \includegraphics[width=.95\linewidth]{logo.png}
          \includegraphics[width=5cm]{example-image.png} % <=============================
        \end{center}
        \vskip2ex
      \end{column}
      \begin{column}{.02\paperwidth}
      \end{column}
    \end{columns}
    \vskip2ex
  \end{beamercolorbox}

  \begin{beamercolorbox}[wd=\paperwidth]{lower separation line head}
    \rule{0pt}{3pt}
  \end{beamercolorbox}
}



%----------------------------------------------------------------------------------------
%   TITLE SECTION 
%----------------------------------------------------------------------------------------

\title{\huge Unnecessarily Complicated Research Title} % Poster title

\author{John Smith, James Smith and Jane Smith} % Author(s)

\institute{Department and University Name} % Institution(s)

%----------------------------------------------------------------------------------------
%   FOOTER TEXT
%----------------------------------------------------------------------------------------

\newcommand{\leftfoot}{http://www.LaTeXTemplates.com} % Left footer text

\newcommand{\rightfoot}{[email protected]} % Right footer text

%----------------------------------------------------------------------------------------

\begin{document}

\addtobeamertemplate{block end}{}{\vspace*{2ex}} % White space under blocks

\begin{frame}[t] % The whole poster is enclosed in one beamer frame

\begin{columns}[t] % The whole poster consists of two major columns, each of which can be subdivided further with another \begin{columns} block - the [t] argument aligns each column's content to the top

\begin{column}{.02\textwidth}\end{column} % Empty spacer column

\begin{column}{.465\textwidth} % The first column

%----------------------------------------------------------------------------------------
%   OBJECTIVES
%----------------------------------------------------------------------------------------

\begin{block}{Objectives}

\begin{enumerate}
\item Donec fringilla, velit id lobortis commodo, eros dui consectetur mi, ut interdum lorem dui sed mauris.
\item Nulla ac nulla rhoncus est bibendum ullamcorper:
\item Quisque vestibulum, nisl sit amet gravida ultricies dis parturient montes, nascetur ridiculus musobortis commodo, eros dui consectetur mi.
\end{enumerate}

\end{block}

%----------------------------------------------------------------------------------------
%   INTRODUCTION
%----------------------------------------------------------------------------------------

\begin{block}{Introduction}

\begin{itemize}
\item Donec fringilla, velit id lobortis commodo, eros dui consectetur mi, ut interdum lorem dui sed mauris. Duis id sem nunc, a pharetra odio. Phasellus posuere \alert{semper massa}, id bibendum ligula tristique at. Integer sit amet vulputate turpis. Sed erat lacus, faucibus at viverra et, mattis nec sem. Cras faucibus \alert{scelerisque} cursus. Opet volutpat ligula. Duis semper lorem eget dui dignissim porttitor. Nulla facilisi. In ullamcorper lorem quis dolor iaculis nec egestas enim ultricies. Cras ut mauris elit, ut lacinia dui. Proin in ante et libero hendrerit iaculis. Nulla eu erat a urna laoreet auctor id a turpis. Nam mollis tristique neque eu luctus. Suspendisse rutrum congue nisi sed convallis. Aenean id neque dolor.
\end{itemize}

\end{block}

%----------------------------------------------------------------------------------------
%   MATERIALS
%----------------------------------------------------------------------------------------

\begin{block}{Materials}

\begin{columns} % Subdivide the first main column
\begin{column}{.54\textwidth} % The first subdivided column within the first main column
\begin{itemize}
\item Vestibulum nisl, quis euismod velit eros in ligula.
\begin{itemize}
\item Cras rhoncus quam et augue convallis in elementum urna tincidunt.
\end{itemize}
\item Proin ut vestibulum augue.
\begin{itemize}
\item Donec dapibus sagittis neque eu ultrices.
\end{itemize}
\end{itemize}
\end{column}

\begin{column}{.43\textwidth} % The second subdivided column within the first main column
\centering
\begin{figure}
\includegraphics[width=0.8\linewidth]{placeholder.jpg}
\caption{Figure caption}
\end{figure}
\end{column}
\end{columns} % End of the subdivision

\begin{itemize}
\item Curabitur sapien ligula, faucibus in feugiat quis, vestibulum a turpis.
\begin{itemize}
\item Phasellus quis nunc neque. Suspendisse mauris diam, suscipit non gravida in, placerat id enim. Ut nec ipsum in lectus ultrices sagittis.
\item Ut nec ipsum in lectus ultrices sagittis.
\item Phasellus quis nunc neque.
\end{itemize}
\end{itemize}

\end{block}

%----------------------------------------------------------------------------------------
%   METHODS
%----------------------------------------------------------------------------------------

\begin{block}{Methods}

\begin{itemize}
\item Maecenas Vel Nisl Elit
\begin{itemize}
\item Suspendisse potenti. Fusce a est eget turpis rhoncus varius sed sed dui. Cras justo nibh, bibendum a cursus eget, consequat et dui. Maecenas vel nisl elit, sed dignissim dolor. 
\item In hac habitasse platea dictumst.
\end{itemize}

\item Viewpoint Matching Constraints
\begin{itemize}
\item Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. 
\item Proin in nisi diam.
\item Nam ultricies pellentesque nunc, ultrices volutpat nisl ultrices a.
\end{itemize}

\item Volutpat 
\begin{itemize}
\item Duis semper lorem eget dui dignissim porttitor.
\item Nulla facilisi. In ullamcorper lorem quis dolor.
\end{itemize}
\end{itemize}

\end{block}

%----------------------------------------------------------------------------------------
%   MATHEMATICAL SECTION
%----------------------------------------------------------------------------------------

\begin{block}{Mathematical Section}

\begin{itemize}
\item Maecenas Ultricies Feugiat Velit Non Mattis.
\begin{itemize}
\item Duis ante erat, bibendum nec tempus nec, interdum quis est. Nulla at mollis tortor. Phasellus quis leo dolor, aliquam laoreet orci $X$ Donec dapibus sagittis neque eu nec, interdum quis est. $Y_n, n=1,\cdots,N$ ndum nec tempus nec, interd
\begin{align*}
X \rightarrow r(X) & = \arg \max_{c} \Big\{ \max_n \big\{ \sum_{x_i \in X} \delta(x_i,Y_{n,c})\big\} \Big\} 
\end{align*}
\item Cras faucibus scelerisque cursus. Proin ut vestibulum augue. $\delta(x_i,Y_{n,c})$
\end{itemize}
\item Fusce tempus arcu id ligula varius dictum. Donec ut nisl dui, ac consectetur elit. In nec enim porta augue venenatis sollicitudin. Phasellus quis nunc neque. Suspendisse mauris diam, suscipit non gravida in, placerat id enim. Ut nec ipsum in lectus ultrices sagittis.
\end{itemize}

\end{block}

%----------------------------------------------------------------------------------------

\end{column} % End of the first column

\begin{column}{.03\textwidth}\end{column} % Empty spacer column

\begin{column}{.465\textwidth} % The second column

%----------------------------------------------------------------------------------------
%   RESULTS
%----------------------------------------------------------------------------------------

\begin{block}{Results: Table}

\begin{itemize}
\item Ased Aliquet Luctus Lectus
\end{itemize}

\begin{table}
\begin{tabular}{l l l}
\toprule
\textbf{Treatments} & \textbf{Response 1} & \textbf{Response 2}\\
\midrule
Treatment 1 & 0.0003262 & 0.562 \\
Treatment 2 & 0.0015681 & 0.910 \\
Treatment 3 & 0.0009271 & 0.296 \\
\bottomrule
\end{tabular}
\caption{Table caption}
\end{table}

\begin{itemize}
\item Sollicitudin Vel Orci
\item Maecenas Ultricies Feugiat Velit Non Mattis.
\end{itemize}

\begin{table}
\begin{tabular}{l l l}
\toprule
\textbf{Treatments} & \textbf{Response 1} & \textbf{Response 2}\\
\midrule
Treatment 1 & 0.0003262 & 0.562 \\
Treatment 2 & 0.0015681 & 0.910 \\
Treatment 3 & 0.0009271 & 0.296 \\
\bottomrule
\end{tabular}
\caption{Table caption}
\end{table}

\end{block}

%------------------------------------------------

\begin{block}{Results: Figure}

\begin{figure}
\includegraphics[width=0.8\linewidth]{placeholder.jpg}
\caption{Figure caption}
\end{figure}

\end{block}

%----------------------------------------------------------------------------------------
%   CONCLUSION
%----------------------------------------------------------------------------------------

\begin{block}{Conclusion}

\begin{itemize}
\item Opet volutpat ligula. Duis semper lorem eget dui dignissim porttitor. Nulla facilisi. In ullamcorper lorem quis dolor iaculis nec egestas enim ultricies. Cras ut mauris elit, ut lacinia dui. Proin in ante et libero hendrerit iaculis.
\item Nulla eu erat a urna laoreet auctor id a turpis. Nam mollis tristique neque eu luctus. Suspendisse rutrum congue nisi sed convallis. 
\item Aenean id neque dolor.
\item Opet volutpat ligula. Duis semper lorem eget dui dignissim porttitor. Nulla facilisi. In ullamcorper lorem quis dolor iaculis nec egestas enim ultricies. Cras ut mauris elit, ut lacinia dui. Proin in ante et libero hendrerit iaculis.
\end{itemize}

\end{block}

%----------------------------------------------------------------------------------------
%   REFERENCES
%----------------------------------------------------------------------------------------

\begin{block}{References}

\nocite{*} % Insert publications even if they are not cited in the poster
\small{\bibliographystyle{unsrt}
\bibliography{sample}}

\end{block}

%----------------------------------------------------------------------------------------
%   ACKNOWLEDGEMENTS
%----------------------------------------------------------------------------------------

\begin{block}{Acknowledgments}

\begin{itemize}
\item Nam mollis tristique neque eu luctus. Suspendisse rutrum congue nisi sed convallis. Aenean id neque dolor. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.
\end{itemize}

\end{block}

%----------------------------------------------------------------------------------------
%   CONTACT INFORMATION
%----------------------------------------------------------------------------------------

\setbeamercolor{block title}{fg=black,bg=orange!70} % Change the block title color

\begin{block}{Contact Information}

\begin{itemize}
\item Web: \href{http://www.university.edu/smithlab}{http://www.university.edu/smithlab}
\item Email: \href{mailto:[email protected]}{[email protected]}
\item Phone: +1 (000) 111 1111
\end{itemize}

\end{block}

%----------------------------------------------------------------------------------------

\end{column} % End of the second column

\begin{column}{.015\textwidth}\end{column} % Empty spacer column

\end{columns} % End of all the columns in the poster

\end{frame} % End of the enclosing frame

\end{document}

你得到了你想要的改变的结果:

在此处输入图片描述

根据您的需要更改图像的名称和宽度...

答案2

解释模板——哪些命令做什么?

  1. \graphicspath{{figures/}} % Location of the graphics files不是访问徽标的命令。相反,它是指定要访问哪个文件夹的命令在看找到您想要包含的图像。
  2. 模板中没有明确访问徽标的命令。据我所知,这是软件包的一部分beamerposter,因此您必须从外部编辑徽标尺寸。

一般来说 - 如何包含图像/更改图像大小?

\includegraphics[scale = 1.2]{figures/logoname.extension}

或者

\includegraphics[width = 0.4\textwidth]{figures/logoname.extension}

重要提示:如果包含以下行,这些命令将不起作用

\graphicspath{{figures/}}

我使用的命令更为通用;它们允许您精确指定要查看的源文件夹。为了清楚说明我为什么这样做,假设您有以下文件夹结构:

  1. 父文件夹(这是您保存 .tex 文件的地方)
    • 子文件夹 1(称为figures- 这是您保存一般图像的地方)
    • 子文件夹 2(称为logos- 这是您保存一般徽标的地方)

如果将图形路径设置为figures,则将无法访问logos文件夹中的文件,除非将logos文件夹移入 文件夹中figures。与其处理这个问题,不如采用我的建议(包括使用 时文件夹的路径\includegraphics),这样您就可以指定它。

如果我误解了您的问题,请原谅。

相关内容