Previous: , Up: The latex_vis backend   [Contents][Index]


Further customizations

Further customizations

In addition to the options described above, the front end’s --filter option (see Compiling coNCePTuaL programs) is a useful mechanism for customizing the formatting of the communication diagram. For example, specifying --filter="s/rowsep=30bp/rowsep=1.5in/g" increases the separation between rows from 30bp (where 1bp = 1/72") to 1.5". See the PSTricks documentation for more information about the PSTricks commands used in the generated .tex files.

To facilitate the use of --filter, the latex_vis backend uses a helper macro (\viscolor) to define colors. \viscolor takes an argument of the form ‘name=color’ and defines a macro \namecolor that expands to color. To further facilitate the use of --filter, the LaTeX code generated by the latex_vis backend contains a number of strategically placed placeholder comments of the form ‘% PLACEHOLDER: tag’. A --filter command can thereby insert code into the document by replacing an appropriate ‘PLACEHOLDER’ line. In alphabetical order, the currently defined placeholder tags are ANNOTATIONS, COLORS, COMMUNICATION, DEADLOCK, DOCUMENT, END, NODESHAPE , PACKAGES, PSMATRIX, TEXTOEPS , and TIMELINE. Look through any latex_vis-generated .tex file to see where these are situated. As an example, the following command-line options define a “chartreuse” color then change the color used to indicate point-to-point messages from blue to chartreuse:

--filter="s/% PLACEHOLDER: COLORS/\\newrgbcolor{chartreuse}{0.5 1 0}/"
--filter="s/sendrecv=blue/sendrecv=chartreuse/"

(According to the PSTricks documentation, the predefined colors are red, green, blue, cyan, magenta, and yellow, and the predefined grayscales are black, darkgray, gray, lightgray, and white.)

Tasks that are active at a given time are drawn using the \task macro, which takes the task number as an argument. Tasks that are idle at a given time are drawn using the \idle macro, which is initially defined to be the same as \task. The following “cookbook” examples showcase some of the ways that the power of LaTeX and PSTricks can be exploited to display idle tasks in a variety of different styles (best used with --annotate=2):

omitting idle tasks

--filter="s/\\let\\idle=\\task/\\newcommand*{\\idle}[1]{[mnode=R]}/"

showing each idle task as a gray dot

--filter="s/\\let\\idle=\\task/\\newcommand*{\\idle}[1]{[mnode=dot, linecolor=gray]}/"

drawing idle tasks with a dotted circle instead of a solid circle

--filter="s/\\let\\idle=\\task/\\newcommand*{\\idle}[1] {[linestyle=dotted]\\task{#____"

As an alternative to replacing the ‘\let\idle=\task’ binding, the preceding substitutions can be expressed as the insertion of a LaTeX \renewcommand. That is, idle tasks can also be omitted by specifying ‘--filter="s/% PLACEHOLDER: NODESHAPE/\\renewcommand*{\\idle}[1]{[mnode=R]}/"’.

In short, the latex_vis backend produces highly customizable illustrations of communication patterns. Because latex_vis produces commented LaTeX code, any customization not provided through the use of --filter or one of the backend-specific command-line options is easily performed by compiling with --keep-ints (see Compiling coNCePTuaL programs) and editing the generated LaTeX code.


Previous: , Up: The latex_vis backend   [Contents][Index]

Scott Pakin, pakin@lanl.gov