2021-10-18 15:08:58 +02:00
|
|
|
import PyTeX.formatter
|
|
|
|
import PyTeX.base
|
|
|
|
import PyTeX.macros
|
|
|
|
|
|
|
|
|
|
|
|
class PackageFormatter(PyTeX.formatter.TexFormatter):
|
2022-01-11 18:51:03 +01:00
|
|
|
def __init__(self, package_name: str, author: str, extra_header: [str] = [], tex_version: str = 'LaTeX2e',
|
2022-01-11 21:37:42 +01:00
|
|
|
version: str = '0.0.0', latex_name: str = 'prepend-author'):
|
2022-01-11 18:39:56 +01:00
|
|
|
PyTeX.formatter.TexFormatter.__init__(
|
|
|
|
self,
|
|
|
|
name=package_name,
|
|
|
|
author=author,
|
|
|
|
header=extra_header,
|
|
|
|
file_extension='.sty',
|
2022-01-11 18:51:03 +01:00
|
|
|
tex_version=tex_version,
|
2022-01-11 21:37:42 +01:00
|
|
|
version=version,
|
|
|
|
latex_name=latex_name
|
2022-01-11 18:39:56 +01:00
|
|
|
)
|
2022-01-11 18:51:03 +01:00
|
|
|
self.tex_version = tex_version
|
2021-10-18 15:08:58 +02:00
|
|
|
|
|
|
|
def make_default_macros(self):
|
2022-01-11 18:51:03 +01:00
|
|
|
PyTeX.macros.make_default_macros(self, 'package', tex_version=self.tex_version)
|