홈 Edit a .tex File in Google Docs™ With Your Co-author
포스트
취소

Edit a .tex File in Google Docs™ With Your Co-author

The earlier post on bringing a LaTeX file into Google Docs™ ended at its step 4: the structure of the file — headings, lists, tables, footnotes — had to be rebuilt by hand. This post takes the same situation with Import, on the Export / Import tab of LaTeXFlow, and goes through one real file part by part. Import needs a license key; the click-by-click setup is in the Export and Import walkthrough.

1. The file

The test file is a two-page note of the kind a co-author might send: a title and author line, two sections with subsections, a footnote, two \cite references with the .bib entries inside the file (a filecontents block), a bulleted list, a table whose first column holds pmatrix matrices, a figure with \includegraphics and a caption, and inline and display equations. The .bib sits inside the .tex because Import reads one file; it does not follow \input, \include or a separate refs.bib.

Open an empty tab (or an empty document), open LaTeXFlow, go to Export / Import, and press Choose .tex file in the Import section. Nothing is written yet. The sidebar first reports what it read:

The Import section after choosing received_paper.tex: 17 blocks — 3 paragraphs, 4 headings, 2 list items, 1 table; 12 equations (2 display) — written as LaTeX text; 2 bibliography entries — saved to this document's Bibliography on import; Import into: Tab 4 with a Use current tab button; an expanded list of 4 notes on what changes on the way in; and the Import button

The four notes are the parts that cannot come in as they are: the author line becomes a subtitle, the footnote becomes a [1] marker with an entry under “Notes”, the figure file is not in the .tex, so a placeholder line is written instead, and the two citations are written as [@key] text markers that Export turns back into \cite. Import writes at the end of the tab named after Import into:. If that tab already has content, it asks you to tick Append anyway first.

2. Right after Import

Press Import. The sidebar counts “17 / 17 blocks written”, confirms that the 2 bibliography entries were saved, and points to the Scan tab for the equations:

The sidebar after the import: a greyed-out Import button, 17 17 blocks written, Imported received_paper.tex — 17 blocks, 12 equations, the message that 2 bibliography entries from the .tex were saved to this document, and a note that equations were written as LaTeX text and the Scan tab turns them into images

The top of the document:

The imported document: the title Eigenvalues of Small Matrices, the subtitle Draft for review, Introduction as a heading with a [1] marker and the text [@strang2016], the characteristic polynomial subsection with a display equation written over three lines as [, the equation and ], two bullet points with inline LaTeX, and the start of the table

What came in as Docs structure:

  • \title became a line in the Docs Title style and \author a line in the Subtitle style under it. The sidebar note warns that Export writes \author back empty, so the name survives only as a line of text.
  • \section and \subsection became Heading 1 and Heading 2, so they appear in the Docs outline.
  • The itemize list became a bulleted Docs list.
  • The tabular became a Docs table with the same rows and columns.

What came in as text:

  • Equations are LaTeX source between delimiters, inline in $…$ and display as three lines, \[, the equation, \]. This is deliberate: the source stays editable until you decide to render it (section 4).
  • Citations are [@strang2016] and [@noether1918], a marker with the citation key.

The lower half of the file:

The table with pmatrix source in the first column of each row, an italic centred line Trace, determinant and eigenvalues under it, a bold line [Image: eigen-ellipse.png — insert here], a plain line Caption: The unit circle mapped by a symmetric matrix., and the section A remark on symmetry with [@noether1918] and a display equation in three lines

  • The table caption is an italic, centred line right under the table.
  • The figure is a bold line [Image: eigen-ellipse.png — insert here]. Only the file name is kept. The image itself was never inside the .tex, so insert it from your own copy and delete the line.
  • The figure caption is a plain line starting with Caption:.

Google Docs™ has no caption object, so both captions are ordinary paragraphs, styled to stand apart from the body text.

The footnote text is at the very end of the document, under a heading Notes, as [1] The proofs follow the order of the lecture notes. The [1] in the Introduction points to it. A Docs add-on cannot create real Docs footnotes, so this is the closest it gets; if you want a real one, use Insert › Footnote and move the text.

3. The bibliography

The two .bib entries were not written into the page. They were saved to the document’s Bibliography on the Export / Import tab, which now shows “2 entries”:

The Export Import tab after the import: the Bibliography (.bib) row shows a 2 entries badge, above Convert to LaTeX and a License row marked Licensed

This is the Bibliography that Export reads. When the document is exported again, each [@key] marker goes back to \cite{key} and the entries go back into the file, so keep the markers as they are while you edit. The Bibliography belongs to the whole document, not to one tab. If the document already has a different bibliography, Import does not overwrite it and says so.

4. Turning the equations into images

When the text is settled, or whenever you want the reader to see rendered maths, open the Scan tab and press Scan Document. In this file it found “12 equation(s) — display: 2, inline: 10”, the same count the import summary gave. Convert All replaced all 12, including the matrices inside the table cells:

The same document after Convert All with the sidebar showing 12 12 converted: rendered inline equations in the Introduction and the bullet points, the characteristic polynomial as an image, and the table with rendered 2 by 2 matrices in the first column

The lower part after conversion: the table with rendered matrices and plus-or-minus i, the italic table caption, the bold image placeholder, the Caption line, the remark section with a rendered inequality, and the Notes heading with the footnote text

One thing to know: the two display equations become images at inline size, aligned left, not centred on their own line as they would be in the PDF. Centre them with the paragraph alignment button if it matters. Scan works on the tab you are in; in a document with several tabs, run it in each one.

From here the document is an ordinary Google Docs™ file: share it, comment, suggest edits. To change an equation after conversion, Revert to LaTeX on the Scan tab turns it back into source.

5. What else changes on the way in

The file above did not use every case. From the add-on’s own rules, the ones you are most likely to meet:

In the .texIn the document
\ref{key}the text [ref:key]
\label{…}dropped
% commentsdropped
a command Import does not knowthe command and its argument, kept as monospace source
an environment Import does not knowthe whole environment, kept as monospace lines
\tableofcontentsa bold line telling you to use Insert › Table of contents
\usepackage linesnot written; Export writes its own preamble

Each of these appears as a note in the pick summary before you press Import. The exception is packages that Export writes itself (such as amsmath or graphicx): they are skipped without a note.

6. Where it stops

Import gets the text, the structure Docs can hold, and the equations in. It does not bring back what Docs has no place for: real footnotes, captions tied to their figure, cross-references that update, the figure files. The parts that need your hand are marked in the document itself — the bold placeholder lines, [1], [ref:…], [@…] — so you can find them by searching for [. What does come back unchanged when a document goes from Docs to .tex and back is measured in Google Docs™ to LaTeX and back.

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

구글 문서로 만든 시험지·학습지, LaTeX 파일로 바꾸는 법

구글 문서로 쓴 논문 초안, Overleaf로 옮기기