Parsers
PyDetex https://github.com/ppizarror/PyDetex
PARSERS Defines parsers, which perform a single task for removal of LaTex things.
- pydetex.parsers.find_str(s, char)[source]
Finds a sequence within a string, and returns the position. If not exists, returns
-1
.
- pydetex.parsers.process_begin_document(s, **kwargs)[source]
Removes all code outside begin document, if found.
- pydetex.parsers.process_chars_equations(s, lang, single_only, **kwargs)[source]
Process single char equations, removing the symbols.
- pydetex.parsers.process_cite(s, sort_cites=True, compress_cite=True, cite_separator=', ', **kwargs)[source]
Transforms all cites to a text-based with numbers. For example,
'This is from \cite{Pizarro}'
to'This is from [1]'
.
- pydetex.parsers.process_citeauthor(s, lang, **kwargs)[source]
Transforms all citeauthor to [cite]. For example:
'This is from \citeauthor{Pizarro}, and that is from \citeauthor{cite1, cite2}'
to'This is from [author], and that is from [authors]'
.
- pydetex.parsers.process_def(s, clear_learned=True, replace=False, **kwargs)[source]
Process defs. Store the definition, among others.
- pydetex.parsers.process_inputs(s, clear_not_found_files=False, **kwargs)[source]
Process inputs, which find the input files and retrieve its contents.
- pydetex.parsers.process_ref(s, **kwargs)[source]
Process references, same as cites, replace by numbers.
- pydetex.parsers.remove_commands_param(s, lang, invalid_commands=None, **kwargs)[source]
Remove all commands with params.
- pydetex.parsers.remove_commands_param_noargv(s, **kwargs)[source]
Remove all commands without arguments.
- pydetex.parsers.remove_common_tags(s, replace_tags=None, **kwargs)[source]
Remove common tags from string.
- pydetex.parsers.remove_environments(s, env_list=None, **kwargs)[source]
Remove a selection of environments.
- pydetex.parsers.replace_pydetex_tags(s, cite_format=('[', ']'), **kwargs)[source]
Replaces tags to text.