# how to include photo and format section headings

I would like to include an image on the top right of the document (above the horizontal line). Also, I would like to format the section headings (which appear on the left margin of the document) to red color.

\documentclass[10pt]{article}

\usepackage{calc}
\usepackage{comment}
\usepackage{soul}

\makeatletter
\newlength{\bibhang}
\setlength{\bibhang}{1em} %1em}
\newlength{\bibsep}
\newenvironment{bibsection}%
{\begin{enumerate}{}{%
\setlength{\leftmargin}{\bibhang}%
\setlength{\itemindent}{-\leftmargin}%
\setlength{\itemsep}{\bibsep}%
\setlength{\parsep}{\z@}%
\setlength{\partopsep}{0pt}%
\setlength{\topsep}{0pt}}}
{\end{enumerate}\vspace{-.6\baselineskip}}
\makeatother

\reversemarginpar

\usepackage{titlesec}

\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}

\setlength{\parindent}{0in}

\usepackage[shortlabels]{enumitem}

\usepackage{fancyhdr,lastpage}
\pagestyle{fancy}
\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
\hfill \,}}

\usepackage{color,hyperref}
\definecolor{darkblue}{rgb}{0.0,0.0,0.3}
anchorcolor=darkblue,citecolor=darkblue}

{\hspace*{-\marginparsep minus \marginparwidth}%
\begin{minipage}[t]{\textwidth+\marginparwidth+\marginparsep}%
{\large \bfseries #2 \hfill #1}\\[-0.15\baselineskip]%
\rule{\columnwidth}{1pt}%
\end{minipage}}

\renewcommand{\section}[1]{\pagebreak[3]%
\hyphenpenalty=10000%
\vspace{1.3\baselineskip}%
\noindent\llap{\scshape\smash{\parbox[t]{\marginparwidth}{\raggedright #1}}}%
\vspace{-\baselineskip}\par}

\newenvironment{outerlist}[1][\enskip\textbullet]%
{\begin{itemize}[#1,leftmargin=*]}{\end{itemize}%
\vspace{-.6\baselineskip}}

\newenvironment{lonelist}[1][\enskip\textbullet]%
{\begin{list}{#1}{%
\setlength{\partopsep}{0pt}%
\setlength{\topsep}{0pt}}}
{\end{list}\vspace{-.6\baselineskip}}

\newenvironment{innerlist}[1][\enskip\textbullet]%
{\begin{itemize}[#1,leftmargin=*,parsep=0pt,itemsep=0pt,topsep=0pt,partopsep=0pt]}
{\end{itemize}}

\newenvironment{loneinnerlist}[1][\enskip\textbullet]%
{\begin{itemize}[#1,leftmargin=*,parsep=0pt,itemsep=0pt,topsep=0pt,partopsep=0pt]}
{\end{itemize}\vspace{-.6\baselineskip}}

\providecommand*\url[1]{\href{#1}{#1}}
\renewcommand*\url[1]{\href{#1}{\texttt{#1}}}

\providecommand*\email[1]{\href{mailto:#1}{#1}}

\providecommand\BibTeX{{B\kern-.05em{\sc i\kern-.025em b}\kern-.08em
\TeX}}
\providecommand\Matlab{\textsc{Matlab}}

\begin{document}

\section{Contact Information}

\newlength{\rcollength}\setlength{\rcollength}{2in}
\begin{tabular}[t]{@{}p{\textwidth-\rcollength}p{\rcollength}}
Off no. 123  & 123 456 789  \\
Belgium     & \email{abhi@yahoo.com}\\
\end{tabular}

\section{Research Interests}

Development Economics, Microeconomics

\section{Education}

\textbf{University of Belgium},
\begin{outerlist}

\item[] Ph.D. Student, {Economics}
\begin{innerlist}
\item Thesis Topic: \emph{Essays in Development Economics}
\end{innerlist}
\end{outerlist}

\end{document}


I tried the command

\makeheading[\includegraphics[height=1.5in]{my_picutre}]{Your Name}


where I just have \makeheading, but it didn't work out. The error message says it couldn't find out the end of the line...

• Please make a complete minimal working example. – Marco Daniel May 31 '14 at 14:05
• This looks like an awful hack of some other class or .sty file. I am unsure how to use it and at first glance it does not seem fit to deliver commands for a CV. May I suggest to use moderncv instead? – user31729 May 31 '14 at 14:08
• @ChristianHupfer: Thanks for your suggestion, but since Werner has advised to use article for its flexibility, let us try this, if you don't mind – Abhimanyu Arora May 31 '14 at 14:16
• @AbhimanyuArora: Well, I agree with Werner about that letter issue of yours, but there are definitely differences between a CV and a letter. I would not write a book with article (or its corresponding relatives as scrartcl etc.) and I would refrain from writing a letter with book ;-) – user31729 May 31 '14 at 14:18

Without discussing the template you can achieve your goals with:

1. Adding a photo: \makeheading[{\includegraphics[width=1.5cm]{photo}}]{Abhimanyu Arora}
2. Change the style of section:

\renewcommand{\section}[1]{\pagebreak[3]%
\hyphenpenalty=10000%
\vspace{1.3\baselineskip}%
\noindent\llap{\scshape\smash{\parbox[t]{\marginparwidth}{\raggedright\textcolor{red}{#1}}}}%
\vspace{-\baselineskip}\par}


Here the complete MWE with the result:

\documentclass[10pt]{article}
\usepackage{graphicx}
\usepackage{calc}
\usepackage{comment}
\usepackage{soul}

\makeatletter
\newlength{\bibhang}
\setlength{\bibhang}{1em} %1em}
\newlength{\bibsep}
\newenvironment{bibsection}%
{\begin{enumerate}{}{%
\setlength{\leftmargin}{\bibhang}%
\setlength{\itemindent}{-\leftmargin}%
\setlength{\itemsep}{\bibsep}%
\setlength{\parsep}{\z@}%
\setlength{\partopsep}{0pt}%
\setlength{\topsep}{0pt}}}
{\end{enumerate}\vspace{-.6\baselineskip}}
\makeatother

\reversemarginpar

\usepackage{titlesec}

\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}

\setlength{\parindent}{0in}

\usepackage[shortlabels]{enumitem}

\usepackage{fancyhdr,lastpage}
\pagestyle{fancy}
\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
\hfill \,}}

\usepackage{color,hyperref}
\definecolor{darkblue}{rgb}{0.0,0.0,0.3}
anchorcolor=darkblue,citecolor=darkblue}

{\hspace*{-\marginparsep minus \marginparwidth}%
\begin{minipage}[t]{\textwidth+\marginparwidth+\marginparsep}%
{\large \bfseries #2 \hfill #1}\\[-0.15\baselineskip]%
\rule{\columnwidth}{1pt}%
\end{minipage}}

\renewcommand{\section}[1]{\pagebreak[3]%
\hyphenpenalty=10000%
\vspace{1.3\baselineskip}%
\noindent\llap{\scshape\smash{\parbox[t]{\marginparwidth}{\raggedright\textcolor{red}{#1}}}}%
\vspace{-\baselineskip}\par}

\newenvironment{outerlist}[1][\enskip\textbullet]%
{\begin{itemize}[#1,leftmargin=*]}{\end{itemize}%
\vspace{-.6\baselineskip}}

\newenvironment{lonelist}[1][\enskip\textbullet]%
{\begin{list}{#1}{%
\setlength{\partopsep}{0pt}%
\setlength{\topsep}{0pt}}}
{\end{list}\vspace{-.6\baselineskip}}

\newenvironment{innerlist}[1][\enskip\textbullet]%
{\begin{itemize}[#1,leftmargin=*,parsep=0pt,itemsep=0pt,topsep=0pt,partopsep=0pt]}
{\end{itemize}}

\newenvironment{loneinnerlist}[1][\enskip\textbullet]%
{\begin{itemize}[#1,leftmargin=*,parsep=0pt,itemsep=0pt,topsep=0pt,partopsep=0pt]}
{\end{itemize}\vspace{-.6\baselineskip}}

\providecommand*\url[1]{\href{#1}{#1}}
\renewcommand*\url[1]{\href{#1}{\texttt{#1}}}

\providecommand*\email[1]{\href{mailto:#1}{#1}}

\providecommand\BibTeX{{B\kern-.05em{\sc i\kern-.025em b}\kern-.08em
\TeX}}
\providecommand\Matlab{\textsc{Matlab}}

\begin{document}

\section{Contact Information}

\newlength{\rcollength}\setlength{\rcollength}{2in}
\begin{tabular}[t]{@{}p{\textwidth-\rcollength}p{\rcollength}}
Off no. 123  & 123 456 789  \\
Belgium     & \email{abhi@yahoo.com}\\
\end{tabular}

\section{Research Interests}

Development Economics, Microeconomics

\section{Education}

\textbf{University of Belgium},
\begin{outerlist}

\item[] Ph.D. Student, {Economics}
\begin{innerlist}
\item Thesis Topic: \emph{Essays in Development Economics}
\end{innerlist}
\end{outerlist}

\end{document}


• Grazie. But how can I change the size of the image, please? It shows error when I use square brackets to specify width as in normal \includegraphics command. – Abhimanyu Arora May 31 '14 at 14:41
• @AbhimanyuArora: As usual by the optional argument of \includegraphics: \includegraphics[width=1.5cm]{photo} – Marco Daniel May 31 '14 at 14:42
• You have to use {\includegraphics[....]{photo}} to protect the inner optional [] from the outer ones – user31729 May 31 '14 at 14:43
• @AbhimanyuArora: The the comment of Christian. I improved my answer. – Marco Daniel May 31 '14 at 14:45
• @AbhimanyuArora: I also found Marco's solution, with a different scaling however, but he was quicker (;-)), and the picture is on the right side. – user31729 May 31 '14 at 14:47