> On Sep 23, 2015, at 8:53 AM, Marc Kaufmann <marc.kaufman...@gmail.com> wrote:
> #lang racket/base > > (require scribble/base > scribble/core) > > (provide equation*) > > (define (mymath start end . strs) > (make-element (make-style "relax" '(exact-chars)) `(,start ,@strs ,end))) > > (define (equation* . strs) > (apply mymath "\\begin{equation*}" "\\end{equation*}" strs)) > > ---- > > I still do not understand why I have to type "\\" rather than "\". I get that > something somewhere is escaping the backslash. I am uncomfortable with this, > as it seems that "{" and "}" are not escaped, but since I do not know what is > and what isn't, I may at some point in the future get a cryptic error message > because I used a command or a character in the strings that gets unescaped. To avoid dealing with escapes like that, you could use the raw-string package, which lets you do this: raco pkg install raw-string #lang raw-string/raw-string racket/base #\$ (require scribble/base scribble/core) (provide equation*) (define (mymath start end . strs) (make-element (make-style "relax" '(exact-chars)) `(,start ,@strs ,end))) (define (equation* . strs) (apply mymath $[\begin{equation*}] $[\end{equation*}] strs)) Those don't have to be [] brackets, they could be (), {}, <>, "", '', ^^, or any other pair of characters, as long as you don't try to put the ending character in the string. You could also use at-exp for that, but raw-string is simpler. -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to racket-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.