--- loncom/html/adm/help/tex/Authoring_Output_Tags.tex 2005/06/29 18:07:15 1.3 +++ loncom/html/adm/help/tex/Authoring_Output_Tags.tex 2008/08/04 22:02:26 1.8 @@ -6,45 +6,147 @@ This group of tags generates useful outp \begin{itemize} \item \textbf{algebra}\index{algebra}: Typesets algebraic expressions \begin{verbatim} - 2x^y+sqrt(3/x^2) +2x^y+sqrt(3/x^2) \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. \item \textbf{chem}\index{chem}: Typesets chemical equation \begin{verbatim} 02 + 2H2 -> 2H20 \end{verbatim} -\item \textbf{num}\index{num}: Typesets a number +\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. \begin{verbatim} - 31454678 + 31454678 + 31454678 + 31454678 + 31454678 + 31454678 + 31454678 \end{verbatim} \item \textbf{parse}\index{parse}: to display the parsed view of a variable's contents \begin{verbatim} - - \$table + $table \end{verbatim} -\item \textbf{standalone}\index{standalone}: Everything inbetween the +\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. +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 stylesheets. -\item \textbf{window}\index{window}: The text inbetween is put in a pop-up -javascript window. +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 +\end{itemize} + +When printing, this included text will get turned into a real footnote. + + \item \textbf{m}\index{m}: The inside text is \LaTeX{}, and is converted -to HTML (or MathML) on the fly. If the attribute \textbf{eval} is -set to {}``\textbf{on}'' the intervening text will have a perl variable -expansion done to it before being 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. + +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{\$eqn} + +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. @@ -70,7 +172,9 @@ labels to values, and locations to value -\end{verbatim} Possible attributes are: +\end{verbatim} + + Possible attributes are: \begin{itemize} \item \textbf{bgimg}\index{bgimg}: Either a fully qualified URL for an