{"id":21771427,"url":"https://github.com/alejandrogallo/latex-makefile","last_synced_at":"2025-04-13T16:41:33.763Z","repository":{"id":88965014,"uuid":"73379028","full_name":"alejandrogallo/latex-makefile","owner":"alejandrogallo","description":"Nice latex makefile that works out of the box","archived":false,"fork":false,"pushed_at":"2019-12-09T18:00:56.000Z","size":1678,"stargazers_count":13,"open_issues_count":2,"forks_count":0,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-03-27T07:35:52.616Z","etag":null,"topics":["asymptote","beamer","bibtex","documentation","documentation-tool","gnuplot","latex","makefile","math","mathematics","pandoc","physics","publishing","pythontex","science","tex"],"latest_commit_sha":null,"homepage":null,"language":"TeX","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/alejandrogallo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2016-11-10T12:15:37.000Z","updated_at":"2022-06-10T09:05:09.000Z","dependencies_parsed_at":"2023-06-13T08:30:14.803Z","dependency_job_id":null,"html_url":"https://github.com/alejandrogallo/latex-makefile","commit_stats":{"total_commits":241,"total_committers":3,"mean_commits":80.33333333333333,"dds":0.008298755186721962,"last_synced_commit":"649e471f7e3832658bd33632cf6e0ee630f7f64d"},"previous_names":[],"tags_count":27,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alejandrogallo%2Flatex-makefile","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alejandrogallo%2Flatex-makefile/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alejandrogallo%2Flatex-makefile/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alejandrogallo%2Flatex-makefile/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alejandrogallo","download_url":"https://codeload.github.com/alejandrogallo/latex-makefile/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248747141,"owners_count":21155395,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["asymptote","beamer","bibtex","documentation","documentation-tool","gnuplot","latex","makefile","math","mathematics","pandoc","physics","publishing","pythontex","science","tex"],"created_at":"2024-11-26T14:16:23.640Z","updated_at":"2025-04-13T16:41:33.733Z","avatar_url":"https://github.com/alejandrogallo.png","language":"TeX","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n[![Build Status](https://travis-ci.org/alejandrogallo/latex-makefile.svg?branch=master)](https://travis-ci.org/alejandrogallo/latex-makefile)\n\n### Note\n\nI'm not maintainig this project anymore.\nIf you want a simpler solution check out\n[a simpler version of the same project](\nhttps://github.com/alejandrogallo/simple-latex-makefile\n)\n\n# The ultimate TeX Makefile #\n\n## Installing ##\n\nJust get a built makefile from\n[the latest release](\nhttps://github.com/alejandrogallo/latex-makefile/releases/latest\n) and put it in your TeX project folder.\n\n## Building ##\n\nTo build you have to initialize the submodules:\n\n```\ngit submodule init\ngit submodule update\n```\n\nand then just hit\n\n```\nmake\n```\nYou will need the macro processor `m4`.\n\n\n## Quick start ##\n\nJust drop the Makefile in your project directory and hit make.  The makefile\nshould recognise the main document automatically by looking for a\n`\\begin{document}` in the `tex` file of the current directory.\n\nThe main idea of the makefile is not to modify it directly, but rather through\na `make` configuration file `config.mk`. There you can set many important\nvariables for the project, like the verbosity `QUIET=1` and many more.\n\n\n## Features overview ##\n\n\n  * Build in a different directory.\n  * Multi bibtex files.\n  * Automatic handling of the table of contents (smart recompilation).\n  * Automatic handling of [bibtex](http://www.bibtex.org/) (smart recompilation).\n  * Import `.sty` files (latex packages) from custom directory.\n  * Distribution making for sending documents to the publisher.\n  * Automatic recognition of included graphics.\n    - Automatic [asymptote](http://asymptote.sourceforge.net/) compilation.\n    - Automatic [gnuplot](http://www.gnuplot.info/) compilation.\n    - Automatic `python` figures compilation.\n\n## Overridable variables ##\n  * `VAR_NAME`(`DEFAULT`):  Brief description. If the default value is too long to appear it is\n    omitted and a `see` is put in its place.  If there is no default value then\n    the keyword `empty` appears.\n    \n  * `SH`(`bash`): Shell used\n  * `SHELL`(`see`): Alias for `SHELL'\n  * `PY`(`python`): Python interpreter\n  * `PYTHON`(`see`): Alias for `PY'\n  * `PERL`(`perl`): Perl command\n  * `GREP`(`grep`): Grep program version\n  * `FIND`(`find`): Find utility\n  * `SED`(`see`): `sed` program version\n  * `AWK`(`see`): `awk` program to use\n  * `CTAGS`(`ctags`): For creating tags\n  * `READLINK`(`see`): To get complete paths\n  * `XARGS`(`xargs`): `xargs` program to use\n  * `TR`(`tr`): `tr` program to use\n  * `GIT`(`git`): `git` version to use\n  * `WHICH`(`which`): `which` program to use\n  * `SORT`(`sort`): `sort` program to use\n  * `UNIQ`(`uniq`): `uniq` program to use\n  * `MAKE`(`see`): `Makefile` binary\n  * `RM`(`rm`): `rm` command\n  * `CXX`(`g++`): C++ compiler\n  * `CC`(`gcc`): C compiler\n  * `FC`(`gfortran`): Fortran compiler\n  * `BUILD_DIR`(`.`): Folder to build the project\n  * `LATEX`(`pdflatex`): Shell utilities\n  * `PDFLATEX`(`pdflatex`): Main pdflatex engine\n  * `QUIET`(`0`): If secondary programs output is shown\n  * `QQUIET`(`empty`): If the log messages should be also muted\n  * `DEBUG`(`empty`): If the commands issued should be printed write `DEBUG=1` if you want to see all commands.\n  * `TPUT`(`see`): For coloring\n  * `WITH_COLOR`(`1`): If messages should have color\n  * `DBG_FILE`(`.makefile-dbg`): \n  * `COLOR_R`(`see`): Red\n  * `COLOR_G`(`see`): Green\n  * `COLOR_Y`(`see`): Yellow\n  * `COLOR_DB`(`see`): Dark blue\n  * `COLOR_L`(`see`): Lila\n  * `COLOR_LB`(`see`): Light blue\n  * `COLOR_E`(`see`): Empty color\n  * `ARROW`(`@echo \"see`): \n  * `ARROW`(`@echo \"===\u003e\"`): \n  * `ECHO`(`@echo`): \n  * `MAIN_SRC`(`see`): Main texfile in the current directory\n  * `FMT`(`pdf`): Format to build to\n  * `VIEW`(`1`): If `BUILD_DOCUMENT` should be previewed after building\n  * `INCLUDES_REC`(`3`): Depth for discovering automatically included texfiles\n  * `INCLUDES`(`see`): Texfiles included in the main tex file\n  * `TEXFILES`(`see`): All `texfiles` in the project\n  * `BIBTEX_FILES`(`see`): Bibtex files in the current directory\n  * `PREFIX`(`see`): Source directory\n  * `BUILD_DIR`(`.`): Folder to build the project\n  * `BUILD_DIR_FLAG`(`see`): Build dir flag for latex. If `BUILD_DIR = .` then `BUILD_DIR_FLAG` is not defined, else `BUILD_DIR = -output-directory $(BUILD_DIR)`\n  * `PACKAGES_DIR`(`libtex`): Tex libraries directory\n  * `PACKAGES_FILES`(`see`): Which files are tex libraries\n  * `DEFAULT_DEPENDENCIES`(`\\`): Default dependencies for `BUILD_DOCUMENT`\n  * `DEPENDENCIES`(`see`): General dependencies for `BUILD_DOCUMENT`\n  * `TOC_DEP`(`see`): These files  are to keep  track of the  dependencies for latex  or pdf includes, table of contents generation or figure recognition \n  * `FIGS_DEP`(`see`): \n  * `DEPS_DIR`(`.deps`): Folder to keep makefile dependencies\n  * `FIGURES`(`empty`): Figures included in all texfiles\n  * `BIBTEX`(`bibtex`): For converting document formats\n  * `ASYMPTOTE`(`asy`): For asymptote figures\n  * `GNUPLOT`(`gnuplot`): Gnuplot interpreter\n  * `PDF_VIEWER`(`see`): Recognise pdf viewer automagically\n  * `RM`(`rm`): Remove command\n  * `RM_FLAGS`(`-rf`): \n  * `CLEAN_FILES`(`see`): Files to be cleaned\n  * `DIST_DIR`(`dist`): Distribution directory\n  * `LATEXDIFF`(`latexdiff-git`): For creating differences in a repository\n  * `DIFF`(`HEAD HEAD~1`): Commits to compute the difference from\n  * `DIFF_BUILD_DIR_MAIN`(`diffs`): \n  * `DIFF_BUILD_DIR`(`see`): \n  * `DIFF_SRC_NAME`(`diff.tex`): \n  * `SPELLER`(`aspell`): Speller program to use\n  * `SPELL_DIR`(`.spell`): Directory to store spelling related information\n  * `SPELL_LANG`(`en`): Language for the spelling program\n  * `CHECK_SPELL`(`empty`): Wether or not spelling should be checked\n  * `TEX_LINTER`(`chktex`): For checking tex syntax\n  * `MAKEFILE_UPDATE_URL`(`see`): \n  * `CTAGS_OPTIONS`(`--language-force=latex -R *`): Options for ctags command\n\n\n\n## Targets ##\n### Bibliography generation ###\n\n\nThis generates a `bbl` file from a  `bib` file For documents without a `bib`\nfile, this  will also be  targeted, bit  the '-' before  the `$(BIBTEX)`\nensures that the whole building doesn't fail because of it\n\n```bash \nmake $(BIBITEM_FILES)\n```\n### Force compilation ###\n\n\nThis makefile only compiles the TeX document if it is strictly necessary, so\nsometimes to force compilation this target comes in handy.\n\n```bash \nmake force\n```\n### View document ###\n\n\nOpen and refresh pdf.\n\n```bash \nmake view-pdf\n```\n### Open pdf viewer ###\n\n\nOpen a viewer if there is none open viewing `$(BUILD_DOCUMENT)`\n\n```bash \nmake open-pdf\n```\n### Refresh mupdf ###\n\n\nIf the opened document is being viewed with `mupdf` this target uses the\nmupdf signal API to refresh the document.\n\nFile: clean.m4\nRemove command\nDefault clean file to be cleaned\nFiles to be cleaned\n\nMain cleaning\n\n\nThis does a main cleaning of the produced auxiliary files.  Before using it\ncheck which files are going to be cleaned up.\n\n```bash \nmake clean\n```\n### Distribution ###\n\n\nCreate a distribution folder wit the bare minimum to compile your project.\nFor example it will consider the files in the DEPENDENCIES variable, so make\nsure to update or add DEPENDENCIES to it in the config.mk per user\nconfiguration.\n\n```bash \nmake dist\n```\n### Distribution clean ###\n\n\nClean distribution files\n\n```bash \nmake dist-clean\n```\n### Diff ###\n\n\nThis target creates differences between older versions of the main latex file\nby means of [GIT](https://git-scm.com/). You have to specify the commits that\nyou want to compare by doing\n\n```bash\nmake DIFF=\"HEAD HEAD~3\" diff\n```\nIf you want to compare the HEAD commit with the commit three times older than\nHEAD. You can also provide a *commit hash*. The default value is `HEAD HEAD~1`.\n\nThe target creates a distribution folder located in the variable\n`DIFF_BUILD_DIR`.\n```bash \nmake diff\n```\n### Check spelling ###\n\n\nIt checks the spelling of all the tex sources using the program in the\nSPELLER variable. The default value of the language is english, you can\nchange it by setting in your `config.mk` file\n```make\nSPELL_LANG = fr\n```\nif you happen to write in french.\n\nWether to check spelling or not is controlled by the `CHECK_SPELL`\nvariable, so if you want to check spelling set it to one\n```make\nCHECK_SPELL = 1\n```\notherwise do not set it.\n\n```bash \nmake spelling\n```\n### Check syntax ###\n\n\nIt checks the syntax (lints) of all the tex sources using the program in the\nTEX_LINTER variable.\n\n```bash \nmake lint\n```\n### Update the makefile from source ###\n\n\nYou can always get the  latest `Makefile` version using this target.  You may\noverride the `MAKEFILE_UPDATE_URL` to  any path where you save your own\npersonal makefile\n\n```bash \nmake update\n```\n### Ctags generation for latex documents ###\n\n\nGenerate a tags  file so that you can navigate  through the tags using\ncompatible editors such as emacs or (n)vi(m).\n\n```bash \nmake tags\n```\n### Print a variable used by the Makefile ###\n\n\nFor debugging purposes it is useful to print out some variables that the\nmakefile is using, for that just type `make print` and you will be prompted\nto insert the name of the variable that you want to know.\n\n```bash \nmake FORCE\n```\n### Print quick help ###\n\n\nIt prints a quick help in the terminal\n```bash \nmake help\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falejandrogallo%2Flatex-makefile","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falejandrogallo%2Flatex-makefile","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falejandrogallo%2Flatex-makefile/lists"}