X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mDoc.git/blobdiff_plain/5ffb04ae1044c81f6982fa22e1bc1b05ffa5abce..cc019cff99afcf7a93de4bca22c19f996aa07937:/python/mDoc/tpl/latex.tpl diff --git a/python/mDoc/tpl/latex.tpl b/python/mDoc/tpl/latex.tpl index 266d650..8068863 100644 --- a/python/mDoc/tpl/latex.tpl +++ b/python/mDoc/tpl/latex.tpl @@ -1,6 +1,75 @@ - + + + expected in : "+elem) +cols = int(attrs["cols"]) +colsep = "" +if attrs["colsep"] == "1": + colsep = "|" +rowsep = False +if attrs["rowsep"] == "1": + rowsep = True +align = "r" +if attrs["align"] == "left": + align = "l" +align_arr = cols*[align] +(ctl,elem, value, attrs) = source.extractElement(XMLE.EC_BEG) # searches tbody +while ctl != XMLE.EC_END: + + if elem == "colspec": # colspec found + if "colwidth" in attrs: + align_arr[int(attrs["colnum"])-1] = "p{"+attrs["colwidth"]+"}" + + if elem == "tbody": # tbody found + out += r"\begin{tabular}{" + tmp_colsep = "" + for i in range(cols): + out += tmp_colsep + align_arr[i] + tmp_colsep = colsep + out += "}\n" + (ctl1,elem, value, attrs) = source.extractElement(XMLE.EC_BEG) # reads row + while ctl1 != XMLE.EC_END: + if elem != "row": + raise RuntimeError("Only expected in : "+elem) + (ctl2,elem, value,attrs) = source.extractElement(XMLE.EC_BEG) # reads entry + entry_sep = "" + while ctl2 != XMLE.EC_END: + if not value: + value = "" + if elem != "entry": + raise RuntimeError("Only expected in : "+elem) + # check for further elems + (ctl3,elem,value3,attrs3) = source.extractElement(XMLE.EC_BEG) + line_sep = "" + while ctl3 != XMLE.EC_END: + if elem != "line": # only lines expected + raise RuntimeError("Only expected in + + + + + + + +
testdata @@ -15,9 +84,9 @@ \geometry{a4paper,left=25mm,right=20mm, top=33mm, bottom=30mm} \renewcommand{\familydefault}{\sfdefault} +\renewcommand{\arraystretch}{1.4} \author{Michael J.M. Wagner} -\date{\vspace{-6ex}} \CenterWallPaper{1}{wagner_tech_briefbogen_blau_fs1.pdf} @@ -25,9 +94,8 @@ ]]> - <![CDATA[\title{]]> - - <title position="last"><![CDATA[}]]> + + <pubdate pre="\date{" post="}"/> </articleinfo> <articleinfo position="last"> <![CDATA[ @@ -37,7 +105,17 @@ \maketitle ]]> </articleinfo> +<section pre="\section{"> + <title post="}"/> +</section> </article> +<article position="last"> +<![CDATA[ +\end{document} + +]]> +</article> + </hierarchical> </mdoc>