making a book cover by Asymptote

by Black Mild   Last Updated April 15, 2019 10:23 AM

The following code is a way I make a book cover by TikZ. Basically, I get 4 coordinates of the cover page (book), then we are free to draw inside ABCD with TikZ commands.

Can we do similar for Asymptote, that is, make this book cover by Asymptote? I have tried something, but it does 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.

enter image description here

\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}
Tags : asymptote


Related Questions


Updated May 01, 2015 00:10 AM

Updated May 13, 2015 20:10 PM

Updated April 20, 2015 04:10 AM

Updated May 22, 2015 22:10 PM

Updated May 02, 2015 22:10 PM