Skip to content

Instantly share code, notes, and snippets.

@bshillingford
Last active March 1, 2024 12:50
Show Gist options
  • Select an option

  • Save bshillingford/6259986edca707ca58dd to your computer and use it in GitHub Desktop.

Select an option

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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@sergeyf

sergeyf commented Jan 17, 2016

Copy link
Copy Markdown

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
Copy Markdown
Author

@sergeyf Good catch, thanks!

@stared

stared commented May 14, 2016

Copy link
Copy Markdown

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
Copy Markdown

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