Skip to main content
v2026.11,986 entries · CC-BY 4.0

Overleaf Insert Image: Step-by-Step LaTeX Guide

Insert images in Overleaf with this step-by-step guide covering project asset uploads, graphicx syntax, figure positioning, and compilation troubleshooting.

Written and maintained by CASRAI Editorial Board

Published

On this page

To insert an image in Overleaf, upload your image file (PNG, JPEG, or PDF) to the project file tree using the Upload icon, declare usepackage{graphicx} in your LaTeX document preamble, and place the graphic into your document body using the includegraphics[width=linewidth]{filename} command or enclose it inside a floating figure environment to enable automated numbering, descriptive captions, and cross-referencing labels across your academic manuscript.

What Overleaf is used for in research

Overleaf is a cloud-based LaTeX authoring platform widely adopted across mathematics, computer science, physics, economics, and biomedical engineering. By executing full TeX distributions on remote servers, Overleaf eliminates the need for researchers to configure and maintain local TeX Live or MiKTeX environments. Investigators use the platform to draft scientific papers, doctoral dissertations, conference proceedings, grant proposals, and technical reports with standardized mathematical typesetting and automated citation management.

A defining capability of browser-based LaTeX workflows in Overleaf is real-time multi-user collaboration. Co-authors, principal investigators, and student researchers can review text simultaneously, track revisions, leave contextual comments, and synchronize changes with institutional repositories. The platform also integrates direct submission pipelines with major academic journals and preprint servers, allowing authors to transfer source files, style templates, and graphic figures seamlessly into publisher intake systems.

In scientific publishing, figures provide essential empirical evidence, displaying statistical charts, microscopy images, experimental schematics, and simulation outputs. Because all document assets reside within a remote project repository, understanding how Overleaf manages, indexes, and compiles image files is critical for maintaining reproducible manuscript builds across research teams.

How to install or access Overleaf

Overleaf operates as a web application accessible through standard web browsers, including Google Chrome, Mozilla Firefox, Apple Safari, and Microsoft Edge. Users access the platform directly from the official website without installing desktop binaries or compiler engines. Authentication is available through individual email credentials, ORCID iD, or institutional Single Sign-On (SSO) under institutional Overleaf Commons agreements supported by university libraries and research computing centers.

For institutions requiring strict data residency, compliance with sensitive data handling standards, or isolated network environments, the platform offers on-premises deployment options known as Overleaf Community Edition and Overleaf Server Pro. Research computing administrators can deploy the Community Edition using official Docker containers retrieved from the vendor’s repository, hosting the collaborative editor and underlying TeX engine behind institutional firewalls without external cloud data transmission.

To begin a new document on the cloud service, a researcher navigates to the project dashboard, selects New Project, and chooses between an empty document, an existing archive upload, or a pre-formatted journal template provided by publishers such as IEEE, Springer Nature, or the American Chemical Society. Inside the editor workspace, the interface displays a three-panel layout: the project file directory on the left, the source editing canvas in the center, and the real-time compiled PDF preview pane on the right.

How to insert an image in Overleaf step by step

Inserting visual graphics into an Overleaf project involves uploading image files to the remote workspace, configuring package dependencies, and applying standard typesetting commands. Users can complete these tasks using traditional LaTeX source markup or the graphical Visual Editor.

Step 1: Upload the image asset to the project directory. In the left-hand project file tree, click the Upload icon (a file tray with an upward arrow). In the modal window, drag and drop the image file from your workstation, or click Select from your computer to browse your file system. Supported image formats include PNG, JPEG, PDF (ideal for vector plots), and EPS (Encapsulated PostScript). Avoid spaces, accented characters, or symbols in filenames; use hyphenated names such as experimental-figure-01.png rather than figure 1 (final).png.

Step 2: Create a dedicated assets folder (optional). For projects with numerous figures, click the New Folder icon above the file tree and name the directory images. Move uploaded graphics into this folder. In your main document preamble (before begin{document}), declare the relative search path:

graphicspath{ {./images/} }

This instructs the compiler to search the images subfolder automatically whenever an image command is issued, eliminating the need to prepend directory names in individual graphic calls.

Step 3: Load the graphicx package. In your document preamble, add the standard graphics inclusion package:

usepackage{graphicx}

The graphicx package provides key-value syntax for controlling image width, height, aspect ratio, and rotation. It is bundled with all modern TeX distributions and requires no separate installation on Overleaf.

Step 4: Insert the image using includegraphics. To place an uncaptioned image directly in line with text, call:

