I'm trying to make a wrapper for a latex command that has an optional
argument.  My current solution is to do the following to wrap a
command called `\foo`:

(define (foo #:opt [o #f] x)
  (if o
      (make-multiarg-element (make-style "SfooOpt" '(multicommand))
                             (list (decode-string o)
                                   (decode-string x)))
      (make-element (make-style "foo" '(command))
                    (decode-string x))))

And then I have to insert a definition in the latex:

\newcommand{\SfooOpt}[2]{\foo[#1]{#2}}

Is there a better way to accomplish this?

David

-- 
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.

Reply via email to