I am facing this issue while I am trying to use \import command from latex. I have nested document which is compiling on GitLab pipeline. My configuration uses sub-modules also. Please see the error message image file.

enter image description here

My directory structure like this on GitLab:

my_branch (SP2)

  • some files related with project

  • doc-operation-handook.tex main tex file (contains \input{sub_system_main.tex})

  • gitlab config files

  • sub_system_main.tex (specific for this repository to pipeline config. this file is being used under the test phases.)

  • SP1_BL1 sub-module directory

    • sub_system_main.tex file (specific for this repository to pipeline config. this file is not related with the question please ignore it.)

    • SYSTEM directory

      • system_main.tex (contains \import{SYSTEM/}{system_section_1.tex})
      • system_section_1.tex
    • AOCS directory

      • aocs_main.tex (contains \import{AOCS/}{aocs_section_1.tex})
      • aocs_section_1.tex (contains section specific content)
    • TCR directory

      • tcr_main.tex (contains same as above)
      • tcr_section_1.tex
      • tcr_section_2.tex
    • TCS directory

      • ... tex files
    • ... directories

I have one main latex file (doc-operation-handbook) which is under the SP2 repository and it is calling sub_system_main.tex under the same directorylike this:


In the sub_system_main.tex file again I need to call some other .tex files from sub-module SP1_BL1 but this time I used \import command from LaTeX like this:


I do not know where I am doing something wrong but maybe I am using\import command totally wrong. After this configuration when I run the pipeline from GitLab it gives me an error which I shared above.

But I have an other repository working properly which uses again sub-module future from GitLab. Only difference is between this repository and above one is in sub_system_main.tex files. In other other repository I am using \import command like this:


As you can see I am calling this time from sub-module sub_system_main.tex file in another repository (with sub-module) which contains every latex file listed above in a packaged way. But when I try to use it like this again:


It gives me an error..

I think I am using \import command wrong at all. If you guys can help me on this issue I will be very appreciate for that.

  • You claim \import{SP1_BL1/SYSTEM/}{system_main.tex} in the question, but the error message says otherwise. You have, on line 6, \import{SP1_BL1/../}{system_main.tex}. Dec 23, 2020 at 8:22
  • @DonaldArseneau thank you for your kind response! I am sorry I uploaded wrong image file and it is edited now. Error comes from while we are into the sub-module. Dec 23, 2020 at 8:33
  • @DonaldArseneau Under that sub-module which is SP1_BL1 I have SYSTEM directory. SYSTEM directory has two different latex file one of them is system_main.tex and the other one is system_section_1.tex. Simply system_main.tex has this command in it: \import{SYSTEM/}{system_section_1.tex} and system_section_1.tex is contains the content of the document as it is mentioning section 1. Dec 23, 2020 at 8:46
  • You probably can't edit your question to make it correct, can you? It sounds from the comment that ... Question has been edited ... I'll look. Dec 23, 2020 at 10:05
  • @DonaldArseneau Well I am trying to explain more explicitly my question because of that it is updated. First time it was not very clear I think. Thank you in advance! Dec 23, 2020 at 10:09

2 Answers 2


Using clarifications in comments, it seems you are caught half-way between wanting \import or \subimport.

 \import {full-path}{file}
 \subimport {path-extension}{file} 

If you have done


and if the next files you want to load are in the same directory,
the system_main.tex file could use the full path again


but it is more sensible to just use


It is this redirection of \input that is the point of import.sty.

Now let's assume a slightly different layout of files in directories.

 (main dir)  document_main.tex
    (module dir "MOD") module_main.tex
       (sections dir SEC) m_sec_1.tex, m_sec_2.tex

Then the main document file would say


That module_main.tex file would say


And the "sec" files could use \input or \includegraphics without specifying a path.


Thank you for your help Donald!

I found a solution like that which is now working smoothly on GitLab. I played only some \import and \subimport commands and most importantly I added "../" at the beginning of the path definitions of the \includegraphics command. I hope those definitions can help other ones..

Detailed Information about Configuration (Main Repository):

doc-operation-handbook.tex contains (first latex file in the nested configuration):


sub_system_main.tex contains (second latex file in the nested configuration):


xxxx_main.tex contains (xxxx can be any sub-system name, third latex file in the nested configuration):


Detailed Information about Configuration (Sub-Module Repository):

doc-operation-handbook.tex contains (first latex file in the nested configuration):


sub_system_main.tex contains (second latex file in the nested configuration which is going into sub-module defined in GitLab):


obcs_main.tex contains (third latex file in the nested configuration):


Image files should be added like that (tcolorbox can be ignored):

\includegraphics*[scale=0.5]{../TCR/tcr_images/FOP_Transmitter_switch_over.pdf}\caption{Transmitter Switch Over FOP}

You must log in to answer this question.

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