Skip to content

Instantly share code, notes, and snippets.

@slochower
slochower / diff.py
Created July 8, 2019 16:44
LaTeX diff for Manubot
import subprocess as sp
import argparse
import os
import shutil
import glob
ap = argparse.ArgumentParser()
ap.add_argument("--format", required=True, help="Manuscript diff output format.")
ap.add_argument("--first_commit", required=True, help="First commit for `diff`.")
ap.add_argument("--second_commit", required=False, help="Second commit for `diff` (can be '').")
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@slochower
slochower / diff tmp.log tmp-d.log
Created August 23, 2017 17:46
diff between inline math and display math using Mathjax and wkhtmltopdf
$ diff tmp.log tmp-d.log
237c237
< <p>This is the equation for a line <span class="math inline"><span class="MathJax_Preview" style="color: inherit; display: none; "></span><span id="MathJax-Element-1-Frame" class="mjx-chtml MathJax_CHTML" tabindex="0" style="font-size: 113%; position: relative; " data-mathml="&lt;math xmlns=&quot;http://www.w3.org/1998/Math/MathML&quot;&gt;&lt;mi&gt;y&lt;/mi&gt;&lt;mo&gt;=&lt;/mo&gt;&lt;mi&gt;m&lt;/mi&gt;&lt;mi&gt;x&lt;/mi&gt;&lt;mo&gt;+&lt;/mo&gt;&lt;mi&gt;b&lt;/mi&gt;&lt;/math&gt;" role="presentation"><span id="MJXc-Node-1" class="mjx-math" aria-hidden="true"><span id="MJXc-Node-2" class="mjx-mrow"><span id="MJXc-Node-3" class="mjx-mi"><span class="mjx-char MJXc-TeX-math-I" style="padding-top: 0.224em; padding-bottom: 0.501em; padding-right: 0.006em; ">y</span></span><span id="MJXc-Node-4" class="mjx-mo MJXc-space3"><span class="mjx-char MJXc-TeX-main-R" style="padding-top: 0.058em; padding-bottom: 0.335em; ">=</span></span><span id="MJXc-Node-5" class="mjx-mi MJXc-space3