Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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
add comment

1 Answer

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

\DeclareOption{dvips}{\def\Gin@driver{dvips.def}}
\DeclareOption{pdftex}{\def\Gin@driver{pdftex.def}}
% ...
\input{\Gin@driver}
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
2  
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
add comment

Your Answer

 
discard

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.