includegraphics[width=0.8linewidth]{experimental-figure-01}

Omit the file extension (such as .png or .pdf). This convention enables LaTeX to select the appropriate format based on the active compiler and facilitates seamless conversion if raster files are later replaced with vector PDFs.

Step 5: Enclose the image in a floating figure environment. Wrap the graphic command inside a figure environment to generate numbered captions and cross-references:

begin{figure}[htbp]
    centering
    includegraphics[width=linewidth]{experimental-figure-01}
    caption{Empirical measurement of sensor calibration over twelve test cycles.}
    label{fig:sensor-calibration}
end{figure}

Always place label after or within caption. Placing the label before the caption causes LaTeX to bind the reference to the overarching section number rather than the figure sequence number.

Step 6: Insert figures via the Visual Editor. Overleaf provides a toggle switch at the top-left of the editing pane between Code Editor and Visual Editor. In Visual Editor mode, place your cursor at the desired insertion point and click the Insert Figure button on the toolbar. Choose an existing uploaded image or upload a new file, set target width, specify a caption, and enter a label. The Visual Editor automatically generates clean LaTeX code in the background. You can also copy an image to your operating system clipboard and press Ctrl+V (Cmd+V on macOS) inside the Visual Editor canvas to upload the graphic and insert the figure block automatically.

Step 7: Typeset multi-panel subfigures. When presenting comparative experiments, load the subcaption package in your preamble. Structure side-by-side subfigures using the subfigure environment:

usepackage{subcaption}
...
begin{figure}[htbp]
    centering
    begin{subfigure}[b]{0.48linewidth}
        centering
        includegraphics[width=linewidth]{control-group}
        caption{Baseline control response.}
        label{fig:control}
    end{subfigure}
    hfill
    begin{subfigure}[b]{0.48linewidth}
        centering
        includegraphics[width=linewidth]{treated-group}
        caption{Treated experimental response.}
        label{fig:treated}
    end{subfigure}
    caption{Comparison of baseline and treated experimental cohorts.}
    label{fig:cohort-comparison}
end{figure}

Step 8: Recompile the document. Click the green Recompile button or press Ctrl+Enter (Cmd+Enter on macOS) to build the PDF. The rendered document will immediately reflect the newly inserted figures.

How to read the output

Evaluating the compiled visual output requires examining both the rendered PDF in the Overleaf preview pane and the compilation log files. Typesetting floating graphics involves balancing visual resolution, page geometry, and cross-referencing.

In the rendered PDF preview, verify that the image scales proportionately without exceeding printable margins. When sizing with relative parameters such as width=linewidth or width=0.85textwidth, LaTeX scales the graphic to match surrounding text columns. If explicit measurements are used, such as width=12cm, height=8cm, ensure aspect ratio remains undistorted by appending keepaspectratio inside the optional parameter bracket.

Inspect the typography and alignment of the caption. LaTeX automatically prefixes captions with the word Figure and an incremented integer determined by appearance in document flow. In documents utilizing the report or book classes, figure numbering incorporates chapter designations (e.g., Figure 3.2). Cross-references generated using ref{fig:label} display the corresponding number as hyperlinked text when hyperref is loaded.

Consult the Overleaf compilation log panel located next to the Recompile button. When compilation completes with warnings, a numerical badge appears on the log icon. The most frequent graphic-related diagnostic is an Overfull hbox warning. This indicates that an image exceeds the horizontal dimension of the text column by a specified amount (e.g., Overfull hbox (14.2pt too wide)), causing the visual graphic to jut into the page margin.

Finally, examine visual resolution at high magnification (300% to 500% zoom). Vector formats (PDF, EPS) maintain sharp line weights and crisp text regardless of zoom level, making them standard for statistical plots and schematics. Raster graphics (PNG, JPEG) must provide sufficient pixel density; academic print standards typically require at least 300 dots per inch (DPI) for photographic microscopy and 600 DPI for line art.

Troubleshooting Overleaf

Addressing image insertion issues requires systematic troubleshooting against documented LaTeX and Overleaf behaviors.

1. Resolving ‘LaTeX Error: File not found’ messages. The error ! LaTeX Error: File 'filename' not found on input line XX occurs when the TeX compiler cannot locate the cited asset. First, confirm the file appears in the left-hand project tree. LaTeX on Linux-based servers is strictly case-sensitive: if the file is named Plot.PNG, calling includegraphics{plot} will fail. Second, verify whether the image is stored inside a subfolder. If the image is located in figures/chart.pdf and no graphicspath is defined, write includegraphics{figures/chart}. Third, remove spaces and non-standard symbols from the file name on your workstation and re-upload it; spaces can confuse the TeX tokenizer into treating the path as disjoint arguments.

