I use the package import to import several files for writing a book in the following manner:

I put every chapter in its own folder, where I put a file for course and a file for exercises with solutions, called here ChapterOneExos.tex. The exercises are made using the tcolorbox package, and I put it in the subfolder Exos, lying in each chapter' folder. The file ChapterOneExos.tex contains the exercises of the chapter...

I use a Main file to import all this material, and I write it for only one chapter, which contains for this MWE, only exercises:

I synthetize: in the folder Book, I put the file Main.tex, and the folder ChapterOne, which contains the file ChapterOneExos.tex, and the "subfolder" Exos, which contains the exercises' files.

The file Main.tex:




\NewTColorBox[auto counter,number within=chapter]{exo}{m+O{}}{%
%%    sharp corners,
        \shade[inner color=green!80!yellow,outer color=yellow!10!white]
            (interior.north west) circle (2cm);
    segmentation style={double=white,draw=green!20!black,double distance=1pt,solid},
    attach title to upper=\par,
    after upper={\vspace*{5mm}\par\textcolor{green!40!black}%
            {\bfseries Solution of the exercise \ref{exo:#1}}},




I put in the folder ChapterOne the folder Exos, where I put the exercises, and the file ChapterOneExos.tex is then as the following:

\section{Exercises of the chapter 1}

and the two exercises are:

Exercise one
The solution of exercise one

Exercise two
The solution of exercise two

All is good now ! The compilation gives the suited result, as the following:

enter image description here

Now, we can read in the doc of the import package, the following:

"To avoid searching the TEXINPUTS path when importing files, use the ‘star’ versions of the commands: “\import*” and “\subimport*” "

This can be more useful when we have several files....

but when I use the command \subimport*, the lower part of the exercise doesn't appear !. One can see the result when I use it :

enter image description here

How can I use the command \subimport*, and obtain the good result, as the first image ?

1 Answer 1


Use the latest import.sty, where the * modifier does nothing, and is deprecated. If you are stuck using an old version of import.sty, avoid using \import* unless you have a specific collision with a file name installed in TEXINPUTS, and even then it is better to change your file name.

For background, file searches in LaTeX normally give priority to the current main directory, then the installation, and finally the user-set input path. The \import* variant was created to allow access to personal files where the name collided with installed files, but only by blocking access to installed files. As you may guess, this breaks down when files need to be loaded on demand for loading new fonts and such.

With version 6, import redefines some LaTeX internals to change the search priority (temporarily), eliminating the need for a * variation.

You also didn't say, but did you create directories like Solutions/Solutions_Chap1 as specified in your main file? It looks like a problem.

  • Thank you for your answer. I will update the package, and I hope that all will be good now. I haven't said about the " directories like Solutions/Solutions_Chap1" because all is good ! I don't understand your sentence " It looks like a problem.". What's the problem ? Commented Apr 23, 2020 at 8:57
  • I have updated the package, and it compiles as expected now. Thanks P.S: You say that "eliminating the need for a * variation"... I still use the starred version or not ? Many thanks Commented Apr 23, 2020 at 9:10
  • Don't use \import*, but don't go to the trouble to get rid of it (it is the same as \import). If those directories didn't exist, it would be a problem, leading to missing solutions. Commented Apr 23, 2020 at 9:26
  • Ok. Many thanks Commented Apr 23, 2020 at 11:43

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .