Sunday, October 5, 2003

When Getting High Was On A Swing In The Park

more tags

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
  • , which is the result of a series of drawing commands. It is unusual that this 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
  • picture. This can include formulas and texts that require special formatting. For example: label (BTEX The value of $ i $ is 3. Etex, (0,0)); The downside is that you can use variables metapost between the pair Etex / BTEX , but only words 'literal'.
  • A string , which is a sequence of characters between quotes. In this case, TeX is not used. The chain issued without more, in the default font. The advantage of this second way is that the chain can be built "dynamically", based on the content of other variables metapost. For example, the string may be the concatenation of several strings in label ("The value of i is" & decimal i & "." (0,0)); (remember that is & 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 i is 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 library MAKECIRC . 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
    of future occurrence, to the design of electric circuits. For Instead, LatexMP may be more suitable for the end user, especially if you require multicolor cloud.
     
  • 0 comments:

    Post a Comment