2. Fixing image draft mode boxes. If your document displays an empty rectangle containing only the file path rather than the actual image, check your documentclass line and package declarations. If the global document class contains the draft option (documentclass[draft]{article}), LaTeX suppresses graphic rendering to expedite compilation. Similarly, ensure you have not passed the draft option directly via usepackage[draft]{graphicx}. Removing the draft keyword restores visual rendering.

3. Managing floating figures and positioning drift. In LaTeX, the figure environment is an unconstrained float: the layout engine defers placement if an image cannot fit on the current page alongside preceding paragraphs without violating white space and text ratios. To provide flexible placement hints, specify begin{figure}[htbp], granting permission to place the float here, at the page top, at the bottom, or on a dedicated float page. If strict positional binding is required, load the float package in your preamble and use the uppercase specifier: begin{figure}[H]. The [H] specifier forces LaTeX to insert the figure exactly at that code location.

4. Resolving compilation timeouts caused by large assets. Overleaf projects enforce execution timeouts on document builds. When a project contains dozens of uncompressed raster graphics (such as 20 MB camera RAW files or high-resolution TIFF scans), the pdfLaTeX compiler can exhaust allocated memory or exceed maximum runtime limits. Pre-process images prior to upload: convert multi-megabyte bitmap files into compressed PNG or JPEG formats sized for print, or export scientific plots directly as lightweight vector PDFs.

5. Handling EPS files with modern compilers. When compiling with Overleaf’s default pdfLaTeX engine, the compiler automatically invokes the epstopdf conversion script in the background. However, if an EPS file contains non-conforming PostScript operators or corrupted bounding box headers, compilation halts with an Unable to determine bounding box error. Converting the EPS graphic to a standard PDF prior to uploading ensures reliable rendering across all compilation engines.

Free alternatives to Overleaf

While Overleaf provides a centralized collaborative platform, researchers may consider alternative cloud and desktop tools depending on internet availability, data privacy mandates, institutional software licenses, and computational requirements. The table below compares prominent free and open-source alternatives for typesetting scientific documents and managing image assets.

Platform Architecture Collaboration Model Image Insertion Method Key Academic Advantage
Papeeria Cloud-based web editor Real-time collaborative editing Browser upload to project assets panel Integrated Git synchronization and built-in plot generation
TeXPage Cloud-based web editor Online shared workspaces File manager drag-and-drop interface Low latency performance for international research teams
VS Code + LaTeX Workshop Local desktop IDE Git version control / Live Share Local directory file storage Extensible syntax highlighting, linting, and offline compilation
TeXstudio Local desktop IDE Local files / external Git Dedicated graphics insertion wizard dialog No internet dependency, rapid compilation, zero subscription fees
LyX Local visual processor Local files / version control WYSIWYM graphical image insertion window Structured visual authoring without direct LaTeX syntax manipulation

For projects requiring offline execution or subject to strict confidentiality agreements where cloud uploads are restricted, desktop environments such as VS Code with LaTeX Workshop or TeXstudio paired with a local TeX Live installation offer complete operational independence. Conversely, when collaborative co-authoring across geographically dispersed institutions is paramount, web-based editors remain highly effective.

Researchers interested in deeper technical mechanics can explore detailed comparisons in our guide to web LaTeX editors, review core engine setup in how to compile LaTeX, and examine foundational graphics markup principles in including graphics in LaTeX as well as LaTeX figure environments.

The data table below summarizes format compatibility, bounding box handling, and compiler support across standard TeX compilation engines available in Overleaf.

Frequently asked questions

How can I resize or scale an image?

You can resize or scale an image by passing optional parameters in square brackets to the includegraphics command. Common parameters include relative width such as [width=0.5textwidth] or [width=linewidth], absolute measurements like [width=8cm] or [height=5cm], or proportional scaling factors such as [scale=0.75]. To prevent image distortion when setting both width and height, add keepaspectratio inside the parameter brackets.

Why is my image not showing up or showing a file path error?

An image fails to display or generates a file not found error if the file name in your code does not match the uploaded asset’s exact spelling, casing, and extension. Verify that the file is uploaded to the project tree, ensure names do not contain spaces or special characters, and confirm that you have declared usepackage{graphicx} in your preamble. If the graphic displays as an empty box with a file name, check whether the draft option is active in your documentclass or package settings.

