홈 LaTeX to Google Docs™: Convert a .tex File, Free or Full
포스트
취소

LaTeX to Google Docs™: Convert a .tex File, Free or Full

There are two ways to convert a LaTeX file to Google Docs™. The free one: paste the body of the .tex into a document and convert the equations with the LaTeXFlow add-on; headings, lists and tables are then redone by hand. The paid one: LaTeXFlow Import reads the .tex file and writes headings, lists, tables and equations into the document for you.

You have a .tex file. A co-author who does not use LaTeX needs to comment on it, a course wants the submission as a Google Docs™ document, or a group is drafting in Docs and the maths lives in your file. Docs cannot open .tex, so the question is how much of the file survives the move.

This post walks the free path first and says plainly where it stops, then shows what Import does from that point.

1. Two different problems in one file

A .tex file holds two kinds of content, and they move differently.

  • Prose. Paragraph text is plain text. Copy and paste moves it, and Docs keeps it as text.
  • Maths. Everything between LaTeX math delimiters — $x^2$, \[ … \], and the rest — is also plain text after a paste, but it looks like LaTeX rather than like an equation. This is the part LaTeXFlow handles: it finds those spans and turns each one into a rendered equation image.

Everything else in the file — sectioning commands, lists, tables, citations, figures — is a third kind of content, and it is where the path ends. Section 4 is about that.

2. The free path, step by step

Step 1 — copy the body of the file. Open the .tex in any text editor. Select from the line after \begin{document} to the line before \end{document} and copy. The preamble — \documentclass, \usepackage lines, macro definitions — has no meaning in Docs; leave it behind.

Step 2 — paste into a Google Docs™ document. Paste as plain text (Ctrl+Shift+V on Windows, Cmd+Shift+V on a Mac) so no stray formatting comes along. You now have a document full of readable text with LaTeX commands sitting in it as characters.

Step 3 — open LaTeXFlow. In the document: Extensions → LatexFlow → Open Equation Panel. On the first run a dialog appears; answer it either way, every feature works the same. The install walkthrough covers the first run in detail.

Step 4 — Scan. Switch to the Scan tab and press 🔍 Scan Document. The sidebar lists every span it recognised as an equation, one card each, with a preview. Look through the cards. A card that is not maths — a price with a stray dollar sign is the usual case — can be skipped.

Step 5 — Convert All. Press ⚡ Convert All. Each detected span is replaced in place by an equation image. The LaTeX source is kept in the image’s alt text, so ↩ Revert to LaTeX on the same tab turns any image back into editable text later.

Two things to be clear about. The result is an image per equation, not a native Docs equation — the objects Docs makes with Insert → Symbols → Equation are a different thing and this path does not produce them. And the prose around the equations is exactly what you pasted: plain text, in one font, with the LaTeX commands still visible wherever they were. Steps 3 to 5 changed the maths and nothing else.

3. What Scan detects, and what it does not

This is the part worth reading before you paste a long file, because it decides how much editing you do first.

The scanner detects delimited maths only. It looks for text wrapped in one of four delimiter pairs — $…$ and \(…\) for inline, $$…$$ and \[…\] for display — plus, when you tick Also detect [ … ] in the panel, the bare square brackets that ChatGPT produces when it strips the backslashes from \[ … \]. That option is off by default in the add-on. Maths that is not inside one of those pairs is not an equation to the scanner. This is a deliberate boundary rather than a gap waiting to be filled: a detector loose enough to catch bare \frac{1}{2} also catches file paths, code, and any sentence that happens to contain a backslash, and it would start flagging documents that were fine.

In a .tex file, three consequences follow.

Environments are not delimiters. An equation written as

1
2
3
\begin{equation}
  E = mc^2 \label{eq:energy}
\end{equation}

is not detected, because \begin{equation} is not one of the four pairs. The same holds for align, align*, gather, and multline. To bring it across, wrap the body in display delimiters and drop the label — Docs has no equation numbering for a label to point at:

1
\[ E = mc^2 \]

Aligned bodies need aligned. When the body uses & alignment points and \\ line breaks, put it in an aligned block inside the display delimiters. This is the same shape the add-on’s own symbol palette inserts, so it is the shape the renderer expects:

