|
D.8.2.10 texproc
Procedure from library latex.lib (see latex_lib).
- Usage:
texproc(fname,pname); fname,pname strings
- Assume:
`pname` is a procedure.
- Return:
if fname="" : string, the proc `pname` in a verbatim
environment in LaTeX-typesetting;
otherwise: append this string to the file <fname> , and
return nothing.
- Note:
preceding ">>" are deleted in fname , and suffix ".tex"
(if not given) is added to fname .
texproc cannot be applied to itself correctly.
Example:
| LIB "latex.lib";
proc exp(int i,int j,list #)
{ string s;
if (size(#))
{
for(i;i<=j;i++)
{ s = s + string(j) + string(#); }
}
return(s);
}
export exp;
→ // ** `exp` is already global
texproc("","exp");
→ \begin{verbatim}
→ proc exp(int i,int j,list #)
→ {
→ string s;
→ if (size(#))
→ {
→ for(i;i<=j;i++)
→ { s = s + string(j) + string(#); }
→ }
→ return(s);
→
→ }
→ \end{verbatim}
→
kill exp;
|
|