Skip to content

Instantly share code, notes, and snippets.

@alfanick
Created January 30, 2015 14:59
Show Gist options
  • Save alfanick/a93059e5de0af56208e1 to your computer and use it in GitHub Desktop.
Save alfanick/a93059e5de0af56208e1 to your computer and use it in GitHub Desktop.
def include_tex(code)
code.gsub /\\\input{"(.+)"}/ do
include_tex(File.read(Regexp.last_match[1]))
end
end
File.write(ARGV[0] ||= 'thesis.tex', include_tex(File.read(ARGV[0])))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment