add class formatter. fix typo in error message
This commit is contained in:
parent
9df6bd0513
commit
6c0dee2511
11
class_formatter.py
Normal file
11
class_formatter.py
Normal file
@ -0,0 +1,11 @@
|
||||
from formatter import Formatter
|
||||
from config import DEFAULT_AUTHOR
|
||||
from replacements import make_default_commands
|
||||
|
||||
|
||||
class ClassFormatter(Formatter):
|
||||
def __init__(self, class_name: str, author: str = DEFAULT_AUTHOR, extra_header: str = ''):
|
||||
Formatter.__init__(self, class_name, author, extra_header, '.cls')
|
||||
|
||||
def make_default_macros(self):
|
||||
make_default_commands(self, 'class')
|
@ -52,7 +52,7 @@ def make_default_commands(formatter: Formatter, latex_file_type: str):
|
||||
info=Args.one, Type=latex_file_type.capitalize())
|
||||
formatter.add_arg_replacement(1, 'warning', r'\{Type}Warning{{{name}}}{{{warning}}}',
|
||||
name=Attributes.name_lowercase, warning=Args.one, Type=latex_file_type.capitalize())
|
||||
formatter.add_arg_replacement(1, 'error', r'\{Type}Error{{{name}}}{{{error}}}}',
|
||||
formatter.add_arg_replacement(1, 'error', r'\{Type}Error{{{name}}}{{{error}}}',
|
||||
name=Attributes.name_lowercase, error=Args.one, Type=latex_file_type.capitalize())
|
||||
formatter.add_replacement('end options x',
|
||||
r"\DeclareOptionX*{{\{Type}Warning{{{name_lowercase}}}"
|
||||
|
Loading…
Reference in New Issue
Block a user