0

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:

\input{sub_system_main.tex}

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:

\import{SP1_BL1/SYSTEM/}{system_main.tex}
\import{SP1_BL1/TCR/}{tcr_main.tex}
\import{SP1_BL1/OBCS/}{obcs_main.tex}
\import{SP1_BL1/AOCS/}{aocs_main.tex}
\import{SP1_BL1/PCS/}{pcs_main.tex}
\import{SP1_BL1/TCS/}{tcs_main.tex}

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:

\import{SP1_BL1/}{sub_system_main.tex}

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:

\import{SP1_BL1/SYSTEM/}{system_main.tex}
\import{SP1_BL1/TCR/}{tcr_main.tex}
\import{SP1_BL1/OBCS/}{obcs_main.tex}
\import{SP1_BL1/AOCS/}{aocs_main.tex}
\import{SP1_BL1/PCS/}{pcs_main.tex}
\import{SP1_BL1/TCS/}{tcs_main.tex}

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.

8
  • 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

1

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

\import{SP1_BL1/SYSTEM/}{system_main.tex}

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

\import{SP1_BL1/SYSTEM/}{system_section_1.tex}

but it is more sensible to just use

\input{system_section_1.tex}

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

\import{MOD/}{module_main.tex}

That module_main.tex file would say

\subimport{SEC/}{m_sec_1.tex}
\subimport{SEC/}{m_sec_2.tex}

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

0

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):

\input{sub_system_main.tex}

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

\subimport*{SYSTEM/}{system_main.tex}
\subimport*{OBCS/}{obcs_main.tex}
\subimport*{AOCS/}{aocs_main.tex}
\subimport*{TCR/}{tcr_main.tex}
\subimport*{PCS/}{pcs_main.tex}
\subimport*{TCS/}{tcs_main.tex}

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

\subimport*{./}{xxxx_section_1.tex}

Detailed Information about Configuration (Sub-Module Repository):

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

\input{sub_system_main.tex}

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

\import*{SP1_BL1/SYSTEM/}{system_main.tex}
\import*{SP1_BL1/TCR/}{tcr_main.tex}
\subimport*{OBCS/}{obcs_main.tex}
\import*{SP1_BL1/AOCS/}{aocs_main.tex}
\import*{SP1_BL1/PCS/}{pcs_main.tex}
\import*{SP1_BL1/TCS/}{tcs_main.tex}

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

\subimport*{./}{obcs_section_1.tex}

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

\begin{tcolorbox}
\begin{figure}[H]
\begin{centering}
\includegraphics*[scale=0.5]{../TCR/tcr_images/FOP_Transmitter_switch_over.pdf}\caption{Transmitter Switch Over FOP}
\par\end{centering}
\end{figure}
\end{tcolorbox}

You must log in to answer this question.

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