jneug / typst-codelst

A typst package to render sourcecode
MIT License
87 stars 5 forks source link

Allow selection that does not select line numbers #6

Open qrnch-jan opened 1 year ago

qrnch-jan commented 1 year ago

I apologize in advance for this (probably) annoying request, because I struggled with accomplishing this in HTML/CSS, and I can't imagine that it's more fun in PDF (it may not even currently be possible in typst?):

I have a document that contains some reference code. While the reference code isn't meant to be used as-is, I realize that in practice most readers will likely copy and paste the code into their editor of choice. It would be nifty if, when selecting the code, the line numbers are omitted.

jneug commented 11 months ago

This should work already, but might depend on the PDF-Viewer you use. Maybe this will be more robust once I'm done rewriting the package for Typst 0.0.9.

qrnch-jan commented 11 months ago

Interesting -- thanks, I'll try a few different readers and report back the results.

Edit: I just tried two so far, but Preview on macOS doesn't handle it (which is unfortunate, for me (since that's what I use most often)), but Firefox handles it correctly.

9SMTM6 commented 3 months ago

@qrnch-jan huh, firefox does that for you? With the up to date version too? For me on linux it sadly doesnt seem to work, in neither Firefox, Chromium, Okular nor VSCode-pdf.

Note I don't have a strong wish for this feature, It would've been neat, but oh well. Package is amazing as is.