[NTG-context] textext vs. btex ... etex

Oliver Buerschaper oliver.buerschaper at mpq.mpg.de
Sat Aug 21 16:24:09 CEST 2010


>>> so, if in mkiv you want pieces, you need to textext each snippet that you want as such
>> 
>> Alright... in that case how would I make sure that all glyph positions are kept if my TeX material is, say, some complex formula? How could I find the baseline with textext?
> 
> see mp.mplib for all those anchor points

OK. I found in mp-mplib.mp that rawtextext() does what I was looking for... the baseline is anchored to the current point:

---
\setupbodyfont[10pt]



\starttext


\startMPinclusions
    pickup pencircle scaled 0.05pt;
    defaultpen := savepen;
    
    picture crosshair;
    crosshair := image(draw fullcircle scaled 2pt;
                       draw (0,-2pt)--(0,2pt);
                       draw (-2pt,0)--(2pt,0);
                      );
    
    bboxmargin := 0;
\stopMPinclusions


\startMPpage    
    for item within rawtextext("$(h,g)$"):
        draw bbox item withcolor 0.8white;
        draw item;
    endfor;
    
    draw crosshair;
\stopMPpage


\stoptext
---

This solves step one!

Now onto step two: how can I typeset each glyph in the formula individually such that it appears precisely in the right location?

Thanks,
Oliver


More information about the ntg-context mailing list