Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
EnvironmentTextSpec('align', simplify_repl=fmt_equation_environment),
EnvironmentTextSpec('multline', simplify_repl=fmt_equation_environment),
EnvironmentTextSpec('gather', simplify_repl=fmt_equation_environment),
EnvironmentTextSpec('dmath', simplify_repl=fmt_equation_environment),
EnvironmentTextSpec('array', simplify_repl=fmt_placeholder_node),
EnvironmentTextSpec('pmatrix', simplify_repl=fmt_placeholder_node),
EnvironmentTextSpec('bmatrix', simplify_repl=fmt_placeholder_node),
EnvironmentTextSpec('smallmatrix', simplify_repl=fmt_placeholder_node),
EnvironmentTextSpec('center', simplify_repl='\n%s\n'),
EnvironmentTextSpec('flushleft', simplify_repl='\n%s\n'),
EnvironmentTextSpec('flushright', simplify_repl='\n%s\n'),
EnvironmentTextSpec('exenumerate', discard=False),
EnvironmentTextSpec('enumerate', discard=False),
EnvironmentTextSpec('list', discard=False),
EnvironmentTextSpec('itemize', discard=False),
EnvironmentTextSpec('subequations', discard=False),
EnvironmentTextSpec('figure', discard=False),
EnvironmentTextSpec('table', discard=False),
],
'specials': [
SpecialsTextSpec('&', ' '), # ignore tabular alignments, just add a little space
],
'macros': [
# NOTE: macro will only be assigned arguments if they are explicitly defined as
# accepting arguments in latexwalker.py.
MacroTextSpec('emph', discard=False),
MacroTextSpec('textrm', discard=False),
def _format_uebung(n, l2t):
s = '\n' + l2t.nodelist_to_text([n.nodeargs[0]]) + '\n'
optarg = n.nodeargs[1]
if optarg is not None:
s += '[{}]\n'.format(l2t.nodelist_to_text([optarg]))
return s
# construct the specs structure, more than the just the following definition
latex_base_specs = {
'environments': [
EnvironmentTextSpec('equation', simplify_repl=fmt_equation_environment),
EnvironmentTextSpec('eqnarray', simplify_repl=fmt_equation_environment),
EnvironmentTextSpec('align', simplify_repl=fmt_equation_environment),
EnvironmentTextSpec('multline', simplify_repl=fmt_equation_environment),
EnvironmentTextSpec('gather', simplify_repl=fmt_equation_environment),
EnvironmentTextSpec('dmath', simplify_repl=fmt_equation_environment),
EnvironmentTextSpec('array', simplify_repl=fmt_placeholder_node),
EnvironmentTextSpec('pmatrix', simplify_repl=fmt_placeholder_node),
EnvironmentTextSpec('bmatrix', simplify_repl=fmt_placeholder_node),
EnvironmentTextSpec('smallmatrix', simplify_repl=fmt_placeholder_node),
EnvironmentTextSpec('center', simplify_repl='\n%s\n'),
EnvironmentTextSpec('flushleft', simplify_repl='\n%s\n'),
EnvironmentTextSpec('flushright', simplify_repl='\n%s\n'),
EnvironmentTextSpec('exenumerate', discard=False),
EnvironmentTextSpec('enumerate', discard=False),
# construct the specs structure, more than the just the following definition
latex_base_specs = {
'environments': [
EnvironmentTextSpec('equation', simplify_repl=fmt_equation_environment),
EnvironmentTextSpec('eqnarray', simplify_repl=fmt_equation_environment),
EnvironmentTextSpec('align', simplify_repl=fmt_equation_environment),
EnvironmentTextSpec('multline', simplify_repl=fmt_equation_environment),
EnvironmentTextSpec('gather', simplify_repl=fmt_equation_environment),
EnvironmentTextSpec('dmath', simplify_repl=fmt_equation_environment),
EnvironmentTextSpec('array', simplify_repl=fmt_placeholder_node),
EnvironmentTextSpec('pmatrix', simplify_repl=fmt_placeholder_node),
EnvironmentTextSpec('bmatrix', simplify_repl=fmt_placeholder_node),
EnvironmentTextSpec('smallmatrix', simplify_repl=fmt_placeholder_node),
EnvironmentTextSpec('center', simplify_repl='\n%s\n'),
EnvironmentTextSpec('flushleft', simplify_repl='\n%s\n'),
EnvironmentTextSpec('flushright', simplify_repl='\n%s\n'),
EnvironmentTextSpec('exenumerate', discard=False),
EnvironmentTextSpec('enumerate', discard=False),
EnvironmentTextSpec('list', discard=False),
EnvironmentTextSpec('itemize', discard=False),
EnvironmentTextSpec('subequations', discard=False),
EnvironmentTextSpec('figure', discard=False),
EnvironmentTextSpec('table', discard=False),
],
'specials': [
EnvironmentTextSpec('dmath', simplify_repl=fmt_equation_environment),
EnvironmentTextSpec('array', simplify_repl=fmt_placeholder_node),
EnvironmentTextSpec('pmatrix', simplify_repl=fmt_placeholder_node),
EnvironmentTextSpec('bmatrix', simplify_repl=fmt_placeholder_node),
EnvironmentTextSpec('smallmatrix', simplify_repl=fmt_placeholder_node),
EnvironmentTextSpec('center', simplify_repl='\n%s\n'),
EnvironmentTextSpec('flushleft', simplify_repl='\n%s\n'),
EnvironmentTextSpec('flushright', simplify_repl='\n%s\n'),
EnvironmentTextSpec('exenumerate', discard=False),
EnvironmentTextSpec('enumerate', discard=False),
EnvironmentTextSpec('list', discard=False),
EnvironmentTextSpec('itemize', discard=False),
EnvironmentTextSpec('subequations', discard=False),
EnvironmentTextSpec('figure', discard=False),
EnvironmentTextSpec('table', discard=False),
],
'specials': [
SpecialsTextSpec('&', ' '), # ignore tabular alignments, just add a little space
],
'macros': [
# NOTE: macro will only be assigned arguments if they are explicitly defined as
# accepting arguments in latexwalker.py.
MacroTextSpec('emph', discard=False),
MacroTextSpec('textrm', discard=False),
MacroTextSpec('textit', discard=False),
MacroTextSpec('textbf', discard=False),
MacroTextSpec('textsc', discard=False),
EnvironmentTextSpec('gather', simplify_repl=fmt_equation_environment),
EnvironmentTextSpec('dmath', simplify_repl=fmt_equation_environment),
EnvironmentTextSpec('array', simplify_repl=fmt_placeholder_node),
EnvironmentTextSpec('pmatrix', simplify_repl=fmt_placeholder_node),
EnvironmentTextSpec('bmatrix', simplify_repl=fmt_placeholder_node),
EnvironmentTextSpec('smallmatrix', simplify_repl=fmt_placeholder_node),
EnvironmentTextSpec('center', simplify_repl='\n%s\n'),
EnvironmentTextSpec('flushleft', simplify_repl='\n%s\n'),
EnvironmentTextSpec('flushright', simplify_repl='\n%s\n'),
EnvironmentTextSpec('exenumerate', discard=False),
EnvironmentTextSpec('enumerate', discard=False),
EnvironmentTextSpec('list', discard=False),
EnvironmentTextSpec('itemize', discard=False),
EnvironmentTextSpec('subequations', discard=False),
EnvironmentTextSpec('figure', discard=False),
EnvironmentTextSpec('table', discard=False),
],
'specials': [
SpecialsTextSpec('&', ' '), # ignore tabular alignments, just add a little space
],
'macros': [
# NOTE: macro will only be assigned arguments if they are explicitly defined as
# accepting arguments in latexwalker.py.
MacroTextSpec('emph', discard=False),
MacroTextSpec('textrm', discard=False),
MacroTextSpec('textit', discard=False),
MacroTextSpec('textbf', discard=False),
EnvironmentTextSpec('eqnarray', simplify_repl=fmt_equation_environment),
EnvironmentTextSpec('align', simplify_repl=fmt_equation_environment),
EnvironmentTextSpec('multline', simplify_repl=fmt_equation_environment),
EnvironmentTextSpec('gather', simplify_repl=fmt_equation_environment),
EnvironmentTextSpec('dmath', simplify_repl=fmt_equation_environment),
EnvironmentTextSpec('array', simplify_repl=fmt_placeholder_node),
EnvironmentTextSpec('pmatrix', simplify_repl=fmt_placeholder_node),
EnvironmentTextSpec('bmatrix', simplify_repl=fmt_placeholder_node),
EnvironmentTextSpec('smallmatrix', simplify_repl=fmt_placeholder_node),
EnvironmentTextSpec('center', simplify_repl='\n%s\n'),
EnvironmentTextSpec('flushleft', simplify_repl='\n%s\n'),
EnvironmentTextSpec('flushright', simplify_repl='\n%s\n'),
EnvironmentTextSpec('exenumerate', discard=False),
EnvironmentTextSpec('enumerate', discard=False),
EnvironmentTextSpec('list', discard=False),
EnvironmentTextSpec('itemize', discard=False),
EnvironmentTextSpec('subequations', discard=False),
EnvironmentTextSpec('figure', discard=False),
EnvironmentTextSpec('table', discard=False),
],
'specials': [
SpecialsTextSpec('&', ' '), # ignore tabular alignments, just add a little space
],
'macros': [
# NOTE: macro will only be assigned arguments if they are explicitly defined as
# accepting arguments in latexwalker.py.
MacroTextSpec('emph', discard=False),
EnvironmentTextSpec('array', simplify_repl=fmt_placeholder_node),
EnvironmentTextSpec('pmatrix', simplify_repl=fmt_placeholder_node),
EnvironmentTextSpec('bmatrix', simplify_repl=fmt_placeholder_node),
EnvironmentTextSpec('smallmatrix', simplify_repl=fmt_placeholder_node),
EnvironmentTextSpec('center', simplify_repl='\n%s\n'),
EnvironmentTextSpec('flushleft', simplify_repl='\n%s\n'),
EnvironmentTextSpec('flushright', simplify_repl='\n%s\n'),
EnvironmentTextSpec('exenumerate', discard=False),
EnvironmentTextSpec('enumerate', discard=False),
EnvironmentTextSpec('list', discard=False),
EnvironmentTextSpec('itemize', discard=False),
EnvironmentTextSpec('subequations', discard=False),
EnvironmentTextSpec('figure', discard=False),
EnvironmentTextSpec('table', discard=False),
],
'specials': [
SpecialsTextSpec('&', ' '), # ignore tabular alignments, just add a little space
],
'macros': [
# NOTE: macro will only be assigned arguments if they are explicitly defined as
# accepting arguments in latexwalker.py.
MacroTextSpec('emph', discard=False),
MacroTextSpec('textrm', discard=False),
MacroTextSpec('textit', discard=False),
MacroTextSpec('textbf', discard=False),
MacroTextSpec('textsc', discard=False),
MacroTextSpec('textsl', discard=False),
s += '[{}]\n'.format(l2t.nodelist_to_text([optarg]))
return s
# construct the specs structure, more than the just the following definition
latex_base_specs = {
'environments': [
EnvironmentTextSpec('equation', simplify_repl=fmt_equation_environment),
EnvironmentTextSpec('eqnarray', simplify_repl=fmt_equation_environment),
EnvironmentTextSpec('align', simplify_repl=fmt_equation_environment),
EnvironmentTextSpec('multline', simplify_repl=fmt_equation_environment),
EnvironmentTextSpec('gather', simplify_repl=fmt_equation_environment),
EnvironmentTextSpec('dmath', simplify_repl=fmt_equation_environment),
EnvironmentTextSpec('array', simplify_repl=fmt_placeholder_node),
EnvironmentTextSpec('pmatrix', simplify_repl=fmt_placeholder_node),
EnvironmentTextSpec('bmatrix', simplify_repl=fmt_placeholder_node),
EnvironmentTextSpec('smallmatrix', simplify_repl=fmt_placeholder_node),
EnvironmentTextSpec('center', simplify_repl='\n%s\n'),
EnvironmentTextSpec('flushleft', simplify_repl='\n%s\n'),
EnvironmentTextSpec('flushright', simplify_repl='\n%s\n'),
EnvironmentTextSpec('exenumerate', discard=False),
EnvironmentTextSpec('enumerate', discard=False),
EnvironmentTextSpec('list', discard=False),
EnvironmentTextSpec('itemize', discard=False),
EnvironmentTextSpec('subequations', discard=False),
EnvironmentTextSpec('figure', discard=False),
'environments': [
EnvironmentTextSpec('equation', simplify_repl=fmt_equation_environment),
EnvironmentTextSpec('eqnarray', simplify_repl=fmt_equation_environment),
EnvironmentTextSpec('align', simplify_repl=fmt_equation_environment),
EnvironmentTextSpec('multline', simplify_repl=fmt_equation_environment),
EnvironmentTextSpec('gather', simplify_repl=fmt_equation_environment),
EnvironmentTextSpec('dmath', simplify_repl=fmt_equation_environment),
EnvironmentTextSpec('array', simplify_repl=fmt_placeholder_node),
EnvironmentTextSpec('pmatrix', simplify_repl=fmt_placeholder_node),
EnvironmentTextSpec('bmatrix', simplify_repl=fmt_placeholder_node),
EnvironmentTextSpec('smallmatrix', simplify_repl=fmt_placeholder_node),
EnvironmentTextSpec('center', simplify_repl='\n%s\n'),
EnvironmentTextSpec('flushleft', simplify_repl='\n%s\n'),
EnvironmentTextSpec('flushright', simplify_repl='\n%s\n'),
EnvironmentTextSpec('exenumerate', discard=False),
EnvironmentTextSpec('enumerate', discard=False),
EnvironmentTextSpec('list', discard=False),
EnvironmentTextSpec('itemize', discard=False),
EnvironmentTextSpec('subequations', discard=False),
EnvironmentTextSpec('figure', discard=False),
EnvironmentTextSpec('table', discard=False),
],
'specials': [
SpecialsTextSpec('&', ' '), # ignore tabular alignments, just add a little space
],
'macros': [
def _format_uebung(n, l2t):
s = '\n' + l2t.nodelist_to_text([n.nodeargs[0]]) + '\n'
optarg = n.nodeargs[1]
if optarg is not None:
s += '[{}]\n'.format(l2t.nodelist_to_text([optarg]))
return s
# construct the specs structure, more than the just the following definition
latex_base_specs = {
'environments': [
EnvironmentTextSpec('equation', simplify_repl=fmt_equation_environment),
EnvironmentTextSpec('eqnarray', simplify_repl=fmt_equation_environment),
EnvironmentTextSpec('align', simplify_repl=fmt_equation_environment),
EnvironmentTextSpec('multline', simplify_repl=fmt_equation_environment),
EnvironmentTextSpec('gather', simplify_repl=fmt_equation_environment),
EnvironmentTextSpec('dmath', simplify_repl=fmt_equation_environment),
EnvironmentTextSpec('array', simplify_repl=fmt_placeholder_node),
EnvironmentTextSpec('pmatrix', simplify_repl=fmt_placeholder_node),
EnvironmentTextSpec('bmatrix', simplify_repl=fmt_placeholder_node),
EnvironmentTextSpec('smallmatrix', simplify_repl=fmt_placeholder_node),
EnvironmentTextSpec('center', simplify_repl='\n%s\n'),
EnvironmentTextSpec('flushleft', simplify_repl='\n%s\n'),
EnvironmentTextSpec('flushright', simplify_repl='\n%s\n'),
EnvironmentTextSpec('exenumerate', discard=False),