How to never transcribe numbers again

Transcribing numbers correctly is both difficult and boring. I’ve come up with two workflows for avoiding number transcription when writing research papers. They both require programmatically defining, exporting, and writing statistics you plan to report inline (see here for a discussion on how to do this for tables 1) For LaTex, the process is simple: you can print out a list of macros (of the form \macro{item_name}{value}), and refresh the macros every time you’d like to refresh your results. For Google Docs, the procedure is a bit more involved:

  1. Make internal + external Google Docs and a results Google Sheet. The internal doc is for edits, internal comments, and variable names; the external document is automatically populated with data. The Google Sheet will store all data in key-value format.
  2. Export data you intend to report to a CSV file. The first column should contain the item name and the second column the item value.
  3. Import CSV into Google Sheet. Ensure the sheet name is ‘output_results’, as expected by the script.
  4. Modify script to include file IDs. The file IDs are at the end of each URL; remove trailing modifiers.
  5. Upload script to App Scripts. You can find the code here, and upload here.
  6. Run the Google App script. The script will prompt you for permissions on its first run. The script will generate the external document according to the internal document, replacing instances of KEY_A with VALUE_A, for all keys in the Google Sheet. Comments on the internal document will also transfer to the external document, but this function is easily removed.
  7. Invite collaborators to comment on the external document. I restrict access to the internal doc to a smaller set of collaborators, who can then carefully propagate the feedback into the internal state.

I produced the code in close collaboration with ChatGPT, making this a doubly generative procedure. The two document set-up is admittedly clunky – I landed here because a single document doesn’t allow for paper regeneration (since you’d overwrite your variable names).

Email me if you have better ideas, or about ways you embed reproducibility into your research.

Divya

  1. To transcribe tables of results in LaTex, use the pandas to_latex() function! I often write post-processing functions that modify this string to e.g. bold the best result across columns. To transcribe tables of results into a Google Doc, use the to_markdown() function. Copy the outputted text, right-click at the desired location, and select ‘Paste from Markdown’. 

Written on October 25, 2025