[texhax] Making a condition in LaTeX (if..., then..., else)

Yuri Robbers yuri.robbers at gmail.com
Thu Oct 5 00:21:07 CEST 2006


Hello Reinhard,

On 10/4/06, Reinhard Kotucha <reinhard.kotucha at web.de> wrote:
>
> >>>>> "Yuri" == Yuri Robbers <yuri.robbers at gmail.com> writes:
>
>   > It might be even easier to use
>
>   >  \InputIfFileExists{filename}{then part}{else part}
>
> It looks easier but it doesn't exactly the same as
>
>    \IfFileExists{pack.sty}
>         {\usepackage{pack}}
>         {\typeout{Package pack.sty was not found.}}
>
> Using \usepackage instead of \input is the preferred way to load .sty
> files.  The LaTeX macros \usepackage and \RequirePackage make sure
> that a package is not loaded twice.


That's not something I had thought about at all... Thanks for pointing it
out!

Perhaps it might be helpful to beginning package authors to define
\UseIfPackageExists{filename}{the-part}{else-part} or something like it, and
then mention that in the clsguide, rather than InputIfFileExists{}{}{}?

Best regards,
Yuri.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://tug.org/pipermail/texhax/attachments/20061005/05a1768b/attachment.html 


More information about the texhax mailing list