This is a continuation of my question.

Now when I work with it, it seems to me that this code produces the label letters that are slightly bigger that the corresponding letters in the text formulas (Say, look at the letter A in the in-line formula, in the caption - these looks the same, and letter A the label of the vetrex A - this one looks bigger for me).

enter image description here

Question: How to make them the same?

In general: How to make the labels on the picture of the same size as in the text?

It is obvious (for me), that the problem is in the way how the function opendot works, but neither @Charles Staats (who suggested it and helped me a lot), nor me understand how it works.


  1. The option to scale the picture must be preserved. Sometimes I need to scale the picture, this shouldn't affect the labels - all of them have to be the same (and equal the letters in the main text formulas) regardless of the picture size.
  2. The points have to stay "empty". This is the entire three volume book design, which I really want to preserve.
  3. The graphics has to stay vector. Therefore,
 settings.prc = false;  // IMPORTANT
 settings.render = 0;   // IMPORTANT

is really important. So, please no solutions with the entire picture with labels change.

The ability to change the picture has to stay, the labels has always be the same as in the body text.

Thank you.




Triangle $ABC$.

    \caption{Triangle $ABC$.}\label{OrthoCenterTetr}
    settings.outformat = "pdf";
    settings.prc = false;  // IMPORTANT
    settings.render = 0;   // IMPORTANT
    import three;
    import geometry;
    void opendot(picture pic=currentpicture, triple v, material p=currentpen,
    light light=nolight, string name="", render render=defaultrender)
    pen q=(pen) p;
    pen fillpen = light.background;
    if (invisible(fillpen)) fillpen = currentlight.background;
    if (invisible(fillpen)) fillpen = white;
    real size=0.5*linewidth(dotsize(q)+q);
    pic.add(new void(frame f, transform3 t, picture pic, projection P) {
    triple V=t*v;
    assert(!is3D(), "opendot() not supported unless settings.prc == false and settings.render != 0");
    if(pic != null)
    dot(pic,project(V,P.t),filltype=FillDraw(fillpen=fillpen, drawpen=q));
    triple R=size*(1,1,1);
    void opendot(picture pic=currentpicture, Label L, triple v, align align=NoAlign,
    string format=defaultformat, material p=currentpen,
    light light=nolight, string name="", render render=defaultrender)
    Label L=L.copy();
    if(L.s == "") {
    if(format == "") format=defaultformat;
    L.p((pen) p);
    size(4cm, 0);

    real a=3;
    real b=4;
    real c=4;

    triple A=(0,0,a);
    triple B=(0,b,0);
    triple C=(c,0,0);


    path3 p=O--(6,6*c/b,0);
    path3 q=B--C;
    path3 p1=O--(6,0,6*c/a);
    path3 q1=A--C;

    triple H1=intersectionpoint(p,q);
    triple H2=intersectionpoint(p1,q1);

    path3 h1=A--H1;
    path3 h2=B--H2;
    triple H=intersectionpoint(h1,h2);



  • This is quite weird. I tested on a 2D asy picture. Label $A$ in the asy picture is bigger than $A$ outside the asy picture, while no scaling. A kind of default ?
    – Black Mild
    Commented Jan 30, 2020 at 18:52
  • 4
    Have you tried playing with the asy font size? E.g., defaultpen(fontsize(10)); is an Asymptote command to set the font to 10 points (or 10 bp, I don't remember which). Ideally this should be taken care of by the inline option you are using, but perhaps you can add it manually. Commented Jan 30, 2020 at 19:28

2 Answers 2


Charles Staats is correct. Using the same fontsize in documentclass and tell Asymptote that size for defaultpen, then the labels on the Asymptote picture of the same size as in the text.

enter image description here

In \LaTeX\ document, using the same fontsize in \verb|documentclass| and tell Asymptote that size for \verb|defaultpen|  in a Asymptote picture, say drawing a triangle $ABC$.
\caption{Triangle $ABC$}\label{OrthoCenterTetr}
pair B=(-4,0), C=(1,0), A=(0,3.5);
pair M=(C+B)/2;
draw (A--M,green);
draw (A--B--C--cycle,orange);

Then the labels on the Asymptote picture of the same size as in the text: $A$ in the triangle $ABC$ and $A$ in Figure \ref{OrthoCenterTetr} have the same size.
  • This works for 2D but not for 3D. For some reason, the inline option does not agree with the document class option even despite of defaultpen(fontsize(12pt)). However the answer below works. Commented Feb 19, 2020 at 16:34

Previous answer works for 2D. For 3D I needed to add:

  1. [10 pt] option in the documentclass
  2. defaultpen(fontsize(10pt)); in the asymptote environment AND (ta-da-da-da...)
  3. \usepackage{asypictureB} as suggested here

The combination of these three approaches does provide same size font in the diagrams as in the text. Thanks everyone.

You must log in to answer this question.

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