Questions tagged [filecontents]

This tag should be used for questions about the filecontents or filecontents* environment. If you only want to refer to the content of other files, use the external-files tag instead.

This tag should be used for questions about the filecontents or filecontents* environment. If you only want to refer to the content of other files, use the tag instead.

75 questions
15
votes
2 answers

Why can't filecontents work in a macro

I am trying to output some text in a file. I use filecontents and it works nicely. However, if I put the filecontents environment inside a macro, it only ouputs the comments but not the text when the macro is called. Here is an…
13
votes
3 answers

filecontents replaces tabs with spaces

filecontents package replaces tabs with spaces. Is there any solution to preserve tabs in the generated file without changing the following code? \begin{filecontents*}{textWithTabs.txt} Aa Bb Cc 1 2 3 \end{filecontents*} Generated…
Kadir
  • 1,537
  • 1
  • 11
  • 27
12
votes
2 answers

\begin{filecontents}{tabelle.tex} will not overwrite existing file

The old environment (before 10/2019) \usepackage{filecontents} \begin{filecontents}{tabelle.tex} ... some text ... \end{filecontents}` will overwrite an existing file tabelle.tex. After my update yesterday in debian sid, it does not work any…
Volker
  • 121
6
votes
1 answer

How to extend filecontents to append and count lines?

Here are two questions about filecontents environment: is it possible to add content to a preexisting file or, at a minimum, to keep open the external file to append the content of several filecontents environments to the same external file? is it…
Paul Gaborit
  • 70,770
  • 10
  • 176
  • 283
6
votes
1 answer

Overwriting file warning

Is it possible to suppress the warning generated by: \begin{filecontents*} Every time it outputs the warning: Overwriting file 'xxxx.xxx'. Maybe to delete it before it creates a new one or something like that? Thank you
marko3d
  • 351
  • 1
  • 2
  • 8
6
votes
1 answer

\end{filecontents} and \input{} on the same line

This code generates output that shows contents of excerpt1.tex \documentclass{article} \usepackage{filecontents} \begin{document} Pragraph is starting. \begin{filecontents}{excerpt1.tex} Part that must be in two…
Kadir
  • 1,537
  • 1
  • 11
  • 27
5
votes
1 answer

Reading a student class list

Whenever I create a class list of my students, I use the format in MWE below. The problem I have is that I normally have to copy and paste a student name at a time and ensure the table is correct every time. Is it possible to read the student names…
azetina
  • 28,884
2
votes
1 answer

File `data.csv' already exists on the system

Why does this Warning appear when using filecontents? : File `data.csv' already exists on the system. Does anyone know how i can remove this…
2
votes
1 answer

filecontents environment cannot change temporary files

\begin{filecontents}{exampleclass.cls} \ProvidesClass{exampleclass} \DeclareOption{testoption}{\PassOptionsToClass{a5paper}{article}} \ProcessOptions\relax …
user157036
2
votes
1 answer

How can I create a subfolder with filecontents?

As shown in this MWE \RequirePackage{snapshot} \documentclass{scrbook} \usepackage{filecontents,biblatex} \begin{filecontents}{bib/\jobname.bib} @misc{anything, author={A.…
lukascbossert
  • 3,015
  • 1
  • 16
  • 37
1
vote
1 answer

filecontents cannot write my text

i want to save a text to a file using the filecontents package. Here is the source code: \begin{filecontents}[overwrite]{test.lst} Hello World! \end{filecontents} A file "test.lst" is created, but it is empty. If I use the source code …
Soener
  • 41
1
vote
0 answers

Merge filecontents and call data from only one file

i have 2 filecontent with different structure: test1.tex and test2.tex. But i want to call data from only one file (ex:test.tex) How can i build only one file test.tex that includes data of 2 file test1.tex and test2.tex? My minimal code: …
latexforti
  • 2,091
1
vote
1 answer

A standard UN*X tool to pack a bunch of files in filecontents environment?

I was looking for something like: filecontents *.sty | cat - main.tex > newmain.tex It should be easy to write a script that iterating over its arguments, would wrap each in a filecontents environment. I wonder if there is a standard such…
Yossi Gil
  • 15,951
0
votes
0 answers

Put the content of a binary file within filecontents environment

I would like to include the content of a binary file within filecontents. Is there any way to do so? My MWE is as follows: \documentclass{article} \begin{filecontents}{file.txt} CPYA 4,3268 195 W64 # s ÷˙÷˙‰ Y Z*oG8#@ …
TobiR
  • 584
0
votes
1 answer

I can't change contentsname

Ths is my whole code \documentclass[12pt,leqno, style=sailor, display=slides, paper=smartboard, orient=landscape]{article} % This works…
1
2