A file dependency checker for tex files generates makefile rules to point to all file changes involved :)
Go to file
2017-10-09 21:12:16 +02:00
Einleitung.tex real test file, ported stuff to c++ streams 2017-10-08 18:44:27 +02:00
fs.cpp real test file, ported stuff to c++ streams 2017-10-08 18:44:27 +02:00
fs.hpp real test file, ported stuff to c++ streams 2017-10-08 18:44:27 +02:00
main.cpp fix target name not written when not overridden 2017-10-09 14:35:53 +02:00
Makefile real test file, ported stuff to c++ streams 2017-10-08 18:44:27 +02:00
memory_string.hpp real test file, ported stuff to c++ streams 2017-10-08 18:44:27 +02:00
README.md add readme 2017-10-09 21:12:16 +02:00
test.tex cleanup (a bit) 2017-10-09 11:41:14 +02:00

Description

texdepends is a small tool that scans given latex files for the following macros:

  • \input{}
  • \include{}
  • \lstinputlisting{} and lists all the files included using these macros in a file with either a given name or with the name of the processed file and a .d extension, using makefile dependency syntax.

This means for a file that uses e.g. \input{Intro.tex} somewhere (the file is named document.tex}, a call to texdepends document.tex will generate a file called document.d with the following content:

document.tex: Intro.tex\ 

This file can be used to trigger a rebuild using make of the document if there were changes in files affecting it.

Command line options

There are two possible switches:

Name Description
--target
-t Can be used to set the string output before the colon char
--output:
-o: modifies the behaviour so all file dependencies of all input files will be written to the given file, instead of creating one file per input.

Note: The --output switch should be used in combination with --target, because otherwise no target will be present in the output file!

Building

The Program is currently only written for Linux, i will see if a windows port is feasible (should be straight forward).

Linux

Under Linux, a call to make should build produce a binary called texdepends. A simple test can be performed using make test

Notes

  • The program will follow all found *.tex links and parse them too, if possible. Files included in included files will therefore also show up as dependencies. It will only parse a file once
  • This is no latex parser, it has two major drawbacks:
    • No Parsing of \if-directives, which means, that files included via \if will always show up
    • No parsing of arguments to macros. The Only macro-supsitution happens inside \include or \input arguments. The only macro definitions supsituted are those made via \def. Therefore the following include will not show up in the output because it happend in a macro-argument.
\frame{
    \include{Intro.tex}
}