A way I make a book cover with TikZ is getting 4 coordinates of the cover page (book), then freely drawing inside ABCD with TikZ commands.
Can we do similar for Asymptote, that is, getting 4 coordinates of the cover page and use them in Asymptote code?
For example below, the picture and last TikZ code of the cover page I redraw. I have tried something with Asymptote, but it did not work as expected.
\documentclass{book}
%\usepackage[top=2cm,bottom=2cm,left=2cm,right=1.5cm]{geometry}
\usepackage[inline]{asymptote}
\begin{document}
\begin{asy}
unitsize(1cm);
pair A=(current page.north west);
pair B=(current page.north east);
pair C=(current page.south east);
pair D=(current page.south west);
pair E=(current page.center);
draw(A--C,blue);
draw(B--D,red);
\end{asy}
\end{document}
PS: Well, the reasson I look for Asymptote way is: Even in 2D, Asymptote is somehow better than TikZ, for example, in drawing graph of Implicit function. I want to utilise excellent capability of Asymptote.
\documentclass{book}
%\usepackage[top=2cm,bottom=2cm,left=2cm,right=1.5cm]{geometry}
\usepackage{tikz}
\definecolor{denim}{rgb}{0.08, 0.38, 0.74}
\begin{document}
\begin{tikzpicture}[overlay,remember picture]
\path
(current page.north west) coordinate (A)
(current page.north east) coordinate (B)
(current page.south east) coordinate (C)
(current page.south west) coordinate (D)
(current page.center) coordinate (E);
% Now you have book cover as the rectangle ABCD
% You are free to draw inside ABCD
\fill[denim] (A) rectangle (C);
\draw[white,line width=1.5mm]
([shift={(6,0)}]A)--([shift={(6,0)}]D)
([shift={(6.25,0)}]A)--([shift={(6.25,0)}]D);
\node[white,scale=1.5,align=left,
font=\bfseries\sffamily] at ([shift={(2.5,-3)}]A)
{Stability\\
and Control:\\
Theory,\\
Method and\\
Applications\\
Volume 15};
\node[white,xscale=5,yscale=5,align=left,
font=\sffamily\bfseries] at ([shift={(2.5,4.5)}]E)
{Almost Periodic\\
Solutions of \\
Differential\\
Equations in\\
Banach Spaces};
\node[white,scale=2,align=left,
font=\sffamily\bfseries] at ([shift={(1,-5)}]E)
{Y. Hino, T. Naito,\\
Nguyen Van Minh\\
and Jong Son Shin};
\end{tikzpicture}
\end{document}
\myAsyCoordA
,\myAsyCoordB
, etc), then these macros will be visible if you useasypictureB
in your asymptote code as@myAsyCoordA
,@myAsyCoordB
, etc. But in general I think TikZ is a better choice for drawing directly on the page;asymptote
usesgraphicx
internally to import images, so it's mostly suited to drawing independent graphics rather than interacting with TeX elements.