A collection of shell scripts to interactively create and print TeX-based form letters.
Explore the docs »
View Demo
·
Report Bug
·
Request Feature
Table of Contents
This project provides a dialog
-based interface to interactively create/print a letter based on a TeX
form letter template by querying individual parameters, e.g. recipient's name and address.
This work includes or is based on other projects:
- CUPSwrapper, a collection of shell scripts to interactively print and manage printers for local usage.
- GerLaTeXLetter, a LaTeX template for business letters (mostly) following German DIN 5008 standard, based on KOMA-Script class
scrlttr2
. - SHtemplate, a template for POSIX-/Bourne-Shell(sh) projects.
The project has been developed and tested on the following system:
Info | Description |
---|---|
OS | Debian GNU/Linux 12 (bookworm) |
Kernel | 5.15.90.1-microsoft-standard-WSL2 |
Packages | texlive-latex-recommended (2022.20230122-3) |
texlive-luatex (2022.20230122-3) |
Please also have a look at the corresponding sections in CUPSwrapper and GerLaTeXLetter.
⚠️ Please follow each of the following setup instructions before continuing:
- Clone the repo
git clone --recurse-submodules /~https://github.com/fkemser/TeXLetterCreator.git
- Edit the repository configuration file. In case it is empty just keep it as it is, do not delete it.
nano ./TeXLetterCreator/etc/tex.cfg.sh
This repository is shipped with a sample template (/test/tex/letter.tex
), a modified version of GerLaTeXLetter. To customize the template please edit the files within the /tex
folder. For more information please have a look at GerLaTeXLetter.
In case you use your own TeX template please make sure that it is capable of using the system's environment variables. This script will provide the following additional environment variables to the template:
Variable | Description | Example |
---|---|---|
arg_recp_addr |
Recipient's address (multiline, without name) | 123 Main Street Anytown, CA 12345 USA |
arg_recp_name |
Recipient's name (one line) | Jane Doe |
To introduce more variables just modify the repository's run file /src/tex.sh
as well as the sample template /tex/letter.tex
(or your own one). For more information on tex.sh
's general structure you may have a look at SHtemplate. For more information on letter.tex
please have a look at GerLaTeXLetter.
To call the script interactively, run /src/tex.sh
(without further arguments) from your terminal. To get help, run /src/tex.sh -h
.
================================================================================
=============================== SYNOPSIS ===============================
================================================================================
There are multiple ways to run this script:
Interactive mode (without any args):
> ./tex.sh
Classic (script) mode:
> ./tex.sh [ OPTION ]... ACTION [ <file_in> ]
ACTION := { -h|--help | --create | --print }
OPTION := { [-i|--in <file_in>] | [-o|--out <file_out>] | [-a|--address <address>] | [-n|--name <name>] }
[ <file_in> ] : LaTeX template file (.tex) to use
--------------------------------------------------------------------------------
-------------------------------- ACTION --------------------------------
--------------------------------------------------------------------------------
-h|--help Show this help message
--submenu <menu> Run a certain submenu interactively and exit
<menu> = { create | print }
--create Create letter and save as PDF file
--print Create letter and print
--------------------------------------------------------------------------------
-------------------------------- OPTION --------------------------------
--------------------------------------------------------------------------------
-i|--in <file_in> LaTeX template file (.tex) to use
-o|--out <file_out> Output file (.pdf)
-a|--address <address> Recipient's delivery address (without name)
-n|--name <name> Recipient's name
================================================================================
=============================== EXAMPLES ===============================
================================================================================
______________________ Interactive mode | Call main menu _______________________
> ./tex.sh
________ Interactive mode | Print letter with pre-defined TeX template _________
> ./tex.sh --submenu print "../tex/letter.tex"
_________________________________ Script mode __________________________________
> addr="\
123 Main Street
Anytown, CA 12345
USA"
> name="Jane Doe"
> ./tex.sh --create --address "${addr}" --name "${name}" "../tex/letter.tex"
See the open issues for a full list of proposed features (and known issues).
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Distributed under the GNU General Public License v3.0 (or later). See LICENSE
for more information.
⚠️ The license above does not apply to the files and folders within the library directory/lib
. Please have a look at theLICENSE
file located in the root directory of each library to get more information.
⚠️ The license above may not apply to some files within the TeX sample letter directory/test/tex
. Please have a look at theSPDX-FileCopyrightText
andSPDX-License-Identifier
headers in each file to get more information.
⚠️ The license above does not apply to the sample logo file/test/tex/logo.png
. For more information please have a look at Logoipsum's terms of license.
Project Link: /~https://github.com/fkemser/TeXLetterCreator