Pipelines

PyDetex https://github.com/ppizarror/PyDetex

PIPELINES Defines the pipelines which apply parsers.

pydetex.pipelines.simple(s, lang='en', show_progress=False, replace_pydetex_tags=True, remove_common_tags=True, replace_single_chars_eqn=True, **kwargs)[source]

The most simple pipeline ever.

Parameters:
  • s (str) – String latex

  • lang (str) – Language tag of the code

  • show_progress (bool) – Show progress bar

  • replace_pydetex_tags (bool) – Replace pydetex tags like symbols, cites

  • remove_common_tags (bool) – Call remove_common_tags parser

  • replace_single_chars_eqn (bool) – Replaces all single char equations

Return type:

str

Returns:

String with no latex!

pydetex.pipelines.strict(s, lang='en', show_progress=False, eqn_simple=True, **kwargs)[source]

Apply simple + removes all commands.

Parameters:
  • s (str) – String latex

  • lang (str) – Language tag of the code

  • show_progress (bool) – Show progress bar

  • eqn_simple (bool) – If true, replace equations with a label, else, attempt to write it as-is

Return type:

str

Returns:

String with no latex!

pydetex.pipelines.strict_eqn(s, lang='en', show_progress=False, **kwargs)[source]

Same as strict, but replaces the equations with their string representation.

Parameters:
  • s (str) – String latex

  • lang (str) – Language tag of the code

  • show_progress (bool) – Show progress bar

Return type:

str

Returns:

String with no latex!