pytex/default_formatters/class_formatter.py

22 lines
757 B
Python

import PyTeX.formatter
import PyTeX.base
import PyTeX.macros
class ClassFormatter(PyTeX.formatter.TexFormatter):
def __init__(self, class_name: str, author: str, extra_header: [str] = [], tex_version: str = 'LaTeX2e',
version: str = '0.0.0', latex_name: str = 'prepend-author'):
PyTeX.formatter.TexFormatter.__init__(
self,
name=class_name,
author=author,
header=extra_header,
file_extension='.cls',
tex_version=tex_version,
version=version,
latex_name=latex_name
)
self.tex_version = tex_version
def make_default_macros(self):
PyTeX.macros.make_default_macros(self, 'class', tex_version=self.tex_version)