Per request, here is the image of mwe.pdf:
See below for my problem, discussion of problem, and copy of mwe.tex.
This is a difficult query to present because it necessarily involves inserting an aymptote box into a picture environment. Unfortunately, this is not an asymptote problem, so it must be presented in a LaTeX forum.
As discussed below, I (necessarily) use the picture environment to vertically align a minipage of free-form text with an asymptote diagram. Apparently(?), the picture environment moderately disrupts the horizontal positioning of the asymptote diagram with glue.
How do I prevent the disruption of the asymptote diagram's horizontal positioning?
Discussion
A minimum working example of the problem is presented below. asyboxa, which draws the 4 quadrants of a circle, is hard-coded to create a 4cm by 4cm diagram. boxa presents a 6cm wide minipage, with its text aligned to the bottom of boxa.
The preamble sets the unitlength of 1cm, which controls how coordinates are interpreted in the picture environment. The first framed picture environment combines the minipage with the asymptote diagram while the second framed picture environment only presents the asymptote diagram.
In both frames, the manually drawn square indicates where the asymptote diagram is intended to be placed. This can be confirmed by comparing the \put commands within each picture environment. As the generated PDF will show, both picture environments are vertically positioning the asymptote diagrams as intended, but are also (apparently) inserting unwanted glue that is disturbing the horizontal
positioning.
Compile procedure:
- Save the file as (for example)
mwe.tex - Execute:
pdflatex mwe.tex - Execute:
asy mwe-*.asy - Execute:
pdflatex mwe.tex
This should create mwe.pdf. The mwe.tex file is shown below.
\documentclass[fleqn,letterpaper,10pt]{article}
\pagestyle{plain}
\usepackage{asymptote}
\newsavebox{\boxa}
\newsavebox{\asyboxa}
\setlength{\unitlength}{1cm}
\begin{document}%
\begin{lrbox}{\asyboxa}%
\begin{asy}
size(4cm,4cm);
draw((-2,0) -- (2,0));
draw((0,-2) -- (0,2));
draw(circle((0,0), 2));
\end{asy}
\end{lrbox}%
\begin{lrbox}{\boxa}%
\begin{minipage}[b]{6cm}%
Minipage has 6cm width. \\%
Text alignment uses [b] option. \\%
Therefore last line of minipage \\%
is at bottom of boxa.
\end{minipage}%
\end{lrbox}%
\frame{%
\begin{picture}(11.5,4.5)
\linethickness{.5mm}%
\put(0,0.2){\usebox\boxa}%
\put(7.0,0.2){\usebox\asyboxa}%
\put(7.0,0.2){\line(1,0){4.0}}%
\put(7.0,4.2){\line(1,0){4.0}}%
\put(7.0,0.2){\line(0,1){4.0}}%
\put(11.0,0.2){\line(0,1){4.0}}%
\end{picture}%
}%
\vspace*{36pt}%
\frame{%
\begin{picture}(5.5,4.5)
\linethickness{.5mm}%
\put(1.0,0.2){\usebox\asyboxa}%
\put(1.0,0.2){\line(1,0){4.0}}%
\put(1.0,4.2){\line(1,0){4.0}}%
\put(1.0,0.2){\line(0,1){4.0}}%
\put(5.0,0.2){\line(0,1){4.0}}%
\end{picture}%
}%
\end{document}
Addendum
Two additions to the query.
- I added the
asymptotetag, since otherasymptoteusers may have {struggled with -- solved} the problem. - I experimented by defining the
pictureenvironment wide enough to extend the right side margin, defining a (very wide)saveboxto contain theasymptotebox flush left, and having thepictureenvironment\putthesaveboxinstead of theasymptotebox -- No Joy.

pictureenvironment in a\fboxwith\fboxsepset to zero, adding\put(0,0){\circle*{0.1}}and\put(5.5,4.5){\circle*{0.1}}just to mark the bounding box, I get this picture (click). The Asymptote drawing sits exactly at (1,0.2). – egreg Feb 23 '20 at 16:15asymptote.sty. – egreg Feb 23 '20 at 20:46