/usr/share/mozart/doc/demo/node15.html is in mozart-doc 1.4.0-8ubuntu1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE>The interface to LaTeX: Latex.oz</TITLE><LINK href="ozdoc.css" rel="stylesheet" type="text/css"></HEAD><BODY><TABLE align="center" border="0" cellpadding="6" cellspacing="6" class="nav"><TR bgcolor="#DDDDDD"><TD><A href="node14.html#code.college.graphics"><< Prev</A></TD><TD><A href="college.html">- Up -</A></TD></TR></TABLE><DIV class="unnumbered" id="code.college.latex"><H3><A name="code.college.latex">The interface to LaTeX: <CODE>Latex.oz</CODE></A></H3><P class="margin"><A href="College/Latex.oz">Source File</A></P><P> </P><BLOCKQUOTE><PRE><SPAN class="keyword">functor</SPAN> <BR> <BR><SPAN class="keyword">export</SPAN> <BR> <BR> LaTeX<BR> <BR><SPAN class="keyword">import</SPAN> <BR> <BR> Open<BR> OS<BR> <BR> Common(monday: Monday<BR> tuesday: Tuesday<BR> wednesday: Wednesday<BR> thursday: Thursday<BR> friday: Friday<BR> quartersPerDay: QuartersPerDay<BR> quartersPerHour: QuartersPerHour)<BR> <BR> <BR><SPAN class="keyword">define</SPAN> <BR> <BR> %% <SPAN class="comment">maps starting time to LaTeX tabular entry in German<BR></SPAN> <SPAN class="keyword">fun</SPAN><SPAN class="variablename"> </SPAN>{<SPAN class="functionname">StartToVS</SPAN> Start}<BR> <SPAN class="keyword">cond</SPAN> Start<SPAN class="keyword">::</SPAN>Monday <SPAN class="keyword">then</SPAN> <SPAN class="string">"Montag"</SPAN> <BR> <SPAN class="keyword">[]</SPAN> Start<SPAN class="keyword">::</SPAN>Tuesday <SPAN class="keyword">then</SPAN> <SPAN class="string">"Dienstag"</SPAN> <BR> <SPAN class="keyword">[]</SPAN> Start<SPAN class="keyword">::</SPAN>Wednesday <SPAN class="keyword">then</SPAN> <SPAN class="string">"Mittwoch"</SPAN> <BR> <SPAN class="keyword">[]</SPAN> Start<SPAN class="keyword">::</SPAN>Thursday <SPAN class="keyword">then</SPAN> <SPAN class="string">"Donnerstag"</SPAN> <BR> <SPAN class="keyword">[]</SPAN> Start<SPAN class="keyword">::</SPAN>Friday <SPAN class="keyword">then</SPAN> <SPAN class="string">"Freitag"</SPAN> <BR> <SPAN class="keyword">end</SPAN> <BR> <SPAN class="keyword">#</SPAN> <BR> <SPAN class="string">" & "</SPAN> <BR> <SPAN class="keyword">#</SPAN> <BR> (((Start<SPAN class="keyword">-</SPAN>1) <SPAN class="keyword">mod</SPAN> (QuartersPerDay))<SPAN class="keyword">+</SPAN>1) <SPAN class="keyword">div</SPAN> QuartersPerHour <SPAN class="keyword">+</SPAN> 8<BR> <SPAN class="keyword">#</SPAN> <BR> <SPAN class="string">" & Uhr & "</SPAN> <BR> <SPAN class="keyword">#</SPAN> <BR> ((Start) <SPAN class="keyword">mod</SPAN> QuartersPerHour) <SPAN class="keyword">*</SPAN> 15<BR> <SPAN class="keyword">end</SPAN> <BR> <BR> %% <SPAN class="comment">Ordering according to semesters<BR></SPAN> <SPAN class="keyword">local</SPAN> <BR> <SPAN class="keyword">proc</SPAN><SPAN class="variablename"> </SPAN>{<SPAN class="functionname">TakeDigits</SPAN> String Front Back}<BR> {List<SPAN class="keyword">.</SPAN>takeDropWhile String Char<SPAN class="keyword">.</SPAN>isDigit Front Back}<BR> <SPAN class="keyword">end</SPAN> <BR> <SPAN class="keyword">fun</SPAN><SPAN class="variablename"> </SPAN>{<SPAN class="functionname">Split</SPAN> S}<BR> <SPAN class="keyword">case</SPAN> S<BR> <SPAN class="keyword">of</SPAN> nil <SPAN class="keyword">then</SPAN> nil<BR> <SPAN class="keyword">else</SPAN> Back <SPAN class="keyword">in</SPAN> <BR> <SPAN class="keyword">case</SPAN> S<SPAN class="keyword">.</SPAN>1<BR> <SPAN class="keyword">of</SPAN> <SPAN class="string">&M</SPAN> <SPAN class="keyword">then</SPAN> Back = S<SPAN class="keyword">.</SPAN>2 10 <BR> <SPAN class="keyword">[]</SPAN> <SPAN class="string">&F</SPAN> <SPAN class="keyword">then</SPAN> Back = S<SPAN class="keyword">.</SPAN>2 12<BR> <SPAN class="keyword">else</SPAN> {String<SPAN class="keyword">.</SPAN>toInt {TakeDigits S $ Back}}<BR> <SPAN class="keyword">end</SPAN> <BR> <SPAN class="keyword">|</SPAN>{Split {List<SPAN class="keyword">.</SPAN>dropWhile Back Char<SPAN class="keyword">.</SPAN>isPunct}}<BR> <SPAN class="keyword">end</SPAN> <BR> <SPAN class="keyword">end</SPAN> <BR> <SPAN class="keyword">fun</SPAN><SPAN class="variablename"> </SPAN>{<SPAN class="functionname">Compare</SPAN> X1<SPAN class="keyword">|</SPAN>X2<SPAN class="keyword">|</SPAN>Xr Y1<SPAN class="keyword">|</SPAN>Y2<SPAN class="keyword">|</SPAN>Yr}<BR> X1 <SPAN class="keyword"><</SPAN> Y1 <SPAN class="keyword">orelse</SPAN> <BR> (X1 <SPAN class="keyword">==</SPAN> Y1<BR> <SPAN class="keyword">andthen</SPAN> <BR> (X2 <SPAN class="keyword"><</SPAN> Y2 <SPAN class="keyword">orelse</SPAN> (X2 <SPAN class="keyword">==</SPAN> Y2 <SPAN class="keyword">andthen</SPAN> (Xr <SPAN class="keyword">==</SPAN> Yr <SPAN class="keyword">orelse</SPAN> Xr<SPAN class="keyword">.</SPAN>1 <SPAN class="keyword">=<</SPAN> Yr<SPAN class="keyword">.</SPAN>1))))<BR> <SPAN class="keyword">end</SPAN> <BR> <SPAN class="keyword">in</SPAN> <BR> <SPAN class="keyword">fun</SPAN><SPAN class="variablename"> </SPAN>{<SPAN class="functionname">NameOrdering</SPAN> X Y}<BR> {Compare {Split {AtomToString X<SPAN class="keyword">.</SPAN>name}} {Split {AtomToString Y<SPAN class="keyword">.</SPAN>name}}}<BR> <SPAN class="keyword">end</SPAN> <BR> <SPAN class="keyword">end</SPAN> <BR> <BR> %% <SPAN class="comment">Ordering according to start time<BR></SPAN> <SPAN class="keyword">fun</SPAN><SPAN class="variablename"> </SPAN>{<SPAN class="functionname">TimeOrdering</SPAN> X Y}<BR> X<SPAN class="keyword">.</SPAN>start <SPAN class="keyword">=<</SPAN> Y<SPAN class="keyword">.</SPAN>start<BR> <SPAN class="keyword">end</SPAN> <BR> <BR> %% <SPAN class="comment">Ordering according to professor<BR></SPAN> <SPAN class="keyword">fun</SPAN><SPAN class="variablename"> </SPAN>{<SPAN class="functionname">ProfessorOrdering</SPAN> X Y}<BR> X<SPAN class="keyword">.</SPAN>professor <SPAN class="keyword">=<</SPAN> Y<SPAN class="keyword">.</SPAN>professor<BR> <SPAN class="keyword">end</SPAN> <BR> <BR> %% <SPAN class="comment">Number of lines on page of document<BR></SPAN> LinesOnPage = 30<BR> <BR> %% <SPAN class="comment">Begin of tabular environment<BR></SPAN> BeginTab = <SPAN class="string">"\\begin{tabular}{lllrlr}\n"</SPAN> <BR> <BR> %% <SPAN class="comment">End of tabular environment<BR></SPAN> EndTab = <SPAN class="string">"\\end{tabular}\n"</SPAN> <BR> <BR> %% <SPAN class="comment">LecturesToLaTeX transforms list of lectures to LaTeX format<BR></SPAN> <SPAN class="keyword">fun</SPAN><SPAN class="variablename"> </SPAN>{<SPAN class="functionname">LecturesToLaTeX</SPAN> Lectures}<BR> BeginTab<BR> <SPAN class="keyword">#</SPAN> <BR> {FoldL Lectures<BR> <SPAN class="keyword">fun</SPAN><SPAN class="variablename"> </SPAN>{<SPAN class="functionname">$</SPAN> N<SPAN class="keyword">#</SPAN>In Lecture}<BR> N<SPAN class="keyword">+</SPAN>1<BR> <SPAN class="keyword">#</SPAN> <BR> (In<BR> <SPAN class="keyword">#if</SPAN> N <SPAN class="keyword">mod</SPAN> LinesOnPage <SPAN class="keyword">==</SPAN> 0<BR> <SPAN class="keyword">then</SPAN> EndTab <SPAN class="keyword">#</SPAN> <SPAN class="string">"\\newpage\n"</SPAN> <SPAN class="keyword">#</SPAN> BeginTab<BR> <SPAN class="keyword">else</SPAN> <SPAN class="string">""</SPAN> <BR> <SPAN class="keyword">end</SPAN> <BR> <SPAN class="keyword">#</SPAN>Lecture<SPAN class="keyword">.</SPAN>name<BR> <SPAN class="keyword">#</SPAN><SPAN class="string">" & "</SPAN> <BR> <SPAN class="keyword">#</SPAN>Lecture<SPAN class="keyword">.</SPAN>professor<BR> <SPAN class="keyword">#</SPAN><SPAN class="string">" & "</SPAN> <BR> <SPAN class="keyword">#</SPAN>{StartToVS Lecture<SPAN class="keyword">.</SPAN>start}<BR> <SPAN class="keyword">#</SPAN><SPAN class="string">"\\\\\n"</SPAN>)<BR> <SPAN class="keyword">end</SPAN> <BR> 1<SPAN class="keyword">#</SPAN><SPAN class="string">""</SPAN>}<SPAN class="keyword">.</SPAN>2<BR> <SPAN class="keyword">#</SPAN> <BR> EndTab<BR> <SPAN class="keyword">end</SPAN> <BR> <BR> %% <SPAN class="comment">WriteSchedule writes a solution to file FileName<BR></SPAN> <SPAN class="keyword">proc</SPAN><SPAN class="variablename"> </SPAN>{<SPAN class="functionname">WriteSchedule</SPAN> Lectures FileName Ordering}<BR> OO = {New Open<SPAN class="keyword">.</SPAN>file init(name:FileName<BR> flags: [write <SPAN class="string">'create'</SPAN> truncate])}<BR> <SPAN class="keyword">in</SPAN> <BR> {OO write(vs:{LecturesToLaTeX<BR> {Sort<BR> {List<SPAN class="keyword">.</SPAN>flatten Lectures} Ordering}})}<BR> {OO close}<BR> <SPAN class="keyword">end</SPAN> <BR> <BR> Name = {OS<SPAN class="keyword">.</SPAN>tmpnam}<BR> SourceName = <SPAN class="keyword">!</SPAN>Name<SPAN class="keyword">#</SPAN><SPAN class="string">".tex"</SPAN> <BR> DVIName = <SPAN class="keyword">!</SPAN>Name<SPAN class="keyword">#</SPAN><SPAN class="string">".dvi"</SPAN> <BR> NameFileName = {OS<SPAN class="keyword">.</SPAN>tmpnam}<SPAN class="keyword">#</SPAN><SPAN class="string">".tex"</SPAN> <BR> ProfFileName = {OS<SPAN class="keyword">.</SPAN>tmpnam}<SPAN class="keyword">#</SPAN><SPAN class="string">".tex"</SPAN> <BR> TimeFileName = {OS<SPAN class="keyword">.</SPAN>tmpnam}<SPAN class="keyword">#</SPAN><SPAN class="string">".tex"</SPAN> <BR> <BR> LaTeXSource= <SPAN class="string">'\\documentstyle[12pt]{article}\\begin{document}'</SPAN> <BR> <SPAN class="keyword">#</SPAN><SPAN class="string">'\\section*{Vorlesungsplan der Katholischen Hochschule f\\"ur Soziale Arbeit, Saarbr\\"ucken}'</SPAN> <BR> <SPAN class="keyword">#</SPAN><SPAN class="string">'\\subsection*{Nach Professoren alphabetisch geordnet}'</SPAN> <BR> <SPAN class="keyword">#</SPAN><SPAN class="string">'\\input '</SPAN><SPAN class="keyword">#!</SPAN>ProfFileName<BR> <SPAN class="keyword">#</SPAN><SPAN class="string">'\\newpage \\subsection*{Nach Vorlesungen geordnet}'</SPAN> <BR> <SPAN class="keyword">#</SPAN><SPAN class="string">'\\input '</SPAN><SPAN class="keyword">#!</SPAN>NameFileName<BR> <SPAN class="keyword">#</SPAN><SPAN class="string">'\\newpage \\subsection*{Nach Anfangszeiten geordnet}'</SPAN> <BR> <SPAN class="keyword">#</SPAN><SPAN class="string">'\\input '</SPAN><SPAN class="keyword">#!</SPAN>TimeFileName<BR> <SPAN class="keyword">#</SPAN><SPAN class="string">'\\end{document}'</SPAN> <BR> <BR> <SPAN class="keyword">local</SPAN> <BR> OO = {New Open<SPAN class="keyword">.</SPAN>file init(name:SourceName<BR> flags:[read write <SPAN class="string">'create'</SPAN>])}<BR> <SPAN class="keyword">in</SPAN> <BR> {OO write(vs:LaTeXSource)}<BR> <SPAN class="keyword">end</SPAN> <BR> <BR> %% <SPAN class="comment">Write computes the first solution<BR></SPAN> %% <SPAN class="comment">and writes three different listings to files<BR></SPAN> <BR> <SPAN class="keyword">proc</SPAN><SPAN class="variablename"> </SPAN>{<SPAN class="functionname">LaTeX</SPAN> What Solution}<BR> {Wait Solution}<BR> {WriteSchedule Solution ProfFileName ProfessorOrdering}<BR> {WriteSchedule Solution TimeFileName TimeOrdering}<BR> {WriteSchedule Solution NameFileName NameOrdering}<BR> Flag={OS<SPAN class="keyword">.</SPAN>system <SPAN class="string">'cd /tmp; latex '</SPAN><SPAN class="keyword">#</SPAN>SourceName}<BR> <SPAN class="keyword">in</SPAN> <BR> {Wait Flag}<BR> <SPAN class="keyword">case</SPAN> What<BR> <SPAN class="keyword">of</SPAN> show <SPAN class="keyword">then</SPAN> {OS<SPAN class="keyword">.</SPAN>system <SPAN class="string">'xdvi '</SPAN><SPAN class="keyword">#</SPAN>DVIName _}<BR> <SPAN class="keyword">[]</SPAN> print <SPAN class="keyword">then</SPAN> {OS<SPAN class="keyword">.</SPAN>system <SPAN class="string">'dvips '</SPAN><SPAN class="keyword">#</SPAN>DVIName _}<BR> <SPAN class="keyword">end</SPAN> <BR> <SPAN class="keyword">end</SPAN> <BR> <BR><SPAN class="keyword">end</SPAN> <BR></PRE></BLOCKQUOTE><P></P></DIV><TABLE align="center" border="0" cellpadding="6" cellspacing="6" class="nav"><TR bgcolor="#DDDDDD"><TD><A href="node14.html#code.college.graphics"><< Prev</A></TD><TD><A href="college.html">- Up -</A></TD></TR></TABLE><HR><ADDRESS><SPAN class="version">Version 1.4.0 (20110908185330)</SPAN></ADDRESS></BODY></HTML>
|