{external-files} is about external files included in a document, e.g., pictures via \includegraphics, or parts of a document via \input or \include. For questions about files automatically generated by LaTeX (.aux, .log, .out, .toc, ...) use {auxiliary-files}.

learn more… | top users | synonyms

52
votes
2answers
15k views

How to include graphics with spaces in their path?

I want to import graphics into my main input file using the macro \includegraphics. It does not work if the filename contains spaces. Include image with spaces in path directory to be processed with ...
19
votes
4answers
4k views

How to iterate through the name of files in a folder

Assume I have many TeX files. For the sake of simplicity, also asssume they are in a single folder or directory. I want to input all files from within my main LaTeX document. Actually I can create a ...
37
votes
11answers
14k views

Deleting external/auxiliary files?

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.
27
votes
2answers
2k views

Graphics file extensions and their order of inclusion when not specified

When using graphicx's \includegraphics you can specify the file extension or not. For generic use and perhaps portability, extensions are commonly dropped. The types of "approved" inclusions and their ...
36
votes
2answers
18k views

Cross-referencing between different files

I want to cross-reference between different .tex files, just because I want to put every chapters separately. Let's say in file chapterI.tex I have \label{a} and I want to access this in file ...
44
votes
2answers
5k views

Can I use an image located on the web in a LaTeX document?

