diff --git a/.nojekyll b/.nojekyll new file mode 100644 index 0000000..e69de29 diff --git a/LICENSE.html b/LICENSE.html new file mode 100644 index 0000000..66ef7df --- /dev/null +++ b/LICENSE.html @@ -0,0 +1,417 @@ +
The LaTeX Project Public License
+=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
+
+LPPL Version 1.3c 2008-05-04
+
+Copyright 1999 2002-2008 LaTeX3 Project
+ Everyone is allowed to distribute verbatim copies of this
+ license document, but modification of it is not allowed.
+
+
+PREAMBLE
+========
+
+The LaTeX Project Public License (LPPL) is the primary license under
+which the LaTeX kernel and the base LaTeX packages are distributed.
+
+You may use this license for any work of which you hold the copyright
+and which you wish to distribute. This license may be particularly
+suitable if your work is TeX-related (such as a LaTeX package), but
+it is written in such a way that you can use it even if your work is
+unrelated to TeX.
+
+The section `WHETHER AND HOW TO DISTRIBUTE WORKS UNDER THIS LICENSE',
+below, gives instructions, examples, and recommendations for authors
+who are considering distributing their works under this license.
+
+This license gives conditions under which a work may be distributed
+and modified, as well as conditions under which modified versions of
+that work may be distributed.
+
+We, the LaTeX3 Project, believe that the conditions below give you
+the freedom to make and distribute modified versions of your work
+that conform with whatever technical specifications you wish while
+maintaining the availability, integrity, and reliability of
+that work. If you do not see how to achieve your goal while
+meeting these conditions, then read the document `cfgguide.tex'
+and `modguide.tex' in the base LaTeX distribution for suggestions.
+
+
+DEFINITIONS
+===========
+
+In this license document the following terms are used:
+
+ `Work'
+ Any work being distributed under this License.
+
+ `Derived Work'
+ Any work that under any applicable law is derived from the Work.
+
+ `Modification'
+ Any procedure that produces a Derived Work under any applicable
+ law -- for example, the production of a file containing an
+ original file associated with the Work or a significant portion of
+ such a file, either verbatim or with modifications and/or
+ translated into another language.
+
+ `Modify'
+ To apply any procedure that produces a Derived Work under any
+ applicable law.
+
+ `Distribution'
+ Making copies of the Work available from one person to another, in
+ whole or in part. Distribution includes (but is not limited to)
+ making any electronic components of the Work accessible by
+ file transfer protocols such as FTP or HTTP or by shared file
+ systems such as Sun's Network File System (NFS).
+
+ `Compiled Work'
+ A version of the Work that has been processed into a form where it
+ is directly usable on a computer system. This processing may
+ include using installation facilities provided by the Work,
+ transformations of the Work, copying of components of the Work, or
+ other activities. Note that modification of any installation
+ facilities provided by the Work constitutes modification of the Work.
+
+ `Current Maintainer'
+ A person or persons nominated as such within the Work. If there is
+ no such explicit nomination then it is the `Copyright Holder' under
+ any applicable law.
+
+ `Base Interpreter'
+ A program or process that is normally needed for running or
+ interpreting a part or the whole of the Work.
+
+ A Base Interpreter may depend on external components but these
+ are not considered part of the Base Interpreter provided that each
+ external component clearly identifies itself whenever it is used
+ interactively. Unless explicitly specified when applying the
+ license to the Work, the only applicable Base Interpreter is a
+ `LaTeX-Format' or in the case of files belonging to the
+ `LaTeX-format' a program implementing the `TeX language'.
+
+
+
+CONDITIONS ON DISTRIBUTION AND MODIFICATION
+===========================================
+
+1. Activities other than distribution and/or modification of the Work
+are not covered by this license; they are outside its scope. In
+particular, the act of running the Work is not restricted and no
+requirements are made concerning any offers of support for the Work.
+
+2. You may distribute a complete, unmodified copy of the Work as you
+received it. Distribution of only part of the Work is considered
+modification of the Work, and no right to distribute such a Derived
+Work may be assumed under the terms of this clause.
+
+3. You may distribute a Compiled Work that has been generated from a
+complete, unmodified copy of the Work as distributed under Clause 2
+above, as long as that Compiled Work is distributed in such a way that
+the recipients may install the Compiled Work on their system exactly
+as it would have been installed if they generated a Compiled Work
+directly from the Work.
+
+4. If you are the Current Maintainer of the Work, you may, without
+restriction, modify the Work, thus creating a Derived Work. You may
+also distribute the Derived Work without restriction, including
+Compiled Works generated from the Derived Work. Derived Works
+distributed in this manner by the Current Maintainer are considered to
+be updated versions of the Work.
+
+5. If you are not the Current Maintainer of the Work, you may modify
+your copy of the Work, thus creating a Derived Work based on the Work,
+and compile this Derived Work, thus creating a Compiled Work based on
+the Derived Work.
+
+6. If you are not the Current Maintainer of the Work, you may
+distribute a Derived Work provided the following conditions are met
+for every component of the Work unless that component clearly states
+in the copyright notice that it is exempt from that condition. Only
+the Current Maintainer is allowed to add such statements of exemption
+to a component of the Work.
+
+ a. If a component of this Derived Work can be a direct replacement
+ for a component of the Work when that component is used with the
+ Base Interpreter, then, wherever this component of the Work
+ identifies itself to the user when used interactively with that
+ Base Interpreter, the replacement component of this Derived Work
+ clearly and unambiguously identifies itself as a modified version
+ of this component to the user when used interactively with that
+ Base Interpreter.
+
+ b. Every component of the Derived Work contains prominent notices
+ detailing the nature of the changes to that component, or a
+ prominent reference to another file that is distributed as part
+ of the Derived Work and that contains a complete and accurate log
+ of the changes.
+
+ c. No information in the Derived Work implies that any persons,
+ including (but not limited to) the authors of the original version
+ of the Work, provide any support, including (but not limited to)
+ the reporting and handling of errors, to recipients of the
+ Derived Work unless those persons have stated explicitly that
+ they do provide such support for the Derived Work.
+
+ d. You distribute at least one of the following with the Derived Work:
+
+ 1. A complete, unmodified copy of the Work;
+ if your distribution of a modified component is made by
+ offering access to copy the modified component from a
+ designated place, then offering equivalent access to copy
+ the Work from the same or some similar place meets this
+ condition, even though third parties are not compelled to
+ copy the Work along with the modified component;
+
+ 2. Information that is sufficient to obtain a complete,
+ unmodified copy of the Work.
+
+7. If you are not the Current Maintainer of the Work, you may
+distribute a Compiled Work generated from a Derived Work, as long as
+the Derived Work is distributed to all recipients of the Compiled
+Work, and as long as the conditions of Clause 6, above, are met with
+regard to the Derived Work.
+
+8. The conditions above are not intended to prohibit, and hence do not
+apply to, the modification, by any method, of any component so that it
+becomes identical to an updated version of that component of the Work as
+it is distributed by the Current Maintainer under Clause 4, above.
+
+9. Distribution of the Work or any Derived Work in an alternative
+format, where the Work or that Derived Work (in whole or in part) is
+then produced by applying some process to that format, does not relax or
+nullify any sections of this license as they pertain to the results of
+applying that process.
+
+10. a. A Derived Work may be distributed under a different license
+ provided that license itself honors the conditions listed in
+ Clause 6 above, in regard to the Work, though it does not have
+ to honor the rest of the conditions in this license.
+
+ b. If a Derived Work is distributed under a different license, that
+ Derived Work must provide sufficient documentation as part of
+ itself to allow each recipient of that Derived Work to honor the
+ restrictions in Clause 6 above, concerning changes from the Work.
+
+11. This license places no restrictions on works that are unrelated to
+the Work, nor does this license place any restrictions on aggregating
+such works with the Work by any means.
+
+12. Nothing in this license is intended to, or may be used to, prevent
+complete compliance by all parties with all applicable laws.
+
+
+NO WARRANTY
+===========
+
+There is no warranty for the Work. Except when otherwise stated in
+writing, the Copyright Holder provides the Work `as is', without
+warranty of any kind, either expressed or implied, including, but not
+limited to, the implied warranties of merchantability and fitness for a
+particular purpose. The entire risk as to the quality and performance
+of the Work is with you. Should the Work prove defective, you assume
+the cost of all necessary servicing, repair, or correction.
+
+In no event unless required by applicable law or agreed to in writing
+will The Copyright Holder, or any author named in the components of the
+Work, or any other party who may distribute and/or modify the Work as
+permitted above, be liable to you for damages, including any general,
+special, incidental or consequential damages arising out of any use of
+the Work or out of inability to use the Work (including, but not limited
+to, loss of data, data being rendered inaccurate, or losses sustained by
+anyone as a result of any failure of the Work to operate with any other
+programs), even if the Copyright Holder or said author or said other
+party has been advised of the possibility of such damages.
+
+
+MAINTENANCE OF THE WORK
+=======================
+
+The Work has the status `author-maintained' if the Copyright Holder
+explicitly and prominently states near the primary copyright notice in
+the Work that the Work can only be maintained by the Copyright Holder
+or simply that it is `author-maintained'.
+
+The Work has the status `maintained' if there is a Current Maintainer
+who has indicated in the Work that they are willing to receive error
+reports for the Work (for example, by supplying a valid e-mail
+address). It is not required for the Current Maintainer to acknowledge
+or act upon these error reports.
+
+The Work changes from status `maintained' to `unmaintained' if there
+is no Current Maintainer, or the person stated to be Current
+Maintainer of the work cannot be reached through the indicated means
+of communication for a period of six months, and there are no other
+significant signs of active maintenance.
+
+You can become the Current Maintainer of the Work by agreement with
+any existing Current Maintainer to take over this role.
+
+If the Work is unmaintained, you can become the Current Maintainer of
+the Work through the following steps:
+
+ 1. Make a reasonable attempt to trace the Current Maintainer (and
+ the Copyright Holder, if the two differ) through the means of
+ an Internet or similar search.
+
+ 2. If this search is successful, then enquire whether the Work
+ is still maintained.
+
+ a. If it is being maintained, then ask the Current Maintainer
+ to update their communication data within one month.
+
+ b. If the search is unsuccessful or no action to resume active
+ maintenance is taken by the Current Maintainer, then announce
+ within the pertinent community your intention to take over
+ maintenance. (If the Work is a LaTeX work, this could be
+ done, for example, by posting to comp.text.tex.)
+
+ 3a. If the Current Maintainer is reachable and agrees to pass
+ maintenance of the Work to you, then this takes effect
+ immediately upon announcement.
+
+ b. If the Current Maintainer is not reachable and the Copyright
+ Holder agrees that maintenance of the Work be passed to you,
+ then this takes effect immediately upon announcement.
+
+ 4. If you make an `intention announcement' as described in 2b. above
+ and after three months your intention is challenged neither by
+ the Current Maintainer nor by the Copyright Holder nor by other
+ people, then you may arrange for the Work to be changed so as
+ to name you as the (new) Current Maintainer.
+
+ 5. If the previously unreachable Current Maintainer becomes
+ reachable once more within three months of a change completed
+ under the terms of 3b) or 4), then that Current Maintainer must
+ become or remain the Current Maintainer upon request provided
+ they then update their communication data within one month.
+
+A change in the Current Maintainer does not, of itself, alter the fact
+that the Work is distributed under the LPPL license.
+
+If you become the Current Maintainer of the Work, you should
+immediately provide, within the Work, a prominent and unambiguous
+statement of your status as Current Maintainer. You should also
+announce your new status to the same pertinent community as
+in 2b) above.
+
+
+WHETHER AND HOW TO DISTRIBUTE WORKS UNDER THIS LICENSE
+======================================================
+
+This section contains important instructions, examples, and
+recommendations for authors who are considering distributing their
+works under this license. These authors are addressed as `you' in
+this section.
+
+Choosing This License or Another License
+----------------------------------------
+
+If for any part of your work you want or need to use *distribution*
+conditions that differ significantly from those in this license, then
+do not refer to this license anywhere in your work but, instead,
+distribute your work under a different license. You may use the text
+of this license as a model for your own license, but your license
+should not refer to the LPPL or otherwise give the impression that
+your work is distributed under the LPPL.
+
+The document `modguide.tex' in the base LaTeX distribution explains
+the motivation behind the conditions of this license. It explains,
+for example, why distributing LaTeX under the GNU General Public
+License (GPL) was considered inappropriate. Even if your work is
+unrelated to LaTeX, the discussion in `modguide.tex' may still be
+relevant, and authors intending to distribute their works under any
+license are encouraged to read it.
+
+A Recommendation on Modification Without Distribution
+-----------------------------------------------------
+
+It is wise never to modify a component of the Work, even for your own
+personal use, without also meeting the above conditions for
+distributing the modified component. While you might intend that such
+modifications will never be distributed, often this will happen by
+accident -- you may forget that you have modified that component; or
+it may not occur to you when allowing others to access the modified
+version that you are thus distributing it and violating the conditions
+of this license in ways that could have legal implications and, worse,
+cause problems for the community. It is therefore usually in your
+best interest to keep your copy of the Work identical with the public
+one. Many works provide ways to control the behavior of that work
+without altering any of its licensed components.
+
+How to Use This License
+-----------------------
+
+To use this license, place in each of the components of your work both
+an explicit copyright notice including your name and the year the work
+was authored and/or last substantially modified. Include also a
+statement that the distribution and/or modification of that
+component is constrained by the conditions in this license.
+
+Here is an example of such a notice and statement:
+
+ %% pig.dtx
+ %% Copyright 2005 M. Y. Name
+ %
+ % This work may be distributed and/or modified under the
+ % conditions of the LaTeX Project Public License, either version 1.3
+ % of this license or (at your option) any later version.
+ % The latest version of this license is in
+ % http://www.latex-project.org/lppl.txt
+ % and version 1.3 or later is part of all distributions of LaTeX
+ % version 2005/12/01 or later.
+ %
+ % This work has the LPPL maintenance status `maintained'.
+ %
+ % The Current Maintainer of this work is M. Y. Name.
+ %
+ % This work consists of the files pig.dtx and pig.ins
+ % and the derived file pig.sty.
+
+Given such a notice and statement in a file, the conditions
+given in this license document would apply, with the `Work' referring
+to the three files `pig.dtx', `pig.ins', and `pig.sty' (the last being
+generated from `pig.dtx' using `pig.ins'), the `Base Interpreter'
+referring to any `LaTeX-Format', and both `Copyright Holder' and
+`Current Maintainer' referring to the person `M. Y. Name'.
+
+If you do not want the Maintenance section of LPPL to apply to your
+Work, change `maintained' above into `author-maintained'.
+However, we recommend that you use `maintained', as the Maintenance
+section was added in order to ensure that your Work remains useful to
+the community even when you can no longer maintain and support it
+yourself.
+
+Derived Works That Are Not Replacements
+---------------------------------------
+
+Several clauses of the LPPL specify means to provide reliability and
+stability for the user community. They therefore concern themselves
+with the case that a Derived Work is intended to be used as a
+(compatible or incompatible) replacement of the original Work. If
+this is not the case (e.g., if a few lines of code are reused for a
+completely different task), then clauses 6b and 6d shall not apply.
+
+
+Important Recommendations
+-------------------------
+
+ Defining What Constitutes the Work
+
+ The LPPL requires that distributions of the Work contain all the
+ files of the Work. It is therefore important that you provide a
+ way for the licensee to determine which files constitute the Work.
+ This could, for example, be achieved by explicitly listing all the
+ files of the Work near the copyright notice of each file or by
+ using a line such as:
+
+ % This work consists of all files listed in manifest.txt.
+
+ in that place. In the absence of an unequivocal list it might be
+ impossible for the licensee to determine what is considered by you
+ to comprise the Work and, in such a case, the licensee would be
+ entitled to make reasonable conjectures as to which files comprise
+ the Work.
+
# the default goal is build
+.DEFAULT_GOAL := build
+
+# Set the shell to bash
+SHELL := /bin/bash
+
+# Get the current working directory
+CWD := $(shell pwd)
+
+# Get the latexgit version.
+VERSION := $(shell (less '$(CWD)/latexgit.dtx' | sed -n 's/.*\\ProvidesPackage{latexgit}\[[0-9\/]* *\([.0-9]*\) .*\].*/\1/p'))
+
+# Get the current date and time
+NOW = $(shell date +'%0Y-%0m-%0d %0R:%0S')
+
+# Print the status information.
+status:
+ echo "$(NOW): working directory: '$(CWD)'." &&\
+ echo "$(NOW): latexgit version to build: '$(VERSION)'." &&\
+ echo "$(NOW): shell: '$(SHELL)'"
+
+pre_clean: status
+ echo "$(NOW): Deleting all temporary, intermediate, and generated files before the build." && \
+ rm -rf website &&\
+ rm latexgit.aux || true &&\
+ rm latexgit.glo || true &&\
+ rm latexgit.gls || true &&\
+ rm latexgit.idx || true &&\
+ rm latexgit.ilg || true &&\
+ rm latexgit.ind || true &&\
+ rm latexgit.latexgit.dummy || true &&\
+ rm latexgit.log || true &&\
+ rm latexgit.out || true &&\
+ rm latexgit.pdf || true &&\
+ rm latexgit.sty || true &&\
+ rm latexgit.toc || true &&\
+ rm -rf examples/*.log &&\
+ rm -rf examples/*.aux &&\
+ rm -rf examples/*.pdf &&\
+ echo "$(NOW): Done deleting all temporary, intermediate, and generated files before the build."
+
+
+# Initialization: Install all Python requirements, both for executing and building the library.
+python_dependencies: pre_clean
+ echo "$(NOW): Initialization: first install required packages from requirements.txt." && \
+ pip install --no-input --timeout 360 --retries 100 -r requirements.txt && ## nosem \
+ echo "$(NOW): Finished installing required packages from requirements.txt, now installing packages required for development from requirements-dev.txt." && \
+ pip install --no-input --timeout 360 --retries 100 -r requirements-dev.txt && ## nosem \
+ echo "$(NOW): Finished installing requirements from requirements-dev.txt, now printing all installed packages." &&\
+ pip freeze &&\
+ echo "$(NOW): Finished printing all installed packages."
+
+post_clean: extract build_documentation build_examples build_tds build_website pre_clean python_dependencies status
+ echo "$(NOW): Deleting all temporary and intermediate files after the build." && \
+ rm latexgit.aux &&\
+ rm latexgit.glo &&\
+ rm latexgit.gls &&\
+ rm latexgit.idx &&\
+ rm latexgit.ilg &&\
+ rm latexgit.ind &&\
+ rm latexgit.latexgit.dummy || true &&\
+ rm latexgit.log &&\
+ rm latexgit.out &&\
+ rm latexgit.toc &&\
+ rm -rf examples/*.log &&\
+ rm -rf examples/*.aux &&\
+ echo "$(NOW): Done deleting all temporary and intermediate files after the build."
+
+extract: pre_clean
+ echo "$(NOW): Now extracting the package." &&\
+ pdflatex latexgit.ins &&\
+ rm latexgit.log &&\
+ echo "$(NOW): Finished extracting the package."
+
+build_examples: extract python_dependencies
+ echo "$(NOW): Now building the examples." &&\
+ cp latexgit.sty examples &&\
+ cd examples &&\
+ pdflatex example_1.tex &&\
+ python3 -m latexgit.aux example_1 &&\
+ pdflatex example_1.tex &&\
+ rm example_1.log &&\
+ rm example_1.aux &&\
+ rm example_1.latexgit.dummy &&\
+ pdflatex example_2.tex &&\
+ python3 -m latexgit.aux example_2 &&\
+ pdflatex example_2.tex &&\
+ rm example_2.log &&\
+ rm example_2.aux &&\
+ rm example_2.latexgit.dummy &&\
+ rm example_2.out &&\
+ rm latexgit.sty &&\
+ cd .. &&\
+ echo "$(NOW): Finished building the examples."
+
+build_documentation: extract build_examples
+ echo "$(NOW): Now building the documentation." &&\
+ pdflatex latexgit.dtx &&\
+ pdflatex latexgit.dtx &&\
+ makeindex -s gglo.ist -o latexgit.gls latexgit.glo &&\
+ makeindex -s gind.ist -o latexgit.ind latexgit.idx &&\
+ pdflatex latexgit.dtx &&\
+ echo "$(NOW): Done building the documentation."
+
+build_website: build_documentation
+ echo "$(NOW): Now building the website." &&\
+ mkdir -p website &&\
+ echo "$(NOW): Now copying LICENSE and other files." &&\
+ pygmentize -f html -l latex -O full -O style=default -o website/latexgit_sty.html latexgit.sty &&\
+ pygmentize -f html -l latex -O full -O style=default -o website/latexgit_dtx.html latexgit.dtx &&\
+ pygmentize -f html -l latex -O full -O style=default -o website/latexgit_ins.html latexgit.ins &&\
+ pygmentize -f html -l text -O full -O style=default -o website/LICENSE.html LICENSE &&\
+ pygmentize -f html -l text -O full -O style=default -o website/requirements.html requirements.txt &&\
+ pygmentize -f html -l text -O full -O style=default -o website/requirements-dev.html requirements-dev.txt &&\
+ pygmentize -f html -l make -O full -O style=default -o website/Makefile.html Makefile &&\
+ echo "$(NOW): Finished creating additional files, now building index.html from README.md." &&\
+ export PART_A='<!DOCTYPE html><html><title>' &&\
+ export PART_B='</title><style>code {background-color:rgb(204 210 95 / 0.3);white-space:nowrap;border-radius:3px}</style><body style="margin-left:5%;margin-right:5%">' &&\
+ export PART_C='</body></html>' &&\
+ export BASE_URL='https\:\/\/thomasweise\.github\.io\/latexgit_tex\/' &&\
+ echo "$${PART_A}latexgit $(VERSION)$${PART_B}$(shell (python3 -m markdown -o html ./README.md))$$PART_C" > ./website/index.html &&\
+ sed -i "s/\"$$BASE_URL/\".\//g" ./website/index.html &&\
+ sed -i "s/=$$BASE_URL/=.\//g" ./website/index.html &&\
+ sed -i "s/<\/h1>/<\/h1><h2>version\&nbsp;$(VERSION) build on\&nbsp;$(NOW)<\/h2>/g" ./website/index.html &&\
+ echo "$(NOW): Finished copying README.md to index.html, now minifying all files." &&\
+ cd "website/" &&\
+ find -type f -name "*.html" -exec python3 -c "print('{}');import minify_html;f=open('{}','r');s=f.read();f.close();s=minify_html.minify(s,do_not_minify_doctype=True,ensure_spec_compliant_unquoted_attribute_values=True,keep_html_and_head_opening_tags=False,minify_css=True,minify_js=True,remove_bangs=True,remove_processing_instructions=True);f=open('{}','w');f.write(s);f.close()" \; &&\
+ cd "../" &&\
+ echo "$(NOW): Finished minifying all files, now copying or moving remaining files." &&\
+ mv latexgit.sty website &&\
+ mv latexgit.pdf website &&\
+ cp latexgit.dtx website &&\
+ cp latexgit.ins website &&\
+ cp Makefile website &&\
+ cp requirements.txt website &&\
+ cp requirements-dev.txt website &&\
+ touch website/.nojekyll &&\
+ echo "$(NOW): Done building the website."
+
+build_tds: build_documentation build_website
+ echo "$(NOW): Now creating latexgit.tds.zip."
+ export tempDir=`mktemp -d` &&\
+ export oldDir="$(CWD)" &&\
+ echo "$(NOW): Created temp directory '$$tempDir'. Now building tds." &&\
+ mkdir -p "$$tempDir/tex/latex/latexgit/" &&\
+ cp website/latexgit.sty "$$tempDir/tex/latex/latexgit/" &&\
+ mkdir -p "$$tempDir/doc/latex/latexgit/" &&\
+ cp README.md "$$tempDir/doc/latex/latexgit/" &&\
+ cp website/index.html "$$tempDir/doc/latex/latexgit/README.html" &&\
+ cp website/latexgit.pdf "$$tempDir/doc/latex/latexgit/" &&\
+ mkdir -p "$$tempDir/source/latex/latexgit/" &&\
+ cp latexgit.ins "$$tempDir/source/latex/latexgit/" &&\
+ cp latexgit.dtx "$$tempDir/source/latex/latexgit/" &&\
+ cd "$$tempDir" &&\
+ zip -9 -r "latexgit.tds.zip" tex doc source &&\
+ mv "latexgit.tds.zip" "$$oldDir/website" &&\
+ rm -rf "$$tempDir" &&\
+ cd "$$oldDir" &&\
+ echo "$(NOW): Done building latexgit.tds.zip."
+
+# The meta-goal for a full build
+build: build_documentation build_examples build_tds build_website extract status pre_clean post_clean python_dependencies
+ echo "$(NOW): The build has completed."
+
+# .PHONY means that the targets init and test are not associated with files.
+# see https://stackoverflow.com/questions/2145590
+.PHONY: build build_documentation build_examples build_tds build_website extract status pre_clean post_clean python_dependencies
+
latexgit
is a LaTeX package that works in combination with a preprocessor for accessing files from git
repositories from LaTeX
. It works somewhat like BibTeX: In your LaTeX document, you first can define requests to load files from git
repositories. During your first LaTeX compilation, these requests just evaluate to dummy results. They are, however, stored in that aux
file of your project, say article.aux
. Then you execute python3 -m latexgit.aux article
(pretty much as you would execute bibtex article
for building a bibliography). This Python package will then perform the actual git
requests and update the aux
file. In your next LaTeX pass, you can now access the contents of these files. This process is described in detail in the documentation.
latexgit
via pip install latexgit
latexgit.sty
from https://thomasweise.github.io/latexgit_tex/latexgit.sty into the folder of your LaTeX project or unpack latexgit.tds.zip
into your TeX tree1 as described here or here.latexgit
LaTeX package described in latexgit.pdf
at https://thomasweise.github.io/latexgit_tex/latexgit.pdf.latexgit
Python companion at https://thomasweise.github.io/latexgit_py.Below, we provide a list of files that may be interesting to look at.
latexgit.dtx
is the main source file of the package [html] | [raw]latexgit.ins
is the installation script of the package [html] | [raw]latexgit.sty
is the compiled style file [html] | [raw]latexgit.tds.zip
is a TDS packaged version of our package. In other words, it is an a .zip
file that is ready to unzip into a user's TeX tree1. This may be done as described here or here.latexgit.pdf
is the documentation of the package [pdf]LICENSE.html
holds the license information for the package [html]Makefile
is the make file with the build process [html] | [raw]requirements.txt
holds the Python requirements for using the package [html] | [txt]requirements-dev.txt
holds the Python requirements for building the package [html] | [txt]latexgit
is a tool for accessing files in git
repositories from LaTeX
.
Copyright (C) 2023 Thomas Weise (汤卫思教授)
Dr. Thomas Weise (see Contact) holds the copyright of this package. The package and its documentation are under the LaTeX Project Public License, version 1.3, which may be found online at http://www.latex-project.org/lppl.txt or at https://thomasweise.github.io/latexgit_tex/LICENSE.html.
If you have any questions or suggestions, please contact Prof. Dr. Thomas Weise (汤卫思教授) of the Institute of Applied Optimization (应用优化研究所, IAO) of the School of Artificial Intelligence and Big Data (人工智能与大数据学院) at Hefei University (合肥学院) in Hefei, Anhui, China (中国安徽省合肥市) via email to tweise@hfuu.edu.cn with CC to tweise@ustc.edu.cn.
\ No newline at end of file
diff --git a/latexgit.dtx b/latexgit.dtx
new file mode 100755
index 0000000..439962a
--- /dev/null
+++ b/latexgit.dtx
@@ -0,0 +1,624 @@
+% \iffalse meta-comment
+%
+% Copyright (C) 2023 by Thomas Weise % \iffalse meta-comment
+%
+% Copyright (C) 2023 by Thomas Weise <http://iao.hfuu.edu.cn/5>
+%
+% This file may be distributed and/or modified under the conditions of the LaTeX Project Public License, either version 1.3 of this license or (at your option) any later version. The latest version of this license is in http://www.latex-project.org/lppl.txt.
+% The license can be found at https://thomasweise.github.io/latexgit_tex/LICENSE.html.
+% This work is author-maintained, i.e., it can only be maintained by Thomas Weise.
+%
+% \fi
+%
+% \iffalse
+%
+%<*driver>
+\ProvidesFile{latexgit.dtx}
+%</driver>
+%<package>\NeedsTeXFormat{LaTeX2e}[1999/12/01]%
+%<package>\ProvidesPackage{latexgit}[2023/11/17 0.8.0 The first public version.]%
+%
+%<*driver>
+\documentclass{ltxdoc}
+\usepackage{latexgit}[2014/06/17]
+%
+\usepackage{xcolor}%
+\usepackage[%
+colorlinks,%
+breaklinks=true,%
+urlcolor={blue!80!black},%
+menucolor=black,%
+linkcolor={red!50!black},%
+bookmarks=true,%
+bookmarksopen=false,%
+hyperfootnotes=true,%
+citecolor={blue!50!black},%
+filecolor=black,%
+pdfkeywords={LaTeX, package, latexgit}
+]{hyperref}%
+\usepackage{breakurl}%
+\usepackage[square,numbers,comma,sort&compress]{natbib}%
+%
+\newcommand{\exampleautorefname}{Example}%
+\renewcommand{\sectionautorefname}{Section}%
+\renewcommand{\subsectionautorefname}{Section}%
+\renewcommand{\subsubsectionautorefname}{Section}%
+\usepackage{verbatim}%
+\usepackage{graphicx}%
+\usepackage{subcaption}%
+\usepackage{afterpage}%
+%
+\usepackage{listings}%
+\lstset{%
+language=[LaTeX]TeX,%
+basicstyle=\small,%
+keywordstyle=\ttfamily\color{teal!90!black}\bfseries,%
+morekeywords={url,verbatiminput},
+classoffset=1,morekeywords={gitLoad,gitFile,gitUrl},keywordstyle=\ttfamily\bfseries\color{red!70!black},classoffset=0,%
+identifierstyle=,%
+commentstyle=\color{gray}\footnotesize,%
+stringstyle=\ttfamily\color{red!90!black}, % typewriter type for string
+numbers=left,%
+numberstyle=\tiny,%
+columns=fullflexible,%
+frame=shadowbox,%
+frameround=tttt,%
+backgroundcolor=\color{black!10!yellow!5!white}%
+}%
+%
+\usepackage{placeins}%
+%
+\EnableCrossrefs
+\CodelineIndex
+\RecordChanges
+%
+%
+\begin{document}
+ \DocInput{latexgit.dtx}
+ \PrintChanges
+ \PrintIndex
+\end{document}
+%</driver>
+% \fi
+%
+% \CharacterTable
+% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
+% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
+% Digits \0\1\2\3\4\5\6\7\8\9
+% Exclamation \! Double quote \" Hash (number) \#
+% Dollar \$ Percent \% Ampersand \&
+% Acute accent \' Left paren \( Right paren \)
+% Asterisk \* Plus \+ Comma \,
+% Minus \- Point \. Solidus \/
+% Colon \: Semicolon \; Less than \<
+% Equals \= Greater than \> Question mark \?
+% Commercial at \@ Left bracket \[ Backslash \\
+% Right bracket \] Circumflex \^ Underscore \_
+% Grave accent \` Left brace \{ Vertical bar \|
+% Right brace \} Tilde \~}
+%
+% \changes{v0.8.0}{2023/11/16}{Initial Draft Version}
+%
+% \GetFileInfo{latexgit.dtx}
+%
+% \DoNotIndex{\def,\if,\fi}
+%
+% \title{The \textsf{latexgit} Package}
+% \author{Thomas Weise\\%
+% \resizebox{0.95\textwidth}{!}{%
+% \parbox{\linewidth}{%
+% \centering%
+% Institute of Applied Optimization\\%
+% School of Artificial Intelligence and Big Data\\%
+% Hefei University, Hefei 230601, Anhui, China\\%
+% \href{mailto:tweise@hfuu.edu.cn}{tweise@hfuu.edu.cn} $\cdot$ \href{mailto:tweise@ustc.edu.cn}{tweise@hfuu.edu.cn}%
+% }}}%
+% \date{\today}
+%
+% \renewcommand{\textfraction}{0.05}%
+% \renewcommand{\topfraction}{0.85}%
+% \renewcommand{\bottomfraction}{0.95}%
+% \renewcommand{\floatpagefraction}{0.95}%
+%
+% \maketitle
+%
+% \begin{abstract}
+% This \LaTeX\ package works in combination with the Python package
+% |latexgit|.
+% It offers the command |\gitLoad|\index{|\gitLoad|}, which can load a file
+% from a |git|\index{git} repository, optionally post-process it, and then
+% provide a local path to the file as macro |\gitFile|\index{|\gitFile|} and
+% the URL to the original file in |\gitUrl|\index{|\gitUrl|}.
+% This is achieved by storing the |git| requests in the |aux|\index{aux} file
+% of the project during the first |pdflatex|\index{pdflatex} pass.
+% The |aux| file is then processed by the Python package which performs the
+% actual git queries, stores the result in local files, and adds the resolved
+% paths to the |aux| file.
+% During the first |pdflatex|\index{pdflatex} run, |\gitFile| and |\gitUrl|
+% offer dummy results.
+% However, after the resolution via the Python package, in the second
+% |pdflatex| run they then point to the right data.
+% \end{abstract}
+%
+% \setcounter{tocdepth}{2}
+% \tableofcontents
+%
+% \section{Introduction}%
+%
+% \subsection{Addressed Problem and Use Case}%
+% \LaTeX\ documents can contain source codes from different locations.
+% Especially in computer science, we want to present examples source codes in
+% our lecture scripts or slides.
+% These example codes need to be \emph{correct}.
+% They should compile.
+% However, they often are also just snippets from longer codes.
+% This package addresses the following problem:%
+%
+% \begin{quote}
+% \emph{``How can we include snippets of code from a separate, complex code basis
+% (located in a |git| repository) into our \LaTeX\ documents?''}
+% \end{quote}
+%
+% \subsection{Provided Functionality}%
+% \label{sec:functionality}%
+% It does so by offering a combination of a \LaTeX\ package (this package
+% here) and a Python\index{Python} program (published at
+% \url{https://pypi.org/projects/latexgit}).
+% This \LaTeX\ provides the command |\gitLoad| that can load a specific file
+% (its second argument) from a specific |git| repository (its first argument)
+% and, optionally, pipe the file contents through a program for
+% post-processing (the third argument, which can be left empty).
+% Such requests are stored in the |aux| file during the first |pdflatex| pass,
+% then resolved by the Python program, and their results become available in
+% the second |pdflatex| pass via the commands |\gitFile| and |\gitUrl|.
+%
+% \section{Usage}%
+% Using the package requires the following steps:
+% \begin{enumerate}%
+% \item Obviously, the package \emph{and} its Python-based postprocessor
+% must be installed (see \autoref{sec:installation}).
+% \item In your document, you need to load the package in the preamble
+% (see \autoref{sec:loadThePackage}).%
+% \item Then you can make |git| queries and using the paths to files holding
+% their results (see \autoref{sec:gitquery}).
+% \item Finally, the Python package can carry them out after the first
+% |pdflatex| run and in the next |pdflatex| run, |\gitFile| and |\gitUrl| are
+% defined appropriately, see \autoref{sec:pythonProgram}.
+% \end{enumerate}
+%
+% \subsection{Installation}%
+% \label{sec:installation}%
+%
+% \subsubsection{\LaTeX\ Package}%
+% First, make sure that you have the |latexgit.sty| either installed or inside
+% your document's directory.
+% You can download |latexgit.dtx|\index{|latexgit.dtx|} and
+% |latexgit.ins|\index{|latexgit.ins|} from
+% \url{https://github.com/thomasWeise/latexgit_tex}\index{latexgit\_tex} and
+% then execute
+% \begin{quote}%
+% |pdflatex latexgit.ins|\index{pdflatex}
+% \end{quote}%
+% and you should get
+% the style file |latexgit.sty|\index{|latexgit.sty|}.
+% Copy it into your document's folder.
+%
+% \subsubsection{Python Package}%
+% \label{sec:latexgitpy}%
+% The Python\index{Python} package is available at
+% \url{https://github.com/thomasWeise/latexgit_py}\index{latexgit\_py},
+% \url{https://thomasweise.github.io/latexgit_py}, and
+% \url{https://pypi.org/project/latexgit}.
+% You can most easily install it from PyPI\index{PyPI} by doing
+% \begin{quote}
+% |pip install latexgit|
+% \end{quote}
+%
+% \subsection{Loading the Package}%
+% \label{sec:loadThePackage}%
+% Load this package using%
+% \begin{quote}
+% |\usepackage{latexgit}|
+% \end{quote}
+% \begin{sloppypar}%
+% Side note: This will automatically load the packages
+% |alphalph|\index{alphalph} and |filecontents|\index{filecontents}, see
+% \autoref{sec:implementation}.
+% \end{sloppypar}%
+%
+% \subsection{Querying a File from a git Repository}%
+% \label{sec:gitquery}%
+% To query a file stored at path |thePath| inside from a |git|\index{git}
+% repository available under URL |theUrl|, you would specify the command
+% \begin{quote}
+% |\gitLoad{theUrl}{theFile}{}|\index{|\gitLoad|}
+% \end{quote}
+% After this command is executed, a local path to the file becomes available
+% in the fully-expandable command |\gitFile|\index{|\gitFile|}.
+% The full URL to the file in the |git| repository, including the current
+% commit id, becomes available in the fully-expandable command
+% |\gitUrl|\index{|\gitUrl|}.
+% Both |\gitFile| and |\gitUrl| will be overwritten every time |\gitLoad| is
+% invoked.
+% You can invoke |\gitLoad| any number of times.
+%
+% The third parameter, left empty in the above example, can specify an
+% optional post-processing commend.
+% If it is not left empty, this command will be executed in the
+% shell\index{shell}.
+% The contents of the file loaded from the |git| repository will be piped to
+% the |stdin|\index{stdin} of the command.
+% The |stdout|\index{stdout} of the command will be piped to a file and
+% |\gitFile|\index{|\gitFile|} will then contain the path to this file
+% instead.
+% For example, under Linux\index{Linux}, you could use the
+% \href{https://www.man7.org/linux/man-pages/man1/head.1.html}{|head|}\index{head}
+% command to return only the first 5~lines of a file as follows:
+% \begin{quote}
+% |\gitLoad{theUrl}{theFile}{head -n 5}|\index{|\gitLoad|}.
+% \end{quote}
+%
+% \subsection{Executing the Python Package}
+% \label{sec:pythonProgram}
+% \begin{sloppypar}%
+% During the first |pdflatex|\index{pdflatex} run, |\gitFile| points to an
+% empty dummy file
+% (|\jobname.latexgit.dummy|)\index{|\jobname.latexgit.dummy|} and
+% |\gitUrl| points to |http://example.com|\index{http://example.com}.
+% Both commands will only expand to useful information if the Python package
+% |latexgit| is applied to the project's |aux| file.
+% This works very similar to \BibTeX.
+% If the name of your \TeX\ file is |myfile.tex|, then you would execute
+% \end{sloppypar}%
+% \begin{quote}
+% |python3 -m latexgit.aux myfile|
+% \end{quote}
+% More specifically, the Python package processes the |aux| files, so for a
+% specific |aux|\index{aux} file |myfile.aux|, you could also do:
+% \begin{quote}
+% |python3 -m latexgit.aux myfile.aux|
+% \end{quote}
+%
+% After this, in the next pass of |pdflatex|, |\gitFile| and |\gitUrl| will
+% contain the right paths and URLs.
+%
+% \section{Provided Macros}\label{sec:providedMacros}%
+%
+% Here we discuss the macros that can directly be accessed by the user to
+% make use of the functionality of the |latexgit| package.
+% The implementation of these macros is given in \autoref{sec:implementation}
+% and several examples can be found in \autoref{sec:examples}.
+%
+% \DescribeMacro{\gitLoad}%
+% The macro |\gitLoad|\marg{repositoryURL}\marg{path}\marg{postProcessing}
+% provides a local path to a file from a |git| repository.
+% \begin{itemize}%
+% \item[\marg{repositoryURL}] is the URL of the |git| repository.
+% It could, e.g., be \url{https://github.com/thomasWeise/latexgit} or
+% \url{ssh://git@github.com/thomasWeise/latexgit} or any other valid
+% repository URL.%
+%
+% \item[\marg{path}] is then the path to the file within the repository.
+% This could be, for example, |latex/latexgit.dtx|.%
+%
+% \item[\marg{postProcessing}] Can either be empty, in which case the
+% repository is downloaded and the the local path to the file is returned.
+% It can also be shell command, e.g., |head -n 5|.
+% In this case, the contents of the file are piped to |stdin|\index{stdin} of
+% the command and the text written to the |stdout|\index{stdout} by the
+% command is stored in a file whose path is returned.
+% \end{itemize}%
+%
+% After invoking this command, two new commands will be defined:%
+% \begin{itemize}%
+% \item[\texttt{{\textbackslash}gitFile}] returns the path to the file that was loaded and/or
+% post-processed.%
+% \item[\texttt{{\textbackslash}gitUrl}] returns the fully URL to the file in the |git| repository
+% online.
+% This command works for GitHub, but it may not provide the correct URL for
+% other repository types.%
+% \end{itemize}%
+%
+% \DescribeMacro{\gitFile}%
+% The macro |\gitFile| returns the path to the file with the contents of the
+% latest |\gitLoad| request.
+% During the first |pdflatex| pass, this will be the path to a dummy file.
+% After the Python package has been applied to the |aux| file, then |\gitFile|
+% will point to the proper file during the next |pdflatex| pass.
+%
+%
+% \DescribeMacro{\gitUrl}%
+% The macro |\gitUrl| returns the URL from which the file corresponding to
+% the latest |\gitLoad| request was downloaded.
+% This command is designed to work with GitHub.
+% It will be the repository URL combine with the path of the file inside the
+% repository and the commit has code.
+% The Url thus points to the exact same version of the file that was
+% downloaded (and optionally post-processed).
+%
+% During the first |pdflatex| pass, this will be \url{https://example.com}.
+% After the Python package has been applied to the |aux| file, then
+% |\gitUrl| will point to the proper file during the next |pdflatex| pass.
+%
+% \subsection{Examples}\label{sec:examples}%
+%
+% Here we provide a set of examples for the use of the package.
+% Each example demonstrates another facet of the package and, at the same
+% time, serves as test case.
+%
+% \subsection{Minimal Working Example}%
+% This minimal working example shows how to load a file from a |git|
+% repository and directly |\input|\index{input} its contents.
+% The result can be seen in \autoref{ex:example_2:res}.
+%
+% \lstinputlisting[classoffset=2,morekeywords={A,B,C,D},keywordstyle=\ttfamily\bfseries\color{blue!90!black},classoffset=0,float,label=ex:example_1,caption={A minimal working example for using the \texttt{latexgit} package, rendered as \autoref{ex:example_1:res}. The contents of \texttt{dummy.tex} are shown in \autoref{ex:dummy_tex}.}]{examples/example_1.tex}%
+%
+% As you can see in \autoref{ex:example_1}, we first load the package
+% |latexgit| in line~2.
+% Inside the document, we define a |git| request via the |\gitLoad| command.
+% This command takes the URL of a |git| repository as first parameter.
+% in this case, this is \url{https://github.com/thomasWeise/latexgit_tex},
+% which happens to be the URL where you can find the repository of this
+% package on GitHub.
+% The second parameter is a path to the file in this repository relative to
+% the repository root.
+% In this case, this is the path to the file |examples/dummy.tex|, whose
+% contents you can find in \autoref{ex:dummy_tex}.
+%
+% \lstinputlisting[float,label=ex:dummy_tex,caption={The contents of the file \texttt{dummy.tex} included from \texttt{git} in \autoref{ex:example_1}.}]{examples/dummy.tex}%
+%
+% The third parameter shall be ignored for now.
+%
+% After defining the request, we can now use two commands, |\gitFile| and
+% |\gitUrl|.
+% In this Minimal Working Example, we shall only consider the first one.
+% This command expands to a local path of a file with the contents downloaded
+% from the |git| repository.
+%
+% Well, during the first \LaTeX\ or |pdflatex| run, it just points to a dummy
+% file with the name |\jobname.latexgit.dummy|, where
+% |\jobname|\index{|\jobname|} evaluates to the name of the main \LaTeX\
+% document, say |article| for |article.tex|.
+% At that point, the dummy file's content is a single space character followed
+% by a newline.
+%
+% After the first |pdflatex| pass, you can apply the Python\index{Python}
+% processor (see \autoref{sec:latexgitpy}) as follows:
+% \begin{quote}%
+% |python3 -m latexgit.aux jobname|
+% \end{quote}%
+% Where |jobname| shall be replaced with the main file name, again |article|
+% for |article.tex|, for instance.
+%
+% This command then downloads the file from |git| and puts it into a path that
+% can locally accessed by \LaTeX.
+% Usually, it will create a folder |__git__|\index{|__git__|} in your
+% project's directory and place the file there.
+%
+% Anyway, during the second \LaTeX\ or |pdflatex| pass, |\gitFile| points to a
+% valid file path with actual contents.
+% By doing |\input{\gitFile}|\index{|\input|}, we here include this file
+% (remember, its contents are given in \autoref{ex:dummy_tex}) as if it was
+% part of our normal \LaTeX\ project.
+% The result of this pass is shown in \autoref{ex:example_1:res}.
+%
+% \begin{figure}%
+% \centering%
+% \fbox{\includegraphics[page=1,width=0.9\linewidth,trim=1.65in 9.3in 1.5in 1.6in,clip]{examples/example_1.pdf}}%
+% \caption{The rendered result of \autoref{ex:example_1} (with trimmed page margins and bottom).}%
+% \label{ex:example_1:res}%
+% \end{figure}%
+%
+% If we look back at the \autoref{ex:example_1} of our main file, you will
+% notice the four blue marks {\bfseries\color{blue!90!black}A},
+% {\bfseries\color{blue!90!black}B}, {\bfseries\color{blue!90!black}C}, and
+% {\bfseries\color{blue!90!black}D}.
+% These are just normal letters, colored and emphasized for your convenience.
+% I put them there so that you can see where the action takes place.
+% |\gitLoad| produces no output, so ``ABC'' come out next to each other.
+% |\input{\gitFile}| between {\bfseries\color{blue!90!black}C} and
+% {\bfseries\color{blue!90!black}D} loads and directly includes the example
+% file, so this is where its content appear.
+%
+% One small interesting thing is that, since we directly |\input| the file,
+% its contents are interpreted as \LaTeX\ code.
+% This means that you could construct a document by inputting files from
+% different |git| repositories.
+%
+% However, this is not the envisioned use case.
+% The envisioned use case is to include source codes and snippets from source
+% codes as listings.
+% We will show how this could be done in the next example.
+% \clearpage%
+%
+% \subsection{Second Example}\FloatBarrier%
+% In \autoref{ex:example_2} we, use |latexgit| to download and present two
+% different files from two different GitHub repositories.
+% We also show how post-processing can work, once using the aforementioned
+% simple |head -n 5| command available in the Linux shell and also by
+% using the Python code formatting tool offered by the |latexgit| Python
+% package.
+% The result can be seen in \autoref{ex:example_2:res}.
+%
+% \lstinputlisting[float,label=ex:example_2,caption={An example using the latexgit package, rendered as \autoref{ex:example_2:res}.}]{examples/example_2.tex}%
+% \FloatBarrier%
+% \begin{figure}%
+% \centering%
+% \strut\hfill\strut%
+% \subcaptionbox{Page 1 of the pdf compiled from \autoref{ex:example_2}.
+% }{%
+% \fbox{\includegraphics[page=1,width=0.455\linewidth,trim=1.65in 5in 1.5in 1.5in,clip]{examples/example_2.pdf}}%
+% }%
+% \strut\hfill\strut\hfill\strut%
+% \subcaptionbox{Page 2 of the pdf compiled from \autoref{ex:example_2}.
+% }{%
+% \fbox{\includegraphics[page=2,width=0.455\linewidth,trim=1.65in 5in 1.5in 1.5in,clip]{examples/example_2.pdf}}%
+% }%
+% \strut\hfill\strut%
+% \\%
+% \strut\hfill\strut%
+% \subcaptionbox{Page 3 of the pdf compiled from \autoref{ex:example_2}.
+% }{\parbox{\linewidth}{\centering%
+% \fbox{\includegraphics[page=3,width=0.455\linewidth,trim=1.65in 5in 1.5in 1.5in,clip]{examples/example_2.pdf}}%
+% }}%
+% \strut\hfill\strut%
+%
+% \caption{The rendered result of \autoref{ex:example_2} (with trimmed page margins and bottoms).}%
+% \label{ex:example_2:res}%
+% \end{figure}%
+%
+% \afterpage{\clearpage}%
+%
+% \clearpage%
+%
+%
+% \StopEventually{}
+%
+% \section{Implementation}%
+% \label{sec:implementation}%
+% The names of all internal elements of the package are prefixed
+% with |@latexgit@|.
+% This naming convention should prevent any name clashes with other packages.
+%
+% Our |latexgit| package requires only one other package:%
+% \begin{enumerate}%
+% \item |alphalph|\index{alphalph}~\cite{O2019TAP} is required to translate
+% \TeX\ counters to alphabetic series for counters that are outside of the
+% range~$1\dots26$.
+% Basically, for each file we include from |git|, we store the corresponding
+% local path in a command of the structure |\@latexgit@pathXXX| where the
+% |XXX| is an alphabetical sequence which is increasing in the form
+% ``\alphalph{1},'', ``\alphalph{2},'' \dots, ``\alphalph{25},''
+% ``\alphalph{26},'' ``\alphalph{27},'' \dots, ``\alphalph{51},''
+% ``\alphalph{52},'' ``\alphalph{53},'' ``\alphalph{701},''
+% ``\alphalph{702},'' ``\alphalph{703},'' ``\alphalph{704},'' \dots%
+%
+% \item |filecontents|\index{filecontents}~\cite{P2023TFP} is used to allow us
+% to generate the dummy file on the fly.
+% This package is obsolete for the most recent \LaTeX\ version, where it
+% simply does nothing, but may help us to get our package to work on older
+% systems.
+% \end{enumerate}%
+% \begin{macrocode}
+\RequirePackage{alphalph}% Convert counters to alphabetical series.
+\RequirePackage{filecontents}% Allow us to create the dummy file.
+% \end{macrocode}
+%
+% \begin{macrocode}
+\newcount\@latexgit@counter% The counter for the git files included.
+\@latexgit@counter0\relax% We start the counter at 0.
+%
+% This is the path to the dummy file.
+% The dummy file is created directly below.
+% The dummy file is referenced by all invocations of |\gitFile| until the
+% Python package has been applied to the |.aux| file and has loaded the
+% actual files.
+\edef\@latexgit@dummyPath{\jobname.latexgit.dummy}% the dummy file
+%
+% Create the dummy file that replaces git files before they are loaded.
+% This file only has one line with one single space.
+\expandafter\begin\expandafter{filecontents*}{\@latexgit@dummyPath}
+
+\end{filecontents*}
+%
+% This command does nothing and is just a placeholder in the |aux| files.
+\protected\gdef\@latexgit@gitFile#1#2#3{}%
+% \end{macrocode}
+%
+% \begin{macro}{\gitLoad}
+% The macro |\gitLoad|\marg{repositoryURL}\marg{path}\marg{postProcessing}
+% defines a query to a |git| repository.
+% The query is stored in the |aux| file of the project and carried out by the
+% Python companion package (see \autoref{sec:pythonProgram}).
+% This macro will define two other macros, |\gitFile| and |\gitUrl|.
+% During the first \LaTeX\ build, these macros will return a path to a dummy
+% file which only has a single space character in it followed by a newline and
+% the URL \url{https://example.com}, respectively.
+% As said, |\gitLoad| will store all information in the |aux| file, which then
+% permits the |latexgit| Python package to download (and optionally
+% post-process) the actual file.
+% In the second round of \LaTeX\ building, |\gitFile| and |\gitUrl| will then
+% return the local path to that downloaded file and the actual URL,
+% respectively.%
+%
+% \begin{itemize}%
+%
+% \item[\marg{repositoryURL}] is the URL of the |git| repository.
+% It could, e.g., be \url{https://github.com/thomasWeise/latexgit} or
+% \url{ssh://git@github.com/thomasWeise/latexgit} or any other valid
+% repository URL.%
+%
+% \item[\marg{path}] is then the path to the file within the repository.
+% This could be, for example, |latex/latexgit.dtx|.%
+%
+% \item[\marg{postProcessing}] Can either be empty, in which case the
+% repository is downloaded and the the local path to the file is
+% returned.
+% It can also be shell command, e.g., |head -n 5|.
+% In this case, the contents of the file are piped to |stdin| of the command
+% and the text written to the |stdout| by the command is stored in a file
+% whose path is returned.
+% \end{itemize}%
+% \begin{macrocode}
+%%
+%% Define a query to load and post-process a file from a |git| repository.
+%% #1 is the repository URL
+%% #2 is the path to the file inside the repository
+%% #3 is a command through which the file contents should be piped
+%%% (leave #3 empty to use the file as-is)
+\protected\gdef\gitLoad#1#2#3{%
+\edef\@latexgit@pA{#1}% fully expand the repository URL
+\edef\@latexgit@pB{#2}% fully expand the path into the repository
+\edef\@latexgit@pC{#3}% fully expand the (optional) shell command
+% Write the parameters to the aux file.
+\immediate\write\@mainaux{%
+\noexpand\@latexgit@gitFile{\@latexgit@pA}{\@latexgit@pB}{\@latexgit@pC}}%
+% Increment the counter for command names by 1.
+\advance\@latexgit@counter by 1\relax%
+% We now create the name of the path command based on the structure
+% |\@latexgit@pathXXX| where |XXX| is a alphabetic sequence representing
+% the value of |\@latexgit@counter|
+\edef\@latexgit@pathCmd{@latexgit@path\alphalph{\the\@latexgit@counter}}%
+% If the path command exists, then we store it as |\gitFile|.
+\expandafter\ifcsname\@latexgit@pathCmd\endcsname\relax%
+\xdef\gitFile{\csname\@latexgit@pathCmd\endcsname}%
+\else%
+% But if it does not exist, we assign |\gitFile| to the dummy path.
+\xdef\gitFile{\@latexgit@dummyPath}%
+\fi% If we get here, the |\gitFile| command holds a valid path.
+% We now create the name of the url command based on the structure
+% |\@latexgit@urlXXX| where |XXX| is a alphabetic sequence representing
+% the value of |\@latexgit@counter|
+\edef\@latexgit@urlCmd{@latexgit@url\alphalph{\the\@latexgit@counter}}%
+% If the url command exists, then we store it as |\gitUrl|.
+\expandafter\ifcsname\@latexgit@urlCmd\endcsname\relax%
+\xdef\gitUrl{\csname\@latexgit@urlCmd\endcsname}%
+\else%
+% But if it does not exist, we store the example url in |\gitUrl|.
+\xdef\gitUrl{http://example.com}%
+\fi% If we get here, the |\gitUrl| holds a valid URL.
+}%
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \begin{thebibliography}{10}
+% \providecommand{\natexlab}[1]{#1}
+% \providecommand{\url}[1]{\texttt{#1}}
+% \expandafter\ifx\csname urlstyle\endcsname\relax
+% \providecommand{\doi}[1]{doi: #1}\else
+% \providecommand{\doi}{doi: \begingroup \urlstyle{rm}\Url}\fi
+%
+% \bibitem[Oberdieck(2019)]{O2019TAP}
+% Heiko Oberdieck.%
+% \newblock {The \textbf{alphalph}\index{alphalph} package}.%
+% \newblock \emph{CTAN Comprehensive \TeX\ Archive Network}, \mbox{2019/12/09 v2.6}.%
+% \newblock URL \url{https://ctan.org/pkg/alphalph}%
+%
+% \bibitem[Pakin(2023)]{P2023TFP}
+% Scott Pakin.
+% \newblock {The \textbf{filecontents} package.}%
+% \newblock \emph{CTAN Comprehensive \TeX\ Archive Network}, \mbox{April 2, 2023}.%
+% \newblock URL \url{https://ctan.org/pkg/filecontents}%
+%
+% \end{thebibliography}
+% \Finale
+\endinput
+
%
+% Copyright (C) 2023 by Thomas Weise <http://iao.hfuu.edu.cn/5>
+%
+% This file may be distributed and/or modified under the conditions
+% of the GNU GENERAL PUBLIC LICENSE, Version 3, 29 June 2007.
+% The license can be found at
+% https://thomasweise.github.io/latexgit/LICENSE.html.
+% You can obtain the latest version of this package from
+% http://thomasweise.github.io/latexgit or
+% http://github.com/thomasWeise/latexgit.
+% This work is author-maintained, i.e., it can only be maintained by
+% Thomas Weise.
+%
+\input docstrip.tex
+\keepsilent
+%
+\usedir{tex/latex/latexgit}%
+%
+\preamble
+This is a generated file.
+
+Copyright (C) 2023 by Thomas Weise <http://iao.hfuu.edu.cn/5>
+
+This file may be distributed and/or modified under the conditions of the
+GNU GENERAL PUBLIC LICENSE, Version 3, 29 June 2007.
+The license can be found at
+https://thomasweise.github.io/latexgit/LICENSE.html.
+You can obtain the latest version of this package from
+http://thomasweise.github.io/latexgit or
+http://github.com/thomasWeise/latexgit.
+This work is author-maintained, i.e., it can only be maintained by
+Thomas Weise.
+\endpreamble
+%
+\generate{\file{latexgit.sty}{\from{latexgit.dtx}{package}}}%
+%
+\obeyspaces%
+\Msg{*************************************************************}%
+\Msg{* *}%
+\Msg{* To finish the installation you have to move the following *}%
+\Msg{* file into a directory searched by TeX: *}%
+\Msg{* *}%
+\Msg{* latexgit.sty *}%
+\Msg{* *}%
+\Msg{* To produce the documentation run the file latexgit.dtx *}%
+\Msg{* through LaTeX. *}%
+\Msg{* *}%
+\Msg{* Happy TeXing! *}%
+\Msg{* *}%
+\Msg{*************************************************************}%
+%
+\endbatchfile%
+%
+
%%
+%% This is file `latexgit.sty',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% latexgit.dtx (with options: `package')
+%% This is a generated file.
+%%
+%% Copyright (C) 2023 by Thomas Weise <http://iao.hfuu.edu.cn/5>
+%%
+%% This file may be distributed and/or modified under the conditions of the
+%% GNU GENERAL PUBLIC LICENSE, Version 3, 29 June 2007.
+%% The license can be found at
+%% https://thomasweise.github.io/latexgit/LICENSE.html.
+%% You can obtain the latest version of this package from
+%% http://thomasweise.github.io/latexgit or
+%% http://github.com/thomasWeise/latexgit.
+%% This work is author-maintained, i.e., it can only be maintained by
+%% Thomas Weise.
+\NeedsTeXFormat{LaTeX2e}[1999/12/01]%
+\ProvidesPackage{latexgit}[2023/11/17 0.8.0 The first public version.]%
+\RequirePackage{alphalph}% Convert counters to alphabetical series.
+\RequirePackage{filecontents}% Allow us to create the dummy file.
+\newcount\@latexgit@counter% The counter for the git files included.
+\@latexgit@counter0\relax% We start the counter at 0.
+\edef\@latexgit@dummyPath{\jobname.latexgit.dummy}% the dummy file
+\expandafter\begin\expandafter{filecontents*}{\@latexgit@dummyPath}
+
+\end{filecontents*}
+\protected\gdef\@latexgit@gitFile#1#2#3{}%
+%%
+%% Define a query to load and post-process a file from a |git| repository.
+%% #1 is the repository URL
+%% #2 is the path to the file inside the repository
+%% #3 is a command through which the file contents should be piped
+%%% (leave #3 empty to use the file as-is)
+\protected\gdef\gitLoad#1#2#3{%
+\edef\@latexgit@pA{#1}% fully expand the repository URL
+\edef\@latexgit@pB{#2}% fully expand the path into the repository
+\edef\@latexgit@pC{#3}% fully expand the (optional) shell command
+\immediate\write\@mainaux{%
+\noexpand\@latexgit@gitFile{\@latexgit@pA}{\@latexgit@pB}{\@latexgit@pC}}%
+\advance\@latexgit@counter by 1\relax%
+\edef\@latexgit@pathCmd{@latexgit@path\alphalph{\the\@latexgit@counter}}%
+\expandafter\ifcsname\@latexgit@pathCmd\endcsname\relax%
+\xdef\gitFile{\csname\@latexgit@pathCmd\endcsname}%
+\else%
+\xdef\gitFile{\@latexgit@dummyPath}%
+\fi% If we get here, the |\gitFile| command holds a valid path.
+\edef\@latexgit@urlCmd{@latexgit@url\alphalph{\the\@latexgit@counter}}%
+\expandafter\ifcsname\@latexgit@urlCmd\endcsname\relax%
+\xdef\gitUrl{\csname\@latexgit@urlCmd\endcsname}%
+\else%
+\xdef\gitUrl{http://example.com}%
+\fi% If we get here, the |\gitUrl| holds a valid URL.
+}%
+\endinput
+%%
+%% End of file `latexgit.sty'.
+
#
+# Dependencies Required to Build `latexgit`
+#
+
+# minify_html is needed to minify html output.
+minify_html == 0.11.1
+
+# for converting the additional markdown files to HTML
+markdown == 3.5
+
+# for converting files to HTML
+Pygments==2.16.1
+
#
+# Dependencies Required to Use `latexgit`
+#
+
+# Basically, we only need the `latexgit` Python companion package.
+# You can find it at https://thomasweise.github.io/latexgit_py,
+# https://github.com/thomasWeise/latexgit_py, or at
+# https://pypi.org/project/latexgit.
+latexgit == 0.8.2
+