How to Add a Picture to a LaTeX CV Template
At a glance
- 1. Load graphicx
Add the graphicx package in the preamble so LaTeX can include image files.
- 2. Store the image
Put the headshot in your project folder and use its exact filename and extension.
- 3. Place the picture
Use includegraphics in the CV header, beside your name and contact details.
- 4. Adjust and compile
Set a width or maximum height, then compile and check the image position.
To add a picture to a LaTeX CV, load the graphicx package and insert the file with \includegraphics. The exact location depends on the template: a simple document can place the command directly, while a CV header usually needs a small layout block to put the photo beside your name and contact details.
The example below creates a compact header with the text on the left and a headshot on the right. Save it as cv.tex and put an image named headshot.jpg in the same folder before compiling.
Add the photo beside your contact details
\documentclass[11pt]{article}
\usepackage[margin=1in]{geometry}
\usepackage{graphicx}
\pagestyle{empty}
\begin{document}
\noindent
\begin{minipage}[t]{0.70\textwidth}
\vspace{0pt}
{\LARGE\textbf{Alex Example}}\\[4pt]
Researcher in applied mathematics\\
alex@example.com\\
City, Country
\end{minipage}
\hfill
\begin{minipage}[t]{0.25\textwidth}
\vspace{0pt}
\includegraphics[width=\linewidth,height=3cm,keepaspectratio]{headshot.jpg}
\end{minipage}
\section*{Experience}
Add your CV content here.
\end{document}
The graphicx package provides \includegraphics. The first minipage holds the text; the second holds the image. Their widths, plus the space between them, fit within the line. The [t] option aligns the minipages at the top, and \vspace{0pt} helps make that top alignment consistent.
In the image command, width=\linewidth makes the picture fit the width of its minipage. The height is capped at 3 cm, and keepaspectratio prevents the photo from being stretched. Change 3cm or the minipage widths to suit your layout. If you want a fixed-width image instead, use a setting such as width=2.5cm and remove the height limit.
Adapt the code to your template
If you already have a CV template, add \usepackage{graphicx} in its preamble—the part before \begin{document}—unless the template already loads it. Then put the \includegraphics command inside the template’s header area, not necessarily at the start of the document. For example, a template may define a title or personal-information block where the photo belongs.
For the moderncv class, the class provides a photo command. A common form is \photo[64pt][0.4pt]{headshot} in the preamble, before \begin{document}. The optional arguments set the photo height and frame thickness. Check the documentation for your class and version, since CV templates do not all use the same interface.
Image files and compilation
With pdfLaTeX, use a supported image format such as JPG, PNG, or PDF. Keep the image in the same directory as the .tex file, or provide a relative path, such as images/headshot.jpg. The filename, capitalization, and extension must match the actual file. In many workflows the extension can be omitted, but including it makes the intended file clear.
If the photo is too large, reduce its specified width or height. If it looks distorted, make sure keepaspectratio is present. To crop rather than resize, graphicx supports options such as trim and clip; for instance, trim=10 5 10 5,clip trims the left, bottom, right, and top edges, respectively. The trim values use TeX units unless you specify otherwise.
Common mistakes
- Putting the package in the wrong place:
\usepackage{graphicx}belongs in the preamble, not after\begin{document}. - Using the wrong file path: Check the folder, spelling, capitalization, and extension. A missing-file error usually means LaTeX cannot find the image.
- Using unsupported formats: If compiling with pdfLaTeX, convert formats such as SVG to PDF or PNG first, or use a workflow that supports the format.
- Placing the command outside the header:
\includegraphicsappears wherever it occurs in the document. Put it inside the layout area where you want the photo. - Forcing both dimensions without preserving proportions: Specifying both width and height can stretch the image unless you include
keepaspectratio.
If a template has its own photo command or header layout, use that interface where possible. It is designed to work with the template’s spacing and styling; the generic minipage approach is useful when the template has no built-in photo support.
References
Spotted an error? Send a correction. Read how we write and check articles in our editorial policy.