5

I am writing my own package called mylisting.sty to format code inclusion for languanges: LaTeX, PSTricks, C#, and XML.

To maintain mylisting.sty cleaner, I make a separate file for each language:

  • LaTeXSettings.tex for LaTeX,
  • PSTricksSettings.tex for PSTricks,
  • CSharpSettings.tex for CSharp, and
  • XMLSettings.tex for XML.

Is it correct to use \input{} within mylisting.sty to import LaTeXSettings.tex, PSTricksSettings.tex, CSharpSettings.tex and XMLSettings.tex?

Or you have a better method to accomplish this objective?

Display Name
  • 46,933

1 Answers1

3

It's OK. You can use whatever file name (or extensions) you like. An extensible method is, like many packages use, to use a set of configuration/definition files. For example, in graphics package macro \Gin@driver is the driver file. The code is used as

\DeclareOption{dvips}{\def\Gin@driver{dvips.def}}
\DeclareOption{pdftex}{\def\Gin@driver{pdftex.def}}
% ...
\input{\Gin@driver}
Leo Liu
  • 77,365