That's what I'm doing.

On Sun, Mar 5, 2017 at 10:48 AM, Robby Findler
<ro...@eecs.northwestern.edu> wrote:
> Define two different commands at the latex level?
>
> Robby
>
> On Sun, Mar 5, 2017 at 9:39 AM David Van Horn <dvanh...@cs.umd.edu> wrote:
>>
>> 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.

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