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

Why is ~ converted to $\sim$ by the LaTeX renderer? #370

Closed
benknoble opened this issue Jul 7, 2023 · 6 comments
Closed

Why is ~ converted to $\sim$ by the LaTeX renderer? #370

benknoble opened this issue Jul 7, 2023 · 6 comments

Comments

@benknoble
Copy link

This bit me recently because $\sim$ is hard to copy-paste as a tilde, and I had much better luck switching to \textasciitilde{} which is admittedly not as pretty in @racket and friends.

If there's no good reason, I'm happy to send this diff of scribble-lib/scribble/latex-render.rkt as a PR:

1078c1078
<                      [(#\~) "$\\sim$"]
---
>                      [(#\~) "{\\textasciitilde}"]
1457c1457
<         [(#\∼) "$\\sim$"]
---
>         [(#\∼) "{\\textasciitilde}"]
@racket-discourse-github-bot

This issue has been mentioned on Racket Discussions. There might be relevant details there:

https://racket.discourse.group/t/copy-paste-from-scribble-acmart-sigplan-into-drracket/2078/15

@rfindler
Copy link
Member

rfindler commented Jul 9, 2023

I think the second one of those is a different character that should actually be `$\sim$.

@benknoble
Copy link
Author

I think the second one of those is a different character that should actually be `$\sim$.

Oh, indeed it is! I don't think my font showed the difference well, but I can tell on GitHub at least. Let me check my font again; it might be worth a comment that it's not a regular tilde.

@rfindler
Copy link
Member

rfindler commented Jul 9, 2023

I think the second one of those is a different character that should actually be `$\sim$.

Oh, indeed it is! I don't think my font showed the difference well, but I can tell on GitHub at least. Let me check my font again; it might be worth a comment that it's not a regular tilde.

Yeah, mine didn't either! I just had a hunch so checked it by typing a regular tilde and comparing the two characters. 😄

I've (finally) finished running raco setup --doc-pdf with the change locally and it doesn't seem to cause any errors so I'm happy to merge a pull request. Or I can just push a commit too if that's easier?

@benknoble
Copy link
Author

Whichever is easier for you. Thanks for looking!

@benknoble
Copy link
Author

Closing the loop: my font does a better job distinguishing (0x223c) from ~ (0x7e) than I thought it did. I just made the mistake of not looking carefully; in retrospect, I should have questioned harder why there were two substitutions of the same character.

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

3 participants