I am not sure if this is recreate-able through a MWE. Whenever I compile a standalone TikZ picture, it compiles all my standalone figures in the same folder. I am using Ubuntu 13.04 and Emacs with server mode running.

Some of this information may be irrelevant, but I am not sure what is needed to troubleshoot such an issue. From the screen shot, I have the main document on the left and my TikZ picture I am creating on the right. As you can see, I compiled the figure and Latexmk compiled every other standalone .tex file too.
Output written on sunplanetspacecraft.pdf (1 page, 1117 bytes).
SyncTeX written on sunplanetspacecraft.synctex.gz.
Transcript written on sunplanetspacecraft.log.
Latexmk: Log file says output to 'sunplanetspacecraft.pdf'
Latexmk: All targets (sunplanetspacecraft.pdf) are up-to-date
Latexmk: All targets (transferchoices.pdf) are up-to-date
Latexmk: All targets (transfergeoa.pdf) are up-to-date
Latexmk: All targets (transfergeob.pdf) are up-to-date
Latexmk: All targets (trigidentities.pdf) are up-to-date
Latexmk: All targets (twobodies3D.pdf) are up-to-date
Latexmk: All targets (unitvec.pdf) are up-to-date
Latexmk: All targets (velcomp.pdf) are up-to-date
Latexmk finished at Thu Jul 25 14:12:06
I am compiling sunplanetspacecraft.tex and none of the files are related to the to this .tex file but yet they still were compiled.
I looked through the log file, but I didn't see anything that related to the other files Latexmk compiled. Below is my preamble in case that helps.
\documentclass[convert = false]{standalone}
\usepackage[utf8]{inputenc}
\renewcommand{\rmdefault}{ppl}
\linespread{1.05}
\usepackage[scaled]{helvet}
\usepackage{courier}
\usepackage{eulervm}
\normalfont
\usepackage[T1]{fontenc}
\usepackage{textcomp}
\usepackage[usenames, dvipsnames, svgnames, table]{xcolor}
\usepackage{tikz}
\usetikzlibrary{arrows}
The reason I want to resolve this is because one of the another standalone TikZ pictures takes about 2minutes to compile which slows down compiling a simple picture.
This problem cropped up with another document. This time my document that calls all my standalones in it tried calling an unrelated standalone just because it was in the same folder.
So a MWE (concept) would be to have a a folder, in the folder at a main.tex, in the main.tex, you need have \usepackage{standalone}, then we have two cases:
create two
standalones to be called in themain.texand compile the first one. When you compile the second one, it will also compile the first one. This wont cause the problem I am having since you are probably creating simple documents (not an issue though). Just check the output to see if it compile the other one too. This will be the first issue at the top I mention. Create a folder called test.main.tex
\documentclass{article} \usepackage{standalone} \usepackage{tikz} \begin{document} test \includestandalone{test1} \includestandalone{test2} \end{document}test1.tex
\documentclass[tikz, convert = false]{standalone} \begin{document} \begin{tikzpicture} \draw (0, 0) -- (2, 0); \end{tikzpicture} \end{document}test2.tex
\documentclass[tikz, convert = false]{standalone} \begin{document} \begin{tikzpicture} \draw (0, 0) -- (-2, 0); \end{tikzpicture} \end{document}So if I compile
test2.tex,test1.texcompiles also. This hardly causes a slow down but you get the idea.- create a standalone not called in the
main.tex, but this time don't add anything in the file. Just name it and save it no preamble. Even though this file isn't being called by themain.tex, compiling themain.texfile will try and compile this file that doesn't even have a preamble. It calls because it has a.texextension. In the same folder, createtest3.texwhich is blank no pre-amble or code and save it. Now add a line tomain.texand compile. This should cause the error no\begin{document}in the main file. The document will compile fine though but will constantly have that error.main.texis forcing the compiling of a blank.texfile even though it isn't included.
;; ============ Latexmk setup ============== (defun run-latexmk () (interactive) (let ((TeX-save-query nil) (TeX-process-asynchronous nil) (master-file (TeX-master-file))) (TeX-save-document "") (TeX-run-TeX "latexmk" (TeX-command-expand "latexmk -pdf %O %S" 'TeX-master-file) master-file)) (if (plist-get TeX-error-report-switches (intern master-file)) (TeX-next-error t) (progn (demolish-tex-help) (minibuffer-message "latexmk: done."))))(add-hook 'LaTeX-mode-hook (lambda () (push '("Latexmk" "latexmk -pdf %S" TeX-run-TeX nil t :help "Run Latexmk on file") TeX-command-list)))
.latexmkrc setup:
$pdflatex = 'pdflatex --shell-escape -interaction=nonstopmode %O %S -file-line-error -synctex=1';
Latexmk? By default it runs on every.texfile (according to http://users.phys.psu.edu/~collins/software/latexmk-jcc/latexmk-437.txt) – Jim Paris Jul 25 '13 at 19:51latexmk. The behavior you are seeing is exactly what happens when the command line is "latexmk", without any file name, whereas the command line should have been "latexmk sunplanetspacecraft.tex". This was what @JimParis was getting at in his first comment. Since you are usingemacsto invokelatexmk, it is possible thatemacsis misconfigured. The value of$pdflatexthat you quoted is irrelevant for this issue. – John Collins Aug 05 '13 at 14:45emacs/auctexto have alatexmkcommand? The answers in http://stackoverflow.com/questions/2199678/how-to-call-latexmk-in-emacs-and-jump-to-next-error suggest how to do this. Did you possibly omit "%s" in the definition of how to runlatexmk? That would be consistent with the symptoms you observe (and I can reproduce them). – John Collins Aug 06 '13 at 15:18latexmkhow it callspdflatex; this uses%O %S(as I recommended) to specify where options and source name are. But there must also be%sin the command line that is defined in.emacsto say howemacs/auctexcallslatexmk. You'll need to show us exactly what is in.emacsandlatexmkrc. – John Collins Aug 06 '13 at 16:41.emacsonly, change the%O %Sand%Sto%s(lower case). Second, inlatexmkrconly, move the%O %Sto the end of the defined command line, just inside the single quotes, but keeping it as%O %S(upper case). That works for me. If it works for you, I'll convert this to an answer (with explanation). – John Collins Aug 06 '13 at 17:09