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.

Filter by
Sorted by
Tagged with
0
votes
1answer
42 views

Metadata with more than one language

I want to use more than one language in the creation of my Metadata. I was looking at the pdfx package documentation. And as I understood it, that would be possible. Based on the information in ...
0
votes
1answer
65 views

How can the filecontents environment be used with a build directory?

Having updated an old template for a paper I wanted also to clean up the way the document gets built by having a dedicated build directory. Using TexStudio it works (mostly) by changing: pdflatex.exe -...
0
votes
0answers
11 views

Producing a 2 PDF files at once

I am trying to produce 2 PDF files at once. MWE: \documentclass{article} \usepackage{filecontents} \begin{filecontents*}{myfile.tex} Hello World \end{filecontents*} \begin{document} test \end{document}...
2
votes
1answer
23 views

Looping over table elements with pgfplots (beamer)?

I am working in beamer with pgfplotstable. I want to produce the following: \documentclass{beamer} \usepackage{tikz,pgfplots,pgfplotstable,filecontents} \pgfplotsset{compat=newest} \...
1
vote
1answer
54 views

How can I use makefile to run typeset document with bibliorgaphy?

Recently I was introduced to typeset LaTeX documents with makefile, and I liked that idea. However, when come to the case where I have bibliography, things becomes complicated. First of all, I ...
2
votes
1answer
62 views

macros/commands inside a filecontents* environment does not expand

i would like to seek your help on the following. Consider the following MWE1: \documentclass{article} \usepackage{filecontents} \begin{document} Hi \begin{filecontents*}{dummy.tex} some text and ...
1
vote
1answer
123 views

Set new filecontents-environment to overwrite globally

I recently updated my LaTeX-Distribution and found out afterwards that the filecontents and ltxtable combination was broken. Only one table was loaded multiple times in my document. Afterwards I found ...
0
votes
1answer
31 views

create command to write with filecontents

What's the most efficient way to do this? \begin{filecontents*}{./weekly/week07.tex} % Week 7 \section{} \end{filecontents*} \begin{filecontents*}{./weekly/week08.tex} % Week 8 \section{} \end{...
2
votes
0answers
85 views

Attendance list

In my last question, Reading a student class list, I asked how to read a list of students and create a class list. Everything works ok as @egreg had a wonderful answer. I am now attempting to create a ...
5
votes
1answer
121 views

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 ...
6
votes
1answer
125 views

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 ...
1
vote
0answers
34 views

How to fix incompatibilities between etex package and new filecontents? [duplicate]

