\label{Authoring_Output_Tags}
This group of tags generates useful output.
\begin{itemize}
\item \textbf{algebra}\index{algebra}\index{format algebra}: Typesets algebraic expressions
\begin{verbatim}
<algebra>2x^y+sqrt(3/x^2)</algebra>
\end{verbatim}
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}.
\item \textbf{chem}\index{chem}\index{format reaction}: Typesets chemical equation
\begin{verbatim}
<chem>O2 + 2H2 -> 2H2O</chem>
\end{verbatim}
\item \textbf{num}\index{num}\index{format number}: Typesets a number formatted in scientific notation, fixed point, fixed point with commas, fixed point with commas and dollar sign, or in significant digits.
\begin{verbatim}
<num format="2E">31454678</num> results in 3.15 x 10^7
<num format="2f">31454678</num> results in 31454678.00
<num format="4g">31454678</num> results in 3.145 x 10^7
<num format="4g">314.54678</num> results in 314.5
<num format=",2f">31454678</num> results in 31,454,678.00
<num format="$2f">31454678</num> results in $31,454,678.00
<num format="2s">31454678</num> results in 31000000
<num format=",2s">31454678</num> results in 31,000,000
\end{verbatim}
\item \textbf{parse}\index{parse}: to display the parsed view of a variable's
contents
\begin{verbatim}
<script type="loncapa/perl">
$table='<table>';
for ($i=1;$i<=10;$i++) {
$table.='<tr><td>'.$i.'</td><td>'.&random(1,10,1).'</td></tr>';
}
$table.='</table>';
</script>
<parse>$table</parse>
\end{verbatim}
\item \textbf{standalone}\index{standalone}: Everything in between the
start and end tag is shown only on the web and only if the resource
is not part of a course.
\item \textbf{displayduedate}\index{displayduedate}: This will insert the
current due date if one is set in the document. It is generated to
be inside a table of 1x1 elements. The displayduedate tag accepts
The following attributes:
\begin{description}
\item{style=``plain'' } Makes the due date appear without any boxing.
If the parameter value is other than ``\emph{plain}'',
or if the \textbf{style} parameter is omitted, the
due date will be displayed within a box.
\item{format=``fmt\_string''}
Allows you to control the format of the due date.
``\emph{fmt\_string}'' is an arbitrary string that
can contain any of the following formatting items:
\begin{description}
\item{\%a} Replaced by the abbreviated weekday
name according to the current locale.
\item{\%A} Replaced by the full weekday name
according to the current locale.
\item{\%b} The abbreviated month name according to the
current locale.
\item{\%B} The full month name according to the
current locale.
\item{\%c} The preferred date and time representation
for the current locale (the default format
string is just this).
\item{\%C} The century number as a two digit integer
\item{\%d} The day of the month as a decimal number.
Leading zeroes are shown for single digit day numbers.
\item{\%D} Equivalent to \%m/\%d/\%y
\item{\%e} Like \%d but a leadnig zero is replaced by a space.
\item{\%F} Equivalent to \%Y-\%m-\%d
\item{\%G} The four digit year number.
\item{\%g} The two digit year numbger.
\item{\%H} The hour as a two digit number in the range 00 thorugh 23.
\item{\%I} The hour as a two digit number in the range 00 through 12.
\item{\%j} The day your the year in the range 001 through 366.
\item{\%k} The hour (24 hour clock), single digits are preceded by a blank.
\item{\%l} Like \%k but using a 12 hour clock.
\item{\%m} The month as a two digit decimal number in the range 01 through 12.
\item{\%M} The minute as a two digit decimal number in the range 00 through 59.
\item{\%n} A newline character.
\item{\%p} AM or PM depending on the time value.
\item{\%P} am or pm.
\item{\%r} The time in am or pm notation.
\item{\%R} Time in 24 hour notatinon (\%H:\%M). See also \%T below.
\item{\%s} Number of seconds since midnight of January 1, 1970.
\item{\%S} The second as a decimal number int the range 00 through 59.
\item{\%t} A horizontal tab character.
\item{\%T} The time in 24 hour notation (\%H:\%M:\%S).
\item{\%u} Day of the week as a decimal number with Monday as 1.
\item{\%U} The week number of the current year in the range 00 through 53.
Week 1 is the week containing the first Sunday of the year.
\item{\%V} Same as \%U but week 1 is the first week with at least 4 days,
with Monday being the first day of a week.
\item{\%w} Day of the week as a decimal integer in the range 0 through 7, Sunday is 0.
\item{\%W} Week number of the current year in the range 00 through 53, where
the first Monday of the year is the first day of week 01.
\item{\%x} The preferred date notation in the current locale without the time.
\item{\%X} The preferred time notation in the current locale without the date.
\item{\%y} The year as a decimal number without the century (range 00 through 99).
\item{\%Y} The year as a decimal number including the century.
\item{\%\%} A \% character.
\item{\%+} Date and time in the form returned by the Unix date command.
\end{description}
\end{description}
\item \textbf{displaytitle}\index{displaytitle}: This will insert the title
of the problem from the metadata of the problem. Only the first \textbf{displaytitle}
in a problem will show the title; this allows clean usage of \textbf{displaytitle}
in LON-CAPA style files.
\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
\begin{itemize}
\item \textbf{width} controls the starting width of the popup window
\item \textbf{height} controls the starting height of the popup window
\item \textbf{linktext} the text that should appear as the link that causes the creation of the window
\item \textbf{printtext} the text that should appear instead of a footnote when printed
\end{itemize}
When printing, the included text will get turned into a real footnote.
\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
between the start and the end tag. By default the window will be 500 pixels wide and 200 pixels tall.
\begin{itemize}
\item \textbf{width} controls the starting width of the popup window
\item \textbf{height} controls the starting height of the popup window
\item \textbf{href} the address
\end{itemize}
\item \textbf{togglebox}\index{togglebox}: This creates a toggling box that can be clicked open and close.
\begin{itemize}
\item \textbf{heading} heading text of the box, by default no heading
\item \textbf{headerbg} background color of the header, by default white
\item \textbf{showtext} the text that appears to make the box visible, by default the translation of 'show'
\item \textbf{hidetext} the text that appears to hide the box again, by default the translation of 'hide'
\end{itemize}
When printing, the included text will be rendered in a visible box.
\item \textbf{m}\index{m}: The inside text is \LaTeX{}, and is converted
to HTML (or MathML) on the fly. The default is to convert
to the display mechanism that the user has selected in preferences. This can be
overriden by setting the attribute \textbf{display} to one of
``\textbf{tth}'' or ``\textbf{jsMath}'' or ``\textbf{mimetex}''which
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.
If you want variables inside of this tag to be evaluated before the
tex gets converted, then use eval=``on'' \index{eval=on}. For
example, $<$m eval=``on''$>$\textbackslash{}[\$eqn\textbackslash{}]$<$/m$>$,
will evaluate the variable \$eqn first and then run it through the
TTH\index{TTH} converter. Anytime you use a variable inside of the m tag,
you will want to set eval to on.
For example, put the following in a script in the resource:
\texttt{\$eqn = "\$a+\$b";}
\texttt{\$eqn =~ s/\textbackslash{}+-/-/g;}
and in a text area, you can type:
\texttt{<m eval=``on''>\$eqn</m>}
You will get the equation rendered with no +-, no matter what value
\$b may take on.
\item \textbf{randomlabel}\index{randomlabel}: This shows a specified image
with images or text labels randomly assigned to a set of specific
locations. Those locations may also have values assigned to them.
A hash is generated that contains the mapping of labels to locations,
labels to values, and locations to values. Example: \begin{verbatim}
<randomlabel bgimg="URL" width="12" height="45" texwidth="50">
<labelgroup name="GroupOne" type="image">
<location x="123" y="456" value="10" />
<location x="321" y="654" value="20" />
<location x="213" y="546" value="13" />
<label description="TEXT-1">IMG-URL</label>
<label description="TEXT-2">IMG-URL</label>
<label description="TEXT-3">IMG-URL</label>
</labelgroup>
<labelgroup name="GroupTwo" type="text">
<location x="12" y="45" />
<location x="32" y="65" />
<location x="21" y="54" />
<label>TEXT-1</label>
<label>TEXT-2</label>
<label>TEXT-3</label>
</labelgroup>
</randomlabel>
\end{verbatim}
Possible attributes are:
\begin{itemize}
\item \textbf{bgimg}\index{bgimg}: Either a fully qualified URL for an
external image or a LON-CAPA resource. It supports relative references
(../images/apicture.gif). The image must either be a GIF or JPEG.
\item \textbf{width}\index{width}: The width of the image in pixels.
\item \textbf{height}\index{height}: The height of the image in pixels.
\item \textbf{texwidth}\index{texwidth}: The width of the image in millimeters.
\end{itemize}
\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}
<problemtype mode="show" for="exam,survey">
<startouttext />
The formula for the circumference of a circle is 2*pi*r
<endouttext />
</problemtype>
\end{verbatim}
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.
\end{itemize}
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>