How do I fix image positioning issues?

LaTeX treats figures as floating elements, moving them to optimize page margins and avoid awkward white spaces. To guide placement, provide flexible location specifiers such as begin{figure}[htbp], which permits placement here, at the page top, at the bottom, or on a dedicated float page. If you require the figure to remain strictly in place without floating, declare usepackage{float} in your preamble and set the strict specifier begin{figure}[H].

Can I use drag-and-drop or the visual editor to add images?

Yes, Overleaf fully supports drag-and-drop file management and visual editing. You can drag image files directly from your computer into the left-hand file tree panel to upload them. Furthermore, in Overleaf’s Visual Editor mode, you can click the Insert Figure button on the formatting toolbar, drag images straight onto the text canvas, or paste images directly from your system clipboard using standard shortcut keys.

How do I organize multiple images into separate folders?

To organize multiple images, click the New Folder button at the top of the Overleaf file tree and create an assets directory such as images. Drag your uploaded graphic files into this folder. To avoid writing relative paths in every individual graphic command, add graphicspath{ {./images/} } to your LaTeX document preamble; the compiler will automatically scan that directory for all referenced images.

Sources

Data: Graphic Format and Engine Compatibility Matrix in Overleaf LaTeX Workflows

Technical compilation detailing image file format support, bounding box requirements, and automated conversion pipelines across standard TeX compilation engines (pdfLaTeX, XeLaTeX, LuaLaTeX) within Overleaf cloud environments, synthesized from official Overleaf and CTAN graphicx specifications.

Graphic Format and Engine Compatibility Matrix in Overleaf LaTeX Workflows
Graphic FormatFormat ClassificationpdfLaTeX Engine SupportXeLaTeX Engine SupportLuaLaTeX Engine SupportBounding Box DetectionRecommended Academic Application
PNGRaster bitmapNative direct supportNative direct supportNative direct supportAutomated via file headerMicroscopy images, UI screenshots, and continuous-tone figures without vector text
JPEG / JPGRaster bitmapNative direct supportNative direct supportNative direct supportAutomated via JFIF/EXIF headerPhotographic fieldwork documentation, clinical imaging, and continuous-tone visuals
PDFVector graphicNative direct supportNative direct supportNative direct supportAutomated via MediaBox or CropBoxMulti-panel charts, scatter plots, schematics, and vector diagrams from R, Python, and MATLAB
EPSVector PostScriptAutomated conversion via epstopdfNative direct support via xdvipdfmxAutomated conversion via epstopdfExtracted from %%BoundingBox headerLegacy journal submissions, publisher artwork packages, and specialized CAD exports
SVGVector XMLRequires inkscape or svg packageRequires inkscape or svg packageRequires inkscape or svg packageParsed via external Inkscape rendererWeb-derived schematics, network graphs, and interactive illustrations converted for print

Sources

Compiled by CASRAI from the sources above. Free to reuse under CC BY 4.0 with attribution.

Follow CASRAI

Research-administration guidance, standards updates and independent tool reviews.

Ask CASRAI · free to try

Ask about Overleaf Insert Image: Step-by-Step LaTeX Guide

2 free questions a day, no account.

An AI assistant for research: funder rules, compliance, methods and publishing. It links the sources behind its answers and labels answers that come from a web search.

Answers draw on CASRAI's guides and dictionary plus the federal and funder documents we index: Federal Register, Grants.gov, Regulations.gov and UKRI.

Works on this site and inside Claude, Cursor and the AI tools you already use.

Everything CASRAI publishes — this page, the dictionary, the guides and the news — stays open to read, with no account and no card.

Referenced across the research world

University of Cambridge logoColumbia University logoCrossref logoUniversity of Edinburgh logoHarvard University logoUniversity of Oxford logoPrinceton University logoStanford School of Medicine logoUniversity College London logoORCID logoUniversity of Cambridge logoColumbia University logoCrossref logoUniversity of Edinburgh logoHarvard University logoUniversity of Oxford logoPrinceton University logoStanford School of Medicine logoUniversity College London logoORCID logo
  • University of Cambridge logo
  • Columbia University logo
  • Crossref logo
  • University of Edinburgh logo
  • Harvard University logo
  • University of Oxford logo
  • Princeton University logo
  • Stanford School of Medicine logo
  • University College London logo
  • ORCID logo

View CASRAI adoption →