[OS X TeX] help with \newcommand

Ramón Figueroa-Centeno ramonf at hawaii.edu
Sat Jun 5 16:10:39 CEST 2010


I want to define a new command that will make my life a lot easier. Here is
what I would like:

\newcommand{\foo}[1]{#1 $\#1$}

So that I could invoke it as "\foo{aleph}" I get the same as if I typed
"aleph $\aleph$" (no backslash on the first character).

Also, much harder (I think):

a command that would do URL encoding right from within LaTeX to pass
arguments to the hyperref package:

\newcommand{\foo2}[1]{\href{<#1 url encoded>}{#1}}

so that "\foo2{Hello you}" would yield the same as typing
"\href{http://Hello%20you}{Hello you}"


View this message in context: http://macosx-tex.576846.n2.nabble.com/help-with-newcommand-tp5142889p5142889.html
Sent from the MacOSX-TeX mailing list archive at Nabble.com.

More information about the macostex-archives mailing list