TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question
up vote 3 down vote accepted

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

% ...
share|improve this answer
Let's use your sample above in our discussion. Do I have to specify ProvideFile{dvips.def} in dvips.def ? – xport Jan 12 '11 at 5:56
No, you needn't. See clsguide for more information. – Leo Liu Jan 12 '11 at 6:23
but you should. then it is listed in file list which makes sense if one has an error in his code. – Herbert Jan 12 '11 at 7:32
@Herbert + @Leo : Thanks. – xport Jan 12 '11 at 7:50

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.