Skip to main content

Support your bash needs when working with latex projects in git repositories.

Project description

Test Status

PyPI version

GitHub license

Latex Suite

This suite of little programs is intended to support creating latex documents that are being written in editor and console.

If you want to change the default behaviour create a configuration file. See Task: conf on how to create a config file and see Configuration on the parameters and their defaults.

Installation

Installation with Pip

  $ python3 -m pip install latexsuite

Manual Installation

  $ git clone https://github.com/jbuerman/latexsuite
  $ cd latexsuite
  $ python setup.py install

Autocomplete

LatexSuite uses argcomplete for argument autocompletion and is set up for global completion. See argcomplete's pypi site or github to activate global completion.

Tasks

The suite's different capabilities are determined by the first argument the task. The different tasks are:

  • make: Typeset the default tex
  • cmake: Typeset any tex
  • bibfile: Create bibliography file from required citations.
  • clean: Remove typesetting side files.
  • lang: Check common language errors in a document.
  • conf: Write the default config file.

Task: make and cmake

Typeset one or several tex files. The make command will initiate the typesetting of the main tex file or all compilable tex. The cmake command will initiate the typesetting of any specified tex.

Parameter

texfile
  Positional argument that accepts any compilable tex file in the current directory. If no argument is supplied the default tex file is compiles. (Ignored if --all is given.)

--all
  Compile all latex files in the current directory which are deemed self-compilable. Self-compilable tex files that contain a \documentclass in the first non comment/empty line. (Not available for cmake.)

-b/--bib
  Also process the bibliography. Will process the tex file twice. Once before and once after the bibliography file processing.

-v/--verbose
  Print the cmd output of the latex and bib engine.

-l/--listStatus
  List the compilation status of file typesetting when --all is given. (Ignored if --all is not given. Not available for cmake.)

-n/--number
  Number of latex error to ignore. Override the number_ignore_latex_compile_errors configuration value for the current run.

-d/--double
  Translate the tex document twice. If the '--bib' flag is set the file will be translated three times. Once before the bibliography processing and twice after.

Task: bibfile

Creates a bibliography based on the citations in the main tex file. The assumption is that there is a "database" of bibtex files, i.e. a folder that contains one or several bibtex files. The task reads in the aux file and searches in the database for all bibliographic blocks for citations listed in the aux file. The task then writes a local bibliography file with the needed references.

Parameter

-a/--auxFile
  The aux file to use. If not supplied the aux file of the main tex file is used.

-b/--bibsFolder
  The folder where the bibliography files are located.

-o/--output
  The output file where the local bibliography is written to.

Task: clean

Removes the temporary files from the latex typesetting process based on the configured file extensions.

Parameter

-d
  Depth of search into sub-folders for the files. Overrides clean_depth configuration value for the current run.

-l
  Only list the files and do not delete them.

-f   Force delete and not ask for confirmation for every file

Task: lang

Allows checking a text file for textual errors. The default behaviour is that every line gets tested for all errors. However, error types can be ignored using the associated flag. The task tests for the following errors.

  • 'An' not in front of a vowel or 'a' in front of a vowel , e.g. 'an car' or 'a apple'. Will also list 'false positives' like 'a hour'.
  • Extra space. Lists occasions where a space is followed by one or more spaces.
  • Named reference with lower case. Occasions where a reference is not capitalised, e.g. "figure 4" instead of "Figure 4".
  • Doubled word. Occasions where a word is repeated, e.g. "John had a car and and a house."
  • Citation with name and not shortcite.
    • Flag for exclusion '-c'.
  • Every sentence in a line. Checks that every sentence is in its own line.
    • Flag for exclusion '-l'.

Parameter

file
  Positional argument that accepts any text file.

-l
  Ignore (do not list) "Every sentence in a line" errors.

-c
  Ignore (do not list) "Citation with name and not shortcite" errors.

Task: conf

Write the config file for the suite with the default parameters.

Parameter

-f
Overriding the config file if it already exists.

Configuration

The configuration parameters, their meaning and their default values.

engine
The program to use to typeset the tex file (default value: pdflatex).
bib_engine
The program to use to process the bibliography (default value: biber).
main_tex
The main tex file to compile (default value: main.tex).
clean_file_extensions
The file extensions to use when searching for temporary files to delete (default value: [".log", ".aux", ".bbl", ".blg"]).
clean_depth
The depth (sub-folder traversal) used to search for temporary files. 0 means current dir, 1 means include sub-folder, 2 means sub-folder of sub-folders, etc. (default value: 0).
bib_files_folder
The folder where bibliography files are stored that shall be parsed when compiling a bib file of relevant references (default value: . [i.e. current dir]).
main_bibliography_file
The file to write the relevant references blocks to (default value: bibliography.bib").
bibliography_fields_to_remove
The bibliography blocks fields that are to be removed before adding the block to the file of relevant references (default value: ["abstract", "file", "keywords", "url"]).
number_ignore_latex_compile_errors
Number of times the latex typesetting program should try to ignore un-ended environments (default value: 1).
language_errors
Errors that are checked during the text error check. All errors are matches of the specified regular expression. Every error must have the following required and can have the following optional parameter.
message (required)
The error message.
regex (required)
The regular expression used to search for this error.
identifier (optional)
Used to create a command line arg to exclude the error during a check for text errors. Uniqueness should be ensured.
exclude_words (optional)
First words for which a match should be ignored. For example, an error checking for capitalisation of references, e.g. 'figure 1' instead of 'Figure 1', should ignore a match with an 'and', e.g. 'and 1' out of 'Figure 1 and 2' should not be a match.
split_character (optional)
The character to split a match of the regex into substrings. Used in conjunction with exclude_words to determine the first word (default: ' ', i.e. space).

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

latexsuite-0.9.5.tar.gz (24.4 kB view hashes)

Uploaded Source

Built Distribution

latexsuite-0.9.5-py3-none-any.whl (24.4 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