# Scenario

I want to create a new PSTricks object, e.g., \myBatLogo[<key-val options>]{}{}...{} that is not a redefinition of a built-in PSTricks object.

It means that any redefinition as follows does not make sense in my scenario.

\newpsobject{myBatLogo}{<built-in PSTrick object>}


# Question

How to define a new PSTrick object that is not a redefinition of a built-in PSTricks object? It must accept key-value optional arguments and mandatory arguments.

-
a curve, an area, or something special? –  Herbert Jan 11 '11 at 14:26
@Herbert: for simplicity, let the new object just draw BATMAN logo with fillcolor as an optional argument and the center bounding box position {x,y} as the mandatory argument. –  xport Jan 11 '11 at 14:36
I have no idea about PSTricks, but can't you simply define a macro (maybe using keyval for the optional arguments) that expands to the code to draw the object using built-in PSTrick objects? –  Juan A. Navarro Jan 11 '11 at 15:19
@Juan: It is possible but I want to use the mechanism the PSTricks authors use. –  xport Jan 11 '11 at 16:39

\documentclass{article}
\usepackage{pstricks}
\makeatletter
\def\psBatman{\pst@object{psBatman}}
\def\psBatman@i(#1)#2{%
\begin@ClosedObj%
\rput(#1){\psframebox{#2}}
\end@ClosedObj%
}
\makeatother

\begin{document}
\pspicture(7,7)
\psBatman(1,1){Batman}

Is there a counterpart of \begin@ClosedObj ? Is it \begin@OpenObj ? –  xport Jan 11 '11 at 16:03
@xport: yes, that one can have line ends like arrows. And we have \begin@SpecialObj for special purposes. –  Herbert Jan 11 '11 at 16:08