pyfan.util.pdf.pdfgen

pyfan generate and clean pdf files from folder The pyfan.util.pdf.pdfgen generates pdf files from tex files.

Gather all tex files from a folder, allow for exclusion strings. Generate PDFs from the tex files. And then clean up extraneous PDF outputs.

Includes method ff_pdf_gen_clean().

Module Contents

Functions

ff_pdf_gen_clean(ls_spt_srh=None, spt_out='C:/Users/fan/Documents/Dropbox (UH-ECON)/' + 'Project Emily Minority Survey/' + 'EthLang/reg_lang_abi_cls_mino/', spn_pdf_exe='C:/texlive/2019/bin/win32/xelatex.exe', ls_st_contain=None, ls_st_ignore=None, bl_recursive=False, bl_clean=True, ls_suf_clean=None)

Generate pdf files from latex files in various folders.

pyfan.util.pdf.pdfgen.ff_pdf_gen_clean(ls_spt_srh=None, spt_out='C:/Users/fan/Documents/Dropbox (UH-ECON)/' + 'Project Emily Minority Survey/' + 'EthLang/reg_lang_abi_cls_mino/', spn_pdf_exe='C:/texlive/2019/bin/win32/xelatex.exe', ls_st_contain=None, ls_st_ignore=None, bl_recursive=False, bl_clean=True, ls_suf_clean=None)[source]

Generate pdf files from latex files in various folders.

This file serves important paper generation function. It compiles multiple files satisfying string search requirements or exclusion conditions in multiple folders, and saves resulting pdf outputs in one folder. This allows for easy testing and management of mutiple pdf/latex files for the same project. Suppose there is a longer version of a paper, a shorter version, and an appendix file. We want to regularly test the compilations of all files, otherwise, as we work on one of the files, perhaps we some something in the some shared files that lead to other files breaking without knowing.

This should be run for all outward facing pdf/tex files for a project regularly in order to check if all files still compile.

By brining resulting outputs to a single folder, this makes it easier to see all paper and project relevant outputs. Additionally, this cleans up all pdf generated extraneous files once we have pdf itself, saving pdf compile folder clutter.

Parameters
ls_spt_srhlist of str

A list of strings of the path in which to search for tex files. They should be all on the same path. If bl_recursive is true, then this searchs in all subfolders.

spt_outstr

The Path to store outputs. All PDFs stored under single directory. This path must be directly on the same path as `ls_spt_srh’, can be higher up on the same tree, but not on a different branch.

spn_pdf_exe: str

The path to the pdflatex or alternative exe file

ls_st_contain: :obj:`list` of :obj:`str`

a list of strings the found names must contain one of these search words, not all, just one of.

ls_st_ignorelist of str

a list of string file names to ignore

bl_recursivebool

Whether to search for all tex files within subfolders

bl_cleanbool

To clean up after file generation

ls_suf_clean: :obj:`list` of :obj:`str`

list of

Returns
dict

A list of string pdf file names outputed,