I have a main document with lots of tikz pictures, which happens to be added from different directories within the main directory by using the 'input' and 'figure' commands. There are also some other files which make up the main file, like chapters and commentaries added the same way as the tikz pictures.   Since I want to modify some of those pictures and also files separately I don't want to compile the whole document every time I make a change because it takes a lot of time.    My question is whether by any chance there's some package or a workaround to manage this.  What I'm trying at the moment when I need to modify an input file is opening the file, pasting all the preamble of the main file in it, and then compiling it as an article class. The problem with this approach is that when I'm finished with it then I have to take out the preamble again and the other stuff I have added to compile (document class, begining and end document, etc). Also another drawback is that this process generates a lot of extra files.   Thanks for any help
23371
Is there a script to automate externalizing TikZ graphics?  (As suggested by Scott )
92535
I am creating multiple TikZ pictures within one document and would like to set the default style of arrow heads for all the pictures to the latex style, i.e. like -latex does, so that I don't have to do this every time I draw an arrow.  I'm new to TikZ, but have searched and must not be choosing the correct terms.
76108
When I tried to compile:  \documentclass{standalone} \usepackage{tikz} \begin{document} \begin{tikzpicture} \draw[very thin, red] (0,0) circle (2); \foreach \i in {0, 1, 2, ..., 46} \draw[very thin, red] ({360 * \i / 100}:1) circle (1); \end{tikzpicture} \end{document}   I got:  ! Dimension too large. &lt;recently read&gt; \pgfmath@x   l.6 ...thin, red] ({360 * \i / 100}:1) circle (1);  I can't work with sizes bigger than about 19 feet. Continue and I'll use the largest value I can.   And if I turn 46 to 45, say \foreach \i in {0, 1, 2, ..., 45}, that code will pass the compiling.  It seems that some value I was trying to calculate is larger than the TeX engine can handle.   After searching TeX.SX for about half an hour, I got ,  and . These questions have been solved, however, the origin and structure of the problem still remain unclear. Hence, I decide to raise this question: what is the limit (its origin and formation), and how can I avoid it.  Any clues would be appreciated.
2149
I'm working on a large document which contains several figures. Due to the figures it takes a long time to compile.   I would like to comment out all the figures while I'm working and then put them back in at the end. To do this, I added something like   \renewenvironment{figure}{\begin{comment}}{\end{comment}}  which I could then comment out when needed. However, this just doesn't work and gives all sorts of problems. Specifically, I tried to compile this -   \documentclass[12pt]{article} \usepackage{graphicx} \usepackage{comment} %\renewenvironment{figure}{\begin{comment}}{\end{comment}} \begin{document} \begin{figure} \begin{center} \includegraphics{image.png} \end{center} \end{figure} \end{document}   With the % everything compiled perfectly. If I remove the %, I get an error  Excluding 'comment' comment.) Runaway argument? ! File ended while scanning use of \next.
37408
I am writing a large document with several chapters and I would like to work on each chapter separately. In my main.tex I include the chapters either like   \include{chap1.tex}  \include{chap2.tex}  \include{chap3.tex}   or   \input{chap1.tex}  \input{chap2.tex}  \input{chap3.tex}   I think \include is preferable if I want things to be referenced and cited correctly? but doing it the \include way latex main.tex I don't get any dvi output whereas with \input things compile fine to dvi. What's going wrong here?  I would then like to use \includeonly (or \excludeonly ) to work on individual sections of the document whilst maintaining the referencing etc.  A mwe can be handy:  \documentclass[a4paper,10pt]{article} \includeonly{chap1}  \begin{document}   \include{chap1}   \include{chap2}   \include{chap3} \end{document}
103148
A couple weeks ago I didn't have any issue when using Bibtex on a document where the different parts were included with \include commands, but today I updated Miktex, and now it seems not to work anymore. Now when I compile the main document I get an error message that says  I couldn't open auxiliary file section.aux ---line 3 of file test.aux : @input{section.aux : } I'm skipping whatever remains of this command  Here's a minimal (non)working example : my main file &quot;test.tex&quot; is just \documentclass{article} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage[english]{babel} \begin{document} \include{section} \bibliography{reference} \bibliographystyle{plain} \end{document}  where the file &quot;section.tex&quot; is just \section{My section} I need to test the citations, so see \cite{A}.  and the file &quot;reference.bib&quot; just contains one reference. It works like a charm if I add the section directly or if I \input it, but with \include it just gives the error message as above. I tried with different editors (Texniccenter, Texmaker, Texstudio and Texworks) and it seemed to have the same issue each time. What is causing this problem ? P.S. I've looked at an old version of my document that used to work, and I've noticed a difference in the .aux files : the old version has, near the beginning, a line \bbl@cs{beforestart}  whereas in the newer versions it seems that this line has become \@nameuse{bbl@beforestart}  I'm not sure it's related or if it makes any sense, but I thought I'd add it in case it made a difference.
17724
With the 2020 fall update, the behaviour of \input{} changed. Before, I would have a main latex document (main.tex) and then the table contents in another file (table.tex) . Importantly, the file table.tex could be anywhere on my PC, because I could add directories that the \input command went through. So my set-up looked like this: The main.tex document: \documentclass[11pt, a4paper]{article}    \makeatletter \providecommand*{\input@path}{} \g@addto@macro\input@path{{&quot;C:/Users/me/inpath/&quot;}}% \input finds files in this directory \makeatother  \begin{document}  \begin{tabular}{lll} \hline \input{table.tex} \hline \end{tabular}  \end{document}  Then the file table.tex that would be placed in the directory &quot;C:/Users/me/inpath/&quot;: 1 &amp; 2 \\ 3 &amp; 4 \\  Unfortunately, this set-up no longer works. My question is: What is the best way to replicate this behaviour? For now, my solution would be to change the main.tex to: \documentclass[11pt, a4paper]{article}        \newcommand{\inpath}{&quot;C:/Users/me/inpath/&quot;}  \makeatletter\let\expandableinput\@@input\makeatother    \begin{document}  \begin{tabular}{lll} \hline \expandableinput{\inpath table.tex} \hline \end{tabular}    %%% Or alternatively \begin{tabular}{lll} \hline \input \inpath table.tex \hline \end{tabular}  \end{document}  Is there a more elegant way to achieve this? A solution similar to how things worked before the latex fall update? In which I can tell the TeX primitive \@@input where to look for files? What I have found so far is the information  and .
64834
I see that there a number of questions (, , , , ) on best practices, none of them answer the issue I am going to talk about.  We all need to prepare large documents (or slides) from time-to-time. And once you have reached a certain number of pages, you find that compiling the whole document takes a substantial time, which you need to do to check that the part you have written is error free, specially if it contains a number of images.   To circumvent the situation, I have used the following practices over years to keep compile time at minimum.   Divide the document in to many chapters: The chapters are put in separate files. Only the one I am working one is uncommented.  \documentclass{book}  \begin{document}  %\input {chapterone.tex} \input {chaptertwo.tex} %\input {chapterthree.tex} %\input {chapterfour.tex}  \end{document}    The above technique can also be used for \include.   Keep a preamble replica of the main file in a temporary file (build file): I use this technique when I am preparing a presentation with many slides, say a hundred. Prepare a main file, copy it to another build file. Delete everything between  \begin{document} and \end{document} in the build file. Prepare a slide (or a group of slides) in the build file. Cut and paste the contents between \begin{document} and \end{document} in the build file to relevant location in the main file only when satisfied with the output (image locations, overfull boxes etc.)     We can hear your inputs about the best practices you practice when a you are preparing a document or presentation from scratch.    Now, I have failed to find a good answer in the case when you have finished the whole document or presentation and now you need tweaking the small things, may be edit a text here, add an image there. What will be your best practice?  Perhaps, again keeping only one chapter uncommented will be usable here. But what about large presentations? May be adding a \end{document} just after the point-of-change will be beneficial, but only if you can put that before midpoint of the file.  Commenting a part of the file will also work, but that is error-prone, at least for me.
34843
I am using the external library to avoid recompiling tikz figures unnecessarily in a large document. Every now and then I have to change some details of some selected pictures. After the modifications it is necessary to recompile only those figures that have been modified. My aim is to do that automatically.   From Christian Feuersänger's answer to , I have interpreted that pictures whose content change can be remade automatically. I have not found however a simple MWE in which a tikz figure is recompiled only when its content is changed. It would be useful to have one.  The following MWE does not work, in the sense that changes in figure.tikz do not trigger re-compilation of the figure.  \documentclass{article} \usepackage{pgfplots} \usetikzlibrary{external} \tikzexternalize[prefix=tikz2pdf/]  \begin{document} \begin{figure}   \tikzsetnextfilename{figure}   \input{figure.tikz} \end{figure} \end{document}   figure.tikz  \begin{tikzpicture}  \draw (0,0) -- (1,0); \end{tikzpicture}   From the logs of pdflatex I can see  ===== Image 'tikz2pdf/figure' is up-to-date. ======   which tells that the file checked against being up-to-date is the generated pdf, not the original tikz. Obviously I am missing something.  How do I specify that the file to be checked is the original tikz?  For the background, I use pdflatex and tikz/pgf 2.10.
118686
This question is about finding reasons for compile errors when using tikz.  Consider the files compiles.tex, compiles-not1.tex and compiles-not2.tex. Then it is clear that compiles-not1.tex does not compile, because the name C has not been assigned. The file compiles-not2.tex does not compile, because \draw (A) -- (A -| B ); contains a space after the name B. However, this is difficult to see from the error message.   Is it possible to tweak the error messages generated by tikz to perhaps mark tikz-code and names in some way? What I mean is that in the example, an error message ! Package pgf Error: No shape named 'B ' is known. might be more helpful, as the space in the name B\␣ (B with a trailing space) is more clearly delimited from the message.   File compiles.tex compiles without errors.  \documentclass{article} \usepackage{tikz} \begin{document} \begin{tikzpicture}     \node (A) {A};     \node[above right of=A] (B) {B};     \draw (A) -- (A -| B); \end{tikzpicture} \end{document}   On compilation compiles-not1.tex generates ! Package pgf Error: No shape named C is known.  \documentclass{article} \usepackage{tikz} \begin{document} \begin{tikzpicture}     \node (A) {A};     \node[above right of=A] (B) {B};     \draw (A) -- (A -| C); \end{tikzpicture} \end{document}   compiles-not2.tex generates ! Package pgf Error: No shape named B  is known.  \documentclass{article} \usepackage{tikz} \begin{document} \begin{tikzpicture}     \node (A) {A};     \node[above right of=A] (B) {B};     \draw (A) -- (A -| B ); \end{tikzpicture} \end{document}
111180
I've heard a lot of recommendations to use the KOMA-Script document classes in place of the base document classes. I appreciate that there is a lot of added functionality, and customisation is easier. But before I jump in, I would like to know of any potential problems with these classes.  In my particular case, I am writing a thesis - it's part of the way through, and I've been compiling using the base classes (report), and a bunch of packages. But in the interest of keeping the question broadly relevant, answers with problems that don't affect my use-case are more than welcome.
67633
When I click save or hit Command + S what appears to be a new version of the document is created. So if I save 2 times, I get 2 documents, filename.blend1 and filename.blend2.  What exactly are these files and why is Blender creating them?
27692
Suppose I have a document with multiple include or input statements  \input{fileA} \input{fileB}   etc.   Is there an easy way to generate a single .tex file where \input{fileA} is replaced by the actual content of fileA etc. without copying it manually?
34009
Is there a way to make TeX delete files?   In my document a lot of auxiliary files are created and it would be wonderful to have them removed after their content has been used.
84002
I'm writing a manual for a class, and I never liked add images as files in my tex, so I'm drawning the logo with this code:   \documentclass{article} \usepackage{tikz} \begin{document} \definecolor{xdxdff}{rgb}{0.5,0.5,1.} \definecolor{qqqqff}{rgb}{0.,0.,1.} \definecolor{cqcqcq}{rgb}{0.75,0.75,0.75} \begin{tikzpicture} \clip(-4.42,-1.90) rectangle (8.03,4.69); \draw [color=red,fill=red,fill opacity=1.0] (-0.67,1.06) circle (2.41cm); \draw [color=white,fill=white,fill opacity=1.0] (-0.66,1.71) circle (1.92cm); \draw [shift={(-0.05,2.21)},color=red]  plot[domain=2.01:4.03,variable=\t]({1.*1.40*cos(\t r)+0.*1.40*sin(\t r)},{0.*1.40*cos(\t r)+1.*1.40*sin(\t r)}); \draw [shift={(-1.60,0.27)},color=red]  plot[domain=-0.48:0.92,variable=\t]({1.*1.08*cos(\t r)+0.*1.08*sin(\t r)},{0.*1.08*cos(\t r)+1.*1.08*sin(\t r)}); \draw [shift={(-1.26,1.06)},color=red]  plot[domain=-1.12:0.68,variable=\t]({1.*1.43*cos(\t r)+0.*1.43*sin(\t r)},{0.*1.43*cos(\t r)+1.*1.43*sin(\t r)}); \draw [shift={(0.42,3.0)},color=red] plot[domain=2.72:4.22,variable=\t]({1.*1.18*cos(\t r)+0.*1.18*sin(\t r)},{0.*1.18*cos(\t r)+1.*1.18*sin(\t r)}); \end{tikzpicture} \end{document}   which gives me this image   How can I color red the thing in middle?
103344
It's often the case that I'd like to include some graphic in a LaTeX document and overlay it with some text or other annotation, maybe including arrows or other simple graphics. The annotations can be easily handled using TikZ, so obviously if I create the graphic itself in TikZ, I'm all set. But sometimes the graphic is very complex and it's not practical to recreate it with TikZ commands. In these cases, I would like to include the graphic file directly, but still be able to layer my annotations over it. Editing the image to include the annotation is a possibility, but I'd really like to avoid that because the annotations then wouldn't reflect the document's font style and size, and also because it'd be harder to change them.  Is there a preferred way to include an external image and then layer additional content over it? A solution that lets me continue to use TikZ for the annotations is preferred, but not required.  EDIT: All three answers (overpic, a TikZ node, and \pgftext) work fine, but unfortunately I can only accept one, so I'm going with the one recommended in the "official source," the TikZ manual.
59394
I have a main document (manuscript) and a supplemental document.   I wonder if there is a way that I can "link" the two (make them recognize each other) so that section, equation, and figure references across documents are recognized?