Skip to content

A collection of shell scripts to interactively create and print TeX-based form letters.

License

Notifications You must be signed in to change notification settings

fkemser/TeXLetterCreator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Contributors Forks Stargazers Issues GNU GPL v3.0 License


TeXLetterCreator

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
  1. About The Project
  2. Getting Started
  3. TeX Template
  4. Usage (/src/tex.sh)
  5. Roadmap
  6. Contributing
  7. License
  8. Contact
  9. Acknowledgments

About The Project

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.

Screenshot 11

(back to top)

Built With

LaTeX Shell Script

(back to top)

Related Projects

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.

(back to top)

Testing Environment

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.

(back to top)

Getting Started

Prerequisites

⚠️ Please follow each of the following setup instructions before continuing:

Installation

  1. Clone the repo
    git clone --recurse-submodules /~https://github.com/fkemser/TeXLetterCreator.git
  2. 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

(back to top)

TeX Template

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.

(back to top)

Usage (/src/tex.sh)

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"

(back to top)

Roadmap

See the open issues for a full list of proposed features (and known issues).

(back to top)

Contributing

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!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

(back to top)

License

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 the LICENSE 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 the SPDX-FileCopyrightText and SPDX-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.

(back to top)

Contact

Project Link: /~https://github.com/fkemser/TeXLetterCreator

(back to top)

Acknowledgments

(back to top)

About

A collection of shell scripts to interactively create and print TeX-based form letters.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published