4

I need to insert a dot symbol, such as “•” or a METAPOST circle into my document, at different heights between the baseline and top of characters, like this example:

            _____ _____        _____
*             |   |     \    /   |
 * *   *      |   |      \  /    |
  * * * *     |   |____   \/     |
     *   *    |   |       /\     |
          *   |   |      /  \    |
           *  |   |____ /    \   |

The letters TEXT appear as regular sized text, and the * are circles placed at different heights. There are never dots above or below each other.

Using ^ and _ in math mode, I was able to place the dot at 3 different placements vertically, e.g.:

\math{^•} prints high
\math{•} prints in the middle
\math{_•} prints low

This has several problems though:

  • The superscript and subscript dots are smaller than the middle dot, but I need a consistent radius.
  • The superscript is too high, going beyond the top of characters in the same line. The subscript is also too low, going below the baseline. Ideally, the lowest dot will not fall below the baseline, and the highest dot will not go higher than the top of a capital letter.
  • I need to draw the dots at 6 different levels.

If the dots are large, there can be overlap in their levels, e.g.:

  __
 /  \   __
 \__/  /  \ 
       \__/

How can I control the vertical placement of a dot character, or similar METAPOST dots and ensure that the placement falls between the baseline and top of words on the same line?

1 Answer 1

5

You can use MetaPost to place the dots. You have exact control what to place where. Here I used the expression \strutheight-\strutdepth as what you were refering to as height of characters. This of course depends on the following character.

The first argument of shifted is the x shift, the second argument is the shift in y direction. This allows exact placement. Here a simple example:

\starttext
  Foo%%
  \startMPcode
    pickup pencircle scaled .5mm;
    h := \strutheight-\strutdepth;
    for i=0 upto 5:
      fill fullcircle shifted (i*h/10, i*h/5);
    endfor
  \stopMPcode
  Bar
\stoptext

result

3
  • Why is it if I create just 1 isolated dot, such as fill fullcircle shifted (5*h/10, 0); or fill fullcircle shifted (3*h/10, 0); both are placed at the same height, right on the baseline?
    – Village
    Oct 20, 2012 at 0:30
  • That is because the dots are placed at (x, y), and the y is 0 in both your example placements.
    – Esteis
    Oct 20, 2012 at 11:12
  • The bounding box of MetaPost images is always placed on the baseline. You can adjust the bounding box manually: setbounds currentpicture to boundingbox unitsquare xyscaled (5mm, h);
    – Marco
    Oct 20, 2012 at 11:39

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .