[Tex/LaTex] Usage of \include, \input and \import commands

import

hpekristiansen answer from Using \import correctly There are three ways to put subfile.tex file into main.tex:

  1. \include{⟨filename⟩}
  2. \input{⟨filename⟩}
  3. \import{⟨path⟩}{⟨filename⟩}

It is clear that

  • \include is only used in the main.tex and \include can not be used in subfile.tex

  • \input can be used in main.tex or subfile.tex

  • \import needs \usepackage{import}.

Now I'm confused about using \import. When this should be used?
What is the use of \subimport?

The point is that there is no example in the manual for import. I have different files in different folders. How to use \import with giving the path of subfile.tex?

Should I use \input for importing TikZ pictures using a standalone file subfile.tex?

Best Answer

When you use the import package (which provides the \import command), you must use slashes / in your path.

E.g.

\import{/Users/Public/Documents/}{subfile}

Also, be sure that you put / at the end of the path.

Related Question