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
1 answer
35 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 ...
user avatar
  • 5,285
2 votes
1 answer
50 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}{\...
user avatar
  • 5,285
1 vote
0 answers
24 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\\...
user avatar
  • 5,285
2 votes
1 answer
74 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{...
user avatar
  • 512
0 votes
0 answers
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 ...
user avatar
  • 512
0 votes
1 answer
116 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} \...
user avatar
  • 1,309
1 vote
1 answer
83 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 ...
user avatar
  • 11
1 vote
2 answers
84 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. ...
user avatar
  • 705
1 vote
1 answer
148 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 ...
user avatar
  • 235
0 votes
1 answer
86 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 -...
user avatar
  • 203
2 votes
1 answer
42 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} \...
user avatar
1 vote
1 answer
148 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 ...
user avatar
  • 1,884
4 votes
1 answer
236 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 ...
user avatar
1 vote
1 answer
613 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 ...
user avatar
0 votes
1 answer
86 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{...
user avatar
  • 515
2 votes
0 answers
160 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 ...
user avatar
  • 27.7k
5 votes
1 answer
572 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 ...
user avatar
  • 27.7k
6 votes
1 answer
247 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 ...
user avatar
  • 68.1k
1 vote
0 answers
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{...
user avatar
  • 68.1k
11 votes
2 answers
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 ...
user avatar
  • 111
0 votes
0 answers
56 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 ...
user avatar
  • 8,789
29 votes
1 answer
6k 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 (...
user avatar
  • 8,789
5 votes
1 answer
596 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 ...
user avatar
  • 7,444
1 vote
0 answers
73 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 ...
user avatar
  • 1,921
0 votes
1 answer
141 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} \...
user avatar
3 votes
3 answers
129 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 ...
user avatar
  • 131
1 vote
1 answer
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 ...
user avatar
  • 131
0 votes
0 answers
71 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} \...
user avatar
  • 1,921
5 votes
2 answers
288 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 ...
user avatar
  • 8,789
1 vote
1 answer
206 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 ...
user avatar
  • 768
4 votes
2 answers
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} \...
user avatar
4 votes
2 answers
95 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 ...
user avatar
1 vote
1 answer
458 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 å ...
user avatar
  • 392
1 vote
1 answer
207 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]...
user avatar
  • 218
1 vote
1 answer
236 views

filecontents environment cannot change temporary files

\begin{filecontents}{exampleclass.cls} \ProvidesClass{exampleclass} \DeclareOption{testoption}{\PassOptionsToClass{a5paper}{article}} \ProcessOptions\relax \LoadClass{article} \end{...
user avatar
2 votes
1 answer
216 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{...
user avatar
2 votes
1 answer
132 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} \...
user avatar
6 votes
1 answer
468 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. ...
user avatar
  • 19.9k
5 votes
1 answer
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 ...
user avatar
  • 321
2 votes
1 answer
292 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 ...
user avatar
  • 942
4 votes
1 answer
831 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 ...
user avatar
  • 916
2 votes
1 answer
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{...
user avatar
5 votes
2 answers
751 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 ...
user avatar
  • 2,653
0 votes
1 answer
697 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? ...
user avatar
  • 651
2 votes
1 answer
540 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: %% ...
user avatar
  • 171
2 votes
2 answers
363 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 ...
user avatar
  • 8,674
1 vote
0 answers
159 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 } <&...
user avatar
  • 199
5 votes
2 answers
358 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 ...
user avatar
  • 2,601
1 vote
1 answer
527 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} \...
user avatar
  • 543
3 votes
1 answer
162 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 ...
user avatar