Questions tagged [filesystem-access]
The filesystem-access tag has no usage guidance.
42
questions
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 ...
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 ...
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....
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 ...
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[...
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 ...
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 ...
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 ...
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...".
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 = ...
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 ...
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}
...
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 ...
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 \...
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 ...
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 ...
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 " ...
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}\...
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
...
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\...
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-...
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 ...
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/...
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 ...
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 ...
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. ...
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 ...
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:
\...
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 ...
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:/...
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 ...
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 ...
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-...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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)....
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 #, ...