Commit 1a2e62db authored by Eckhart Arnold's avatar Eckhart Arnold
Browse files

LaTeX example extended

parent ab609a77
......@@ -6,7 +6,8 @@
@ comment = /%.*/ # note: trailing linefeed is not part of the comment proper
@ reduction = merge_treetops
@ disposable = _WSPC, _GAP, _LB, _PARSEP, _LETTERS, _NAME, INTEGER, FRAC,
_QUALIFIED, TEXT_NOPAR, TEXT, _block_content,
_QUALIFIED, TEXT_NOPAR, TEXT, _block_content, PATH, PATHSEP,
HASH, COLON, TAG,
block_environment, known_environment, text_element,
line_element, inline_environment, known_inline_env, info_block,
begin_inline_env, end_inline_env, command, known_command
......@@ -25,7 +26,7 @@ document = [_WSPC] "\begin{document}"
§frontpages
(Chapters | Sections)
[Bibliography] [Index] [_WSPC]
"\end{document}" [_WSPC] §EOF
"\end{document}" [_WSPC] EOF
frontpages = sequence
......@@ -76,8 +77,8 @@ generic_block = begin_generic_block sequence §end_generic_block
begin_generic_block = <-&_LB begin_environment LFF
end_generic_block = <-&_LB end_environment LFF
itemize = "\begin{itemize}" [_WSPC] { item } §"\end{itemize}"
enumerate = "\begin{enumerate}" [_WSPC] {item } §"\end{enumerate}"
itemize = "\begin{itemize}" [_WSPC] { command | item } §"\end{itemize}"
enumerate = "\begin{enumerate}" [_WSPC] { command | item } §"\end{enumerate}"
item = "\item" sequence
figure = "\begin{figure}" sequence §"\end{figure}"
......@@ -86,15 +87,23 @@ quotation = ("\begin{quotation}" sequence §"\end{quotation}")
verbatim = "\begin{verbatim}" sequence §"\end{verbatim}"
tabular = "\begin{tabular}" tabular_config { tabular_row } §"\end{tabular}"
tabular_row = (multicolumn | tabular_cell) { "&" (multicolumn | tabular_cell) }
"\\" ( hline | { cline } )
tabular_cell = {line_element [S] }
tabular_config = "{" TBCFG_VALUE §"}"
("\\" ( hline | { cline } ) [_PARSEP] | &`\end{tabular}`)
tabular_cell = raisebox [S|_PARSEP] | { line_element [S|_PARSEP] }
raisebox = "\raisebox" rb_offset [rb_up] [rb_down] block
rb_offset = "{" number UNIT ~ "}"
rb_up = "[" number UNIT ~ "]"
rb_down = "[" number UNIT ~ "]"
tabular_config = "{" { cfg_celltype [cfg_unit] | cfg_separator }+ §"}"
cfg_celltype = /[lcrp]/
cfg_unit = `{` number UNIT `}`
cfg_separator = `|`
TBCFG_VALUE = /[lcr|]+/~
#### paragraphs and sequences of paragraphs ####
block_of_paragraphs = "{" [sequence] §"}"
sequence = [_WSPC] { (paragraph | block_environment ) [_PARSEP] }+
sequence = [_WSPC] { (paragraph | block_environment) [_PARSEP|S] }+
paragraph = { !blockcmd text_element [S] }+
text_element = line_element | LINEFEED
line_element = text | inline_environment | command | block
......@@ -120,7 +129,7 @@ command = known_command | text_command | generic_command
known_command = citet | citep | footnote | includegraphics | caption
| multicolumn | hline | cline | documentclass | pdfinfo
| hypersetup
| hypersetup | label | ref | href | url
text_command = TXTCOMMAND | ESCAPED | BRACKETS
generic_command = !no_command CMDNAME [[ ~ config ] { ~ block }+ ]
| `{` CMDNAME _block_content §`}`
......@@ -136,6 +145,14 @@ cline = "\cline{" INTEGER "-" INTEGER "}"
documentclass = "\documentclass" [ config ] block
pdfinfo = "\pdfinfo" info_block
hypersetup = "\hypersetup" param_block
label = "\label{" CHARS "}"
ref = ( "\ref{" | "\pageref{" ) CHARS "}"
url = "\url{" urlstring "}"
href = "\href{" urlstring "}" block
urlstring = [protocol] { path } [target]
protocol = /\w+:\/\/(?!\*)/
path = PATH PATHSEP
target = PATH { <-!/s?ptth/ COLON PATH } [ (HASH| <-!/s?ptth/ COLON) TAG ]
#######################################################################
......@@ -145,7 +162,7 @@ hypersetup = "\hypersetup" param_block
#######################################################################
block = "{" _block_content §`}`
_block_content = { !blockcmd text_element [S] }
_block_content = { (block_environment | text_element | paragraph) [_PARSEP|S] }
info_block = "{" §{ info_assoc } "}"
info_assoc = info_key ~ [ "(" §info_value ")" ]
info_key = `/` _NAME
......@@ -172,7 +189,6 @@ structural = "subsection" | "section" | "chapter" | "subsubsection"
#######################################################################
config = "[" § (parameters &"]" | cfg_text) "]"
param_config = "[" § [parameters] "]"
param_block = "{" [parameters] "}"
parameters = (association | flag) { "," (association | flag) } [ WARN_Komma ]
association = key~ "=" value~
......@@ -209,11 +225,17 @@ LINEFEED = /[\\][\\]/
_QUALIFIED = IDENTIFIER { /[:.-]/ IDENTIFIER }
IDENTIFIER = _NAME
NAME = _NAME # captured! don't use without retrival
_NAME = /(?!\d)\w+/
_NAME = /(?!\d)\w+\*?/
INTEGER = /-?(?:(?:[1-9][0-9]+)|[0-9])/
FRAC = /\.[0-9]+/
UNIT = /(?!\d)\w+/
PATH = /[\w=~?.,%&\[\]-]+/
PATHSEP = /\/(?!\*)/
HASH = `#`
COLON = `:`
TAG = /[\w=?.:\-%&\[\] \/]+/
TEXT = /(?:[^\\%$&\{\}\[\]\n]+(?:\n(?![ \t]*\n))?)+/
TEXT_NOPAR = /(?:[^\\%$&\{\}\[\]\(\)\n]+(?:\n(?![ \t]*\n))?)+/ # text without parnetheses
LINE = /[^\\%$&\{\}\[\]\n]+/ # a line of text
......
......@@ -86,8 +86,8 @@ class LaTeXGrammar(Grammar):
paragraph = Forward()
param_block = Forward()
text_element = Forward()
source_hash__ = "1defeb8c06a45217d1fba760a3364e88"
disposable__ = re.compile('_WSPC$|_GAP$|_LB$|_PARSEP$|_LETTERS$|_NAME$|INTEGER$|FRAC$|_QUALIFIED$|TEXT_NOPAR$|TEXT$|_block_content$|block_environment$|known_environment$|text_element$|line_element$|inline_environment$|known_inline_env$|info_block$|begin_inline_env$|end_inline_env$|command$|known_command$')
source_hash__ = "4a60dc317415b6953ba8665a77571119"
disposable__ = re.compile('_WSPC$|_GAP$|_LB$|_PARSEP$|_LETTERS$|_NAME$|INTEGER$|FRAC$|_QUALIFIED$|TEXT_NOPAR$|TEXT$|_block_content$|PATH$|PATHSEP$|HASH$|COLON$|TAG$|block_environment$|known_environment$|text_element$|line_element$|inline_environment$|known_inline_env$|info_block$|begin_inline_env$|end_inline_env$|command$|known_command$')
static_analysis_pending__ = [] # type: List[bool]
parser_initialization__ = ["upon instantiation"]
COMMENT__ = r'%.*'
......@@ -113,10 +113,15 @@ class LaTeXGrammar(Grammar):
LINE = RegExp('[^\\\\%$&\\{\\}\\[\\]\\n]+')
TEXT_NOPAR = RegExp('(?:[^\\\\%$&\\{\\}\\[\\]\\(\\)\\n]+(?:\\n(?![ \\t]*\\n))?)+')
TEXT = RegExp('(?:[^\\\\%$&\\{\\}\\[\\]\\n]+(?:\\n(?![ \\t]*\\n))?)+')
TAG = RegExp('[\\w=?.:\\-%&\\[\\] /]+')
COLON = Text(":")
HASH = Text("#")
PATHSEP = RegExp('/(?!\\*)')
PATH = RegExp('[\\w=~?.,%&\\[\\]-]+')
UNIT = RegExp('(?!\\d)\\w+')
FRAC = RegExp('\\.[0-9]+')
INTEGER = RegExp('-?(?:(?:[1-9][0-9]+)|[0-9])')
_NAME = RegExp('(?!\\d)\\w+')
_NAME = RegExp('(?!\\d)\\w+\\*?')
NAME = Capture(Synonym(_NAME))
IDENTIFIER = Synonym(_NAME)
_QUALIFIED = Series(IDENTIFIER, ZeroOrMore(Series(Drop(RegExp('[:.-]')), IDENTIFIER)))
......@@ -135,9 +140,8 @@ class LaTeXGrammar(Grammar):
flag = Alternative(_QUALIFIED, magnitude)
association = Series(key, dwsp__, Series(Drop(Text("=")), dwsp__), value, dwsp__)
parameters = Series(Alternative(association, flag), ZeroOrMore(Series(Series(Drop(Text(",")), dwsp__), Alternative(association, flag))), Option(WARN_Komma))
sequence = Series(Option(_WSPC), OneOrMore(Series(Alternative(paragraph, block_environment), Option(_PARSEP))))
sequence = Series(Option(_WSPC), OneOrMore(Series(Alternative(paragraph, block_environment), Option(Alternative(_PARSEP, S)))))
block_of_paragraphs = Series(Series(Drop(Text("{")), dwsp__), Option(sequence), Series(Drop(Text("}")), dwsp__), mandatory=2)
param_config = Series(Series(Drop(Text("[")), dwsp__), Option(parameters), Series(Drop(Text("]")), dwsp__), mandatory=1)
text = Series(TEXT, ZeroOrMore(Series(Alternative(S, trennung), TEXT)))
structural = Alternative(Series(Drop(Text("subsection")), dwsp__), Series(Drop(Text("section")), dwsp__), Series(Drop(Text("chapter")), dwsp__), Series(Drop(Text("subsubsection")), dwsp__), Series(Drop(Text("paragraph")), dwsp__), Series(Drop(Text("subparagraph")), dwsp__), Series(Drop(Text("item")), dwsp__))
begin_environment = Series(Drop(RegExp('\\\\begin{')), NAME, Drop(RegExp('}')), mandatory=1)
......@@ -148,49 +152,64 @@ class LaTeXGrammar(Grammar):
info_key = Series(Drop(Text("/")), _NAME)
info_assoc = Series(info_key, dwsp__, Option(Series(Series(Drop(Text("(")), dwsp__), info_value, Series(Drop(Text(")")), dwsp__), mandatory=1)))
info_block = Series(Series(Drop(Text("{")), dwsp__), ZeroOrMore(info_assoc), Series(Drop(Text("}")), dwsp__), mandatory=1)
end_environment = Series(Drop(RegExp('\\\\end{')), Pop(NAME), Drop(RegExp('}')), mandatory=1)
_block_content = ZeroOrMore(Series(Alternative(block_environment, text_element, paragraph), Option(Alternative(_PARSEP, S))))
hide_from_toc = Series(Text("*"), dwsp__)
target = Series(PATH, ZeroOrMore(Series(NegativeLookbehind(Drop(RegExp('s?ptth'))), COLON, PATH)), Option(Series(Alternative(HASH, Series(NegativeLookbehind(Drop(RegExp('s?ptth'))), COLON)), TAG)))
path = Series(PATH, PATHSEP)
protocol = RegExp('\\w+://(?!\\*)')
urlstring = Series(Option(protocol), ZeroOrMore(path), Option(target))
href = Series(Series(Drop(Text("\\href{")), dwsp__), urlstring, Series(Drop(Text("}")), dwsp__), block)
url = Series(Series(Drop(Text("\\url{")), dwsp__), urlstring, Series(Drop(Text("}")), dwsp__))
ref = Series(Alternative(Series(Drop(Text("\\ref{")), dwsp__), Series(Drop(Text("\\pageref{")), dwsp__)), CHARS, Series(Drop(Text("}")), dwsp__))
label = Series(Series(Drop(Text("\\label{")), dwsp__), CHARS, Series(Drop(Text("}")), dwsp__))
hypersetup = Series(Series(Drop(Text("\\hypersetup")), dwsp__), param_block)
pdfinfo = Series(Series(Drop(Text("\\pdfinfo")), dwsp__), info_block)
documentclass = Series(Series(Drop(Text("\\documentclass")), dwsp__), Option(config), block)
cline = Series(Series(Drop(Text("\\cline{")), dwsp__), INTEGER, Series(Drop(Text("-")), dwsp__), INTEGER, Series(Drop(Text("}")), dwsp__))
hline = Series(Text("\\hline"), dwsp__)
TBCFG_VALUE = Series(RegExp('[lcr|]+'), dwsp__)
cfg_celltype = RegExp('[lcrp]')
caption = Series(Series(Drop(Text("\\caption")), dwsp__), block)
includegraphics = Series(Series(Drop(Text("\\includegraphics")), dwsp__), Option(config), block)
footnote = Series(Series(Drop(Text("\\footnote")), dwsp__), block_of_paragraphs)
citep = Series(Alternative(Series(Drop(Text("\\citep")), dwsp__), Series(Drop(Text("\\cite")), dwsp__)), Option(config), block)
citet = Series(Series(Drop(Text("\\citet")), dwsp__), Option(config), block)
begin_generic_block = Series(Lookbehind(_LB), begin_environment, LFF)
generic_command = Alternative(Series(NegativeLookahead(no_command), CMDNAME, Option(Series(Option(Series(dwsp__, config)), OneOrMore(Series(dwsp__, block))))), Series(Drop(Text("{")), CMDNAME, _block_content, Drop(Text("}")), mandatory=3))
text_command = Alternative(TXTCOMMAND, ESCAPED, BRACKETS)
tabular_config = Series(Series(Drop(Text("{")), dwsp__), TBCFG_VALUE, Series(Drop(Text("}")), dwsp__), mandatory=2)
end_generic_block = Series(Lookbehind(_LB), end_environment, LFF)
cfg_unit = Series(Drop(Text("{")), number, UNIT, Drop(Text("}")))
cfg_separator = Text("|")
inline_math = Series(Drop(RegExp('\\$')), Drop(RegExp('[^$]*')), Drop(RegExp('\\$')), mandatory=2)
blockcmd = Series(BACKSLASH, Alternative(Series(Alternative(Series(Drop(Text("begin{")), dwsp__), Series(Drop(Text("end{")), dwsp__)), Alternative(Series(Drop(Text("enumerate")), dwsp__), Series(Drop(Text("itemize")), dwsp__), Series(Drop(Text("figure")), dwsp__), Series(Drop(Text("quote")), dwsp__), Series(Drop(Text("quotation")), dwsp__), Series(Drop(Text("tabular")), dwsp__)), Series(Drop(Text("}")), dwsp__)), structural, begin_generic_block, end_generic_block))
_block_content = ZeroOrMore(Series(NegativeLookahead(blockcmd), text_element, Option(S)))
end_environment = Series(Drop(RegExp('\\\\end{')), Pop(NAME), Drop(RegExp('}')), mandatory=1)
begin_generic_block = Series(Lookbehind(_LB), begin_environment, LFF)
end_inline_env = Synonym(end_environment)
begin_inline_env = Alternative(Series(NegativeLookbehind(_LB), begin_environment), Series(begin_environment, NegativeLookahead(LFF)))
generic_inline_env = Series(begin_inline_env, dwsp__, paragraph, end_inline_env, mandatory=3)
known_inline_env = Synonym(inline_math)
inline_environment = Alternative(known_inline_env, generic_inline_env)
generic_command = Alternative(Series(NegativeLookahead(no_command), CMDNAME, Option(Series(Option(Series(dwsp__, config)), OneOrMore(Series(dwsp__, block))))), Series(Drop(Text("{")), CMDNAME, _block_content, Drop(Text("}")), mandatory=3))
tabular_config = Series(Series(Drop(Text("{")), dwsp__), OneOrMore(Alternative(Series(cfg_celltype, Option(cfg_unit)), cfg_separator)), Series(Drop(Text("}")), dwsp__), mandatory=2)
heading = Synonym(block)
SubParagraph = Series(Series(Drop(Text("\\subparagraph")), dwsp__), heading, Option(sequence))
frontpages = Synonym(sequence)
SubParagraphs = OneOrMore(Series(Option(_WSPC), SubParagraph))
TBCFG_VALUE = Series(RegExp('[lcr|]+'), dwsp__)
multicolumn = Series(Series(Drop(Text("\\multicolumn")), dwsp__), Series(Drop(Text("{")), dwsp__), INTEGER, Series(Drop(Text("}")), dwsp__), tabular_config, block_of_paragraphs)
known_command = Alternative(citet, citep, footnote, includegraphics, caption, multicolumn, hline, cline, documentclass, pdfinfo, hypersetup)
known_command = Alternative(citet, citep, footnote, includegraphics, caption, multicolumn, hline, cline, documentclass, pdfinfo, hypersetup, label, ref, href, url)
command = Alternative(known_command, text_command, generic_command)
line_element = Alternative(text, inline_environment, command, block)
tabular_cell = ZeroOrMore(Series(line_element, Option(S)))
rb_down = Series(Series(Drop(Text("[")), dwsp__), number, UNIT, dwsp__, Series(Drop(Text("]")), dwsp__))
rb_up = Series(Series(Drop(Text("[")), dwsp__), number, UNIT, dwsp__, Series(Drop(Text("]")), dwsp__))
rb_offset = Series(Series(Drop(Text("{")), dwsp__), number, UNIT, dwsp__, Series(Drop(Text("}")), dwsp__))
raisebox = Series(Series(Drop(Text("\\raisebox")), dwsp__), rb_offset, Option(rb_up), Option(rb_down), block)
tabular_cell = Alternative(Series(raisebox, Option(Alternative(S, _PARSEP))), ZeroOrMore(Series(line_element, Option(Alternative(S, _PARSEP)))))
tabular_row = Series(Alternative(multicolumn, tabular_cell), ZeroOrMore(Series(Series(Drop(Text("&")), dwsp__), Alternative(multicolumn, tabular_cell))), Alternative(Series(Series(Drop(Text("\\\\")), dwsp__), Alternative(hline, ZeroOrMore(cline)), Option(_PARSEP)), Lookahead(Drop(Text("\\end{tabular}")))))
tabular = Series(Series(Drop(Text("\\begin{tabular}")), dwsp__), tabular_config, ZeroOrMore(tabular_row), Series(Drop(Text("\\end{tabular}")), dwsp__), mandatory=3)
verbatim = Series(Series(Drop(Text("\\begin{verbatim}")), dwsp__), sequence, Series(Drop(Text("\\end{verbatim}")), dwsp__), mandatory=2)
quotation = Alternative(Series(Series(Drop(Text("\\begin{quotation}")), dwsp__), sequence, Series(Drop(Text("\\end{quotation}")), dwsp__), mandatory=2), Series(Series(Drop(Text("\\begin{quote}")), dwsp__), sequence, Series(Drop(Text("\\end{quote}")), dwsp__), mandatory=2))
figure = Series(Series(Drop(Text("\\begin{figure}")), dwsp__), sequence, Series(Drop(Text("\\end{figure}")), dwsp__), mandatory=2)
item = Series(Series(Drop(Text("\\item")), dwsp__), sequence)
enumerate = Series(Series(Drop(Text("\\begin{enumerate}")), dwsp__), Option(_WSPC), ZeroOrMore(item), Series(Drop(Text("\\end{enumerate}")), dwsp__), mandatory=3)
itemize = Series(Series(Drop(Text("\\begin{itemize}")), dwsp__), Option(_WSPC), ZeroOrMore(item), Series(Drop(Text("\\end{itemize}")), dwsp__), mandatory=3)
tabular_row = Series(Alternative(multicolumn, tabular_cell), ZeroOrMore(Series(Series(Drop(Text("&")), dwsp__), Alternative(multicolumn, tabular_cell))), Series(Drop(Text("\\\\")), dwsp__), Alternative(hline, ZeroOrMore(cline)))
tabular = Series(Series(Drop(Text("\\begin{tabular}")), dwsp__), tabular_config, ZeroOrMore(tabular_row), Series(Drop(Text("\\end{tabular}")), dwsp__), mandatory=3)
enumerate = Series(Series(Drop(Text("\\begin{enumerate}")), dwsp__), Option(_WSPC), ZeroOrMore(Alternative(command, item)), Series(Drop(Text("\\end{enumerate}")), dwsp__), mandatory=3)
itemize = Series(Series(Drop(Text("\\begin{itemize}")), dwsp__), Option(_WSPC), ZeroOrMore(Alternative(command, item)), Series(Drop(Text("\\end{itemize}")), dwsp__), mandatory=3)
end_generic_block = Series(Lookbehind(_LB), end_environment, LFF)
blockcmd = Series(BACKSLASH, Alternative(Series(Alternative(Series(Drop(Text("begin{")), dwsp__), Series(Drop(Text("end{")), dwsp__)), Alternative(Series(Drop(Text("enumerate")), dwsp__), Series(Drop(Text("itemize")), dwsp__), Series(Drop(Text("figure")), dwsp__), Series(Drop(Text("quote")), dwsp__), Series(Drop(Text("quotation")), dwsp__), Series(Drop(Text("tabular")), dwsp__)), Series(Drop(Text("}")), dwsp__)), structural, begin_generic_block, end_generic_block))
generic_block = Series(begin_generic_block, sequence, end_generic_block, mandatory=2)
known_environment = Alternative(itemize, enumerate, figure, tabular, quotation, verbatim)
preamble = OneOrMore(Series(Option(_WSPC), command))
......@@ -225,8 +244,7 @@ def get_grammar() -> LaTeXGrammar:
elif get_config_value('history_tracking'):
set_tracer(grammar, trace_history)
return grammar
def parse_LaTeX(document, start_parser = "root_parser__", *, complete_match=True):
return get_grammar()(document, start_parser, complete_match)
......@@ -265,10 +283,9 @@ flatten_structure = flatten(lambda context: is_one_of(
def transform_generic_command(context: List[Node]):
node = context[-1]
assert node.children[0].tag_name == 'CMDNAME'
node.tag_name = 'cmd_' + node.children[0].content.lstrip('\\')
node.result = node.children[1:]
pass
if node.children[0].tag_name == 'CMDNAME':
node.tag_name = 'cmd_' + node.children[0].content.lstrip('\\')
node.result = node.children[1:]
def transform_generic_block(context: List[Node]):
......@@ -330,6 +347,7 @@ LaTeX_AST_transformation_table = {
"tabular_cell": [flatten, remove_whitespace],
"multicolumn": [remove_tokens('{', '}')],
"hline": [remove_whitespace, reduce_single_child],
"ref, label, pageref, url": reduce_single_child,
"sequence": [flatten],
"paragraph": [flatten, strip(is_one_of({'S'}))],
"text_element": replace_by_single_child,
......
......@@ -151,3 +151,4 @@ M1: "title"
M2: "metadata:title"
M3: "metadata.title"
M4: "metadata-title"
......@@ -41,6 +41,8 @@
\end{generic}
"""
M12: """\ { }"""
[fail:paragraph]
20: Paragraphs are separated by gaps.
......
......@@ -19,6 +19,13 @@
a known block element
\end{quote}
M4: """\begin{eqnarray*}
x - y & > & z - w \\
a(x-y) & > & a(z-w) \\
a(x-y) + b - b & > & a(z-w) + b - b \\
(ax + b) - (ay + b) & > & (az + b) - (aw + b) \\
u(x) - u(y) & > & u(z) - u(w)
\end{eqnarray*}"""
[fail:block_environment]
10: """\begin{generic}inline environment\end{generic}
......@@ -132,3 +139,17 @@
\end{itemize}
as a separate paragraph
\end{enumerate}
5: \begin{enumerate}
\label{Ordnungsaxiome}
\item {\em Antisymmetrie:} Wenn $x \succ y$, dann nicht $y \succ x$ und auch
nicht $x \sim y$
\item {\em Zusammenhang:} Für jedes Paar $x, y$ aus der
Menge der möglichen Resultate gilt entweder $x \succ y$ oder $y \succ x$
oder $x \sim y$
\item {\em Transitivität:} Wenn $x \succ y$ und $y \succ z$, dann auch $x
\succ z$. (In analoger Weise gilt: $x \sim y \wedge y \sim z \Rightarrow x
\sim z$, sowie weiterhin: $x \sim y \wedge y \succ z \Rightarrow x \succ z$ und:
$x \succ y \wedge y \sim z \Rightarrow x \succ z$)
\end{enumerate}
......@@ -44,7 +44,7 @@
Some text for chapter 2
[match:preamble]
1*: """\usepackage{ifpdf}
1: """\usepackage{ifpdf}
\ifpdf
\usepackage{xmpincl}
\usepackage[pdftex]{hyperref}
......@@ -69,4 +69,74 @@
/Keywords (Computer Simulations, Validation of Simulations)
}
\fi
"""
\ No newline at end of file
"""
[match:frontpages]
M1: """
%\title{Vorlesung: Grundlagen des Entscheidens I}
%\author{Eckhart Arnold}
%\date{Stand: 6. Juli 2009}
%\maketitle
\begin{titlepage}
\begin{center}
\ { }
\vspace{0.5cm}
{\Large Vorlesung: Grundlagen des Entscheidens I}
\vspace{0.75cm}
Sommersemester 2009
\vspace{0.5cm}
Stand: 6. Juli 2009 \\~\\
Hinweis: Das Skript wurde bisher noch wenig Korrektur gelesen und das letzte Kapitel
fehlt leider ganz. Es enthält jedem Menge Tippfehler und auch vereinzelte sachliche Fehler
können nicht ganz ausgeschlossen werden. Trotzdem: Viel Spaß beim Durcharbeiten!
\vspace{0.5cm}
Dozent: Dr. Eckhart Arnold
\vspace{1cm}
\includegraphics[width=6cm]{Grafiken/pe_logo.eps}
\vspace{0.25cm}
{\Large Universität Bayreuth}
\vspace{1.75cm}
\includegraphics[width=2.5cm]{Grafiken/CC-BY-SA.eps}
\vspace{0.5cm}
\begin{small}
Dieses Material ist frei zugänglich und darf unter den Bedingungen der
Creative-Commons-Lizenz BY-SA 4.0 weiter gegeben werden.
\vspace{0.5cm}
Die Klausel BY-SA besagt: Der Name des Autors muss bei abgeleiteten Werken
genannt werden, und abgeleitete Werke oder Kopien müssen ebenfalls unter
dieser Lizenz weitergegeben werden.
\end{small}
\end{center}
\end{titlepage}
\tableofcontents
\newpage
\setlength{\marginparwidth}{2cm}
"""
......@@ -46,3 +46,61 @@
15: """\newcommand{\marginline}{\marginnote}"""
16: """\renewcommand{\marginfont}{\scriptsize}"""
17: """\ """
18: """\parbox{5cm}{
\begin{tabular}{c|c|}
& $S_1$ \\ \cline{1-2}
$A_1$ & $r_1$ \\ \cline{1-2}
$A_2$ & $r_2$ \\ \cline{1-2}
\end{tabular}}"""
M19: \label{name}
M20: \ref{name}
M21: \pageref{name}
[match:protocol]
M1: "https://"
M2: "http://"
[fail:protocol]
F1: "https:"
F2: "http: //"
F3: "http:/"
[match:path]
M1: "badw.de/"
M2: "www.badw.de/"
M3: "badw/"
[fail:path]
F2: "https://badw.de"
[match:target]
M1: "suche.html?id=448&tx_kesearch_pi1%5Bsword%5D=Fraunhofer&tx_kesearch_pi1"
M2: "suche.html?id=448&tx_kesearch_pi1[sword]=Fraunhofer&tx_kesearch_pi1"
M3: "ziel.html"
M4: "ziel"
M5: "ibi_1"
[match:urlstring]
M1: "https://badw.de/verzeichnis/ziel"
M2: "badw.de/verzeichnis/ziel"
M3: "badw.de/ziel"
M4: "verzeichnis/ziel"
M5: "ziel"
M6: "hauptverzeichnis/unterverzeichnis/zielseite.html"
M7: "ziel.html"
M8: "https://www.badw.de"
M9: "https://publikationen.badw.de"
M10: "https://archive.org/details/culturamedioeval01roncuoft/page/312/mode/2up?q=sacrilegare#xzy"
M11: "https://epub.ub.uni-muenchen.de/17286/1/4Cod.ms.321_Sept.2013.pdf#page=36"
M12: "https://www.dmgh.de/mgh_capit_1/index.htm#page/189/mode/1up"
M13: "https://ccfr.bnf.fr/portailccfr/ark:/06871/004D52013650"
M14: "https://daten.digitale-sammlungen.de/bsb00000756/images/index.html?id=00000756&groesser=&fip=193.174.98.30&no=&seite=17"
M15: """http://digital.bib-bvb.de/view/bvbmets/viewer.0.6.4.jsp?folder_id=0&dvs=1602227306084~698&pid=16949465&locale=de&usePid1=true&usePid2=true"""
M16: """https://nbn-resolving.org/urn:nbn:de:bvb:355-ubr05184-8#0011"""
[fail:urlstring]
F5: "http:/badw.de/verzeichnis/ziel"
[ast:urlstring]
M11: '(urlstring (protocol "https://") (path "epub.ub.uni-muenchen.de/") (path "17286/") (path "1/") (target "4Cod.ms.321_Sept.2013.pdf#page=36"))'
[match:raisebox]
M1: "\raisebox{1.5ex}[-1.5ex]{Nutzenskala {\bf u()}}"
[match:cfg_unit]
M1: "{1cm}"
[match:tabular_config]
M1: """{c|p{1cm}|p{1cm}|p{1cm}|cc|p{1cm}|p{1cm}|p{1cm}|}"""
[match:tabular]
1 : \begin{tabular}{c|c|}
& $S_1$ \\ \cline{1-2}
......@@ -18,6 +28,44 @@
\cline{2-4} \cline{7-9}
\end{tabular}
M3: """\begin{tabular}{c|ccc|c|ccc|}
& $S_1 \wedge T_1$ & $\cdots$ & $S_n \wedge T_1$ & $\cdots$
& $S_1 \wedge T_l$ & $\cdots$ & $S_n \wedge T_l$
\\ \cline{1-8}
$X_1 \wedge A_1$ & $r_{11}$ & $\cdots$ & $r_{1n}$ & $\cdots$
& $r_{11}$ & $\cdots$ & $r_{1n}$ \\
$\vdots$ & $\vdots$ & $\ddots$ & $\vdots$ & $\ddots$
& $\vdots$ & $\ddots$ & $\vdots$\\
$X_1 \wedge A_m$ & $r_{m1}$ & $\cdots$ & $r_{mn}$ & $\cdots$
& $r_{m1}$ & $\cdots$ & $r_{mn}$\\ \cline{1-8}
$X_2 \wedge B_1$ & $u_{11}$ & $\cdots$ & $u_{11}$ & $\cdots$
& $u_{1l}$ & $\cdots$ & $u_{1l}$\\
$\vdots$ & $\vdots$ & $\ddots$ & $\vdots$ & $\ddots$
& $\vdots$ & $\ddots$ & $\vdots$\\
$X_2 \wedge B_h$ & $u_{h1}$ & $\cdots$ & $u_{h1}$ & $\cdots$
& $u_{hl}$ & $\cdots$ & $u_{hl}$\\\cline{1-8}
\end{tabular}"""
M4: """\begin{tabular}{c|p{1cm}|p{1cm}|p{1cm}|cc|p{1cm}|p{1cm}|p{1cm}|}
\multicolumn{1}{c}{} & \multicolumn{3}{c}{Entscheidungstabelle} &
\multicolumn{2}{c}{} & \multicolumn{3}{c}{"`Bedauerns"'-tabelle}
\\ \cline{2-4} \cline{7-9}
$A_1$ & 0 & 10 & 4 & & $A_1$ & 5 & 0 & 6 \\
\cline{2-4} \cline{7-9}
$A_2$ & 5 & 2 & 10 & & $A_2$ & 0 & 8 & 0 \\
\cline{2-4} \cline{7-9}
\end{tabular}"""
M5: """\begin{tabular}{cc|c|cccc|c|c}
& x & y & z & & & x & y & z \\ \cline{2-4} \cline{7-9}
\raisebox{1.5ex}[-1.5ex]{Nutzenskala {\bf u()}}
& 1 & 2 & 3 & &
\raisebox{1.5ex}[-1.5ex]{Nutzenskala {\bf v()}}
& 1 & 4 & 9
\end{tabular}"""
[match:figure]
1 : \begin{figure}
\doublespacing
......
[match:paragraph]
M1: """\ { }"""
[match:command]
[match:frontpages]
M1: """
%\title{Vorlesung: Grundlagen des Entscheidens I}
%\author{Eckhart Arnold}
%\date{Stand: 6. Juli 2009}
%\maketitle
\begin{titlepage}
\begin{center}
\ { }
\vspace{0.5cm}
{\Large Vorlesung: Grundlagen des Entscheidens I}
\vspace{0.75cm}
Sommersemester 2009
\vspace{0.5cm}
Stand: 6. Juli 2009 \\~\\
Hinweis: Das Skript wurde bisher noch wenig Korrektur gelesen und das letzte Kapitel
fehlt leider ganz. Es enthält jedem Menge Tippfehler und auch vereinzelte sachliche Fehler
können nicht ganz ausgeschlossen werden. Trotzdem: Viel Spaß beim Durcharbeiten!
\vspace{0.5cm}
Dozent: Dr. Eckhart Arnold
\vspace{1cm}
\includegraphics[width=6cm]{Grafiken/pe_logo.eps}
\vspace{0.25cm}
{\Large Universität Bayreuth}
\vspace{1.75cm}
\includegraphics[width=2.5cm]{Grafiken/CC-BY-SA.eps}