fix defaults for x any y (to be strings)
[PyX.git] / examples / text / color.txt
blobcdd12b06ca6380381921b86d805aad639e34b999
1 Using the same color in PyX and in LaTeX
3 ! This example shows three different methods how to use a color defined in PyX
4 also in LaTeX.... In the example code, we first define a cmyk color `col`,
5 which is then used to define a color `COL` in LaTeX. The latter is then used in
6 a LaTeX expression.
8 ! The same behavior can be achieved by two different methods in `c.text`,
10     r"\textcolor[named]{PineGreen}{Text} and outline ..."
11     r"\textcolor[pyx]{color.cmyk.PineGreen}{Text} and outline ..."
13 They are not as elegant as the above shown, since we need to insert the color
14 definition `PineGreen` explicitly. The first alternative makes use of the
15 `named` color model of color.sty. All colors of this model are predefined also
16 in PyX. The other alternative allows to use PyX colors directly.
18 !! Note that no graphics driver has been used for the color.sty LaTeX package.
19 PyX performs a hack to enforce the use of its own LaTeX driver file pyx.def. In
20 case that you have installed the three files `pyx.def`, `color.cfg`, and
21 `graphics.cfg` from the PyX distribution somewhere in the LaTeX search path, it is
22 possible to use
24     text.set(mode="latex", pyxgraphics=0)
25     text.preamble(r"\usepackage[pyx]{color}")
27 which is the more aesthetic variant.