LaTeX guides and converters
Quick answer
To move between LaTeX and Word or Google Docs, convert with Pandoc (pandoc file.tex -o file.docx) or paste equations into the equation editor, then fix references and tables by hand. For LaTeX formatting itself, most tasks come down to choosing the right package, such as graphicx for images or tabularx for wrapped table text.
Converters between LaTeX, Microsoft Word and Google Docs, plus tested answers to common LaTeX formatting questions about fonts, equations, figures, tables, code and references.
Convert LaTeX to and from Word and Docs
- How to Convert LaTeX to Word (Pandoc, make4ht and Equations) Video The most reliable way to convert LaTeX to Word is Pandoc: run pandoc paper.tex -o paper.docx --citeproc --bibliography=refs.bib. Equations become editable Word equations, images are embedded and citations are formatted. Add --reference-doc=template.docx to apply your Word styles. For a single formula, paste it into Word's equation editor in LaTeX mode.
- How to Convert LaTeX to Google Docs (Files and Equations) Video Google Docs can't open .tex files, but you can get LaTeX into a Doc two ways. For a whole document, convert it with Pandoc (pandoc paper.tex -o paper.docx) and open the .docx in Google Docs. For individual formulas, use the built-in equation editor, or an add-on such as Auto-LaTeX Equations to render LaTeX code.
- How to Convert Google Docs to LaTeX (Overleaf-Ready) Google Docs has no LaTeX export, so convert in two steps. Choose File > Download > Microsoft Word (.docx) or Markdown (.md), then run Pandoc: pandoc mydoc.docx -s -o mydoc.tex --extract-media=. The .docx route keeps headings, lists, tables, images and equations. Finally, open the .tex file in Overleaf and tidy the formatting.
Text, fonts and equations
- How to Write LaTeX in IPython Notebook (Jupyter) To write LaTeX in a Jupyter (IPython) notebook, switch a cell to Markdown and wrap the maths in dollar signs: single dollars for inline maths and double dollars for display equations. Jupyter renders them with MathJax when you run the cell. From Python code, use IPython.display.Math to show a LaTeX string as an equation.
- How to Write URLs and Hyperlinks in LaTeX (url, hyperref, xurl) To write a URL in LaTeX, load hyperref and use \url{https://example.com} for a clickable link in typewriter font, or \href{https://example.com}{link text} to show your own text. Characters like _, % and # need no escaping inside \url. For long URLs that overflow the margin, add \usepackage{xurl} to allow breaks anywhere.
- How to Change the Font in LaTeX (Family, Size and Custom Fonts) To change the font of a whole LaTeX document, load a font package in the preamble, for example \usepackage{newtxtext,newtxmath} for a Times-style font with pdfLaTeX. With XeLaTeX or LuaLaTeX, load fontspec and pick any installed font with \setmainfont. Change the base size with a class option such as 12pt, or locally with commands like \large.
- How to Add Line Breaks in LaTeX Equations (amsmath Guide) To break a long equation in LaTeX, load amsmath and use an environment that accepts a double backslash: multline for one long equation, split inside equation for aligned lines under one number, or align for several aligned equations. A double backslash inside a plain equation environment is ignored, so the formula stays on one line.
Figures, tables and code
- How to Insert a JPG Image in LaTeX (graphicx, figure, wrapfig) To add a JPG image in LaTeX, load the graphicx package with \usepackage{graphicx} and call \includegraphics[width=0.8\textwidth]{photo.jpg} in the body. Wrap it in a figure environment to add a caption and label. Compile with pdfLaTeX, XeLaTeX or LuaLaTeX; plain latex (DVI output) cannot read JPG files.
- How to Insert Code in LaTeX with Indentation (listings, minted) To insert code with its indentation preserved, load the listings package and put the code in an lstlisting environment, for example \begin{lstlisting}[language=Python, tabsize=4]. Spaces and tabs are kept as typed. For richer highlighting use minted with \begin{minted}{python}, and for plain unformatted text the built-in verbatim environment is enough.
- How to Wrap Text in LaTeX Tables (p, tabularx, makecell) To wrap text in a LaTeX table cell, give the column a fixed width with p{width} instead of l, c or r, for example \begin{tabular}{|l|p{6cm}|}. Long text in that column now breaks onto new lines. To make columns fill the page automatically, use tabularx with X columns, and use \newline for a manual break inside a cell.
- How to Insert a PDF into LaTeX (pdfpages and includegraphics) To insert a PDF into LaTeX, load pdfpages with \usepackage{pdfpages} and use \includepdf[pages=-]{file.pdf} to insert every page as a full page; pages={1-3} takes a range. To place one PDF page as a figure inside your text, use \includegraphics[page=2,width=\textwidth]{file.pdf} from the graphicx package.