Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to transfer the fixed width and height in tex to the size in asy? #479

Open
ccworld1000 opened this issue Oct 21, 2024 · 2 comments
Open

Comments

@ccworld1000
Copy link
Contributor

Question 2: How to transfer the fixed width and height in tex to the size in asy?
fg:
By obtaining the tex height and width, some calculations may be performed to re pass the new values to the size function in asy.

Screenshot 2024-10-21 at 11 11 26

The areas where tex height and width are needed may include annotations 1, 2, and 3 in the screenshot above.

@charlesstaats
Copy link
Contributor

Note that the asypictureB package has tools for this. For instance, you can use the macro @the@linewidth inside the asymptote code (which will get preprocessed into the value of the TeX linewidth quantity before the asy code is run). You can also define your own macros, as in this example from the asypictureB documentation:

\noindent\def\asywidth{4.5cm}
\begin{asypicture}{name=triangle2,width=\asywidth}
settings.outformat="pdf";
size(@asywidth,0);
draw((0,0) -- (1,0) -- (1,1) -- cycle);
dot((1,0), L=Label(
"\textbf{Bold} \textsc{Smallcaps}",
align=NE));
\end{asypicture}

Again, note that these are capabilities available when using the asypictureB package, which is not the same as the official asymptote package (although both packages call the Asymptote program behind the scenes).

@ccworld1000
Copy link
Contributor Author

Is there such a simplified version?
Like directly accepting the tex command. The following pseudocode
\begin{asy}
real x = \width;
\end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants