This section describes how to add a new user-defined macro. For the sake of simplicity, a macro fname(name) is defined to typeset a filename. The macro maps to em() in LaTeX output or to bf() in other formats.
  • The place to insert the macro is lib/yodl/shared.yo.in in the Yodl source tree. This is the `master file' from which both the final macrofile and relevant documentation is created.
  • The macro must appear in alphabetical order in the list of all other macros, this is relevant for the documentation. Hence, the fname macro would appear somewhere near footnote() though before it.
  • The documentation about the hypothetical macro must be set between two tags @startdoc and @enddoc. The make process looks for these tags. The documentation itself must appear as a macro which is (appropriately) called macro, and expects two arguments: the new macro that is being defined, and its description:
    @startdoc
    macro(fname(file))
    (Sets a filename in either boldface or italics,
    depending on the output format.)
    @enddoc
    

  • Following the documentation, the macro itself is defined using whenformat() commands and/or formatcommand():

    
        DEFINEMACRO(fname)(1)(\ 
            whenlatex(em(ARG1))\ 
            whenhtml(bf(ARG1))\ 
            whenman(bf(ARG1))\ 
            whenms(bf(ARG1))\ 
            whentxt(bf(ARG1))\ 
            whensgml(bf(ARG1)))
    

  • The new macro is now in place. A new make job should install it all, and if necessary, make the appropriate new documentation files.

    After this, please kindly mail me your addition to the Yodl package. I will include it (if it's worth while), stating full credits too.


    Go back to index of Yodl.

    Please send Yodl questions and comments to yodl@icce.rug.nl.

    Please send comments on these web pages to (address unknown)

    Copyright (c) 1997, 1998, 1999 Karel Kubat and Jan Nieuwenhuizen.

    Verbatim copying and distribution of this entire article is permitted in any medium, provided this notice is preserved.


    This page was built from Yodl-1.31.18 by

    <(address unknown)>, Fri Feb 22 08:56:03 2002 EST.