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

epoxy_latex() should actually use << and >> for open/close delimiter #107

Closed
gadenbuie opened this issue Aug 14, 2023 · 0 comments · Fixed by #110
Closed

epoxy_latex() should actually use << and >> for open/close delimiter #107

gadenbuie opened this issue Aug 14, 2023 · 0 comments · Fixed by #110
Milestone

Comments

@gadenbuie
Copy link
Owner

gadenbuie commented Aug 14, 2023

Currently, < and > are used for the open/close delimiters in epoxy_latex(), but somewhere in the documentation I wrote that it uses double angle brackets.

While single angle brackets are certainly easier to type, it's also easier to run into unavoidable errors if you use assignment operators like <- or actually write < in the text. In these cases, the glue parser simply cannot work with them (because they're inside the expression to be interpolated) and no amount of escaping will make it work.

pkgload::load_all()
#> ℹ Loading epoxy

x <- 0
epoxy_latex("< x <- a >", a = 1)
#> Error in glue_data(.x = .data, ..., .sep = .sep, .envir = glue_env, .open = .open, : Expecting '>'
epoxy_latex("< x <<- a >", a = 2)
#> Error in glue_data(.x = .data, ..., .sep = .sep, .envir = glue_env, .open = .open, : Expecting '>'
epoxy_latex("<< x <- a >>", a = 3, .open = "<<", .close = ">>")
#> 3
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

Successfully merging a pull request may close this issue.

1 participant