1

I am using vimtex(which itself uses texlive?) to edit some files called A, B, and C. A is my main file and I intend to intend to embed B and C in it. But B and C are large individually, so I wanted to be able to edit and compile them quickly without having to compile the whole thing over and over. I have seen this question my code is more or less the same,

File structure(before compiling)

└── stuff
    ├── A.tex
    └── sections
        ├── B.tex
        └── C.tex

A.tex

\documentclass{article}
\usepackage{amsmath}
\usepackage[subpreambles=true]{standalone}

\title{Title} \author{Author} \includeonly{ section/B, section/C } \listfiles

\begin{document} \maketitle{} \include{section/B} \include{section/C} \end{document}

B.tex

\documentclass[class=article, crop=false]{standalone}
\usepackage{graphicx}
\usepackage{amsmath}
\begin{document}
% -- stuff -- %
\end{document}

C looks pretty similar to B.

The situation is currently that I can compile anything and everything. The problem is that compiling anything causes everything to be compiled(or at least, it seems so?). Suppose I clear out all my compilation files and the file structure is exactly as I have written above. I then go into B.tex and compile. I get "Compilation error" and no more information. If I try it again, the compilation works, however, the pdf that automatically opens(a vimtex thing?) is A.pdf containing the content of both B and C. If I go back into B, B.pdf exists. If I go into C, C.pdf does not exist and only the aux(and tex) file is there(despite appearing correctly in full in A.pdf)

Now that I have explained the situation, some of the debugging I tried was to repeat up until "Compilation failed" then check whats going on in C and A. C has the C.aux file. A has been fully compiled, pdf and all, the only difference being that B has an aux file, but no pdf.

Another test performed was to, when everything is had been compiled, modify C, then recompile B and see what happens in A. As it happens, the new content of C updates in A, so everything is being compiled and my attempt at reducing processing requirements was a waste of time adding unnecessary baggage to my files.

Thanks for reading, I'm sure I'm doing something stupid.

EDIT: I figured using vimtex may narrow my chances of finding an answer, so I have performed the same tests described above using the"latex" command in the terminal (which is actually pdfTex it appears?) and now standalone works properly(at least with regard to the issue described in my post), so I presume this is a problem with vimtex?

  • @DavidCarlisle Sorry, I have misexpressed myself. What I mean to say is that the content of B and C appear in A. It is the source files that are included,(as you instruct), not the pdfs. – grouptheory Jun 29 '21 at 21:28
  • No I misread, I have deleted the comment, sorry – David Carlisle Jun 29 '21 at 21:28
  • vimtex calls latexmk which tries to do a number of things to produce a complete compilation, so if compiling with pdflatex on the command line works the problem is probably coming from latexmk and you should be able to reproduce it using latexmk on the command line. This question might be the same and have some useful information in the comments. – Dai Bowen May 08 '23 at 21:01

0 Answers0