我无法使图片照片发生变化。我正在使用 Texmaker 和 QuickBuild 或 pdflatex 选项。事实上,可以写这行代码:
\includegraphics[width=1in,scale=0.1]{logo.jpg}
或者这个:
\includegraphics[width=1in,scale=1]{logo.jpg}
这没什么区别。
这是我从中复制的全部源代码 Overleaf 上的 Vel Gayevskiy 和 Brian Moses 模板。我刚刚把标志改成了我自己大学的标志:
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Professional Formal Letter
% LaTeX Template
% Version 1.0 (28/12/13)
%
% This template has been downloaded from:
% http://www.LaTeXTemplates.com
%
% Original author:
% Brian Moses (http://www.ms.uky.edu/~math/Resources/Templates/LaTeX/)
% with extensive modifications by Vel ([email protected])
%
% License:
% CC BY-NC-SA 3.0 (http://creativecommons.org/licenses/by-nc-sa/3.0/)
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%----------------------------------------------------------------------------------------
% PACKAGES AND OTHER DOCUMENT CONFIGURATIONS
%----------------------------------------------------------------------------------------
\documentclass[11pt,a4paper]{letter} % Specify the font size (10pt, 11pt and 12pt) and paper size (letterpaper, a4paper, etc)
\usepackage{graphicx} % Required for including pictures
\usepackage{microtype} % Improves typography
%\usepackage{gfsdidot} % Use the GFS Didot font: http://www.tug.dk/FontCatalogue/gfsdidot/
\usepackage[T1]{fontenc}
\usepackage{lmodern}
% Create a new command for the horizontal rule in the document which allows thickness specification
\makeatletter
\def\vhrulefill#1{\leavevmode\leaders\hrule\@height#1\hfill \kern\z@}
\makeatother
%----------------------------------------------------------------------------------------
% DOCUMENT MARGINS
%----------------------------------------------------------------------------------------
\textwidth 6.75in
\textheight 9.25in
\oddsidemargin -.25in
\evensidemargin -.25in
\topmargin -1in
\longindentation 0.50\textwidth
\parindent 0.4in
%----------------------------------------------------------------------------------------
% SENDER INFORMATION
%----------------------------------------------------------------------------------------
\def\Who{John Smith} % Your name
\def\What{, PhD} % Your title
\def\Where{Department of Mathematics} % Your department/institution
\def\Address{123 Broadway} % Your address
\def\CityZip{Berkeley CA 12345} % Your city, zip code, country, etc
\def\Email{E-mail: [email protected]} % Your email address
\def\TEL{Phone: (000) 111-1111} % Your phone number
\def\URL{URL: http://www.johnsmith.com} % Your URL
%----------------------------------------------------------------------------------------
% HEADER AND FROM ADDRESS STRUCTURE
%----------------------------------------------------------------------------------------
\address{
\includegraphics[width=1in,scale=0.1]{logo.jpg}
%\includegraphics[width=0.3\textwidth,natwidth=610,natheight=642]{logo.jpg} % Include the logo of your institution
\vspace{1cm}
\hspace{5.1in} % Position of the institution logo, increase to move left, decrease to move right
\vskip -1.07in~\\ % Position of the text in relation to the institution logo, increase to move down, decrease to move up
\Large\hspace{1.5in}UNIVERSITE \hfill ~\\[0.05in] % First line of institution name, adjust hspace if your logo is wide
\hspace{1.5in}PARIS DAUPHINE \hfill \normalsize % Second line of institution name, adjust hspace if your logo is wide
\makebox[0ex][r]{\bf \Who \What }\hspace{0.08in} % Print your name and title with a little whitespace to the right
~\\[-0.11in] % Reduce the whitespace above the horizontal rule
\hspace{1.5in}\vhrulefill{1pt} \\ % Horizontal rule, adjust hspace if your logo is wide and \vhrulefill for the thickness of the rule
\hspace{\fill}\parbox[t]{2.85in}{ % Create a box for your details underneath the horizontal rule on the right
\footnotesize % Use a smaller font size for the details
\Who \\ \em % Your name, all text after this will be italicized
\Where\\ % Your department
\Address\\ % Your address
\CityZip\\ % Your city and zip code
\TEL\\ % Your phone number
\Email\\ % Your email address
\URL % Your URL
}
\hspace{-1.4in} % Horizontal position of this block, increase to move left, decrease to move right
\vspace{-1in} % Move the letter content up for a more compact look
}
%----------------------------------------------------------------------------------------
% TO ADDRESS STRUCTURE
%----------------------------------------------------------------------------------------
\def\opening#1{\thispagestyle{empty}
{\centering\fromaddress \vspace{0.6in} \\ % Print the header and from address here, add whitespace to move date down
\hspace*{\longindentation}\today\hspace*{\fill}\par} % Print today's date, remove \today to not display it
{\raggedright \toname \\ \toaddress \par} % Print the to name and address
\vspace{0.4in} % White space after the to address
\noindent #1 % Print the opening line
% Uncomment the 4 lines below to print a footnote with custom text
%\def\thefootnote{}
%\def\footnoterule{\hrule}
%\footnotetext{\hspace*{\fill}{\footnotesize\em Footnote text}}
%\def\thefootnote{\arabic{footnote}}
}
%----------------------------------------------------------------------------------------
% SIGNATURE STRUCTURE
%----------------------------------------------------------------------------------------
\signature{\Who \What} % The signature is a combination of your name and title
\long\def\closing#1{
\vspace{0.1in} % Some whitespace after the letter content and before the signature
\noindent % Stop paragraph indentation
\hspace*{\longindentation} % Move the signature right
\parbox{\indentedwidth}{\raggedright
#1 % Print the signature text
\vskip 0.65in % Whitespace between the signature text and your name
\fromsig}} % Print your name and title
%----------------------------------------------------------------------------------------
\begin{document}
%----------------------------------------------------------------------------------------
% TO ADDRESS
%----------------------------------------------------------------------------------------
\begin{letter}
{Prof. Jones\\
Mathematics Search Committee\\
Department of Mathematics\\
University of California\\
Berkeley, California 12345\\
}
%----------------------------------------------------------------------------------------
% LETTER CONTENT
%----------------------------------------------------------------------------------------
\opening{Dear Sir or Madam,}
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent a nisi diam. Morbi consequat facilisis mi, sit amet laoreet velit aliquet quis. Sed a nisi vel augue ultricies blandit. Phasellus et congue dolor, at cursus dui. Integer quis faucibus metus. Vestibulum lobortis ligula in lectus pretium, in placerat lacus iaculis. Mauris nibh erat, condimentum at tortor at, sagittis viverra tortor. Vivamus posuere fermentum eros, rhoncus sagittis nisi imperdiet ac.
Pellentesque hendrerit neque quis quam fringilla, vitae vulputate quam bibendum. Fusce in hendrerit mauris. Mauris pretium libero eget convallis mattis. Vivamus nec nisi imperdiet, lacinia diam id, facilisis nulla. Vivamus eleifend augue ut libero tincidunt commodo. Vivamus sodales in lacus vitae dictum. Nam et semper felis. Integer scelerisque accumsan condimentum. Aliquam laoreet erat vitae ornare consequat. Donec enim lacus, rutrum ut dui a, pretium mattis dui. Vivamus vulputate arcu nec congue convallis. Suspendisse faucibus turpis ac neque gravida, vel aliquet mauris tristique. In auctor fringilla nunc, sit amet tristique diam semper ac. Cras egestas nisi eu turpis facilisis, ac scelerisque elit lacinia. Sed eget adipiscing enim. Ut pulvinar ultrices purus ac eleifend.
Proin nunc erat, vestibulum quis tincidunt sit amet, cursus et libero. Aliquam erat volutpat. Sed vel malesuada velit. Vivamus risus arcu, facilisis non mauris sed, interdum varius tellus. Vivamus aliquam vel sapien quis ultricies. Mauris venenatis risus enim, in dapibus quam volutpat in. Vivamus iaculis sapien sit amet massa vehicula, tempus facilisis nulla adipiscing. Mauris ullamcorper pharetra libero, quis sodales dolor blandit et. Donec convallis risus id euismod pharetra. Suspendisse placerat laoreet imperdiet. Praesent malesuada fringilla urna, non sollicitudin erat. Nullam arcu neque, lobortis nec facilisis at, scelerisque ac erat. Nunc quis tincidunt lorem, vitae laoreet enim.
\closing{Sincerely,}
%----------------------------------------------------------------------------------------
\end{letter}
\end{document}
答案1
不要同时指定scale
和width
,其中一个参数就足以调整尺寸。
正如您在以下示例中看到的,如果您随后指定宽度,则更改比例将不会产生任何效果:
\documentclass{article}
\usepackage{graphicx}
\begin{document}
\includegraphics[scale=1, width=2cm]{example-image}
\includegraphics[scale=2, width=2cm]{example-image}
\includegraphics[width=2cm]{example-image}
\includegraphics[width=4cm]{example-image}
\includegraphics[scale=0.285]{example-image}
\end{document}