Metadata-Version: 2.1
Name: texbuild
Version: 0.1.1
Summary: Build system for LaTeX documents.
Author-email: Daniel Sank <sank.daniel@gmail.com>
License: MIT License
        
        Copyright (c) 2022 Daniel Thomas Sank
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Project-URL: Homepage, https://github.com/DanielSank/texbuild
Project-URL: Bug Tracker, https://github.com/DanielSank/texbuild/issues
Keywords: latex
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.7
Description-Content-Type: text/markdown
License-File: LICENSE

# texbuild

`texbuild` is a build system for LaTeX documents.
It provides namespacing for labeled items.
Consider a LaTeX document composed of a main file
```
% main.tex

\documentclass{article}
\begin{document}
This is an equation
\begin{equation}
  f(x) = x \label{equation}
\end{equation}
\input{foo.tex}
Let's refer to Equation~(\ref{equation}).
\end{document}
```
which includes a subordinate file
```
% foo.tex

\begin{equation}
  f(x) = x^2 \label{equation}
\end{equation}
```
In this situation, `\ref{equation}` is ambiguous because both files use `\label{equation}` and the namespace for labeled items in LaTeX is global.
`texbuild` fixes this by supporting import semantics:
```
% main.tex

% -- begin imports --
% import foo as foo
% -- end imports --

\documentclass{article}
\begin{document}
This is an equation
\begin{equation}
  f(x) = x \label{equation} % export
\end{equation}
\input{foo.tex}
We can refer to foo's Equation~(\ref{foo.equation}) or our own Equation~(\ref{equation}).
\end{document}
```
and
```
% foo.tex

\begin{equation}
  f(x) = x^2 \label{equation} % export
\end{equation}
```

## Example

To see `texbuild` in action, install it and use it to build the example LaTeX documemt provided in this repo, by following these steps:
```
$ pip install texbuild
$ git clone https://github.com/DanielSank/texbuild
$ cd texbuild/example
$ texbuild

This produces `texbuild/example/build/main.pdf`, which illustrates the use of `texbuild`.
