Welcome to pythonimmediate’s documentation!¶
This package is a Python-TeX binding. It requires the pythonimmediate TeX package to be installed.
The package works both ways – you can run Python code from TeX, or TeX code from Python.
There are different sections of the documentation:
pythonimmediate.simple– interface that “just works” for typical users of thepythonimmediateTeX package, to use Python coding from TeX, who does not know TeX inner details such as category codes.Note that this should be read in conjunction with the
pythonimmediateTeX package documentation.Some properties of the parent TeX interpreter can be accessed from
default_engine.The rest: contain functions to control the precise category codes of the tokens.
Read
expand_once()andNTokenListfor some examples.See the documentation of
pythonimmediate.engine.ChildProcessEnginefor ways to create a TeX engine from inside Python, and explanation of theengine=optional argument for most functions.The command-line arguments that the Python component accepts (can be specified through the
args=TeX module option) are documented inpythonimmediate.pytotex.
Contents:
- pythonimmediate package
- Submodules
- pythonimmediate.communicate module
- pythonimmediate.copy_to_stderr module
- pythonimmediate.decode_8bit module
- pythonimmediate.engine module
- pythonimmediate.pytotex module
- pythonimmediate.simple module
define_char()execute()f1()fully_expand()get_arg_estr()get_arg_str()get_multiline_verb_arg()get_next_char()get_optional_arg_estr()get_optional_arg_str()get_verb_arg()is_balanced()newcommand()newenvironment()newenvironment_verb()peek_next_char()print_TeX()put_next()renewcommand()run_tokenized_line_local()split_balanced()strip_optional_braces()undefine_char()var
- pythonimmediate.textopy module
- Module contents
BalancedTokenListBlueTokenCCatcodeCatcode.activeCatcode.alignmentCatcode.begin_groupCatcode.bgroupCatcode.commentCatcode.egroupCatcode.end_groupCatcode.end_of_lineCatcode.escapeCatcode.for_tokenCatcode.ignoredCatcode.invalidCatcode.letterCatcode.lineCatcode.mathCatcode.math_subscriptCatcode.math_superscriptCatcode.math_toggleCatcode.otherCatcode.paragraphCatcode.paramCatcode.parameterCatcode.spaceCatcode.subscriptCatcode.superscript
CharacterTokenControlSequenceTokenControlSequenceTokenMakerFrozenRelaxTokenNTokenNTokenListPTTBalancedTokenListPTTBlockPTTIntPTTTeXLinePTTVerbatimLinePTTVerbatimRawLinePyToTeXDataPythonCallTeXFunctionTypePythonCallTeXSyncFunctionTypePython_call_TeX_dataPython_call_TeX_extraPython_call_TeX_local()RedirectPrintTeXTTPBalancedTokenListTTPBlockTTPEBlockTTPELineTTPEmbeddedLineTTPLineTTPRawLineTeXToPyDataTokenToken.assign()Token.assign_future()Token.assign_futurenext()Token.assign_value()Token.assignableToken.blueToken.can_blueToken.deserialize()Token.deserialize_bytes()Token.get_next()Token.no_blueToken.noexpandToken.peek_next()Token.put_next()Token.serialize()Token.simple_detokenize()Token.value()Token.value_str()
TokenListTokenList.balancedTokenList.balanced_parts()TokenList.bool()TokenList.check_balanced()TokenList.deserialize()TokenList.deserialize_bytes()TokenList.doc()TokenList.e3()TokenList.execute()TokenList.expand_x()TokenList.force_token_list()TokenList.from_string()TokenList.is_balanced()TokenList.iterable_from_string()TokenList.put_next()TokenList.serialize()TokenList.serialize_bytes()TokenList.simple_detokenize()TokenList.str()TokenList.str_unicode()
bootstrap_code_functionsbuild_Python_call_TeX()can_be_mangled_to()check_line()continue_until_passed_back()continue_until_passed_back_str()debug()define_Python_call_TeX()define_TeX_call_Python()define_internal_handler()eval_with_linecache()exec_or_eval_with_linecache()exec_with_linecache()expand_once()export_function_to_module()get_bootstrap_code()get_random_identifier()have_naive_replace()mark_bootstrap()mark_bootstrap_naive_replace()naive_replace()normalize_line()parse_meaning_str()peek_next_meaning()postprocess_send_code()py()pyc()pycq()pyfile()random_identifiers()read_block()readline()run_block_finish()run_block_local()run_code_redirect_print_TeX()run_error_finish()run_main_loop()run_main_loop_get_return_one()run_none_finish()run_tokenized_line_peek()scan_Python_call_TeX()scan_Python_call_TeX_module()send_bootstrap_code()send_finish()send_raw()substitute_private()surround_delimiter()template_substitute()user_documentation()wrap_naive_replace()