Preserve code indentations (+ colors?) when copying raw text/code from PDF #2017
Andrew15-5
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I have already seen discussion like this (probably for LaTeX +
minted
, maybe even for Typst).We can copy
\n
and\s
in PDF and all printable/visible characters. So is it technically possible to preserve indentations when copying code from PDF? If so, can Typst add this feature?So far, when I used
lualatex
+minted
+tcolorbox
I could do super beautiful frames with colorized code, but the code would lose all indentations (/^\s+/
) which is a big inconvenience (if the code block has indentations that is).Very close but still different problem is colorized code is copied as plain text. When copying from some places (IDE, HTML) the text in clipboard is in RTF (Rich Text Format) or maybe HTML. Is it technically possible to preserve colors of a text (not only code) in PDF? If so, what about Typst?
If there is a possibility of achieving this, this would level up PDF files to the same level of copying code snippets from sites like Stack Overflow or GitHub or copying colorized code from IDE like VS Code.
Beta Was this translation helpful? Give feedback.
All reactions