Annotation of loncom/html/adm/help/tex/Authoring_Output_Tags.tex, revision 1.15
1.1 bowersj2 1: \label{Authoring_Output_Tags}
2:
3:
1.2 vandui11 4: This group of tags generates useful output.
1.1 bowersj2 5:
6: \begin{itemize}
1.3 albertel 7: \item \textbf{algebra}\index{algebra}: Typesets algebraic expressions
8: \begin{verbatim}
1.8 felicia 9: <algebra>2x^y+sqrt(3/x^2)</algebra>
1.3 albertel 10: \end{verbatim}
1.9 riegler 11: Expressions are displayed using the math expression display mechanism defined in the user's preferences. The default is tth. See the section below concerning the $<$m$>$ tag for more information on that as well as on the attribute \textbf{display}.
1.3 albertel 12: \item \textbf{chem}\index{chem}: Typesets chemical equation
13: \begin{verbatim}
1.10 raeburn 14: <chem>O2 + 2H2 -> 2H2O</chem>
1.3 albertel 15: \end{verbatim}
1.8 felicia 16: \item \textbf{num}\index{num}: Typesets a number formatted in scientific notation, fixed point, fixed point with commas, fixed point with commas and dollar sign, or in significant digits.
1.3 albertel 17: \begin{verbatim}
1.8 felicia 18: <num format="2E">31454678</num>
19: <num format="2f">31454678</num>
20: <num format="2f">31454678</num>
21: <num format=",2f">31454678</num>
22: <num format="$2f">31454678</num>
23: <num format="2s">31454678</num>
1.3 albertel 24: \end{verbatim}
25: \item \textbf{parse}\index{parse}: to display the parsed view of a variable's
26: contents
27: \begin{verbatim}
1.8 felicia 28: <script type="loncapa/perl">
1.13 bisitz 29: $table='<table>';
1.3 albertel 30: for ($i=1;$i<=10;$i++) {
1.13 bisitz 31: $table.='<tr><td>'.$i.'</td><td>'.&random(1,10,1).'</td></tr>';
1.3 albertel 32: }
1.13 bisitz 33: $table.='</table>';
1.3 albertel 34: </script>
1.8 felicia 35: <parse>$table</parse>
1.3 albertel 36: \end{verbatim}
37:
1.8 felicia 38: \item \textbf{standalone}\index{standalone}: Everything in between the
1.2 vandui11 39: start and end tag is shown only on the web and only if the resource
1.1 bowersj2 40: is not part of a course.
41: \item \textbf{displayduedate}\index{displayduedate}: This will insert the
1.2 vandui11 42: current due date if one is set in the document. It is generated to
1.6 foxr 43: be inside a table of 1x1 elements. The displayduedate tag accepts
44: The following attributes:
45: \begin{description}
46: \item{style=``plain'' } Makes the due date appear without any boxing.
47: If the parameter value is other than ``\emph{plain}'',
48: or if the \textbf{style} parameter is omitted, the
49: due date will be displayed within a box.
50: \item{format=``fmt\_string''}
51: Allows you to control the format of the due date.
52: ``\emph{fmt\_string}'' is an arbitrary string that
53: can contain any of the following formatting items:
54: \begin{description}
55: \item{\%a} Replaced by the abbreviated weekday
56: name according to the current locale.
57: \item{\%A} Replaced by the full weekday name
58: according to the current locale.
59: \item{\%b} The abbreviated month name according to the
60: current locale.
61: \item{\%B} The full month name according to the
62: current locale.
63: \item{\%c} The preferred date and time representation
64: for the current locale (the default format
65: string is just this).
66: \item{\%C} The century number as a two digit integer
67: \item{\%d} The day of the month as a decimal number.
68: Leading zeroes are shown for single digit day numbers.
69: \item{\%D} Equivalent to \%m/\%d/\%y
70: \item{\%e} Like \%d but a leadnig zero is replaced by a space.
71: \item{\%F} Equivalent to \%Y-\%m-\%d
72: \item{\%G} The four digit year number.
73: \item{\%g} The two digit year numbger.
74: \item{\%H} The hour as a two digit number in the range 00 thorugh 23.
75: \item{\%I} The hour as a two digit number in the range 00 through 12.
76: \item{\%j} The day your the year in the range 001 through 366.
77: \item{\%k} The hour (24 hour clock), single digits are preceded by a blank.
78: \item{\%l} Like \%k but using a 12 hour clock.
79: \item{\%m} The month as a two digit decimal number in the range 01 through 12.
80: \item{\%M} The minute as a two digit decimal number in the range 00 through 59.
81: \item{\%n} A newline character.
82: \item{\%p} AM or PM depending on the time value.
83: \item{\%P} am or pm.
84: \item{\%r} The time in am or pm notation.
85: \item{\%R} Time in 24 hour notatinon (\%H:\%M). See also \%T below.
86: \item{\%s} Number of seconds since midnight of January 1, 1970.
87: \item{\%S} The second as a decimal number int the range 00 through 59.
88: \item{\%t} A horizontal tab character.
89: \item{\%T} The time in 24 hour notation (\%H:\%M:\%S).
90: \item{\%u} Day of the week as a decimal number with Monday as 1.
91: \item{\%U} The week number of the current year in the range 00 through 53.
92: Week 1 is the week containing the first Sunday of the year.
93: \item{\%V} Same as \%U but week 1 is the first week with at least 4 days,
94: with Monday being the first day of a week.
95: \item{\%w} Day of the week as a decimal integer in the range 0 through 7, Sunday is 0.
96: \item{\%W} Week number of the current year in the range 00 through 53, where
97: the first Monday of the year is the first day of week 01.
98: \item{\%x} The preferred date notation in the current locale without the time.
99: \item{\%X} The preferred time notation in the current locale without the date.
100: \item{\%y} The year as a decimal number without the century (range 00 through 99).
101: \item{\%Y} The year as a decimal number including the century.
102: \item{\%\%} A \% character.
103: \item{\%+} Date and time in the form returned by the Unix date command.
104: \end{description}
105: \end{description}
1.1 bowersj2 106: \item \textbf{displaytitle}\index{displaytitle}: This will insert the title
107: of the problem from the metadata of the problem. Only the first \textbf{displaytitle}
108: in a problem will show the title; this allows clean usage of \textbf{displaytitle}
1.7 albertel 109: in LON-CAPA style files.
110:
111: \item \textbf{window}\index{window}: This creates a link that when clicked shows the intervening information in a pop-up window. By default the window will be 500 pixels wide and 200 pixels tall, and the link text will be a superscript * (so as to look like a footnote). These can be changed using the attributes
112:
113: \begin{itemize}
1.8 felicia 114: \item \textbf{width} controls the starting width of the popup window
115: \item \textbf{height} controls the starting height of the popup window
116: \item \textbf{linktext} the text that should appear as the link that causes the creation of the window
1.7 albertel 117: \end{itemize}
118:
1.14 www 119: When printing, the included text will get turned into a real footnote.
120:
1.15 ! www 121: \item \textbf{windowlink}\index{windowlink}: This creates a link to a resource that comes up in a pop-up window. The link will be the intervening information
! 122: between the start and the end tag. By default the window will be 500 pixels wide and 200 pixels tall.
! 123:
! 124: \begin{itemize}
! 125: \item \textbf{width} controls the starting width of the popup window
! 126: \item \textbf{height} controls the starting height of the popup window
! 127: \item \textbf{href} the address
! 128: \end{itemize}
! 129:
1.14 www 130: \item \textbf{togglebox}\index{togglebox}: This creates a toggling box that can be clicked open and close.
131:
132: \begin{itemize}
133: \item \textbf{heading} heading text of the box, by default no heading
134: \item \textbf{headerbg} background color of the header, by default white
135: \item \textbf{showtext} the text that appears to make the box visible, by default the translation of 'show'
136: \item \textbf{hidetext} the text that appears to hide the box again, by default the translation of 'hide'
137: \end{itemize}
138:
139: When printing, the included text will be rendered in a visible box.
1.7 albertel 140:
1.4 albertel 141:
1.1 bowersj2 142: \item \textbf{m}\index{m}: The inside text is \LaTeX{}, and is converted
1.8 felicia 143: to HTML (or MathML) on the fly. The default is to convert
144: to the display mechanism that the user has selected in preferences. This can be
1.4 albertel 145: overriden by setting the attribute \textbf{display} to one of
146: ``\textbf{tth}'' or ``\textbf{jsMath}'' or ``\textbf{mimetex}''which
1.9 riegler 147: will force a specfic display mechanism. Note, however, that setting the attribute \textbf{diplay} to \textbf{jsmath} is generally discouraged as it requires users to have installed jsmath software on their computer.
1.4 albertel 148:
1.8 felicia 149: If you want variables inside of this tag to be evaluated before the
150: tex gets converted, then use eval=``on'' \index{eval=on}. For
151: example, $<$m eval=``on''$>$\textbackslash{}[\$eqn\textbackslash{}]$<$/m$>$,
152: will evaluate the variable \$eqn first and then run it through the
153: TTH\index{TTH} converter. Anytime you use a variable inside of the m tag,
154: you will want to set eval to on.
155:
156: For example, put the following in a script in the resource:
157:
158: \texttt{\$eqn = "\$a+\$b";}
159:
160: \texttt{\$eqn =~ s/\textbackslash{}+-/-/g;}
161:
162: and in a text area, you can type:
163:
164: \texttt{<m eval=``on''>\$eqn</m>}
165:
166: You will get the equation rendered with no +-, no matter what value
167: \$b may take on.
168:
169:
1.2 vandui11 170: \item \textbf{randomlabel}\index{randomlabel}: This shows a specified image
1.1 bowersj2 171: with images or text labels randomly assigned to a set of specific
172: locations. Those locations may also have values assigned to them.
1.2 vandui11 173: A hash is generated that contains the mapping of labels to locations,
1.1 bowersj2 174: labels to values, and locations to values. Example: \begin{verbatim}
175:
176: <randomlabel bgimg="URL" width="12" height="45" texwidth="50">
177: <labelgroup name="GroupOne" type="image">
178: <location x="123" y="456" value="10" />
179: <location x="321" y="654" value="20" />
180: <location x="213" y="546" value="13" />
181: <label description="TEXT-1">IMG-URL</label>
182: <label description="TEXT-2">IMG-URL</label>
183: <label description="TEXT-3">IMG-URL</label>
184: </labelgroup>
185: <labelgroup name="GroupTwo" type="text">
186: <location x="12" y="45" />
187: <location x="32" y="65" />
188: <location x="21" y="54" />
189: <label>TEXT-1</label>
190: <label>TEXT-2</label>
191: <label>TEXT-3</label>
192: </labelgroup>
193: </randomlabel>
194:
1.5 albertel 195: \end{verbatim}
196:
197: Possible attributes are:
1.1 bowersj2 198:
199: \begin{itemize}
200: \item \textbf{bgimg}\index{bgimg}: Either a fully qualified URL for an
1.2 vandui11 201: external image or a LON-CAPA resource. It supports relative references
1.1 bowersj2 202: (../images/apicture.gif). The image must either be a GIF or JPEG.
203: \item \textbf{width}\index{width}: The width of the image in pixels.
204: \item \textbf{height}\index{height}: The height of the image in pixels.
1.2 vandui11 205: \item \textbf{texwidth}\index{texwidth}: The width of the image in millimeters.
1.1 bowersj2 206: \end{itemize}
1.11 felicia 207:
208: \item \textbf{problemtype}\index{problemtype}: This tag allows you to show or hide output based on what the problem-type parameter is set to in the course. For example: \begin{verbatim}
209: <problemtype mode="show" for="exam,survey">
210: <startouttext />
1.12 raeburn 211: The formula for the circumference of a circle is 2*pi*r
1.11 felicia 212: <endouttext />
213: </problemtype>
214: \end{verbatim}
215: Will only show the output text when the problem is set to the type of exam or survey in the course. The attribute for mode can be set to show or hide. The attribute for for can be problem, exam, survey, or practice.
216:
1.1 bowersj2 217: \end{itemize}
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>