1
2
3
4
\begin{align*}
  f(x) &= x^2 + 1 \\
  g(x) &= 2x
\end{align*}

becomes

1
2
3
4
5
6
\[
\begin{aligned}
  f(x) &= x^2 + 1 \\
  g(x) &= 2x
\end{aligned}
\]

One \[ … \] block renders as one image with both lines in it.

Inline maths cannot span a line break. Many .tex files are hard-wrapped at 80 characters. If an inline $ … $ pair happens to straddle a wrapped line, the two dollar signs sit on different lines and the pair is not detected — the inline pattern stops at a line end on purpose. Join the line in the text editor before you copy. The three other delimiter pairs are not affected.

If you find a paragraph after the scan that should have been an equation, you do not need to go back to the file: put the cursor on it, press Tag as $…$ on the Scan tab, and scan again. With a selection it wraps the selection; with only a cursor it wraps the whole paragraph.

4. What does not carry over

Everything in the file that is structure rather than text or maths arrives as plain text with its command still attached. \section{Method} is the six characters of a heading and a command name; \begin{itemize} and each \item are words in a paragraph; a tabular block is rows of & and \\; \cite{knuth84} and the bibliography are a key and a list; \label and \ref are a name with nothing to resolve it; \footnote{…} is the note inline in the sentence; \includegraphics{fig1.pdf} is a file name, since the image itself was never in the .tex. For each of these you apply the Docs equivalent by hand — heading styles, a bulleted or numbered list, a Docs table, a footnote from the Insert menu, the image file from disk — and delete the command text. On a short document this is a few minutes. On a thesis chapter it is most of an afternoon, and it is the honest description of where this path stops.

5. Converting the whole file: Import

Import, on the Export / Import tab of LaTeXFlow, does most of section 4 for you. Choose the .tex file and the sidebar first reports what it read, before anything is written:

The Import section after choosing a .tex file: 17 blocks — 3 paragraphs, 4 headings, 2 list items, 1 table; 12 equations written as LaTeX text; 2 bibliography entries; and the Import button

Press Import and \section and \subsection become Docs headings, itemize becomes a bulleted list, and a tabular becomes a Docs table. Equations are written as LaTeX text, so the Scan and Convert All steps from section 2 turn them into images afterwards. A few things still change on the way in: a figure becomes a placeholder line, because the image file is not in the .tex; citations become [@key] markers; and Import reads one file, so it does not follow \input or a separate .bib. The free path above still works as described.

Import is a paid feature. One real file taken through it part by part, with every screen, is in Edit a .tex File in Google Docs™ With Your Co-author; prices and licence keys are in the Export & Import guide. Taking an imported document back out to .tex is covered in Google Docs™ to LaTeX and back. The add-on installs from LaTeXFlow for Google Docs™.

6. FAQ

How can I convert a LaTeX file to a Google Doc?

Google Docs™ cannot open a .tex file. Either paste the body into a document and convert the equations with the free Scan (section 2), or use LaTeXFlow Import to write the whole file — headings, lists, tables and equations — into the document (section 5).

How do I use LaTeX in Google Docs?

Not on its own: LaTeX typed into a document stays as plain text. With an add-on you can write LaTeX and convert it into equations; converting LaTeX to equations with the add-on walks through it from installing the add-on to the first equation.

How can I convert LaTeX equations to Google Docs?

Paste them into the document with their delimiters — $…$, $$…$$, \(…\) or \[…\] — then run Scan and Convert All (section 2). Docs may already turn some of them into its own equations on the paste; Scan finds the ones still written as LaTeX. Each converted equation keeps its LaTeX, and Revert to LaTeX brings the source back.

Can I use LaTeX code in Google Docs?

Yes, as text that an add-on converts. Write the code between delimiters, as in a .tex file; the guide to converting LaTeX to equations in Google Docs™ covers writing it and what Scan reads.

이 기사는 저작권자의 CC BY 4.0 라이센스를 따릅니다.

LaTeX 정리·증명 환경 — amsthm \newtheorem 과 번호 체계, \qedhere 까지

LaTeX 단위와 숫자 — siunitx 로 고치는 다섯 가지