CTAN Comprehensive TeX Archive Network

Direc­tory macros/latex/contrib/filecontentsdef

Source:  filecontentsdef.dtx (v1.4 2019/04/20)
Author:  Jean-Francois Burnol
Info:    filecontents + macro + verbatim
License: LPPL 1.3c
Copyright (C) 2016-2019 Jean-Francois Burnol.
<jfbu at free dot fr>


This lightweight pack­age pro­vides an en­vi­ron­ment filecontentsdef which is like the filecontents en­vi­ron­ment of Scott Pakin's file­con­tents pack­age but in ad­di­tion to the file cre­ation stores the (ver­ba­tim) con­tents into a macro given as an ad­di­tional ar­gu­ment (ei­ther as a con­trol se­quence or as a name).

Dis­play­ing ver­ba­tim these con­tents is pos­si­ble via \filecontentsprint, and ex­e­cut­ing them (if they rep­re­sent code) via \filecontentsexec.

A vari­ant en­vi­ron­ment filecontentsdefmacro stores the con­tents into a macro, but skips the save-to-a-file part.


v1.4 [2019/04/20]

  • back­port 2018/04/01 re­lease change to file­con­tents en­vi­ron­ment (^^L and ^^I def­i­ni­tions).
  • add filecontentsdefmacro en­vi­ron­ment.
  • ex­tend filecontentsdef and filecontentsdefmacro en­vi­ron­ments as well as \filecontentsprint and \filecontentsexec macros to ac­cept in­dif­fer­ently ei­ther a con­trol se­quence or a name as ar­gu­ment.
  • refac­tor doc­u­men­ta­tion, ex­plain how to de­fine wrap­per en­vi­ron­ments.

v1.2 [2016/09/19]

Ini­tial ver­sion.


This Work may be dis­tributed and/or mod­i­fied un­der the con­di­tions of the Project Public Li­cense 1.3c. This ver­sion of this li­cense is in


and the lat­est ver­sion of this li­cense is in


and ver­sion 1.3 or later is part of all dis­tri­bu­tions of ver­sion 2005/12/01 or later.

The Author of this Work is:

  • Jean-Fran­cois Burnol <jfbu at free dot fr>

This Work con­sists of the main source file file­con­tents­def.dtx and its de­rived files file­con­tents­def.sty, file­con­tents­def.pdf, file­con­tents­def.dvi, README.md, INSTALL.md, README, INSTALL.

Down­load the con­tents of this pack­age in one zip archive (99.6k).

file­con­tents­def – file­con­tents + macro + ver­ba­tim

The pack­age pro­vides two en­vi­ron­ments called file­con­tents­def and file­con­tentshere. They are de­rived from the file­con­tents en­vi­ron­ment as pro­vided by Scott Pakin's file­con­tents pack­age. In ad­di­tion to the file cre­ation they ei­ther store the (ver­ba­tim) con­tents in a macro (file­con­tents­def) or type­set them (ver­ba­tim) on the spot (file­con­tentshere).

The au­thor de­vel­oped the pack­age to dis­play code ver­ba­tim in doc­u­men­ta­tion and the same time pro­duce the cor­re­spond­ing files dur­ing the run in or­der to em­bed them in the PDF as file at­tach­ment an­no­ta­tions (by us­ing Scott Pakin's pack­age at­tach­file).

Ver­sion1.4 2019-04-20
Li­censesThe Project Public Li­cense 1.3
Copy­right2016–2019 Jean-Fran├žois Burnol
Main­tainerJean-Fran├žois Burnol
Con­tained inTeX Live as file­con­tents­def
MiKTeX as file­con­tents­def
TopicsFile man­age­ment
See alsofilecontents
Guest Book Sitemap Contact Contact Author