add separate options x and options macros

This commit is contained in:
Maximilian Keßler 2021-10-07 13:52:20 +02:00
parent 0e90f82076
commit d1a269b56b

View file

@ -31,12 +31,18 @@ def make_default_commands(package_formatter: PackageFormatter):
prefix=Attributes.package_prefix, condition=Args.one, value=Args.two) prefix=Attributes.package_prefix, condition=Args.one, value=Args.two)
package_formatter.add_arg_replacement(1, 'if', r'\if{prefix}{condition}', prefix=Attributes.package_prefix, package_formatter.add_arg_replacement(1, 'if', r'\if{prefix}{condition}', prefix=Attributes.package_prefix,
condition=Args.one) condition=Args.one)
package_formatter.add_replacement('language options', package_formatter.add_replacement('language options x',
r'\newif\if{prefix}english\{prefix}englishtrue' + '\n' + r'\newif\if{prefix}english\{prefix}englishtrue' + '\n' +
r'\DeclareOptionX{{german}}{{\{prefix}englishfalse}}' + '\n' + r'\DeclareOptionX{{german}}{{\{prefix}englishfalse}}' + '\n' +
r'\DeclareOptionX{{ngerman}}{{\{prefix}englishfalse}}' + '\n' + r'\DeclareOptionX{{ngerman}}{{\{prefix}englishfalse}}' + '\n' +
r'\DeclareOptionX{{english}}{{\{prefix}englishtrue}}', r'\DeclareOptionX{{english}}{{\{prefix}englishtrue}}',
prefix=Attributes.package_prefix) prefix=Attributes.package_prefix)
package_formatter.add_replacement('language options',
r'\newif\if{prefix}english\{prefix}englishtrue' + '\n' +
r'\DeclareOption{{german}}{{\{prefix}englishfalse}}' + '\n' +
r'\DeclareOption{{ngerman}}{{\{prefix}englishfalse}}' + '\n' +
r'\DeclareOption{{english}}{{\{prefix}englishtrue}}',
prefix=Attributes.package_prefix)
package_formatter.add_arg_replacement(1, 'info', r'\PackageInfo{{{name}}}{{{info}}}', name=Attributes.package_name, package_formatter.add_arg_replacement(1, 'info', r'\PackageInfo{{{name}}}{{{info}}}', name=Attributes.package_name,
info=Args.one) info=Args.one)
package_formatter.add_arg_replacement(1, 'warning', r'\PackageWarning{{{name}}}{{{warning}}}', package_formatter.add_arg_replacement(1, 'warning', r'\PackageWarning{{{name}}}{{{warning}}}',