Skip to content

Instantly share code, notes, and snippets.

@maxbeier
maxbeier / combine-latex.sh
Last active August 29, 2015 14:06
Takes a LaTeX file, replaces all `\input`s with the actual content and combines everything into a single file.
cat input.tex | ruby -pe '$_.match(/[^%]\\input\{(.+?)\}/) { $_ = IO.binread($1 + ".tex") + "\n\r" }' > output.tex

Keybase proof

I hereby claim:

  • I am maxbeier on github.
  • I am maxbeier (https://keybase.io/maxbeier) on keybase.
  • I have a public key whose fingerprint is 5078 9393 038A 4A59 84E8 8B3D EBA6 69AD 4055 F343

To claim this, I am signing this object: