Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Book feature Request -- keep indentation when copying code from pdf #202

Open
hlgchen opened this issue Jan 10, 2022 · 1 comment
Open

Comments

@hlgchen
Copy link

hlgchen commented Jan 10, 2022

It would be really helpful if indents were kept when copying code snippets from the pdf version of the book. (I don't know how to do it though).
This could enable readers to experiment with code snippets faster and encourage more such behavior.

@TikhonJelvis
Copy link
Owner

Thanks for pointing this out! This is helpful feedback because I didn't even think to test copy-pasting from the PDF.

Doing a cursory search online, looks like there is no reliable way to do this—copy-pasting behavior varies on different PDF viewers and hacks that work for one break others. I see two alternatives:

  1. An HTML version of the book as an alternative to a PDF
  2. Links to copyable code samples as suggested on the TeX Stack Exchange

I'll need to play around with some of our setup a bit to test the two options, so for now solving this will have to go on my to-do list.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants