How to paste formatted content into Overleaf
Please note: pasting formatted content is a new feature, and we are continually making improvements to ensure it works well in a range of scenarios. We’d also love your feedback on it, which you can provide in this survey.
You can paste formatted content, including tables, images, styled text, and lists into our Visual Editor and retain the formatting using Ctrl+V (on Windows/Linux) or Cmd+V (on MacOS).
Your pasted content will appear formatted in Visual Editor while in Code Editor you’ll be able to see the LaTeX code Overleaf has generated for you. (Don’t try pasting formatted text into Code Editor though!)
You can paste into Visual Editor from various sources, including Google Docs, Microsoft 365 (formerly Microsoft Office), LibreOffice, and websites. Pasting formatted content from PDF documents is not currently supported. For optimal results with Microsoft’s tools, use the online versions, though the desktop applications are also supported.
After pasting formatted content into Visual Editor, you’ll see a drop-down menu that lets you change the pasted (formatted) content back to plain text (without formatting):
- Paste without formatting converts formatted text to plain text.
- Paste with formatting switches back to formatted text.
Pasting plain text
You can paste unformatted plain text into Visual Editor or Code Editor by using the following key combinations:
- Windows/Linux: Ctrl+Shift+V
- MacOS: Cmd+Shift+V
Required LaTeX packages
To support pasting images and other content into Overleaf you need to add the following packages to your LaTeX document preamble:
hyperref
: to support hyperlinks contained in pasted content.graphicx
: provides the\includegraphics
command required to use graphics pasted into your project.
Pasting tables into your Overleaf project
Visual Editor can’t fully preserve the form and style of every table pasted into your project, but you can still save time and effort by pasting a wide range of tables created in other applications.
Visual Editor tries to preserve and preview the following table elements:
- horizontally merged cells (spanning multiple columns)
- borders applied to cells
- formatting of text within table cells
- table captions and headings
Visual Editor also lets you modify the pasted table, such as editing cell contents or adding rows and columns. You can also switch to Code Editor to make changes, including setting LaTeX parameters that control the table’s position within the typeset document.
An example of pasting a table
The following video demonstrates pasting a table from Wikipedia—note how hyperlinks and text styling are preserved.
Pasting images into your Overleaf project
You can paste single images into Visual Editor and Code Editor (but only Visual Editor provides an image preview). Pasting multiple images is not currently supported.
You can:
- Name the file used to save the pasted image.
- Choose the project folder in which to save it.
- Decide whether to use a figure caption.
- Decide whether to include a label (used for referencing the table).
- Configure the image width (as a fraction of
\linewidth
).
Any image you paste is saved as a .png file in your Overleaf project. It's then incorporated into your document using automatically generated LaTeX code. Visual Editor will provide a preview of the pasted image but Code Editor will display the LaTeX code only.
An example of pasting an image
Images can be copied from many sources, including web pages, but this video clip demonstrates copying an image from gimp and pasting it into Visual Editor. Note the use of Code Editor to set a custom image width of 0.85\linewidth
.
The image used in the video demonstration was copied from a Wikipedia article on population density.
Pasting styled text into your Overleaf project
To retain formatting of the items listed below, paste them into Overleaf’s Visual Editor using Ctrl+V (on Windows/Linux) or Cmd+V (on MacOS):
- Headings
- Bold text
- Italic text
- Hyperlinks
- Code blocks (e.g. wrapped in <code> tags in HTML)
- Symbols e.g., &, %, …, $50.00
An example of pasting formatted text
The next video clip demonstrates pasting formatted text copied from a Google Doc.
Pasting lists into your Overleaf project
Bulleted and numbered lists can be pasted into Overleaf’s Visual Editor using Ctrl+V (on Windows/Linux) or Cmd+V (on MacOS).
An example of pasting a list
The next video clip demonstrates pasting a multi-level bulleted and numbered list copied from a browser page and a LibreWriter document. Note how the bold and italic text is also preserved.
Description lists
Visual Editor also supports creating and editing description lists.
FAQs about pasting formatted content
Can I use drag and drop?
Visual Editor supports using drag and drop to upload .png
, .jpg
or .pdf
format images, but not for adding formatted content, which must be pasted.
Can I paste multiple images?
It’s not currently possible to paste multiple images simultaneously into Visual Editor or Code Editor. If you paste content that contains multiple images, only the text component will be pasted. The images must be pasted individually, which has the advantage of allowing you to configure each one separately.