racket / scribble

Other
201 stars 93 forks source link

Emails are treated differently in acmart #185

Closed shhyou closed 5 years ago

shhyou commented 6 years ago

On Racket & scribble HEAD, emails are being escaped in the same way as the main body, causing emails like a-b.c@d.edu to be typeset as a{-}b.c@d.edu. This doesn't seem to be the case for Racket 7.0 (I'm not very sure about the version here).

The scribble file:

#lang scribble/acmart @acmsmall

@title{Title}
@author[#:email "a-b.c@d.edu"]{First Last}

What is the better way to get back a-b.c@d.edu here? Would adding a keyword argument to email to allow typesetting emails with 'exact-chars style property be an acceptable solution?

bennn commented 6 years ago

On Racket 6.12 and Racket 7, I'm seeing a-b.c@d.edu typeset as a{-}b.c@d.edu. So maybe this isn't a regression?

Changing email sounds good --- either by adding a keyword or changing the default behavior. (Changing the default would make email more useful, IMO.)

rfindler commented 6 years ago

What (if anything?) do the (latex level) docs say for the form that the email address gets dropped into?

bennn commented 6 years ago

That \email{....} is both typeset in the manuscript and used by metadata extraction tools. https://www.acm.org/binaries/content/assets/publications/consolidated-tex-template/acmart.pdf

Sounds like a +1 for 'exact-chars

rfindler commented 5 years ago

That doesn't seem very specific. I guess 'exact-chars will be an improvement. Might it be worth looking at the email RFC and adding s contract and checking how any latex-strange chars (like % or curly braces) typeset?

Robby

On Sat, Nov 10, 2018 at 8:45 PM Ben Greenman notifications@github.com wrote:

That \email{....} is both typeset in the manuscript and used by metadata extraction tools.

https://www.acm.org/binaries/content/assets/publications/consolidated-tex-template/acmart.pdf

Sounds like a +1 for 'exact-chars

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/racket/scribble/issues/185#issuecomment-437638957, or mute the thread https://github.com/notifications/unsubscribe-auth/AAYWsC0mJ9X2Js-gHrf7P9dgXeDIsQzXks5ut48qgaJpZM4YNHkG .

shhyou commented 5 years ago

The doc I can find for \email points to the the amsart package and the actual TeX implementation, which I have no knowledge of.

Looks like the email RFC (https://tools.ietf.org/html/rfc5322, local part -> dot-atom -> atext) allows pretty much any character except parenthesis and brackets. When typesetting, # and % needs to be escaped as \# and \% but others don't.

Is there a way to control scribble to escape only # and %?

rfindler commented 5 years ago

I think it would have to be at the "@email" level. Use exact chars and do the escaping there, I guess?

Robby

On Sun, Nov 11, 2018 at 9:58 AM shuhung notifications@github.com wrote:

The doc I can find for \email points to the the amsart package and the actual TeX implementation, which I have no knowledge of.

Looks like the email RFC (https://tools.ietf.org/html/rfc5322, local part -> dot-atom -> atext) allows pretty much any character except parenthesis and brackets. When typesetting, # and % needs to be escaped as # and \% but others don't.

Is there a way to control scribble to escape only # and %?

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/racket/scribble/issues/185#issuecomment-437681906, or mute the thread https://github.com/notifications/unsubscribe-auth/AAYWsPQlukRNxAGavcCdmuI75jCK4VmKks5uuEkxgaJpZM4YNHkG .

shhyou commented 5 years ago

The @email takes arbitrary pre-content?. How can I handle this? Should I call decode-content and do the escaping for each of the decoded content? that is a string?, ignoring other kinds of content??

bennn commented 5 years ago

How about: escape string arguments & do nothing for other arguments.

It seems like a bad idea to traverse a decoded content escaping strings, because those strings might be in an exact-chars element already.

rfindler commented 5 years ago

But that will make the function be strange to people and refactorings won't work.

Robby

On Mon, Dec 17, 2018 at 5:18 PM Ben Greenman notifications@github.com wrote:

How about: escape string arguments & do nothing for other arguments.

It seems like a bad idea to traverse a decoded content escaping strings, because those strings might be in an exact-chars element already.

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/racket/scribble/issues/185#issuecomment-448035884, or mute the thread https://github.com/notifications/unsubscribe-auth/AAYWsCoYPA1oWlcsqRvDJVi7Ob6umdRqks5u6CZPgaJpZM4YNHkG .

shhyou commented 5 years ago

In that case, perhaps a better way is just to add a new function that takes (or/c string? (listof string?)), do proper escaping and wrap the result in an email?. What do you think?

rfindler commented 5 years ago

Sure.