I have tried \includegraphics{http://www.site.com/path/to/figure.png} But this returns the error ERROR: Package pdftex.def Error: File `http://www.website.com/path/to/figure.png' not found. ...
16
votes
3answers
2k views

Drawing different tikz shapes parameterized by data from a file

I have a file with three columns of data, x, y, r. # x y r 1 1 0.1 2 2 0.5 3 3 1.2 and so on. I'd like to loop over the rows, and draw a circle at x,y with radius r for each row. I first thought ...
29
votes
3answers
5k views

How to influence the name of the pdf file created with pdfLaTeX (from within the source code)?

I have a source file called 2011-05-27_Myfilename.tex and I'd like to create a PDF file from it called only Myfilename.pdf. Can this be configured from within the .tex file itself? (It seems to be ...
12
votes
2answers
3k views

referencing labels from other files

Sometimes I want to refer (using \ref) a \label from some other tex file. What is the right way to do it? (It's, of course, possible to \include all files in one and then use \includeonly — but it ...
13
votes
1answer
362 views

Can Footnotes reside in another file?

I want to know if is there a possibility/method/package, by which I can uniquely label all footnote positions in book.tex. And another file, footnote.tex, containing the footnotes and matching labels, ...
14
votes
6answers
1k views

Automating quoting across LaTeX documents

I occasionally face the following situation when writing LaTeX documents. (This question is probably not LaTeX specific, though). Suppose I have a document, say orig.tex. Then I quote from that ...
46
votes
3answers
6k views

Outsourcing TikZ code

My Tex files get very confusing since I have multiple long TikZ code in them. How do you organize your files when it comes to TikZ?
28
votes
6answers
1k views

Is it possible to write all mathematical formulas in a separate file and add them in main file on-demand?

Consider this scenario: I have a report to write and I want to write all mathematical formulas in a separate file and then add them in the main report file on demand (i.e. include/import/add/call a ...
15
votes
3answers
3k views

Create list of all external files used by master LaTeX document?

Is there an easy way to create a list of all external files (complete path) which are used by a LaTeX document (and its "sub-documents") by \input \include \includegraphics ? (may I have forgotten ...
31
votes
6answers
14k views

.bib library file in a different directory, how to use? (Mendeley centralised .bib file)

problem Hello All, I have the possibility of a centralised, updated .bib file using Mendeley Desktop. This file will stay updated with all the changes I make using my Mendeley citation software. I ...
11
votes
1answer
5k views

pgfplot: Datafile format for datetime field

I have a datafile (which I may manipulate to any format), it contains a date-time stamp currently in the form "year-month-day hour:min" and a single variable for each recorded time. When I attempt to ...
5
votes
1answer
1k views

pdfpages and linktodoc

I'm trying to link to a specific page in an external document. This has been discussed previously under the topic, How to link to specified page of an outer pdf document?, and the answer suggests ...
13
votes
1answer
2k views

How do I make an attached file display like a link?

I'm embedding an external file in my pdf with \usepackage{attachfile2} and\textattachfile[color=1 1 1]{description}{file.pdf}. How can I make the text look the same as it would if I had used the ...
4
votes
3answers
402 views

Can i automatically load chapters and sections based on the filesystem?

I was interested in knowing if i can load chapters and sections of my book based on the filesystem. For example: Chapter 1/ Section 1.tex Section 2.tex Section 3.tex Chapter 2/ Section 1.tex ...
13
votes
3answers
935 views

How can I open a file in “append” mode?

Could not find anything in the TeXBook, but this could be just me. I guess it is always possible to open the file for reading, copy its content to another file, and then continue writing to that ...
14
votes
1answer
597 views

How do I create a macro which reads the content of a file when the macro is defined?

I am trying to do something like: \newcommand{\sometext}{\input{somefile.txt}} This works, but requires inputting the file every time the macro is used in the document. I would like to know a way ...
11
votes
2answers
3k views

Where can I put biblatex style modifications?

Guidelines for customizing biblatex styles says: Finally, assuming that I'll want to use my style adjustments in a multitude of documents: Where do I put the relevant macro stuff? The ...
7
votes
1answer
1k views

Include figure (from macro) with underscore in filename

I have a system of where a .tex is generated from a program. The final .tex file has a (simplified) structure like this: \newcommand{\PlotFrame}[1]{% \begin{frame} \frametitle{...} ... ... ...
7
votes
4answers
2k views

Using external tables in TikZ

How do I use tabela.xls as a data source to a LaTeX table or even a table made with TikZ with the following command? Note: I wanted to use tabela.xls as a data source for multiple files. Tex and that ...
13
votes
3answers
491 views

Need help creating a custom aux file read/write routine to suit my needs

I require two new commands, \createreference and \citereference, to work with. They should work as shown in the following examples: \createreference{john}{John Q. Citizen} should write the text “John ...
17
votes
1answer
12k views

How do I import a text file so that it becomes the body text of my LaTeX document?

I want to completely separate formatting and content creation. The articles I will write are all plain prose that requires minimum or zero LaTeX formatting. Also, the text file doesn't have the ...
10
votes
6answers
311 views

How can I '\input' a file without getting the implicit newline?

Intro I'm working on a lightweight package that allows you to put any content (typically LaTeX code) in an environment, then use that content multiple times, each time scanned separately, so you can ...
8
votes
1answer
611 views

Accessing randomly selected problems via the probsoln package

I have two datasets, each containing problems dealing with a specific topic. These problems are stored in external files (again, one file per topic) and loaded into the datasets in a random order. I ...
12
votes
2answers
956 views

How to avoid automatic .tex extension in filenames?

I am in an mildly unfortunate situation in which, because of the way I prepared the files automatically, I ended up with a file to be attached but also another file with the same name but ending in ...
10
votes
4answers
487 views

Check for a valid file before using \includegraphics

I know how to check if a given argument represents an existing file (see this question). But is there also a possibility to check if this file can be included by \includegraphics? What I want to ...
8
votes
4answers
14k views

Inserting a .EMF file into a LaTeX document.

I had a question about a file extension I was dealing with after creating a graphics file using the computing software Maxima. When I created the plot I wanted, I saved the file and it saved as a .EMF ...
6
votes
1answer
4k views

Including XML file into LaTeX

I am using LaTeX for very first time and have very basic knowledge about it. I am using the template from here to write my thesis. I am using Ubuntu 12.04. When I try to include a small XML file in ...
8
votes
1answer
544 views

Listings line numbers that match the linerange specification

This is a follow-up question to First line number in lstinputlisting environment. Consider the MWE: \documentclass{article} %\usepackage{etoolbox}% http://ctan.org/pkg/etoolbox ...
7
votes
2answers
1k views

Using the xr package in LyX (for cross-referencing an external LyX document)

Question: What steps are required to use the xr package in LyX in order to reference items in other, independent LyX documents? Steps already taken: The tools package (that contains the xr package) ...
3
votes
2answers
497 views

Disable including of system files [duplicate]

Possible Duplicate: How can I safely compile other people's LaTeX documents? I've got a Linux server that is rendering LaTeX documents, I want to disable the access of LaTeX to system ...
13
votes
2answers
897 views

Parsing files through LuaTeX

This question has two parts: How would one generally parse a file with LuaTeX, assuming the file only holds data that is delimited either by spaces, commas or semicolons. How would you parse the ...
16
votes
3answers
482 views

How to trim .tex for each filename read from an external file?

I have an external text file that contains a list of names of TeX input files. The names have trailing extensions .tex. For example, the external text file named data.txt contains the following list: ...
4
votes
1answer
7k views

Link to local (PDF) file [duplicate]

Possible Duplicate: Does hyperref work between two files? I want to make a link in LaTeX to a PDF file on my local network drive, i.e. when you click on it then Adobe Reader should open and ...
16
votes
1answer
3k views

Can I test if a file exists? [duplicate]

Can I somehow test if a file exists? And can I use this to do only things when it exists? I like to do something like if(exist('members.csv')) { do something }
17
votes
2answers
3k views

What is the variable that contains the source file name?

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 ...
15
votes
4answers
722 views

File copy without expansion

What is the command for file copy? I want to copy the contents of one file into another without any command expansion. In a command line driven operating system one would use copy source target I ...
5
votes
2answers
360 views

Renaming section levels?

I have several reports I've written up in article format. I want to keep them in separate files but combine them into a larger report. I've removed the headers, but don't want to go through each file ...
5
votes
1answer
1k views

Showing only specific lines using the listings package

I am very new to TeX. My source code is in an external file, let's call it source.java, and I use \lstinputlisting{source.java}. How could I use only the lines 3-5 for my code listing? (and not the ...
3
votes
1answer
100 views

In which folder should I copy the image (JPEG) so that it could be found?

I used the following code to insert a JPEG image in my document but I don't know where exactly should I copy the image so that it'll be found. I know it must be somewhere in the TeX folder, but I ...
6
votes
2answers
157 views

Flagging/tracing in roughdraft source document location

Surely I must be reinventing the wheel here. I'm writing a rather lengthy document for which each section corresponds to its own input file. Basically, I have a mother document which looks ...
6
votes
1answer
743 views

\input only part of a file using catchfilebetweentags package

I would like to include only a part of a .tex file into a different .tex file. The part I want to include is delimited by some comment tags, as it is used by catchfilebetweentags package. I tried the ...
5
votes
1answer
440 views

Relative paths for \input and building from different directories

The minimal example If I have a directory containing my main LaTeX source file and it uses \input to incorporate some data in another file, I can use a relative pathname. E.g., with these files: ...
5
votes
1answer
392 views

No room for a new \read/\write

I've already searched a lot about it and there seems to be no possible way of increasing the number of files (La)TeX can open. This for example, gives an explanation about the error message. I've also ...
4
votes
1answer
207 views

Using a non-centralized structure for tex files - similar to \graphicspath

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 ...
4
votes
1answer
279 views

Command to insert filename in caption of a listing

I would like to have a command to insert listings that contain the filename in the caption. This works well as long as there is no "_" etc. in the filename. I also tried the suggestion from a ...