Skip to content

Instantly share code, notes, and snippets.

@bshillingford
Last active March 1, 2024 12:50
Show Gist options
  • Star 37 You must be signed in to star a gist
  • Fork 10 You must be signed in to fork a gist
  • Save bshillingford/6259986edca707ca58dd to your computer and use it in GitHub Desktop.
Save bshillingford/6259986edca707ca58dd to your computer and use it in GitHub Desktop.
arxiv2kindle: recompiles an arxiv paper for kindle-sized screens, and sends it to your wifi-enabled kindle
Display the source blob
Display the rendered blob
Raw
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@sergeyf
Copy link

sergeyf commented Jan 17, 2016

Thanks for this great example!

To make the commented out part work you need quadruple backslash:

        src[i] = re.sub(r'\\includegraphics\[width=([.\d]+)\\(line|text)width\]',
                   '\\includegraphics[width={mul}\\\\textwidth,height={mul}\\\\textheight,keepaspectratio]'.format(mul=mul),
                   line)

@bshillingford
Copy link
Author

@sergeyf Good catch, thanks!

@stared
Copy link

stared commented May 14, 2016

Great! (Though, does not work on all papers, for understandable reasons.)
In any case, while I'm in love with Jupyter Notebook, for such tool it seems more natural to have a standalone script (pip-installable?), or something for Calibre.

@deepwilson
Copy link

Gives me following error:
! LaTeX Error: File "eso-pic.sty\" not found.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment