This file is indexed.

/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">&lt;&lt; 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>&nbsp;<BR>&nbsp;<BR><SPAN class="keyword">export</SPAN>&nbsp;<BR>&nbsp;<BR>&nbsp;&nbsp;&nbsp;LaTeX<BR>&nbsp;<BR><SPAN class="keyword">import</SPAN>&nbsp;<BR>&nbsp;<BR>&nbsp;&nbsp;&nbsp;Open<BR>&nbsp;&nbsp;&nbsp;OS<BR>&nbsp;&nbsp;&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;Common(monday:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Monday<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;tuesday:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Tuesday<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;wednesday:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Wednesday<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;thursday:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Thursday<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;friday:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Friday<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;quartersPerDay:&nbsp;&nbsp;QuartersPerDay<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;quartersPerHour:&nbsp;QuartersPerHour)<BR>&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;<BR><SPAN class="keyword">define</SPAN>&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;%%&nbsp;<SPAN class="comment">maps&nbsp;starting&nbsp;time&nbsp;to&nbsp;LaTeX&nbsp;tabular&nbsp;entry&nbsp;in&nbsp;German<BR></SPAN>&nbsp;&nbsp;&nbsp;<SPAN class="keyword">fun</SPAN><SPAN class="variablename">&nbsp;</SPAN>{<SPAN class="functionname">StartToVS</SPAN>&nbsp;Start}<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN class="keyword">cond</SPAN>&nbsp;Start<SPAN class="keyword">::</SPAN>Monday&nbsp;&nbsp;<SPAN class="keyword">then</SPAN>&nbsp;<SPAN class="string">&quot;Montag&quot;</SPAN>&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN class="keyword">[]</SPAN>&nbsp;Start<SPAN class="keyword">::</SPAN>Tuesday&nbsp;&nbsp;&nbsp;<SPAN class="keyword">then</SPAN>&nbsp;<SPAN class="string">&quot;Dienstag&quot;</SPAN>&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN class="keyword">[]</SPAN>&nbsp;Start<SPAN class="keyword">::</SPAN>Wednesday&nbsp;<SPAN class="keyword">then</SPAN>&nbsp;<SPAN class="string">&quot;Mittwoch&quot;</SPAN>&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN class="keyword">[]</SPAN>&nbsp;Start<SPAN class="keyword">::</SPAN>Thursday&nbsp;&nbsp;<SPAN class="keyword">then</SPAN>&nbsp;<SPAN class="string">&quot;Donnerstag&quot;</SPAN>&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN class="keyword">[]</SPAN>&nbsp;Start<SPAN class="keyword">::</SPAN>Friday&nbsp;&nbsp;&nbsp;&nbsp;<SPAN class="keyword">then</SPAN>&nbsp;<SPAN class="string">&quot;Freitag&quot;</SPAN>&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN class="keyword">end</SPAN>&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN class="keyword">#</SPAN>&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN class="string">&quot;&nbsp;&amp;&nbsp;&quot;</SPAN>&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN class="keyword">#</SPAN>&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(((Start<SPAN class="keyword">-</SPAN>1)&nbsp;<SPAN class="keyword">mod</SPAN>&nbsp;(QuartersPerDay))<SPAN class="keyword">+</SPAN>1)&nbsp;<SPAN class="keyword">div</SPAN>&nbsp;QuartersPerHour&nbsp;<SPAN class="keyword">+</SPAN>&nbsp;8<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN class="keyword">#</SPAN>&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN class="string">&quot;&nbsp;&amp;&nbsp;Uhr&nbsp;&amp;&nbsp;&quot;</SPAN>&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN class="keyword">#</SPAN>&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;((Start)&nbsp;<SPAN class="keyword">mod</SPAN>&nbsp;QuartersPerHour)&nbsp;<SPAN class="keyword">*</SPAN>&nbsp;15<BR>&nbsp;&nbsp;&nbsp;<SPAN class="keyword">end</SPAN>&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;%%&nbsp;<SPAN class="comment">Ordering&nbsp;according&nbsp;to&nbsp;semesters<BR></SPAN>&nbsp;&nbsp;&nbsp;<SPAN class="keyword">local</SPAN>&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN class="keyword">proc</SPAN><SPAN class="variablename">&nbsp;</SPAN>{<SPAN class="functionname">TakeDigits</SPAN>&nbsp;String&nbsp;Front&nbsp;Back}<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{List<SPAN class="keyword">.</SPAN>takeDropWhile&nbsp;String&nbsp;Char<SPAN class="keyword">.</SPAN>isDigit&nbsp;Front&nbsp;Back}<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN class="keyword">end</SPAN>&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN class="keyword">fun</SPAN><SPAN class="variablename">&nbsp;</SPAN>{<SPAN class="functionname">Split</SPAN>&nbsp;S}<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN class="keyword">case</SPAN>&nbsp;S<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN class="keyword">of</SPAN>&nbsp;nil&nbsp;<SPAN class="keyword">then</SPAN>&nbsp;nil<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN class="keyword">else</SPAN>&nbsp;Back&nbsp;<SPAN class="keyword">in</SPAN>&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN class="keyword">case</SPAN>&nbsp;S<SPAN class="keyword">.</SPAN>1<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN class="keyword">of</SPAN>&nbsp;<SPAN class="string">&amp;M</SPAN>&nbsp;<SPAN class="keyword">then</SPAN>&nbsp;Back&nbsp;=&nbsp;S<SPAN class="keyword">.</SPAN>2&nbsp;10&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN class="keyword">[]</SPAN>&nbsp;<SPAN class="string">&amp;F</SPAN>&nbsp;<SPAN class="keyword">then</SPAN>&nbsp;Back&nbsp;=&nbsp;S<SPAN class="keyword">.</SPAN>2&nbsp;12<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN class="keyword">else</SPAN>&nbsp;{String<SPAN class="keyword">.</SPAN>toInt&nbsp;{TakeDigits&nbsp;S&nbsp;$&nbsp;Back}}<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN class="keyword">end</SPAN>&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN class="keyword">|</SPAN>{Split&nbsp;{List<SPAN class="keyword">.</SPAN>dropWhile&nbsp;Back&nbsp;Char<SPAN class="keyword">.</SPAN>isPunct}}<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN class="keyword">end</SPAN>&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN class="keyword">end</SPAN>&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN class="keyword">fun</SPAN><SPAN class="variablename">&nbsp;</SPAN>{<SPAN class="functionname">Compare</SPAN>&nbsp;X1<SPAN class="keyword">|</SPAN>X2<SPAN class="keyword">|</SPAN>Xr&nbsp;Y1<SPAN class="keyword">|</SPAN>Y2<SPAN class="keyword">|</SPAN>Yr}<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;X1&nbsp;<SPAN class="keyword">&lt;</SPAN>&nbsp;Y1&nbsp;<SPAN class="keyword">orelse</SPAN>&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(X1&nbsp;<SPAN class="keyword">==</SPAN>&nbsp;Y1<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN class="keyword">andthen</SPAN>&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(X2&nbsp;<SPAN class="keyword">&lt;</SPAN>&nbsp;Y2&nbsp;<SPAN class="keyword">orelse</SPAN>&nbsp;(X2&nbsp;<SPAN class="keyword">==</SPAN>&nbsp;Y2&nbsp;<SPAN class="keyword">andthen</SPAN>&nbsp;(Xr&nbsp;<SPAN class="keyword">==</SPAN>&nbsp;Yr&nbsp;<SPAN class="keyword">orelse</SPAN>&nbsp;Xr<SPAN class="keyword">.</SPAN>1&nbsp;<SPAN class="keyword">=&lt;</SPAN>&nbsp;Yr<SPAN class="keyword">.</SPAN>1))))<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN class="keyword">end</SPAN>&nbsp;<BR>&nbsp;&nbsp;&nbsp;<SPAN class="keyword">in</SPAN>&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN class="keyword">fun</SPAN><SPAN class="variablename">&nbsp;</SPAN>{<SPAN class="functionname">NameOrdering</SPAN>&nbsp;X&nbsp;Y}<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{Compare&nbsp;{Split&nbsp;{AtomToString&nbsp;X<SPAN class="keyword">.</SPAN>name}}&nbsp;{Split&nbsp;{AtomToString&nbsp;Y<SPAN class="keyword">.</SPAN>name}}}<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN class="keyword">end</SPAN>&nbsp;<BR>&nbsp;&nbsp;&nbsp;<SPAN class="keyword">end</SPAN>&nbsp;<BR>&nbsp;<BR>&nbsp;&nbsp;&nbsp;%%&nbsp;<SPAN class="comment">Ordering&nbsp;according&nbsp;to&nbsp;start&nbsp;time<BR></SPAN>&nbsp;&nbsp;&nbsp;<SPAN class="keyword">fun</SPAN><SPAN class="variablename">&nbsp;</SPAN>{<SPAN class="functionname">TimeOrdering</SPAN>&nbsp;X&nbsp;Y}<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;X<SPAN class="keyword">.</SPAN>start&nbsp;<SPAN class="keyword">=&lt;</SPAN>&nbsp;Y<SPAN class="keyword">.</SPAN>start<BR>&nbsp;&nbsp;&nbsp;<SPAN class="keyword">end</SPAN>&nbsp;<BR>&nbsp;<BR>&nbsp;&nbsp;&nbsp;%%&nbsp;<SPAN class="comment">Ordering&nbsp;according&nbsp;to&nbsp;professor<BR></SPAN>&nbsp;&nbsp;&nbsp;<SPAN class="keyword">fun</SPAN><SPAN class="variablename">&nbsp;</SPAN>{<SPAN class="functionname">ProfessorOrdering</SPAN>&nbsp;X&nbsp;Y}<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;X<SPAN class="keyword">.</SPAN>professor&nbsp;<SPAN class="keyword">=&lt;</SPAN>&nbsp;Y<SPAN class="keyword">.</SPAN>professor<BR>&nbsp;&nbsp;&nbsp;<SPAN class="keyword">end</SPAN>&nbsp;<BR>&nbsp;<BR>&nbsp;&nbsp;&nbsp;%%&nbsp;<SPAN class="comment">Number&nbsp;of&nbsp;lines&nbsp;on&nbsp;page&nbsp;of&nbsp;document<BR></SPAN>&nbsp;&nbsp;&nbsp;LinesOnPage&nbsp;=&nbsp;30<BR>&nbsp;<BR>&nbsp;&nbsp;&nbsp;%%&nbsp;<SPAN class="comment">Begin&nbsp;of&nbsp;tabular&nbsp;environment<BR></SPAN>&nbsp;&nbsp;&nbsp;BeginTab&nbsp;=&nbsp;<SPAN class="string">&quot;\\begin{tabular}{lllrlr}\n&quot;</SPAN>&nbsp;<BR>&nbsp;<BR>&nbsp;&nbsp;&nbsp;%%&nbsp;<SPAN class="comment">End&nbsp;of&nbsp;tabular&nbsp;environment<BR></SPAN>&nbsp;&nbsp;&nbsp;EndTab&nbsp;=&nbsp;<SPAN class="string">&quot;\\end{tabular}\n&quot;</SPAN>&nbsp;<BR>&nbsp;<BR>&nbsp;&nbsp;&nbsp;%%&nbsp;<SPAN class="comment">LecturesToLaTeX&nbsp;transforms&nbsp;list&nbsp;of&nbsp;lectures&nbsp;to&nbsp;LaTeX&nbsp;format<BR></SPAN>&nbsp;&nbsp;&nbsp;<SPAN class="keyword">fun</SPAN><SPAN class="variablename">&nbsp;</SPAN>{<SPAN class="functionname">LecturesToLaTeX</SPAN>&nbsp;Lectures}<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;BeginTab<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN class="keyword">#</SPAN>&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{FoldL&nbsp;Lectures<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN class="keyword">fun</SPAN><SPAN class="variablename">&nbsp;</SPAN>{<SPAN class="functionname">$</SPAN>&nbsp;N<SPAN class="keyword">#</SPAN>In&nbsp;Lecture}<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;N<SPAN class="keyword">+</SPAN>1<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN class="keyword">#</SPAN>&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(In<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN class="keyword">#if</SPAN>&nbsp;N&nbsp;<SPAN class="keyword">mod</SPAN>&nbsp;LinesOnPage&nbsp;<SPAN class="keyword">==</SPAN>&nbsp;0<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN class="keyword">then</SPAN>&nbsp;EndTab&nbsp;<SPAN class="keyword">#</SPAN>&nbsp;<SPAN class="string">&quot;\\newpage\n&quot;</SPAN>&nbsp;<SPAN class="keyword">#</SPAN>&nbsp;BeginTab<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN class="keyword">else</SPAN>&nbsp;<SPAN class="string">&quot;&quot;</SPAN>&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN class="keyword">end</SPAN>&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN class="keyword">#</SPAN>Lecture<SPAN class="keyword">.</SPAN>name<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN class="keyword">#</SPAN><SPAN class="string">&quot;&nbsp;&amp;&nbsp;&quot;</SPAN>&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN class="keyword">#</SPAN>Lecture<SPAN class="keyword">.</SPAN>professor<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN class="keyword">#</SPAN><SPAN class="string">&quot;&nbsp;&amp;&nbsp;&quot;</SPAN>&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN class="keyword">#</SPAN>{StartToVS&nbsp;Lecture<SPAN class="keyword">.</SPAN>start}<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN class="keyword">#</SPAN><SPAN class="string">&quot;\\\\\n&quot;</SPAN>)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN class="keyword">end</SPAN>&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1<SPAN class="keyword">#</SPAN><SPAN class="string">&quot;&quot;</SPAN>}<SPAN class="keyword">.</SPAN>2<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN class="keyword">#</SPAN>&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;EndTab<BR>&nbsp;&nbsp;&nbsp;<SPAN class="keyword">end</SPAN>&nbsp;<BR>&nbsp;<BR>&nbsp;&nbsp;&nbsp;%%&nbsp;<SPAN class="comment">WriteSchedule&nbsp;writes&nbsp;a&nbsp;solution&nbsp;to&nbsp;file&nbsp;FileName<BR></SPAN>&nbsp;&nbsp;&nbsp;<SPAN class="keyword">proc</SPAN><SPAN class="variablename">&nbsp;</SPAN>{<SPAN class="functionname">WriteSchedule</SPAN>&nbsp;Lectures&nbsp;FileName&nbsp;Ordering}<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;OO&nbsp;=&nbsp;{New&nbsp;Open<SPAN class="keyword">.</SPAN>file&nbsp;init(name:FileName<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;flags:&nbsp;[write&nbsp;<SPAN class="string">'create'</SPAN>&nbsp;truncate])}<BR>&nbsp;&nbsp;&nbsp;<SPAN class="keyword">in</SPAN>&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{OO&nbsp;write(vs:{LecturesToLaTeX<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{Sort<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{List<SPAN class="keyword">.</SPAN>flatten&nbsp;Lectures}&nbsp;Ordering}})}<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{OO&nbsp;close}<BR>&nbsp;&nbsp;&nbsp;<SPAN class="keyword">end</SPAN>&nbsp;<BR>&nbsp;<BR>&nbsp;&nbsp;&nbsp;Name&nbsp;=&nbsp;{OS<SPAN class="keyword">.</SPAN>tmpnam}<BR>&nbsp;&nbsp;&nbsp;SourceName&nbsp;=&nbsp;<SPAN class="keyword">!</SPAN>Name<SPAN class="keyword">#</SPAN><SPAN class="string">&quot;.tex&quot;</SPAN>&nbsp;<BR>&nbsp;&nbsp;&nbsp;DVIName&nbsp;=&nbsp;<SPAN class="keyword">!</SPAN>Name<SPAN class="keyword">#</SPAN><SPAN class="string">&quot;.dvi&quot;</SPAN>&nbsp;<BR>&nbsp;&nbsp;&nbsp;NameFileName&nbsp;=&nbsp;{OS<SPAN class="keyword">.</SPAN>tmpnam}<SPAN class="keyword">#</SPAN><SPAN class="string">&quot;.tex&quot;</SPAN>&nbsp;<BR>&nbsp;&nbsp;&nbsp;ProfFileName&nbsp;=&nbsp;{OS<SPAN class="keyword">.</SPAN>tmpnam}<SPAN class="keyword">#</SPAN><SPAN class="string">&quot;.tex&quot;</SPAN>&nbsp;<BR>&nbsp;&nbsp;&nbsp;TimeFileName&nbsp;=&nbsp;{OS<SPAN class="keyword">.</SPAN>tmpnam}<SPAN class="keyword">#</SPAN><SPAN class="string">&quot;.tex&quot;</SPAN>&nbsp;<BR>&nbsp;<BR>&nbsp;&nbsp;&nbsp;LaTeXSource=&nbsp;<SPAN class="string">'\\documentstyle[12pt]{article}\\begin{document}'</SPAN>&nbsp;<BR>&nbsp;&nbsp;&nbsp;<SPAN class="keyword">#</SPAN><SPAN class="string">'\\section*{Vorlesungsplan&nbsp;der&nbsp;Katholischen&nbsp;Hochschule&nbsp;f\\&quot;ur&nbsp;Soziale&nbsp;Arbeit,&nbsp;Saarbr\\&quot;ucken}'</SPAN>&nbsp;<BR>&nbsp;&nbsp;&nbsp;<SPAN class="keyword">#</SPAN><SPAN class="string">'\\subsection*{Nach&nbsp;Professoren&nbsp;alphabetisch&nbsp;geordnet}'</SPAN>&nbsp;<BR>&nbsp;&nbsp;&nbsp;<SPAN class="keyword">#</SPAN><SPAN class="string">'\\input&nbsp;'</SPAN><SPAN class="keyword">#!</SPAN>ProfFileName<BR>&nbsp;&nbsp;&nbsp;<SPAN class="keyword">#</SPAN><SPAN class="string">'\\newpage&nbsp;\\subsection*{Nach&nbsp;Vorlesungen&nbsp;geordnet}'</SPAN>&nbsp;<BR>&nbsp;&nbsp;&nbsp;<SPAN class="keyword">#</SPAN><SPAN class="string">'\\input&nbsp;'</SPAN><SPAN class="keyword">#!</SPAN>NameFileName<BR>&nbsp;&nbsp;&nbsp;<SPAN class="keyword">#</SPAN><SPAN class="string">'\\newpage&nbsp;\\subsection*{Nach&nbsp;Anfangszeiten&nbsp;geordnet}'</SPAN>&nbsp;<BR>&nbsp;&nbsp;&nbsp;<SPAN class="keyword">#</SPAN><SPAN class="string">'\\input&nbsp;'</SPAN><SPAN class="keyword">#!</SPAN>TimeFileName<BR>&nbsp;&nbsp;&nbsp;<SPAN class="keyword">#</SPAN><SPAN class="string">'\\end{document}'</SPAN>&nbsp;&nbsp;<BR>&nbsp;<BR>&nbsp;&nbsp;&nbsp;<SPAN class="keyword">local</SPAN>&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;OO&nbsp;=&nbsp;{New&nbsp;Open<SPAN class="keyword">.</SPAN>file&nbsp;init(name:SourceName<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;flags:[read&nbsp;write&nbsp;<SPAN class="string">'create'</SPAN>])}<BR>&nbsp;&nbsp;&nbsp;<SPAN class="keyword">in</SPAN>&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{OO&nbsp;write(vs:LaTeXSource)}<BR>&nbsp;&nbsp;&nbsp;<SPAN class="keyword">end</SPAN>&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;%%&nbsp;<SPAN class="comment">Write&nbsp;computes&nbsp;the&nbsp;first&nbsp;solution<BR></SPAN>&nbsp;&nbsp;&nbsp;%%&nbsp;<SPAN class="comment">and&nbsp;writes&nbsp;three&nbsp;different&nbsp;listings&nbsp;to&nbsp;files<BR></SPAN>&nbsp;<BR>&nbsp;&nbsp;&nbsp;<SPAN class="keyword">proc</SPAN><SPAN class="variablename">&nbsp;</SPAN>{<SPAN class="functionname">LaTeX</SPAN>&nbsp;What&nbsp;Solution}<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{Wait&nbsp;Solution}<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{WriteSchedule&nbsp;Solution&nbsp;ProfFileName&nbsp;ProfessorOrdering}<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{WriteSchedule&nbsp;Solution&nbsp;TimeFileName&nbsp;TimeOrdering}<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{WriteSchedule&nbsp;Solution&nbsp;NameFileName&nbsp;NameOrdering}<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Flag={OS<SPAN class="keyword">.</SPAN>system&nbsp;<SPAN class="string">'cd&nbsp;/tmp;&nbsp;latex&nbsp;'</SPAN><SPAN class="keyword">#</SPAN>SourceName}<BR>&nbsp;&nbsp;&nbsp;<SPAN class="keyword">in</SPAN>&nbsp;&nbsp;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{Wait&nbsp;Flag}<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN class="keyword">case</SPAN>&nbsp;What<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN class="keyword">of</SPAN>&nbsp;show&nbsp;<SPAN class="keyword">then</SPAN>&nbsp;{OS<SPAN class="keyword">.</SPAN>system&nbsp;<SPAN class="string">'xdvi&nbsp;'</SPAN><SPAN class="keyword">#</SPAN>DVIName&nbsp;_}<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN class="keyword">[]</SPAN>&nbsp;print&nbsp;<SPAN class="keyword">then</SPAN>&nbsp;{OS<SPAN class="keyword">.</SPAN>system&nbsp;<SPAN class="string">'dvips&nbsp;'</SPAN><SPAN class="keyword">#</SPAN>DVIName&nbsp;_}<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN class="keyword">end</SPAN>&nbsp;<BR>&nbsp;&nbsp;&nbsp;<SPAN class="keyword">end</SPAN>&nbsp;<BR>&nbsp;<BR><SPAN class="keyword">end</SPAN>&nbsp;<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">&lt;&lt; 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>