%xsldoc.ent; ]> $Id: callout.mod.xsl,v 1.11 2004/08/12 06:25:52 j-devenish Exp $ &ramon; &james; 20002001200220032004 Ramon Casellas &rev_2003_05; January 2004 Added callout support. Callouts <filename>callout.mod.xsl</filename> These template use the concept of an areamark, an arearef and an areasymbol. An areamark is a way of illustrating a callout area as part of an image or listing. An arearef is a way of illustrating a callout area as part of a callout list. By default, the areamark and the arearef are both represented by the areasymbol. (Aside: that the areamark is drawn first.) This system allows opens the possibility for an areamark to draw a box around an area in addition to displaying the areasymbol. Essential preamble for callout.mod.xsl support Loads the overpic packages and defines calsscale and calspair (which are used to convert calspair coordinates into overpic percent-style coordinates. Whether to enable this preamble or not. If 0, callouts will cause &LaTeX; errors. &preamble; \@tempcntb% \dblatex@ascale=1pt% \dblatex@bscale=\@tempcntb pt% \divide\dblatex@bscale by \@tempcnta% \else% \dblatex@bscale=1 pt% \dblatex@ascale=\@tempcnta pt% \divide\dblatex@ascale by \@tempcntb% \fi% } \newcommand{\calspair}[3]{ \sbox{\z@}{#3} \settowidth{\dblatex@cdimen}{\usebox{\z@}} \settoheight{\dblatex@ddimen}{\usebox{\z@}} \divide\dblatex@cdimen by 2 \divide\dblatex@ddimen by 2 \dblatex@adimen=#1 pt \dblatex@adimen=\strip@pt\dblatex@ascale\dblatex@adimen \dblatex@bdimen=#2 pt \dblatex@bdimen=\strip@pt\dblatex@bscale\dblatex@bdimen \put(\strip@pt\dblatex@adimen,\strip@pt\dblatex@bdimen){\hspace{-\dblatex@cdimen}\raisebox{-\dblatex@ddimen}{\usebox{\z@}}} } ]]> Process programlistingco and screenco elements Applies templates. &no_var; Process areaset-related elements Suppressed (area templates are applied by ). &no_var; Process co-related elements Print a callout number as a parenthesis. &no_var; This template is probably never applied, because we can't yet handled cos in verbatim environments. ( ) Process calloutlist elements Applies templates. &no_var; \begin{description} \end{description} Process titles for calloutlist elements Formats a title. The &LaTeX; command for formatting titles. style The &LaTeX; command to use. Defaults to . Applies templates as a paragraph, formatted with the specified style. { { }} Process callout elements Formats arearefs as an item, then applies templates. Since there may be multiple IDs specified in the arearefs attribute, the template is called recursively to generate the arearefs. &no_var; \item[{ }]\null{} Determine a callout's arearefs Splits the arearef attribute on whitespace, then constructs a list of references by applying templates in generate.callout.arearef mode. &no_var; The current node must be a callout. Format a callout's arearefs Applies templates in generate.callout.arearef mode. &no_var; arearef The ID of the area to which a callout refers. area The area object to which a callout refers. By default, this searches for a area whose id attribute equals the arearef parameter. count The position of this reference in the list of references used by a given callout. Influences delimiters for list items. last Whether this area reference is the last one for a given callout. Influences delimiters for list items. Formats a reference for a single arearef. This is performed by applying templates for the area in generate.area.arearef mode. The current node must be a callout. Uses the naturalinlinelist localisation context. lastofmany lastoftwo ? Error: no ID for constraint arearefs: . Illustrate a reference to a callout's area Formats an area as part of a callout list. &no_var; The current node must be an area. Applies templates in the generate.arearef.calspair, generate.arearef.linerange and generate.arearef modes. Illustrate a reference to a callout's area Formats an area as part of a callout list. &no_var; This is a fallback template for unknown units. It does not format an arearef but instead prints an error message. Error: unsupported arearef units . Illustrate a reference to a callout's area Formats calspair units for a callout list. &no_var; Calls . Illustrate a reference to a callout's area Formats linerange units for a callout list. &no_var; Formats a line range numerically, condensing the line range down to a single line reference if the starting line is the same as the finishing line. Illustrate a callout's area as part of an image or listing Formats an area as part of a displayed image or listing. &no_var; Applies templates in the generate.area.areamark mode. Illustrate a callout's area as part of an image or listing Formats an area as part of a displayed image or listing. &no_var; Applies templates in the generate.areamark.calspair or generate.areamark modes. Illustrate a callout's area as part of an image or listing Formats an area as part of a displayed image or listing. &no_var; This is a fallback template for unknown units. It does not format an areamark but instead prints an error message. Error: unsupported areamark units . Illustrate a callout's area as part of an image or listing Formats calspair units for a displayed image or listing. &no_var; Converts calspair coordinates relative to the width and height of the displayed image area. Will understand "x1,y1 x2,y2" and also "x1 y1". In the former case, the drawing location is moved to the centre of the implied rectangle. Templates are then applied in the generate.area.areasymbol mode. Error: invalid calspair ''. \calspair{ }{ }{ } Illustrate a callout's area as part of an image or listing Formats an area as an overlay on an image or listing. &no_var; If the area has a label attribute, it is used as raw &LaTeX; code. If the area has a linkends attribute, templates are applied for the first linkend using generate.callout.areasymbol mode. It is implicit in this scenario that an arearef and an areamark will both consist of an identical icon for an area. If none of the above were performed, an asterisk is printed. ? Error: no ID for constraint linkends: . * Illustrate a callout's area as part of an image or listing Illustrates an area as part of a displayed image or listing. &no_var; Prints the numeric position of the callout within its calloutlist. Process imageobjectco elements Applies templates. &no_var; Process a imageobjectco's imageobject elements Applies templates for imagedata. &no_var;