5

I have a personalized style file (say main.sty) which I use for all my writings. In some writings however, there is a package in main.sty that I would not like included. As a concrete example, in main.sty I am calling the package eucal. However, for whatever reason, I do not want to include it in the particular .tex file that I am current working in. Is there a command to "remove" that package. What I am looking for is a code like

\documentclass[12pt]{article}
\usepackage{main}
\donotusepackage{eucal}

\begin{document}
blah
\end{document}

What should replace \donotusepackage{eucal}?

PS - Having thought of this, I think one solution would be to have the inclusion/non-inclusion of the package eucal as an option in main.sty. Then, we can have something like \usepackage[noeucal]{main}. Is this the only solution?

naphaneal
  • 2,614
Prahar
  • 337

1 Answers1

7

You can add this in your main.sty

\newif\ifMyEucal

\DeclareOption{Eucal}{\MyEucaltrue}
\DeclareOption{noEucal}{\MyEucalfalse}

\ExecuteOptions{Eucal} 

\ProcessOptions\relax

\ifMyEucal
    \RequirePackage{eucal}
\fi

That will provide two options to main package : Eucal (default) load eucal.sty and noEucal that doesn't.

\documentclass{article}
\usepackage[noEucal]{main}

\begin{document}
essia
\end{document}
Tarass
  • 16,912