PDF creator#
This class mangaes PDF creation via LaTeX.
- class PDFviaLaTeX(fname, package=[], style='normal', pt=10, no_page=False, landscape=False, english=False, dir='')[source]#
Bases:
objectPDF creator class.
- Parameters:
fname (str) – file name without “.tex”.
package (list, optional) – package [(name,option)].
style (str, optional) – margin style (narrowest/narrow/normal/wide/widest).
pt (int, optional) – default point (8/9/10/11/12/14).
no_page (bool, optional) – no page number ?
landscape (bool, optional) – landscape ?
english (bool, optional) – english mode ?
dir (str, optional) – output directory.
- equation(eqs, num=False, long=False)[source]#
Add equation.
- Parameters:
eqs (str or list) – equation or list of eqs.
num (bool, optional) – with eq. number ?
long (bool, optional) – long eq. ? (single eq. only).
- figure(fname, width=0.8, pos='c', caption='')[source]#
Add figure (not in the figure environment, if caption is empty).
- Parameters:
fname (str) – file name of figure.
width (float, optional) – figure width relative to page width.
pos (str, optional) – position (c/l/r) (center/left/right).
caption (str, optional) – caption of figure.
- simple_table(tbl, cols=None, cpos=None, tmath=False)[source]#
Add simple table.
- Parameters:
tbl (list) – content of table (1d or 2d).
cols (int, optional) – number of columns.
cpos (str, optional) – position of each cols. default is center.
tmath (bool, optional) – math mode ?
- table(tbl, row, col, rc='', hl=[], caption='', stretch=1.0, cpos=None, rcmath=False, rmath=False, cmath=False, tmath=False, long=False, center=True)[source]#
Add table (reshaped by using number of col).
- Parameters:
tbl (list) – content of table [[str]].
row (list) – row name [str].
col (list) – column name [str].
rc (str, optional) – row-col name.
hl (list, optional) – position with horizontal line [int]. if True, use horizontal lines for all lines.
caption (str, optional) – table caption.
stretch (float, optional) – baseline stretch (ratio).
cpos (str, optional) – column position. default is center.
rcmath (bool, optional) – math mode for row-col name ?
rmath (bool, optional) – math mode for row name ?
cmath (bool, optional) – math mode for column name ?
tmath (bool, optional) – math mode for table ?
long (bool, optional) – long table ?
center (bool, optional) – centering ?
- list_to_table(lst1d, col, p=None)[source]#
Convert from list to table.
- Parameters:
lst1d (list) – 1d list.
col (int) – number of columns.
p (any, optional) – padding value (no padding for None).
- Returns:
(list) – 2d list.