Skip to main content

Convert your markdown or text files into LaTeX/pdf with one command!

Project description

simtex

simtex (simplified LaTeX) allows you to convert your markdown or text lectures into LaTeX file with one command, configured with simple .json file.

Note: This program does not intend to replace the LaTeX system, but to simplify the process of turning your already existing markdown/text file into PDF with LaTeX.

Program Options

❯ simtex --help
usage: simtex [OPTIONS]

Convert your markdown or text files into LaTeX/pdf with one command!

options:
  -h, --help            show this help message and exit
  -c, --convert         Convert the input to LaTeX.
  -b, --build           Build the generated LaTeX file.
  -B, --buildnview      Build the generated LaTeX file and view the output.
  -F FONT, --font FONT  Use different font package.
  -s FONTSIZE, --fontsize FONTSIZE
                        Use different font size.
  -p PAPERSIZE, --papersize PAPERSIZE
                        Use different paper size.
  -I INDENT, --indent INDENT
                        Indent size to be used.
  -m MARGIN, --margin MARGIN
                        Margin size to be used.
  -e ENCODING, --encoding ENCODING
                        Use a different encoding for the document.
  -i INPUT, --input INPUT
                        File to be converted into LaTeX.
  -T TITLE, --title TITLE
                        Set the title of the document.
  -f FILENAME, --filename FILENAME
                        Use different name for the output file.
  -of OUTPUTFOLDER, --outputfolder OUTPUTFOLDER
                        Change the output folder for the output file.
  -a AUTHOR, --author AUTHOR
                        Set the author name of the document.
  -d DATE, --date DATE  Set the date of the document.
  -C COMPILER, --compiler COMPILER
                        Use a different LaTeX compiler.
  -ft, --filenametitle  Use the filename as title.
  -v, --verbose         Show the stdout of processes.

Features

The program allows the user to convert simple file such as markdown or text file into PDF using LaTeX. This program does not intend to compete with pandoc, which essentially does the same but on higher level. Currently, the program has features that can satisfy conversion of basic inputs:

  1. Supports the most basic commands, such as bold, italics, emphasize, inline code, quotes, as well as hyperlinks.
  2. Environments, the program supports a multiline math environment using align, single line math equation using equation environment, as well as code blocks using lstlisting with syntax highlighting.
  3. Figures with captions.
  4. Sections, subsections upto subparagraphs.
  5. Basic document metadata and properties that can be provided in a configuration file for default value, this includes, author, date, font, among others, view the short documentation for full list.
  6. Simple config file using JSON, which defines the rules that should be followed on how the program should parse the input, as well as how to format the document.

Refer to the PDF for more details.

Examples

You can view the output of the program here which was generated using the command:

simtex -c -i="./examples/1/hello.md" -T="Hello Simtex!" -f="hello.tex" -a="iaacornus" -d="August 15, 2552"

View ./examples/1/hello.md

View output: .examples/1/hello.pdf

To convert a LaTeX file, and rename the default author defined in $CONF_PATH/simtex.json, add -a="iaacornus (or your name), and with the date, -d="August 15, 2552 to provide other date instead of the present. The program will output the tex file, as well as pdf, if -b was used, in ./out inside the folder of the input if there is no output folder given. See the documentation of arguments and configuration file.

Installation

Starting v0.3.2-beta, there is a released frozen code which can be easily downloaded and executed directly with ./simtex [OPTIONS]:

./simtex --help

All of the dependency needed is packaged with in this build.

Another method to install the project is with pip. Since the package is published on PyPI since v0.2.0-alpha:

pip install --user simtex

Other options, specifically -b and -B requires pdflatex, which is provided by any TeX distributions that can be installed, but texlive package is recommended which can be installed via:

# fedora
sudo dnf install texlive-scheme-full

# arch linux
sudo pacman -S texlive-most

# debian
sudo apt install texlive

For other installation method, see INSTALL.md for details.

Contribution

Refer to CONTRIBUTING.

  1. All contributions are required to abide by the CODE_OF_CONDUCT
  2. Opening and reporting issues is welcomed and considered as valuable contribution in this project.

Roadmap

  1. Support for enumerate/lists.
  2. Support Windows
  3. Add templates

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

simtex-0.3.2.1b0.tar.gz (28.1 kB view hashes)

Uploaded Source

Built Distribution

simtex-0.3.2.1b0-py3-none-any.whl (35.3 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page