I rarely need the ancillary files TeX produces when compiling a document (.aux, .log, .out, .synctex.gz). In fact, I've only ever had to read the .log, and that's only a few times. Is there a way to write them to a separate directory, so that my working directory only contains .tex and .pdf files?
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.
15221
I've got a document that compiles without error or warnings (and looks about right) but for some segments of the document synctex doesn't seem to be working.  What could be wrong?  The document consists of one root .tex file which \inputs a bunch of others.  Synctex works for all these sub-documents - except for one.  In practice, this means I can Ctrl-Click in the viewer and find the appropriate spot both in parts of the text before and after this particular subdocument.  Conversely, I can Ctrl-Click in the editor and jump to the right spot in the view in all subdocuments but this one.  However, when I Ctrl-Click on a part of the output corresponding to this particular subdocument I get the following error popup: Cannot read file "E:/emn/uni/Thesis/doc": Access is denied. in the TeXworks viewer.  The path in this error message exists but is a directory: namely the one containing the tex files.   All filenames consist of only latin letters, numbers, and underscores and the extension .tex.  The problematic file is called G2MLVQ_9_Refinements.tex whereas a (working) file is called G2MLVQ_7_Implementation.tex I can't make a small example which fails - small examples don't fail; however the order of files seems to matter, so perhaps something in an earlier file is affecting synctex later on... (once I've isolated this, I'll update the question). Concerns MiKTeX 2.9 and the bundled TeXworks version 0.4.3 r.857.   I'm stumped: what could be going wrong?  Edit: user59152 tried to isolate the error:     It is virtually impossible to create a minimum working example (MWE) for this problem, so I have posted a . You can see the file names at the tops of the windows. The one being edited (Introduction.tex) comes BEFORE the file that can't be opened using inverse search (SourceAndSinkFreeContinuumRVtracking.tex). The screencapture movie confirms that \clearpage restores inverse search capability, but fouls up the layout of the document, so this problem appears to remain unsolved.  I'm using TeXworks version 0.4.4 r.1003 and MikTex 2.9.
14921
I can no more compile any of my tex files, they all generate an error &quot;can't write on file *.pdf&quot;. I suspect a Windows update (it occurred just after that) but I am not sure and I cannot find any reason for that... Even the simple &quot;hello world&quot; does not work and generates the same error: \documentclass{article} \begin{document} hello \end{document}  I am using Windows 10 and Texmaker. I know that Adobe can lead to this error but the PDF is neither open, nor created on my computer. So, the file is not open, I have reinstalled both Miktex &amp; Texmaker, I am not using Dropbox &amp; co, I tested with other editors leading to the same result, searched on google for hours, restarted my computer many times, I have enough space on my computer. But I am now lacking solutions... Does anyone have a suggestion ?
70938
Let's say I have .tex file which is a set of problems and solutions, of which I want to make two pdf files, one which includes the solutions and one which doesn't. so I need to build the .tex file under two different modes, and specify that parts of the document be ignored under one of the modes.  This is something common in programming context. e.g. in C++ i can code  #ifdef DEBUG   // do this additional stuff ... #endif   How can I do something equivalent in latex?
73962
I'm getting some cryptic (for me) errors and warnings when I compile.  On the advice of darn near every internet resource I could find, I dug into the .log file.  The trouble is, I don't know how to interpret what I see.  I don't want to take up people's time so, where can I find a Reading LaTex .log Files for Beginners document?
104286
In a .tex document, I'm using the comment package to produce two different versions (let's say : versionA and versionB) of the document. Each version contains different parts (it could be paragraphs, equations,...). If I use \includecomment{versionA}, it will include all the content between \begin{versionA} and \end{versionA}. Now, let's say some of the parts in each version are marked with a *. How can I ask latex to compile only the * parts in one version ?   It may be clearer on the following example. Let's say I have  \documentclass[10pt,a4paper]{article}  \usepackage{comment} \includecomment{versionA} \excludecomment{versionB}  \begin{document}  \begin{versionA}  *part1  part2  *part3  \end{versionA}  \begin{versionB}  part1  *part2  \end{versionB}  \end{document}   I would like something which enables me to do : "compile all the content of versionA" or "compile only the content marked with * in versionA" (same for versionB). I hope this is clear!
39074
Are there some limitations regarding the pdflatex command with respect to the count of pages of the input files?  My highest page count, when compiling, was 90 without any troubles. (2008)  Currently another document will be prepared which will be approx. 170 pages in sum.  EDIT: Thanks to all answers. They were helpful.
24636
If I have  project.tex  \startproject project \product one \product two \endproject   and the corresponding product files, is there an easy way to process all product files, so I get  one.pdf  two.pdf  at once?
9695
Is there a way to compile all tex files within a specific folder, from LINUX terminal, at once?   I would like to do this using pdflatex or lualatex in a way to create a pdf file for each distinc original tex file.   This question is not about creating individual tex files to form a single pdf file using \input or \include, at all.
111118
I've been working on a project and compiled it using pdfLaTeX, then tried to compile using pdftex and got a whole lot of errors. I'd like to know why that would happen since it's a very plain file and I did not put a pdflatex option in documentclass or anything like that, and what's the real difference between them.
114516
This question led to a new package:      How can I display the full path of the tex file that I compile? It is a simple file, no include or input present.  Edit: I use MiKTeX 2.9 on a Windows 7 64-bit.  Less demanding: If not possible, then I will be satisfied with a partial path (at least one or two folders up + the filename).
29258
I'm writing my manuscript using TeXlive and Texmaker. I have different folders for chapters, images and frontmatter (including title, declaration, acknowledgements, ...) to organize a little bit the writing process. All these documents are properly written.  To be a little bit organized, I would like to use the option in Texmaker of creating a "build" folder for the generated files during compilation (.aux, .nlo, .log, .bbl, ...) but I can't use the \include command with that "build" option because I got this error:  ! I can't write on file `frontmatter/title.aux'. \@include ...\immediate \openout \@partaux #1.aux \immediate \write \@partau... l.63 \include{frontmatter/title}   If I don't use that option everything works as it should but my main folder is filled with those auxiliary files. Apparently there is a problem writing the auxiliary files, but I can't figure out why.  On the other hand, if I use \input command, everything works well even with the "build" option selected in Texmaker.  But there is a big difference in using \input instead of \include in a large document as you well know in terms of compilation time and other issues related with numbering and referencing if I want to compile only one chapter.  Here is my MWE: Main.tex  \documentclass[12pt,a4paper]{report} \begin{document} \include{frontmatter/dedication}   %%% Not working with "build" option %\input{frontmatter/dedication}   %%% It works with "build" option \end{document}   dedication.tex(included in frontmatter folder which is in the same folder as main.tex)  \chapter*{Declaration} I declare that ........................   Any hint will be appreciated! Happy new year!
43663
In addition to the .tex and .dvi or .pdf files, TeX/LaTeX/ConTeXt produces and uses lots of other files. What do they do? Which ones are used to create the document and which ones are automatically created by the compiler. What files can I safely delete?
116657
I have a fairly large document, that I have picked apart into different sections etc, each in their own file. To include graphics that are not in one central directory I use \graphicspath which works quite nicely. Is there a similar command I could use to include tex files from multiple directories without me explicitly naming them?  The idea would be the following:  \graphicspath{{./Some/Directory/For/Figures1/},{./Some/Directory/For/Figures2/}} \texpath{{./Some/Directory/For/Tex/Files1/},{./Some/Directory/For/Tex/Files2/}}   The I would like to call within the document:  \includegraphics{fig_from_Figures1}% this works \includegraphics{fig_from_Figures2}  \input{doc_from_Files1}% this would be awesome \input{doc_from_Files2}
54781
I have a couple of LaTeX files with the same problem. If I produce an error, fix it, and then try to compile a pdf, I get the following error.  )Runaway argument? {{ ! File ended while scanning use of \@newl@ablel. &lt;inserted text&gt;                 \par l.90 \begin{document}   If I then click on the console or trash my .aux file, it compiles fine. Any thoughts on what is going on and how to prevent this annoying extra step?
76986
I am writing a package that saves information to an external file. I would like to name that file according to the source one; something like  foo.tex -> foo.bar But I cannot find any variable that contains 'foo'. I am pretty sure that there must be one because the table of contents is saved to foo.toc.  Any pointers?
62738
Let's say I compile the following file with pdflatex -shell-escape test.tex:   \documentclass{minimal}  \begin{document}  File listing is:  \immediate\write18{ls /usr}  \end{document}   This will send the output of the command ls /usr to report/log of pdflatex (primarily to stdout).   There are then two cases I'd like to utilize:    The output of ls /usr being included directly in the document (LaTeX stream). The output of ls /usr becoming the contents of a \newcommand (by this I mean, that I'd like the script to be executed when the \newcommand is executed first - and upon subsequent calls to the new command, the shell code should not be executed anew).    I have read through , but I'm not sure if this "pipe input" can be applied to \newcommand.   I have also read through  - and it seems that Tex' file I/O should be used; but I'm quite disliking the fact that I'd still have to redirect the script output (actually, in this case, the ls /usr output) to a file, and then read it in, to have it as contents of a command.   So, is there an easier way to achieve what I'd want (hopefully, illustrated through an example based on the above code)?     EDIT: Ehm, I should have asked one more question earlier :) I'll try with an edit here, although it will probably get missed .. :)   I originally asked for a \newcommand that will execute shell code only upon its definition (i.e., in a sense it is "cached"); and the answer from @egreg does exactly that. But then - would it be possible to have a different \newcommand definition, such that each time this newcommand is called, the shell command is executed anew? I.e. executing something like \@@input|"cat tempfile" (which cannot be executed as such), where tempfile changes between calls?