# Unwanted behaviour of \subimport*

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:

\documentclass{book}

\usepackage{import}

\usepackage[most]{tcolorbox}

\NewTColorBox[auto counter,number within=chapter]{exo}{m+O{}}{%
enhanced,
breakable,
%%    sharp corners,
colframe=green!20!black,
colback=yellow!10!white,
coltitle=green!40!black,
fonttitle=\bfseries,
underlay={\begin{tcbclipinterior}
(interior.north west) circle (2cm);
\end{tcbclipinterior}},
title={Exercise~\thetcbcounter:},
label={exo:#1},
segmentation style={double=white,draw=green!20!black,double distance=1pt,solid},
attach title to upper=\par,
colback=white,
after upper={\vspace*{5mm}\par\textcolor{green!40!black}%
{\bfseries Solution of the exercise \ref{exo:#1}}},
lowerbox=visible,
savelowerto=Solutions/Solutions_Chap\thechapter/#1-Sol.tex,
record={\string\solution{#1}{Solutions/Solutions_Chap\thechapter/#1-Sol.tex}},
#2
}

\begin{document}

\setcounter{chapter}{1}
\import{ChapterOne/}{ChapterOneExos}

\end{document}


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}
\subimport{Exos/}{ExoOne}
\subimport{Exos/}{ExoTwo}


and the two exercises are:

\begin{exo}{labelone}
Exercise one
\tcblower
The solution of exercise one
\end{exo}

\begin{exo}{labeltwo}
Exercise two
\tcblower
The solution of exercise two
\end{exo}


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

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 :

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

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.
• 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. Apr 23, 2020 at 9:26