This lightweight script helps build any complicated latex projects. I have ever written a powershell version, but it seems that linux sub-system with this is a better option.
A lightweight shell script supports compiling latex source files to a pdf document. Has been tested on MacOS
and can work with Linux
in theory (might need slight changes). Because I do coding with different languages and need a consistent editing & building environment without any distraction, I use this script with my text editor to write latex documents. Both generating pdf and comparing to historical can choose either live mode or not.
-
[Why]
- Use any preferred text editor;
- Easily manage complicated latex projects;
- Without losing any advanced features for building a latex project;
- Use tools provided by the MacTex installation package and do not want to install any extra tool except MacTex;
- Do not distract your writing;
- Fast.
-
[Features]
- Maintain a global configuration and a local configuration for each project;
- Remember historical operations;
- Maintain version history;
- Easily load a latex project;
- Auto search version history & the entry .tex
- Rename a latex project;
- Choose latex engine & bibliography backend;
- Choose encoding for *.tex
- Count words directly from the output pdf document;
- Support live preview;
- Support comparing to historical versions
in live mode(live mode is not completed yet); - Clean dump files and compress for commit;
- Highlighted error & warn tips;
- Foldable menu;
- Customisable theme;
- Quickly install missing packages using the
tlmgr
tool provided by the MacTex; - Can easily expand with new functions / configurations.
This is for demonstration only. In practice, only text editor and pdf preview window are needed (therefore, you can put them side by side).
live preview pdf | diff with other version |
---|---|
-
Install MacTex
-
Just put the script in a folder, the script will auto-create a profile folder at the current directory and another configuration folder in a specified project directory.
The script maintain default configurations lists for both all projects and each individual project. Extra configurations can be added in the function init()
.
All operations are registered in the function showMenu()
in the form of KEY::Function::Description::Menu_level::CAT_ENABLE_DISPLAY
.
Extra latex engine or bibliography backend can be added either in the list of the function choose_pdf_compiler
or choose_ref_compiler
.
Colour scheme is maintained by the function enable_color_theme
and default_theme
.
Thanks to contributors of the excellent latex system and users using the script.