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
1
vote
1answer
29 views

Why This Code Eliminating Index Commas Works for \jobname.mst and Not for \jobname.ist

This post is an addendum to How to Universally Remove the Comma from Each Index Entry. In the link, I was looking for a universal way to remove the comma in each index entry. Werner advised to include ...
2
votes
1answer
34 views

Difference Between Filecontents and Filecontents* and When to Use One Instead of the Other

I have recently been experimenting with different ways to replace the comma in the Index with a different symbol. The following code replaces the said comma with a blank space. \begin{filecontents}{\...
1
vote
0answers
16 views

Inserting Vertical Space Before Index Heading Items with Filecontents

I recently discovered a seemingly simple way to insert vertical space immediately before new index headings using filecontents--- Consider the code \begin{filecontents*}{\jobname.mst} item_0 "\n\\...
2
votes
1answer
41 views

Suppress filecontents warning if the file is defined before documentclass

I would like to define filecontents blocks before documentclass in my LaTeX document. Is there any way to suppress warning Writing or overwriting file ./filename? My MWE is as follows: \begin{...
0
votes
0answers
22 views

Put the content of a binary file within filecontents environment [duplicate]

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

Filecontents is not recognized

I don't know how, but it seems that this file does not want to be compiled. Why? This is my mwe: \documentclass{beamer} \usetheme{default} \usepackage[frenchb]{babel} \usepackage[T1]{fontenc} \...
1
vote
1answer
67 views

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 ...
1
vote
2answers
60 views

Filecontents inside an environment

I'm trying to write in some external files using the filecontents environment of LaTeX. For this purpose, I created an environment which writes the contents and numbers the file with a counter. ...
1
vote
1answer
119 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
82 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 -...
2
votes
1answer
39 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
111 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 ...
3
votes
1answer
189 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
507 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
62 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
138 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
423 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
213 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
38 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{...
11
votes
2answers
2k 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
54 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 ...
26
votes
1answer
5k 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
438 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
71 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
133 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
121 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
70 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
62 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
265 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
145 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
109 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
91 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
408 views

Remove warning "Tab has been converted to Blank Space."

I get this warning "Tab has been converted to Blank Space." how can I remove it, and why do I get it? \documentclass[12pt]{article} \usepackage[utf8]{inputenc} % Gjør det mulig å ...
1
vote
1answer
192 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
210 views

filecontents environment cannot change temporary files

\begin{filecontents}{exampleclass.cls} \ProvidesClass{exampleclass} \DeclareOption{testoption}{\PassOptionsToClass{a5paper}{article}} \ProcessOptions\relax \LoadClass{article} \end{...
2
votes
1answer
205 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
117 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
439 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
1k 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
274 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 ...
4
votes
1answer
769 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
75 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
729 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
664 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
507 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
343 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
152 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
341 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
508 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
154 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 ...