hi davide, i'm copying the code which define the \probmax function.
but this function is a mathematic one, it's made up to write better mathematic problem in a particular form....so it's a mathematic command, not other latex commands.
this is the code:
%
% PREAMBLE.TEX
% written by RDL
% version 2.0
% last modified October 8, 1998
%
\def\fileversion{2.1}
\def\filedate{1998/11/15}
\wlog{LaTeX `preamble' \fileversion\space<\filedate> (RDL)}
\typeout{LaTeX `preamble' \fileversion\space<\filedate> (RDL)}
\makeatletter
%
% shortcut definition
%
\newcommand{\lineitem}[1]{\item[#1]\mbox{}}
\newcommand{\oneto}[1]{1, \ldots, {#1}}
\newcommand{\dst}{\displaystyle}
\newcommand{\ie}{i.e., }
\newcommand{\POW}{Piece-Of-Work }
\newcommand{\POWs}{Piece-Of-Works }
\newcommand{\RHS}{right--hand-side}
\newcommand{\LHS}{left--hand-side}
%
% roman text in mathmode commands
%
\newcommand{\insmat}[1]{\mathop{\mbox{\rm #1}}} % for mathmode
%(with underlines)
\newcommand{\inmat}[1]{\mbox{\rm {#1}}} % roman text in mathmode
\def\1{{\mathchoice {\roman {1\mskip-4mu l}} {\roman {1\mskip-4mu l}}
{\roman {1\mskip-4.5mu l}} {\roman {1\mskip-5mu l}}}}
%
% common definitions needed
%
\newcommand{\geeq}{ { {{}\atop{>}}\atop{{=}\atop{}}}}
\newcommand{\leeq}{ { {{}\atop{<}}\atop{{=}\atop{}}}}
\newcommand{\infinity}{\infty}
%\newcommand{\ip}[2]{\left\langle #1,#2 \right\rangle}
\newcommand{\ip}[2]{{#1}^T{#2}}
\newcommand{\inv}[1]{#1^{-1}}
\newcommand{\norm}[1]{\left\| #1 \right\|}
\newcommand{\pnorm}[2]{\norm{#1}_#2}
\newcommand{\pop}[1]{P_{#1}}
\newcommand{\ppop}[2]{P_{#2,#1}}
\newcommand{\pproj}[3]{P_{#2,#1}(#3)}
\newcommand{\proj}[2]{\pop{#1}(#2)}
\newcommand{\modulus}[1]{\left| #1 \right|}
\newcommand{\set}[2]{\left\{ #1 \mid #2 \right\}}
\newcommand{\seq}[1]{\left\{ #1 \right\}}
\newcommand{\goes}{\rightarrow}
\newcommand{\nin}{\in\hspace*{-1.8ex}/\hspace*{1.0ex}}
\newcommand{\abs}[1]{\left | #1 \right |}
\newcommand{\der}{\nabla}
\@ifundefined{grad}
{
\newcommand{\grad}{\nabla}
}{}
\newcommand{\half}{\frac{1}{2}}
\newcommand{\intsect}{\bigcap}
\newcommand{\summ}[2]{\sum_{#1}^{#2}}
\newcommand{\union}{\cup}
\newcommand{\define}{:=}
\newcommand{\ldef}{:=}
%\newcommand{\ldef}{\mathrel{\raise.095ex\hbox{:}\mkern-4.2mu=}}
%\newcommand{\ldef}{\stackrel{\mathrm{def}}{=}}
\newcommand{\rdef}{=:}
\newcommand{\msp}{\;\;}
\newcommand{\floor}[1]{\lfloor{#1}\rfloor}
\newcommand{\ceil}[1]{\lceil{#1}\rceil}
\newcommand\refe[1]{(\ref{#1})}
%
% common number system
%
\@ifundefined {flalign}
{
\newcommand{\real}[1]{{\mathrm I\!R}^{#1}}
\def\C{{\mathrm\;\rule{.1em}{1.55ex}\!\!C}}
\def\R{\inmat{\rm I}\!\inmat{\rm R}}
\def\Q{{\mathrm\;\rule{.1em}{1.55ex}\!\!Q}}
\def\Z{{{\mathrm Z}\!\!{\mathrm Z}}}
\def\N{\inmat{\mathrm I}\!\inmat{\mathrm N}}
}
{
\newcommand{\field}[1]{\mathbb #1}
\def\C{\field{C}}
\def\R{\field{R}}
\def\Q{\field{Q}}
\def\Z{\field{Z}}
\def\N{\field{N}}
}
\def\reals{\openR}
\def\integers{\openN}
\def\Fm{\openF^m}
\def\Fn{\openF^n}
\def\Rm{\openR^m}
\def\Rl{\openR^l}
\def\Rn{\openR^n}
\def\Rd{\openR^d}
\def\Rs{\openR^s}
\def\Cs{\openC^s}
\def\Rmn{\openR^{m\times n}}
\def\Rnm{\openR^{n\times m}}
\def\Zm{\openZ^m}
\def\Zn{\openZ^n}
\def\Zd{\openZ^d}
\def\Zs{\openZ^s}
%
% misc
%
\def\setstretch#1{\renewcommand{\baselinestretch}{#1}}
\def\suchthat{\hbox{\mathrm\ s.t.\ }}
\def\cond{\mathop{\mathrm cond}}
\def\vol{\mathop{\mathrm vol}}
\def\dom{\mathop{\mathrm dom}}
\def\ran{\mathop{\mathrm ran}}
\def\tar{\mathop{\mathrm tar}}
\def\jump{\mathop{\mathrm jump}}
\def\for{\mathop{\mathrm for}}
\def\all{\mathop{\mathrm all}}
% note: since \span is a plain TeX operator, use something else here
\def\diam{\mathop{\mathrm diam}}
\def\signum{\mathop{\mathrm signum}}
\def\area{\mathop{\mathrm area}}
\def\const{{\mathrm const}{}}
\def\supp{\mathop{\mathrm supp}}
\def\meas{\mathop{\mathrm meas}}
\def\boldA{{{\bf A}}}
\def\boldB{{{\bf B}}}
\def\boldC{{{\bf C}}}
\def\boldK{{{\bf K}}}
\def\boldL{{{\bf L}}}
\def\boldO{{{\bf O}}}
\def\cA{\mathcal A}
\def\cB{\mathcal B}
\def\cD{\mathcal D}
\def\cF{\mathcal F}
\def\cZ{\mathcal Z}
\def\cN{\mathcal N}
\def\cM{\mathcal M}
\def\cK{\mathcal K}
\def\openA{{{\mathrm A}\kern-.63em{\mathrm A}}}
\def\openB{{{\mathrm I}\kern-.16em {\mathrm B}}}
\def\openC{{\mathrm C\kern-.18cm\vrule width.6pt height 6pt depth-.2pt \kern.18cm}}
\def\openD{{{\mathrm I}\kern-.16em {\mathrm D}}}
\def\openF{{{\mathrm I}\kern-.16em {\mathrm F}}}
\def\openI{{{\mathrm I}\kern-.2em {\mathrm I}}}
\def\openH{{{\mathrm I}\kern-.16em {\mathrm H}}}
\def\openK{{{\mathrm I}\kern-.16em {\mathrm K}}}
\def\openN{{{\mathrm I}\kern-.16em {\mathrm N}}}
\def\openP{{{\mathrm I}\kern-.16em {\mathrm P}}}
\def\openQ{{\mathrm Q\kern-.21cm\vrule width.6pt height 6.2ptdepth-.2pt \kern.21cm}}
\def\openQ{{{\mathrm Q}\kern-.63em {\mathrm Q}}}
\def\openR{{{\mathrm I}\kern-.16em {\mathrm R}}}
\def\openS{{{\mathrm S}\kern-.68em{\mathrm S}}}
\def\openT{{{\mathrm T}\kern-.30em {\mathrm T}}}
\def\openZ{{{\mathrm Z}\kern-.28em{\mathrm Z}}}
\def\sumZ{\sum_{j\in\Zd}}
\def\Iff{\hskip1em\Longleftrightarrow\hskip1em}
\def\iff{\Longleftrightarrow}
\def\Implies{\hskip1em\Longrightarrow\hskip1em}
\def\implies{\Longrightarrow}
\def\Implied{\hskip1em\Longleftarrow\hskip1em}
\def\implied{\Longleftarrow}
\def\ga{\alpha}
\def\gA{{\mathrm A}}
\def\gb{\beta}
\def\gB{{\mathrm B}}
\def\gga{\gamma}
\def\gG{\Gamma}
\def\gd{\delta}
\def\gD{\Delta}
\def\gep{\epsilon}
\def\gz{\zeta}
\def\gZ{{\mathrm Z}}
\def\gth{\theta}
\def\gTh{\Theta}
\def\gk{\kappa}
\def\gl{\lambda}
\def\gL{\Lambda}
\def\gm{\mu}
\def\gM{\mathrm M}
\def\gn{\nu}
\def\gf{\varphi}
\def\gF{\Phi}
\def\gy{\upsilon}
\def\gk{\kappa}
\def\gs{\sigma}
\def\gS{\Sigma}
\def\gt{\tau}
\def\gT{{\mathrm T}}
\def\gr{\varrho}
\def\gR{{\mathrm P}}
\def\Chi{{\mathrm X}}
\def\go{\omega}
\def\gO{\Omega}
%
% Shortcut for commands
%
\newcommand{\SingleSpace}{\edef\baselinestretch{0.9}\Large\normalsize}
\newcommand{\DoubleSpace}{\edef\baselinestretch{1.4}\Large\normalsize}
\newcommand{\Heading}[1]{\par\noindent{\bf#1}\nopagebreak\ }
\newcommand{\Tail}[1]{\nopagebreak\par\noindent{\bf#1}}
\newcommand{\QED}{\vrule height 1.4ex width 1.0ex depth -.1ex\ } % square box
\@ifundefined{flalign}
{
}
{
\renewcommand{\atop}[2]
{\genfrac{}{}{0pt}{}{#1}{#2} }
}
%
% convex analysis definitions
%
\@ifundefined{flalign}
{
\newcommand{\Aff}{\insmat{aff}}
\newcommand{\Conv}{\insmat{conv}}
\newcommand{\Diag}{\insmat{diag}}
\newcommand{\Eff}{\insmat{eff}}
\newcommand{\Paral}{\insmat{par}}
\newcommand{\Intr}{\insmat{int}}
\newcommand{\Ri}{\insmat{ri}}
\newcommand{\Cl}{\insmat{cl}}
\newcommand{\Co}{\insmat{co}}
\newcommand{\Bdry}{\insmat{bdry} }
\newcommand{\Cone}{\insmat{cone} }
\newcommand{\Rec}{\insmat{rec} }
\newcommand{\Lin}{\insmat{lin} }
\newcommand{\EEP}{\insmat{EP} }
}
{
\RequirePackage{amsgen}
\DeclareMathOperator*{\Aff}{aff}
\DeclareMathOperator*{\Conv}{conv}
\DeclareMathOperator*{\Diag}{diag}
\DeclareMathOperator*{\Eff}{eff}
\DeclareMathOperator*{\Paral}{par}
\DeclareMathOperator*{\Intr}{int}
\DeclareMathOperator*{\Ri}{ri}
\DeclareMathOperator*{\Cl}{cl}
\DeclareMathOperator*{\Co}{co}
\DeclareMathOperator*{\Bdry}{bdry}
\DeclareMathOperator*{\Cone}{cone}
\DeclareMathOperator*{\Rec}{rec}
\DeclareMathOperator*{\Lin}{lin}
\DeclareMathOperator*{\EEP}{EP}
}
\newcommand{\aff}[1]{\Aff #1}
\@ifundefined{diag}
{
\newcommand{\diag}[1]{\Diag\left (#1 \right )}
}{}
\newcommand{\eff}[1]{\Eff #1}
\newcommand{\conv}[1]{\Conv #1}
\newcommand{\paral}[1]{\Paral #1}
\newcommand{\intr}[1]{\Intr #1}
\newcommand{\ri}[1]{\Ri #1}
\newcommand{\cl}[1]{\Cl #1}
\newcommand{\co}[1]{\Co\left( #1 \right)}
\newcommand{\clco}[1]{\cl{\co{#1}}}
\newcommand{\bdry}[1]{\Bdry #1}
\newcommand{\cone}[1]{\Cone #1}
\newcommand{\rec}[1]{\Rec #1}
\newcommand{\lin}[1]{\Lin #1}
\newcommand{\EP}[1]{\EEP\left (#1 \right )}
\newcommand{\barrier}[1]{\insmat{bar} #1}
\newcommand{\conj}[1]{#1^*}
\newcommand{\indicator}[2]{\psi(#1 \mid #2)}
\newcommand{\indfn}[1]{\indicator{\cdot}{#1}}
\newcommand{\support}[2]{\conj{\psi}(#1 \mid #2)}
\newcommand{\suppfn}[1]{\support{\cdot{#1}}}
\newcommand{\dist}[2]{\insmat{dist}(#1 \mid #2)}
\newcommand{\distfn}[1]{\dist{\cdot}{#1}}
\newcommand{\ncone}[2]{N(#1 \mid #2)}
\newcommand{\tcone}[2]{T(#1 \mid #2)}
\newcommand{\pcone}[1]{{#1}^\circ}
\newcommand{\polar}[1]{{#1}^\circ}
\newcommand{\epi}[1]{\insmat{epi} #1}
\newcommand{\epiwrt}[2]{\inmat{epi}_{#2}#1 }
%
% numerical analysis definition
%
\@ifundefined{flalign}
{
\def\Rank{\mathop{\mathrm rank}}
\def\SSpan{\mathop{\mathrm span}}
\def\NNull{\mathop{\mathrm null}}
}
{
\RequirePackage{amsgen}
\DeclareMathOperator*{\Rank}{rank}
\DeclareMathOperator*{\SSpan}{span}
\DeclareMathOperator*{\NNull}{null}
}
\@ifundefined{rank}
{
\newcommand{\rank}[1]{\Rank #1}
}{}
\newcommand{\Span}[1]{\SSpan #1}
\newcommand{\spam}[1]{\SSpan #1}
\newcommand{\Null}[1]{\NNull #1}
%
% shorter definitions for common usages
%
\newcommand{\ba}{\begin{array}}
\newcommand{\ea}{\end{array}}
\newcommand{\bc}{\begin{center}}
\newcommand{\ec}{\end{center}} \newcommand{\ds}{\displaystyle}
\newcommand{\arrayc}[1]{\ba{c} #1 \ea}
\newcommand{\be}{\begin{equation}}
\newcommand{\ee}{\end{equation}}
%
% problem definitions and mathematical constructions
%
\newcommand{\argmin}{\insmat{argmin}}
\DeclareOption{italian}
{
\newcommand{\subjectto}{\insmat{soggetto a}}
\newcommand{\maximize}{\insmat{max}}
\newcommand{\minimize}{\insmat{min}}
}
\DeclareOption{english}
{
\newcommand{\subjectto}{\insmat{subject to}}
\newcommand{\maximize} {\insmat{max}}
\newcommand{\minimize} {\insmat{min}}
}
\ProcessOptions
\newcommand{\eeqncond}[3]
{\begin{equation} \ba{rl} #1 & \mbox{ #2} \ea \label{#3}
\end{equation}}
\newcommand{\eqncond}[2]
{\[ \ba{rl} #1 & \mbox{ #2} \ea \] }
\newcommand{\simpleproblem}[3]
{\ba{lc} {\ds #3_{#2}} & {#1} \ea}
\newcommand{\epmin}[3]
{\begin{equation} \simpleproblem{#1}{#2}{\minimize} \label{#3}
\end{equation}}
\newcommand{\pmin}[2]
{\[ \simpleproblem{#1}{#2}{\minimize} \] }
\newcommand{\epmax}[3]
{\begin{equation} \simpleproblem{#1}{#2}{\maximize} \label{#3}
\end{equation}}
\newcommand{\pmax}[2]
{\[ \simpleproblem{#1}{#2}{\maximize} \] }
\newcommand{\problem}[4]
{\ba{lc} {\ds #4_{#1}} & {#2} \\*
{\subjectto} & {\ba[t]{c} #3 \ea}
\ea}
\newcommand{\eprobmin}[4]
{\begin{equation} \problem{#1}{#2}{#3}{\minimize} \label{#4}
\end{equation}}
\newcommand{\probmin}[3]
{\[ \problem{#1}{#2}{#3}{\minimize} \] }
\newcommand{\eprobmax}[4]
{\begin{equation} \problem{#1}{#2}{#3}{\maximize} \label{#4}
\end{equation}}
\newcommand{\probmax}[3]
{\[ \problem{#1}{#2}{#3}{\maximize} \] }
\newcommand{\compproblem}[2]
{ \ba{rcl} #2 \ge 0 \\* #1 \ge 0 \\* \ip{#1}{#2} = 0 \ea }
\newcommand{\compproblemb}[2]
{ \ba{rcl} #2 \ge 0 \\* #1 \ge 0 \\* \ip{#1}{(#2)} = 0 \ea }
\newcommand{\ecomp}[3]
{\begin{equation}
\compproblem{#1}{#2} \label{#3}
\end{equation}}
\newcommand{\ecompb}[3]
{\begin{equation}
\compproblemb{#1}{#2} \label{#3}
\end{equation}}
\newcommand{\comp}[2]
{\[ \compproblem{#1}{#2} \] }
\newcommand{\compb}[2]
{\[ \compproblemb{#1}{#2} \] }
%
% theorem and the like
%
\@ifundefined {flalign}
{
\def\emptybox
{
{\ \vbox{\hrule \hbox%
{%
\vrule height 1.3ex%
\hskip 0.8ex\vrule%
}\hrule%
}
}
}
\def\qed{\emptybox}
\def\endproof{\par \hfill \qed \par}
} { }
\DeclareOption{italian}
{
\newtheorem{thm}{Teorema}[section]
\newtheorem{cor}[thm]{Corollario}
\newtheorem{lem}[thm]{Lemma}
\newtheorem{prop}[thm]{Proposizione}
\newtheorem{fact}{Fatto}[section]
\@ifundefined {flalign} { }
{
\theoremstyle{definition}
}
\newtheorem{defn}{Definizione}[section]
\@ifundefined {flalign} { }
{
\theoremstyle{remark}
}
\newtheorem{remark}{Nota}[section]
\@ifundefined {flalign} { }
{
\theoremstyle{remark}
}
\newtheorem{Note}[remark]{Nota}
\newtheorem{conjecture}{Congettura}[section]
\newtheorem{exa}{Esempio}[section]
\@ifundefined {flalign}
{
\def\proof{\par\noindent{%
{\bf Dimostrazione.}%
\ignorespaces}}{ }
}
{
\renewcommand{\proofname}{Dimostrazione}
}
}
\DeclareOption{english}
{
\newtheorem{thm}{Theorem}[section]
\newtheorem{cor}[thm]{Corollary}
\newtheorem{lem}[thm]{Lemma}
\newtheorem{prop}[thm]{Proposition}
\newtheorem{fact}{Fact}[section]
\@ifundefined {flalign} { }
{
\theoremstyle{definition}
}
\newtheorem{defn}{Definition}[section]
\@ifundefined {flalign} { }
{
\theoremstyle{remark}
}
\newtheorem{remark}{Remark}[section]
\newtheorem{Note}[remark]{Remark}
\newtheorem{conjecture}{Conjecture}[section]
\newtheorem{exa}{Example}[section]
\@ifundefined {flalign}
{
\def\proof{\par\noindent{%
{\bf Proof.}%
\ignorespaces}}{ }
}{ }
}
\ProcessOptions
%\def\proof{\par\noindent{%
% \ifx\dateitalian\undefined%
% {\bf Proof}%
% \else%
% {\bf Dimostrazione}%
% . \ignorespaces}}
%\def\endproof {\par \hfill \emptybox \par}
%\def\blackbox{\vrule height 1.3ex width 0.8ex }
%\def\emptybox
%{
% {\ \vbox{\hrule \hbox%
% {%
% \vrule height 1.3ex%
% \hskip 0.8ex\vrule%
% }\hrule%
% }
% }
%}
%
% definition command
%
\makeatletter
\@ifundefined {flalign}
{
\newcommand\ifdefin[5]
{\[ #1 \define \left \{
\begin{array}{ll}
#2 & #3 \\ \\
#4 & #5
\end{array}
\right . \] }
}{ }
\makeatother
now can you tell me how can i introduce this function, so that jsMath can compile it like another mathematic command?
thank you Davide