Since filecontents is usable into document (LaTeX2e <2019-10-01> patch level 3), the etex package breaks the filecontents new \write... With TeXLive 2018, the following code is ok: \documentclass{...
9
votes
2answers
828 views

\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 ...
0
votes
0answers
38 views

filecontentsdef: How to save a file data in a macro without creating a physical file in the working directory?

Following the description of filecontentsdefmacro environment in the manual of filecontentsdef, I understood that it can be used to save some data in a macro without the need to create a physical file ...
22
votes
1answer
2k views

filecontents: This package is obsolete

Why does the following warning show up? Package filecontents Warning: This package is obsolete. Disabling it and (filecontents) passing control to the filecontents environment (...
5
votes
1answer
126 views

latexmk unhappy with file that only contains filecontents block

Consider the file \documentclass[12pt]{article} \usepackage{filecontents} \begin{filecontents}{stuff.txt} Some stuff \end{filecontents} \begin{document} \end{document} latexmk is unhappy with this ...
1
vote
0answers
50 views

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 ...
0
votes
1answer
112 views

I can't change contentsname [duplicate]

Ths is my whole code \documentclass[12pt,leqno, style=sailor, display=slides, paper=smartboard, orient=landscape]{article} % This works well. \usepackage[utf8]{inputenc} \...
3
votes
3answers
104 views

Append unique characters read from filecontents to a string

I have a list of 2-character strings that is read from table, e.g. \begin{filecontents*}{attributetools.dat} Attribute SL SK MC SL AA PT SK UP MC \end{filecontents*} I want to create a string that ...
1
vote
1answer
65 views

Creating a unique list from two tables read from filecontents

I have two tables.. one contains attributes with values e.g. Name percentage Atr1 80 Atr2 20 Atr3 50 and the other one contains tools for that attribute Attribute Tool Atr1 SK Atr1 SL ...
0
votes
0answers
44 views

Select page number of print command of DTLforeach, filecontent?

My last post: filecontents: select rows of group to display And @Werner wrote brilliant solution for me with command : "print" His MWE code: \documentclass{article} \usepackage{filecontents} \...
5
votes
2answers
186 views

What is the difference between storing table data by filecontents and pgfplotstableread?

In this MWE, the table data loaded from poles.dat is successfully parsed as shown in the left plot. However, storing the same data inside a macro using \pgfplotstableread doesn't result in the same ...
1
vote
1answer
56 views

Pgfplots - Turn off Box when plotting a File

By default, pgfplots will draw a box around my plot. I am plotting a .dat-File with \draw table [...] {data.dat} and i want to turn that box off and just leave the x- and y-lines instead. In the ...
4
votes
2answers
95 views

filecontents non repeating execution of commands

As requested by Merging multiple different tables records. // Splitting table records in tables. I there is a command that I created (a varaint I found here). \newcounter{magicrownumbers} \...
4
votes
2answers
85 views

Not using optional argument makes environment break

I'm defining a wrapper environment for filecontents so that I can modify its behaviour. Everything works fine for most of the test cases. For example, I define an environment testenv which takes one ...
1
vote
1answer
126 views

Set PDF/A properties using filecontents package

I would like to provide the follwing class: \ProvidesClass{pdfatest}[2018/04/12 V0.1 PDF/A Test] \LoadClass[a4paper,11pt]{article} \newcommand{\cnumber}[1]{\def\@cnumber{#1}} \newcommand{\cauthor}[1]...
1
vote
1answer
171 views

filecontents environment cannot change temporary files

\begin{filecontents}{exampleclass.cls} \ProvidesClass{exampleclass} \DeclareOption{testoption}{\PassOptionsToClass{a5paper}{article}} \ProcessOptions\relax \LoadClass{article} \end{...
1
vote
1answer
147 views

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. Anyone}} \end{...
2
votes
1answer
91 views

Missing \endgroup error with ifs nested in foreach and pgf calculations

\documentclass{article} \usepackage{pgfplots, pgfplotstable} \usepackage{filecontents} \usepackage{indentfirst} \usepackage{amsmath} \usepackage{float} \usepackage{hhline} \usepackage{multirow} \...
6
votes
1answer
346 views

Use filecontents environment to write a binary file

In this answer of mine, I was trying to show how to embed an audio file into the pdf with the multimedia package. The resulting MWE does not stand on its own because it requires an example audio file. ...
5
votes
1answer
944 views

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 ...
2
votes
1answer
190 views

pgfplotstabel - create table with time column

I try to create a table with a column for date and time from a file data.txt. I can create a diagram but when I type \pgfplotstabletypeset for a table following error occurs: ! Package pgfplots ...
3
votes
1answer
566 views

Can the pdfx package use the document title and author?

The pdfx package documentation recommends to use a file \jobname.xmpdata to supply PDF metadata. This can be handled by using the filecontents environment. However, that makes macros useless, making ...
2
votes
1answer
70 views

Help with longtable renders extra field

So I have a problem because my longtable seems always render one extra field in my table. Depending on where I put my \ it renders after it goes through the csv or before. My code is: \documentclass{...
5
votes
2answers
599 views

foreach LaTeX input file, output a PDF file

I have a bunch of tables saved in separate files and folders which I have compiled with a master file, commenting the name of each file in the master file one by one and tediously renaming the ...
0
votes
1answer
488 views

Identifying files that contain graphics

I have following code in my article for identifying files that contain graphics. ‎\begin{filecontents*}{example.eps}‎ How should I identify graphic files, if I have more than one of such files? ...
2
votes
1answer
375 views

lstlisting : how to remove unwanted header?

I have a listing that I use to display some code. I use filecontents to specify the content and lstinputlisting to display it. The resulting pdf looks ok (used PDFLaTex), but above my code I get: %% ...
2
votes
2answers
235 views

Longtable with file contents not compiling

I am trying get a simple table like this: I am using longtable as I have data in a .dat files. Can you help me successfully generate the table using the importation of data from a file? Here is ...
1
vote
0answers
130 views

Tikz plot divide by minimun

I want to normalize my plot by the y minimal value. So I want to divide y by y max. I have already done before in Gnuplot with a Perl sentence : ymin1 = `perl -e 'print sort { $a<=>$b } <&...
5
votes
2answers
257 views

Using \input inside environment fails

I'm trying to use the filecontents package in combination with listings as suggested in How to define macro that only makes argument substitution? in order to produce a side-by-side view of LaTeX code ...
1
vote
1answer
420 views

longtable and filecontents inside a newenvironment

I'm trying to create a new environment for longtable enclosed by a filecontents environment. But I'm stuck and don't know exactly how to solve my problem. \documentclass[a4paper,parskip]{scrartcl} \...
3
votes
1answer
131 views

Does morewrites not support filecontents, and can I write body of environment using TeX primatives?

Is there an equivalent way to write the body of my environment to a file without filecontents using TeX primatives? morewrites or filecontents limitation I suspect a limitation that these packages ...
0
votes
0answers
50 views

\addbibresource doesn't work with file contents [duplicate]

I want to cite using the \filecontents command for the books. But it doesn't recognize the books. It only shows the keyword in bold. It says citation "elch" is undefined \documentclass[12pt]{...
1
vote
1answer
67 views

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 ...
15
votes
2answers
604 views

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

Applying and doing math on two functions read from a file using pgf

I'm trying to read two functions of x from a file, and then get the result of f(8) / g(8) using pgfmathparse. Here is a minimal (not) working example: \begin{filecontents}{data.dat} f(x) g(x) x ...
1
vote
1answer
153 views

Help LaTeX with Windows not flushing file cache in time when using filecontents.sty

Casually, I run into trouble while using the filecontents package: LaTeX complains that the data file created by the filecontents environment is not writeable: LaTeX Warning: Overwriting file `./data....
6
votes
1answer
687 views

Generate Tikz tree from filecontents

Is there an easy way to create tree nodes from data in a file? I need the tree to have nodes in the format 1,2,3,4 rather than 1,2,4,8 etc. I can't create the nodes in a loop as there would be two ...
5
votes
1answer
245 views

Concatenating files created with filecontents

I am creating a large number of data files "on the fly" using the filecontents package. I need to be able to concatenate these files in various permutations For example in the MWE below, I would ...
4
votes
1answer
1k views

filecontents can't update my bibliography database

It seems that when I modify the content of filecontents, it will not update the corresponding files auotmatically by compiling. Here is an simplified example: \documentclass{amsart} \usepackage{...