MetaPost has the ability to include labels (text) as part of the drawing. To order this gives the label which receives as first parameter to display text, and as second parameter the coordinates of the point where it should appear. The first parameter (the text) can be of two types:
A picture is the result of processing the directives BTEX / Etex . These policies cause the text between them is processed externally by TeX, and the result of that processing is inserted back into the metapost figure in the form of Etex / BTEX , but only words 'literal'. & concatenation character strings and is a primitive that converts an integer to a string ). However, the downside is that the string can not contain TeX commands. If the string is, for example "$ i $", the text displayed will be precisely that, not a - i
- in math mode. would be interesting to combine the best of both approaches, ie to dynamically generate a string , and is interpreted by TeX, so that the chain process "The value of $ i $ is" & decimal i & "."
obtain the text "The value of iis 3." (Assuming that the value of the variable) This is the problem independently, have raised two different authors, and the solutions they reached each are:LatexMP. This library is published in - MetaPost CTAN , not only solves the above problem, but also provides a method to achieve multicolor cloud patch without dvitomp
(see
my article on this topic.) It also comes with excellent documentation and usage examples. The package provides a wealth of configuration options.latex.mp . This MetaPost library is not published "officially" anywhere (except for this blog), but can be downloaded as part of the libraryMAKECIRC. Code is much simpler and compact than LatexMP, and the documentation is much less (included as comments in the code of the library). However, except for colored labels, it offers the same functionality as LatexMP. Latex.mp I think it may be more appropriate to be used as part of other libraries. For example, has been used in the library Schema for drawing electronic circuits, and library MAKECIRC
0 comments:
Post a Comment