pydocmaker.backend.pdf_maker_tex ================================ .. py:module:: pydocmaker.backend.pdf_maker_tex Attributes ---------- .. autoapisummary:: pydocmaker.backend.pdf_maker_tex.log pydocmaker.backend.pdf_maker_tex._latex_compiler pydocmaker.backend.pdf_maker_tex._allowed_compilers Functions --------- .. autoapisummary:: pydocmaker.backend.pdf_maker_tex.test_latex_compiler pydocmaker.backend.pdf_maker_tex.config_latex_compiler_scan pydocmaker.backend.pdf_maker_tex.config_latex_compiler_testset pydocmaker.backend.pdf_maker_tex.config_latex_compiler_set pydocmaker.backend.pdf_maker_tex.config_latex_compiler_get pydocmaker.backend.pdf_maker_tex.setup pydocmaker.backend.pdf_maker_tex.zip_folder pydocmaker.backend.pdf_maker_tex._procrun pydocmaker.backend.pdf_maker_tex.make_pdf_from_tex Module Contents --------------- .. py:data:: log .. py:function:: test_latex_compiler(compiler) .. py:data:: _latex_compiler :value: None .. py:data:: _allowed_compilers .. py:function:: config_latex_compiler_scan() .. py:function:: config_latex_compiler_testset(verb=1) .. py:function:: config_latex_compiler_set(new_latex_compiler_str) .. py:function:: config_latex_compiler_get(verb=0) .. py:function:: setup() .. py:function:: zip_folder(folder_path) .. py:function:: _procrun(args, verb=0, ignore_error=False, **kwargs) .. py:function:: make_pdf_from_tex(input_latex_text, attachments_dc=None, docname='', out_format='pdf', base_dir=None, latex_compiler=None, n_times_make=None, verb=0, ignore_error=False) -> bytes Converts a LaTeX document to a PDF or a ZIP file containing the PDF and all attachments. :param input_latex_text: The LaTeX document as a string or bytes. :type input_latex_text: str or bytes :param attachments_dc: A dictionary of attachments to include in the ZIP file. The keys are the filenames and the values are the file contents as bytes or strings. Defaults to an empty dictionary. :type attachments_dc: dict, optional :param docname: The name of the output document. Defaults to a timestamp. :type docname: str, optional :param out_format: The format of the output. Either 'pdf' or 'zip'. Defaults to 'pdf'. :type out_format: str, optional :param base_dir: The directory to use as the base directory for the temporary directory. Defaults to the system's default temporary directory. :type base_dir: str, optional :param latex_compiler: The LaTeX compiler to use. Either 'pdflatex', 'lualatex', 'xelatex', or 'pandoc'. If not specified, the function will try to use 'pandoc', 'pdflatex', 'lualatex', or 'xelatex' in that order. :type latex_compiler: str, optional :param n_times_make: The number of times to run the LaTeX compiler. Defaults to 1 for pandoc and 3 for al others. :type n_times_make: int, optional :param verb: The verbosity level. If greater than 0, the function will print debug information. Defaults to 0. :type verb: int, optional :param ignore_error: Whether to ignore errors during the LaTeX compilation. Defaults to False. :type ignore_error: bool, optional :returns: The PDF document as bytes, or a ZIP file containing the PDF and all attachments as bytes. :rtype: bytes :raises ValueError: If the input_latex_text is not a string or bytes, or if the docname is not a string. :raises ValueError: If the latex_compiler is not 'pdflatex', 'lualatex', 'xelatex', or 'pandoc'. :raises ValueError: If the out_format is not 'pdf' or 'zip'. :raises AssertionError: If the attachments_dc contains invalid keys or values.