diff --git a/README.md b/README.md new file mode 100644 index 0000000..10a1b22 --- /dev/null +++ b/README.md @@ -0,0 +1,52 @@ +## 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: +```makefile +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} +} +``` + +