0

I have a main.tex document that I'm trying to import a separate .tex document of a different class. I can't figure out how to use the \import command, more specifically how I'm supposed to write the directory you're supposed to put in the first argument.

My main.tex file is located in the directory C:\Users\(me)\T4 AE 457\Project 1 while the file I'm trying to import is located in C:\Users\(me)\T4 AE 457\Project 1\html. My main.tex preamble and last attempt at the import command are shown below.

\usepackage[subpreambles=true]{standalone}
\usepackage{import}

\import{./Project 1/html/}{DynamicStabilityAnalysisCode}

Something else of note is that the imported file itself has a nested import file in the same folder (html) called "getaircraft_real.tex", but that works just fine with the command \import{./}{getaircraft_real}. The preamble and commands for the imported file is shown below.

\documentclass[class=article, crop=false]{standalone}
\usepackage[subpreambles=true]{standalone}

\usepackage{import}

\subimport{./}{getaircraft_real}

Thanks for your consideration on this in advance!

3
  • whether you use import or input you are combining the definitions of all macros into the same document. so different classes can't work well Commented Dec 6, 2020 at 16:53
  • As I understand the purpose of the standalone package is to basically separate the preamble and class from the .tex file so it may be used in other documents. The subpreambles option reads the preamble of the imported .tex file. Of course I'm having trouble understanding the documentation, but I am looking for clarification. file:///C:/texlive/2020/texmf-dist/doc/latex/standalone/standalone.pdf overleaf.com/learn/latex/Multi-file_LaTeX_projects Commented Dec 7, 2020 at 8:06
  • it reads them and merges them and you might get lucky but tex has no namespacing at that level if you load two preambles then all the definitions for both preambles are active. You may get lucky and it work or (more likely) they do not work. If the documents are all similar and you are using it as a convenience to run them separately or combined it is fine, but if the documents are different I wouldn't expect it to work Commented Dec 7, 2020 at 10:06

0

You must log in to answer this question.

Browse other questions tagged .