I have the following problem: I want to attach a photo in my resume on the right top. If I not use a scale argument, the file compiles but the photo is to large. However using a scale argument leads to an error:
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% NOTE: If you find that it says %%
%% %%
%% 1 of ?? %%
%% %%
%% at the bottom of your first page, this means that the AUX file %%
%% was not available when you ran LaTeX on this source. Simply RERUN %%
%% LaTeX to get the ``??'' replaced with the number of the last page %%
%% of the document. The AUX file will be generated on the first run %%
%% of LaTeX and used on the second run to fill in all of the %%
%% references. %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%% Document Setup %%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Don't like 10pt? Try 11pt or 12pt
\documentclass[10pt]{article}
% This is a helpful package that puts math inside length specifications
\usepackage{calc}
\usepackage[utf8]{inputenc}
% Simpler bibsection for CV sections
% (thanks to natbib for inspiration)
\makeatletter
\newlength{\bibhang}
\setlength{\bibhang}{1em}
\newlength{\bibsep}
{\@listi \global\bibsep\itemsep \global\advance\bibsep by\parsep}
\newenvironment{bibsection}%
{\begin{list}{}{%
\setlength{\leftmargin}{\bibhang}%
\setlength{\itemindent}{-\leftmargin}%
\setlength{\itemsep}{\bibsep}%
\setlength{\parsep}{\z@}%
\setlength{\partopsep}{0pt}%
\setlength{\topsep}{0pt}}}
{\end{list}\vspace{-.6\baselineskip}}
\makeatother
% Layout: Puts the section titles on left side of page
\reversemarginpar
%
% PAPER SIZE, PAGE NUMBER, AND DOCUMENT LAYOUT NOTES:
%
% The next \usepackage line changes the layout for CV style section
% headings as marginal notes. It also sets up the paper size as either
% letter or A4. By default, letter was used. If A4 paper is desired,
% comment out the letterpaper lines and uncomment the a4paper lines.
%
% As you can see, the margin widths and section title widths can be
% easily adjusted.
%
% ALSO: Notice that the includefoot option can be commented OUT in order
% to put the PAGE NUMBER *IN* the bottom margin. This will make the
% effective text area larger.
%
% IF YOU WISH TO REMOVE THE ``of LASTPAGE'' next to each page number,
% see the note about the +LP and -LP lines below. Comment out the +LP
% and uncomment the -LP.
%
% IF YOU WISH TO REMOVE PAGE NUMBERS, be sure that the includefoot line
% is uncommented and ALSO uncomment the \pagestyle{empty} a few lines
% below.
%
%% Use these lines for letter-sized paper
\usepackage[paper=letterpaper,
%includefoot, % Uncomment to put page number above margin
marginparwidth=1.2in, % Length of section titles
marginparsep=.05in, % Space between titles and text
margin=1in, % 1 inch margins
includemp]{geometry}
%% Use these lines for A4-sized paper
%\usepackage[paper=a4paper,
% %includefoot, % Uncomment to put page number above margin
% marginparwidth=30.5mm, % Length of section titles
% marginparsep=1.5mm, % Space between titles and text
% margin=25mm, % 25mm margins
% includemp]{geometry}
%% More layout: Get rid of indenting throughout entire document
\setlength{\parindent}{0in}
\usepackage[shortlabels]{enumitem}
\usepackage[pdftex]{graphicx}
%% Reference the last page in the page number
%
% NOTE: comment the +LP line and uncomment the -LP line to have page
% numbers without the ``of ##'' last page reference)
%
% NOTE: uncomment the \pagestyle{empty} line to get rid of all page
% numbers (make sure includefoot is commented out above)
%
\usepackage{fancyhdr,lastpage}
\pagestyle{fancy}
%\pagestyle{empty} % Uncomment this to get rid of page numbers
\fancyhf{}\renewcommand{\headrulewidth}{0pt}
\fancyfootoffset{\marginparsep+\marginparwidth}
\newlength{\footpageshift}
\setlength{\footpageshift}
{0.5\textwidth+0.5\marginparsep+0.5\marginparwidth-2in}
\lfoot{\hspace{\footpageshift}%
\parbox{4in}{\, \hfill %
\arabic{page} of \protect\pageref*{LastPage} % +LP
% \arabic{page} % -LP
\hfill \,}}
% Finally, give us PDF bookmarks
\usepackage[colorlinks, linkcolor = black, citecolor = black, filecolor = black, urlcolor = blue]{hyperref}
%\usepackage{color,hyperref}
%\definecolor{darkblue}{rgb}{0.0,0.0,0.3}
%\hypersetup{colorlinks,breaklinks,
% linkcolor=darkblue,urlcolor=darkblue,
% anchorcolor=darkblue,citecolor=darkblue}
%%%%%%%%%%%%%%%%%%%%%%%% End Document Setup %%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%% Helper Commands %%%%%%%%%%%%%%%%%%%%%%%%%%%%
% The title (name) with a horizontal rule under it
% (optional argument typesets an object right-justified across from name
% as well)
%
% Usage: \makeheading{name}
% OR
% \makeheading[right_object]{name}
%
% Place at top of document. It should be the first thing.
% If ``right_object'' is provided in the square-braced optional
% argument, it will be right justified on the same line as ``name'' at
% the top of the CV. For example:
%
% \makeheading[\emph{Curriculum vitae}]{Your Name}
%
% will put an emphasized ``Curriculum vitae'' at the top of the document
% as a title. Likewise, a picture could be included:
%
% \makeheading[\includegraphics[height=1.5in]{my_picutre}]{Your Name}
%
% the picture will be flush right across from the name.
\newcommand{\makeheading}[2][]%
{\hspace*{-\marginparsep minus \marginparwidth}%
\begin{minipage}[t]{\textwidth+\marginparwidth+\marginparsep}%
{\large \bfseries #2 \hfill #1}\\[-0.15\baselineskip]%
\rule{\columnwidth}{1pt}%
\end{minipage}}
% The section headings
%
% Usage: \section{section name}
\renewcommand{\section}[1]{\pagebreak[3]%
\hyphenpenalty=10000%
\vspace{1.3\baselineskip}%
\phantomsection\addcontentsline{toc}{section}{#1}%
\noindent\llap{\scshape\smash{\parbox[t]{\marginparwidth}{\raggedright #1}}}%
\vspace{-\baselineskip}\par}
% An itemize-style list with lots of space between items
\newenvironment{outerlist}[1][\enskip\textbullet]%
{\begin{itemize}[#1,leftmargin=*]}{\end{itemize}%
\vspace{-.6\baselineskip}}
% An environment IDENTICAL to outerlist that has better pre-list spacing
% when used as the first thing in a \section
\newenvironment{lonelist}[1][\enskip\textbullet]%
{\begin{list}{#1}{%
\setlength{\partopsep}{0pt}%
\setlength{\topsep}{0pt}}}
{\end{list}\vspace{-.6\baselineskip}}
% An itemize-style list with little space between items
\newenvironment{innerlist}[1][\enskip\textbullet]%
{\begin{itemize}[#1,leftmargin=*,parsep=0pt,itemsep=0pt,topsep=0pt,partopsep=0pt]}
{\end{itemize}}
% An environment IDENTICAL to innerlist that has better pre-list spacing
% when used as the first thing in a \section
\newenvironment{loneinnerlist}[1][\enskip\textbullet]%
{\begin{itemize}[#1,leftmargin=*,parsep=0pt,itemsep=0pt,topsep=0pt,partopsep=0pt]}
{\end{itemize}\vspace{-.6\baselineskip}}
% To add some paragraph space between lines.
% This also tells LaTeX to preferably break a page on one of these gaps
% if there is a needed pagebreak nearby.
\newcommand{\blankline}{\quad\pagebreak[3]}
\newcommand{\halfblankline}{\quad\vspace{-0.5\baselineskip}\pagebreak[3]}
% Uses hyperref to link DOI
\newcommand\doilink[1]{\href{http://dx.doi.org/#1}{#1}}
\newcommand\doi[1]{doi:\doilink{#1}}
% For \url{SOME_URL}, links SOME_URL to the url SOME_URL
\providecommand*\url[1]{\href{#1}{#1}}
% Same as above, but pretty-prints SOME_URL in teletype fixed-width font
\renewcommand*\url[1]{\href{#1}{\texttt{#1}}}
% For \email{ADDRESS}, links ADDRESS to the url mailto:ADDRESS
\providecommand*\email[1]{\href{mailto:#1}{#1}}
% Same as above, but pretty-prints ADDRESS in teletype fixed-width font
%\renewcommand*\email[1]{\href{mailto:#1}{\texttt{#1}}}
%\providecommand\BibTeX{{\rm B\kern-.05em{\sc i\kern-.025em b}\kern-.08em
% T\kern-.1667em\lower.7ex\hbox{E}\kern-.125emX}}
%\providecommand\BibTeX{{\rm B\kern-.05em{\sc i\kern-.025em b}\kern-.08em
% \TeX}}
\providecommand\BibTeX{{B\kern-.05em{\sc i\kern-.025em b}\kern-.08em
\TeX}}
\providecommand\Matlab{\textsc{Matlab}}
%%%%%%%%%%%%%%%%%%%%%%%% End Helper Commands %%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%% Begin CV Document %%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}
\makeheading[\includegraphics[scale=0.1]{pic.jpg}]{My full name}
\section{\textbf{Hi HO}}
% NOTE: Mind where the & separators and \\ breaks are in the following
% table.
%
% ALSO: \rcollength is the width of the right column of the table
% (adjust it to your liking; default is 1.85in).
%
\newlength{\rcollength}\setlength{\rcollength}{2.5in}%
%
\begin{tabular}[t]{@{}p{\textwidth-\rcollength}p{\rcollength}}
Randomstr. 21 & \textit{Mobile:} A funny phone number \\
87129 Apple Pie & \textit{Home:} A funny home number \\
Moon & \textit{E-mail:} \email{myname@whatever.com}
\end{tabular}
\section{\textbf{I want!!!!!!}} A position within your firm as a wizard.
\section{\textbf{hello}} {\sl Birthday:} Sorry, I'm to old\\
{\sl Born:} Mordor
\section{\textbf{Yeah! done!}} {\sl 2012-2014:} MSc in reading Harry Potter books \\
{\sl University:} Hogwards, \href{http://www.google.com}{hogwards}
\begin{itemize}
\item Major: Quiditch, \href{http://www.google.com}{lilalu}
\item Master-Thesis: "Another never ending love story"
\end{itemize}
% \sl will be bold italic in New Century Schoolbook (or
% any postscript font) and just slanted in
% Computer Modern (default) font
{\sl 2008-2012:} BSc in playing guitarre\\
{\sl University:} University of Rock, \href{http://www.google.com}{Rock n Roll}
\begin{itemize}
\item Bachelor-Thesis: ``Never ending love story''
\end{itemize}
\section{\textbf{some questions?}} {\sl What?:} horse \\
{\sl Where:} sea\\
{\sl why:} boring
\section{\textbf{more}}
{\sl Who:} Prince \\
{\sl really:}
\begin{itemize}
\item yes
\item no
\item maybe
\item ok
\end{itemize}
\end{document}
%%%%%%%%%%%%%%%%%%%%%%%%%% End CV Document %%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%----------------------------------------------------------------------%
% The following is copyright and licensing information for
% redistribution of this LaTeX source code; it also includes a liability
% statement. If this source code is not being redistributed to others,
% it may be omitted. It has no effect on the function of the above code.
%----------------------------------------------------------------------%
% Copyright (c) 2007, 2008, 2009, 2010, 2011 by Theodore P. Pavlic
%
% Unless otherwise expressly stated, this work is licensed under the
% Creative Commons Attribution-Noncommercial 3.0 United States License. To
% view a copy of this license, visit
% http://creativecommons.org/licenses/by-nc/3.0/us/ or send a letter to
% Creative Commons, 171 Second Street, Suite 300, San Francisco,
% California, 94105, USA.
%
% THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
% OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
% MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
% IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
% CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
% TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
% SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
%----------------------------------------------------------------------%
So using once the code \makeheading[\includegraphics[scale=0.1]{pic.jpg}]{My full name} produces an error, however using \makeheading[\includegraphics{pic.jpg}]{My full name} it compiles but the picture is to large. I added a picture below. Note, I also tried to use width=/length= producing the same error. How can I use the scale function properly? Just for completeness here is the error message:
! Argument of \Gin@ii has an extra }.
<inserted text>
\par
l.220 ...\makeheading[\includegraphics[width=3cm]p
ic.jpg}]{My full name}
I've run across a `}' that doesn't seem to match anything.
For example, `\def\a#1{...}' and `\a}' would produce
this error. If you simply proceed now, the `\par' that
I've just inserted will cause me to report a runaway
argument that might be the root of the problem. But if
your `}' was spurious, just type `2' and it will go away.
Runaway argument?
width=3cm
! Paragraph ended before \Gin@ii was complete.
<to be read again>
\par
l.220 ...\makeheading[\includegraphics[width=3cm]p
ic.jpg}]{My full name}
I suspect you've forgotten a `}', causing me to apply this
control sequence to too much text. How can we recover?
My plan is to forget the whole thing and hope for the best.
! LaTeX Error: There's no line here to end.
See the LaTeX manual or LaTeX Companion for explanation.
Type H <return> for immediate help.
...
l.220 ...\makeheading[\includegraphics[width=3cm]p
ic.jpg}]{My full name}
Your command was ignored.
Type I <command> <return> to replace it with another command,
or <return> to continue without it.
! Too many }'s.
l.220 ...ading[\includegraphics[width=3cm]pic.jpg}
]{My full name}
You've closed more groups than you opened.
Such booboos are generally harmless, so keep going.
Overfull \hbox (40.83345pt too wide) in paragraph at lines 220--221
[]| []\OT1/cmr/m/n/10 ic.jpg]My
[]
LaTeX Font Warning: Font shape `OT1/cmr/bx/sc' undefined
(Font) using `OT1/cmr/bx/n' instead on input line 222.
\rcollength=\skip60
LaTeX Font Info: External font `cmex10' loaded for size
(Font) <7> on input line 232.
LaTeX Font Info: External font `cmex10' loaded for size
(Font) <5> on input line 232.
Overfull \hbox (18.0pt too wide) in paragraph at lines 232--238
[][]
[]
LaTeX Font Info: Try loading font information for OMS+cmr on input line 250.
(/usr/share/texlive/texmf-dist/tex/latex/base/omscmr.fd
File: omscmr.fd 1999/05/25 v2.5h Standard LaTeX font definitions
)
LaTeX Font Info: Font shape `OMS/cmr/m/n' in size <10> not available
(Font) Font shape `OMS/cmsy/m/n' tried instead on input line 250.
AED: lastpage setting LastPage [1
{/var/lib/texmf/fonts/map/pdftex/updmap/pdftex.map}]
Package atveryend Info: Empty hook `BeforeClearDocument' on input line 276.
Package atveryend Info: Empty hook `AfterLastShipout' on input line 276.
(./test.aux)
Package atveryend Info: Executing hook `AtVeryEndDocument' on input line 276.
Package atveryend Info: Executing hook `AtEndAfterFileList' on input line 276.
Package rerunfilecheck Info: File `test.out' has not changed.
(rerunfilecheck) Checksum: BCA175A70C2E86A6152D11F00EBA3623;268.
LaTeX Font Warning: Some font shapes were not available, defaults substituted.
Package atveryend Info: Empty hook `AtVeryVeryEnd' on input line 276.
)
Here is how much of TeX's memory you used:
6273 strings out of 495031
91835 string characters out of 6181530
182597 words of memory out of 5000000
9418 multiletter control sequences out of 15000+600000
5553 words of font info for 20 fonts, out of 8000000 for 9000
14 hyphenation exceptions out of 8191
29i,13n,43p,223b,322s stack positions out of 5000i,500n,10000p,200000b,80000s
</usr/share/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmbx10.pfb></us
r/share/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmbx12.pfb></usr/shar
e/texlive/texmf-dist/fonts/type1/public/amsfonts/cm/cmr10.pfb></usr/share/texli
ve/texmf-dist/fonts/type1/public/amsfonts/cm/cmsl10.pfb></usr/share/texlive/tex
mf-dist/fonts/type1/public/amsfonts/cm/cmsy10.pfb></usr/share/texlive/texmf-dis
t/fonts/type1/public/amsfonts/cm/cmti10.pfb>
Output written on test.pdf (1 page, 72354 bytes).
PDF statistics:
68 PDF objects out of 1000 (max. 8388607)
58 compressed objects within 1 object stream
8 named destinations out of 1000 (max. 500000)
49 words of extra memory for PDF output out of 10000 (max. 10000000)

\includegraphics[width=3cm]{pic.jpg}? The length is just for testing. – egreg Apr 11 '14 at 17:49pdflatex? – egreg Apr 11 '14 at 18:13\makeheading[{\includegraphics[scale=0.1]{pic.jpg}}]{My...}– egreg Apr 11 '14 at 20:08\includegraphics[width=3cm]pic.jpg}instead of\includegraphics[width=3cm]{pic.jpg}. – Nicola Talbot Apr 11 '14 at 20:08