Questions tagged [filesystem-access]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
50 votes
6 answers
25k 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 ...
Display Name's user avatar
  • 46.9k
23 votes
4 answers
16k views

File input and output

Are there any LaTeX packages that can assist with reading and writing to files? I am trying to develop a solution to the following problem: 1) I am producing a long report regularly. Part of the ...
yannisl's user avatar
  • 117k
17 votes
3 answers
3k 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 file....
Yossi Gil's user avatar
  • 16k
17 votes
5 answers
2k 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 ...
Hector's user avatar
  • 1,100
22 votes
1 answer
11k views

Including a relative path to a class file

I'm trying to set the documentclass type of a certain .tex file to be a class that is in the parent folder. However, I'm not sure how to include the path to the .cls file. I can write \documentclass[...
Jamie's user avatar
  • 373
31 votes
2 answers
55k views

Install LaTeX on Mac OS X El Capitan (10.11) [closed]

How do I install MacTex or another LaTeX distribution? Even after installation, LaTeX commands like latex, pdftex or lualatex are not found, and /usr/texbin/ doesn't exist. Even worse, commands ...
LaX's user avatar
  • 516
15 votes
3 answers
634 views

Include the file size of the generated pdf

How can I include the (approximate) file size of the generated pdf within a pdflatex document? I envision having to compile it three times: once to create the pdf, a second time to write the size to ...
Hooked's user avatar
  • 4,046
17 votes
2 answers
2k 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 ...
alfC's user avatar
  • 14.3k
17 votes
4 answers
9k views

Read arbitrary lines from file

Is there an easy way to read arbitrary lines from a file? For example "read line number 12" or "read backwards from last line to first line" or "read lines 1,3,5...".
Håkon Malmedal's user avatar
11 votes
3 answers
2k views

Read a file and store its contents in a variable

I am trying to implement single sourcing such that same document can be conditionally typeset for number of purposes. This is what I would like to do. \IfFileExists{../DecMaker.txt}{ var x = ...
abyshukla's user avatar
  • 411
11 votes
1 answer
15k views

Including all files within a directory [duplicate]

Possible Duplicate: How to iterate through the name of files in a folder Using \input{filename}, I can input a file canned "filename.tex". I have a directory containing all of the files I want to ...
Village's user avatar
  • 13.6k
16 votes
1 answer
1k views

Is it possible to compile hidden files?

(This question may make sense only in Linux.) I have the following simple file called .main.tex. Note that it is a "hidden" file because of its name. \documentclass[]{article} \begin{document} ...
alfC's user avatar
  • 14.3k
7 votes
3 answers
479 views

How to trim the end of line character for each line read from an external file?

How to trim the end of line character for each line read from an external \jobname.list file below? Note that the real scenario does not use filecontents package to generate the list. I use a batch ...
kiss my armpit's user avatar
7 votes
2 answers
6k views

import input pgfplots with relative paths

The package import makes it posible to \input (and \include) a .tex document which itself \input (or \includegraphics etc.) stuff using relative paths. I was hoping that this also would work with the \...
hpekristiansen's user avatar
33 votes
2 answers
25k views

Link to file in the parent folder

I have a folder, say C:\example\paper with a bib-file C:\example\1.bib. I also have a tex file C:\example\paper\main.tex where I would like to put a link to 1.bib. I can put the whole path, of ...
SBF's user avatar
  • 1,418
17 votes
5 answers
12k views

Graphicspath for MikTeX

Is there a way to specify a \graphicspath that includes all sub-directories? I know I could put all my graphics in a texmf tree, but I'd like to have them in another directory tree. As far as I can ...
Rob Hyndman's user avatar
  • 4,664
12 votes
3 answers
2k views

Read strings from file that contains the special character #

I need to read some values from data files as given in the sample code. The problem arises when the files contain # character. Then I get " ! Illegal parameter number in definition of \@xs@call " ...
A.GH's user avatar
  • 434
11 votes
2 answers
1k views

Checking whether a file is empty?

Well, the obvious way to do that is with \ifeof, but for some reason, I cannot do this right. I wrote \newread\reader \openin\reader=empty \relax \ifeof\reader\message{empty}\else\message{not empty}\...
Yossi Gil's user avatar
  • 16k
9 votes
2 answers
1k views

Read file without file extension from hidden directory

I'm trying to read some data from a file and use the following approach: \documentclass{minimal} \newcommand{\file}{./.dir/.testFile} \begin{document} \newread\myread \openin\myread=\file\relax \loop ...
jrast's user avatar
  • 586
7 votes
2 answers
876 views

\read: trailing spaces are removed

I'm trying to copy a (binary) file with LaTeX (mostly for the sake of it), but when I read a line, the trailing spaces are removed. The MWE, based on this TeX.SX answer: \edef\infile{infile} \edef\...
Suzanne Soy's user avatar
  • 3,043
4 votes
0 answers
355 views

Can LaTeX automatically search directories and \include discovered files?

I have a master document that has a lot of entries like the following: \include{entries/20141212-some-article/entry} \include{entries/20141215-another-article/entry} \include{entries/20141225-...
ana's user avatar
  • 303
2 votes
3 answers
202 views

How to query if a file has changed (a \IfFileHasChanged conditional)?

We know \IfFileExists{<file>}{<yes>}{<no>}. How can I create a command \IfFileHasChanged{<file>}{<yes>}{<no>} for a file which has changed (and does exist!). I mean ...
cis's user avatar
  • 7,965
2 votes
1 answer
531 views

Write to a file outside of the current folder

Is it possible with TeX to write somewhere else than in the current folder? The following does not work: \documentclass{article} \begin{document} \newwrite\tempfile \openout\tempfile=/Users/colas/...
Colas's user avatar
  • 6,762
12 votes
1 answer
587 views

Why does \jobname give asterisks/stars instead of spaces, and how do I fix this?

When I LaTeX a file named test 1.tex with the code \edef\temp{\jobname.txt}\show\temp, I get > \temp=macro: ->test*1.txt. This seems to work fine with LaTeX's internal commands, but if I then ...
Jason Gross's user avatar
  • 2,135
12 votes
1 answer
3k views

Extract all \note tags from beamer as a simple text file

There is a nice presenter tool I am using called pdfpc. Sadly it does not show notes I put in my latex presentation with \note{}. Is there a way to extract the content of all my \note{} tags to a ...
cebe's user avatar
  • 1,485
10 votes
1 answer
778 views

Patched version of pdftex does not see what kpsewhich sees

I have TeX Live version 2013.30973-7 running on ArchLinux. I want to use a patched version of pdftex to create valid PDF/A-1b documents. I have an issue using the patched version after compilation. ...
Florian Bw's user avatar
9 votes
1 answer
2k views

What is the LaTeX filename length limit for images?

See Final Update below. I have some images with very long filenames and/or paths, and when I try to include them, my document appears to build fine, but when I try to open the PDF, it says the ...
SSilk's user avatar
  • 3,732
8 votes
5 answers
2k views

Read number from file

I have a file called _runs.ini. Depending on its content, the document is compiled differently. I tried to read the content and executed a \ifthenelse-command without success. Here's my MWE: \...
Moldevort's user avatar
  • 1,295
7 votes
2 answers
5k views

skipping the first line of a data file for pgfplotstable

I need to skip the first row of a csv file, which is auto-generated by some magic measurement apparatus. It contains its own filename as the first line. The second line contains the column names (no ...
Christoph's user avatar
  • 2,913
6 votes
2 answers
1k views

includepdf and file with comma

How can I use filenames with commas with pdfpages? The grffile package didn't help, the \detokenize command didn't help either Also the \string command doesn't work. For ex. \includepdf{\string"C:/...
robertspierre's user avatar
5 votes
2 answers
782 views

Open a file whose name start with a dot and other strangely named files?

The syntax of TeX's \openout command is rather simple: \openoutN=filename where N is a four-bit number, but what is filename? How do you open a file whose name stars with a dot? More generally, how ...
Yossi Gil's user avatar
  • 16k
5 votes
2 answers
2k 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 files ...
Dig's user avatar
  • 291
4 votes
0 answers
85 views

Can you detect from within TeX how the name of a file accessed by TeX is encoded?

This question is inspired by the question Input dynamically generated file name which basically is about truncating a given filename/the expansion of \jobname by two characters. In utf-8 the byte-...
Ulrich Diez's user avatar
  • 28.7k
4 votes
2 answers
9k views

Cross-reference between LaTeX files

I am trying to get a TeX file to read certain lines from a different text file. More precisely, in my database file a.tex I have a long list. Now in a different file, I would like to have items with ...
user1227's user avatar
  • 485
3 votes
3 answers
2k views

What's Happening With My Path After Upgrade to El Capitan?

I've tried everything I could find (within good reason) regarding how I should proceed in making my TeX files compile again and nothing works. After hunting it down in the computer, I have found that ...
Nobody's user avatar
  • 133
2 votes
0 answers
534 views

Command to flush log file

For the tikzDevice, I want to communicate with a LaTeX process by sending input (generated LaTeX code) to its stdin and parsing output that is written using \immediate\write. In some cases I need also ...
krlmlr's user avatar
  • 12.5k
2 votes
1 answer
251 views

\ShellEscape fails in certain cases with lualatex

This question stems from my question here about minted and lualatex, with similar issues reported by another user here. I think I've isolated the issue to the following. minted relies on \ShellEscape ...
mbert's user avatar
  • 4,151
1 vote
1 answer
178 views

Reach another folder with \input

How do I reach a file in another folder when using \input? E.g. I have my main document frontpage.tex in a folder called main and a file chapter1.tex in a folder chapters. How do I in frontpage.tex ...
Steeven's user avatar
  • 1,407
0 votes
2 answers
49 views

Nested Include Loop Acting Strangely

I'm trying to implement filesystem based file includes for a paper I'm writing and have previously asked a question on this topic. The accepted answer seems to work in the case that I only have a ...
ScottishTapWater's user avatar
0 votes
0 answers
56 views

Appending Text to Each Line of an External File Using expl3 Syntax

Let us suppose I have an external questionfileone.tex file where each line of this external file represents a particular question text. It is something that I can use, for example, as a test database ...
beethovengg14's user avatar
0 votes
0 answers
50 views

Save data from all my .tex files to a global file

I want to keep track of some info of my .tex files. More precisely, I give an id (an integer) to my math exercises and would like to keep somewhere the maximal id already given (and maybe other info)....
Colas's user avatar
  • 6,762
0 votes
1 answer
97 views

Append content to a file containing sharp

In my library, I need to be able to append some text to a file. The problem is that that file may contain the # symbol, and it turns out that every time I append something to a file containing a #, ...
tobiasBora's user avatar
  • 8,567