// https://asymptote.sourceforge.io/gallery/CDlabel.asy
//settings.tex="pdflatex";
size(10cm);
usepackage("graphicx");
import labelpath;
fill(unitcircle^^(scale(0.15)*unitcircle),evenodd+rgb(0.5,1,0.83));
label(minipage(
"\centering\scriptsize
\textbf{
\LARGE {\tt Your Title}\\
\smallskip
\small The authors}\\
\smallskip
\today\\
",6cm),(0,0.5));
label("Your Texts",(-0.6,0));
label("Your Texts",(0.6,0));
//https://en.wikipedia.org/wiki/LaTeX#/media/File:LaTeX_project_logo_bird.svg
// label(graphic("logo.svg","height=2cm"),(0,-0.5));
labelpath("\textbf{ \large MACROPODS - Their Care, Breeding and the Rearing of Their Young\, by: David McCauley}",
reverse(arc((0,0),0.88,-80,260)));
// https://asymptote.sourceforge.io/gallery/CDlabel.asy
settings.tex="pdflatex";
size(10cm);
usepackage("graphicx");
import labelpath;
fill(unitcircle^^(scale(0.15)*unitcircle),evenodd+rgb(0.5,1,0.83));
label(minipage(
"\centering\scriptsize
\textbf{
\LARGE {\tt Your Title}\\
\smallskip
\small The authors}\\
\smallskip
\today\\
",6cm),(0,0.5));
label("Your Texts",(-0.6,0));
label("Your Texts",(0.6,0));
//https://en.wikipedia.org/wiki/LaTeX#/media/File:LaTeX_project_logo_bird.svg
label(graphic("logo.svg","height=2cm"),(0,-0.5));
Pergunta:
Como posso conectar imagem e labelpath?
Responder1
Como labelpath
é necessário settings.tex="latex";
, uma solução alternativa é gerar ambas as saídas separadamente nos asy
ambientes e depois sobrepô-las. Portanto, você deve executar pdfLaTeX
duas Asymptote
vezes e pdfLaTeX
novamente. Desta forma, a saída do selo do CD é filename-2.eps
e filename-2.eps-converted-to.pdf
, um dos quais pode ser incluído como label(graphic("filename-2.eps"),(0,0));
no primeiro asy
ambiente.
O comando clip
recorta o conteúdo atual na região da etiqueta do CD e centraliza assim os dois gráficos. path c=circle((0,0),1); draw(c,white);
é um círculo branco fantasma para obter uma imagem quadrada (de quase 100x100).
Nota: filename
refere-se ao nome do .tex
arquivo, comofilename.tex
MWE testado com TeXstudio
3.0.0 e TeX Live
2020 ( filename.tex
):
\documentclass{standalone}
\usepackage{asymptote}
\begin{document}
\begin{asy}
//https://en.wikipedia.org/wiki/LaTeX#/media/File:LaTeX_project_logo_bird.svg
settings.tex="pdflatex";
size(10cm);
fill(unitcircle^^(scale(0.15)*unitcircle),evenodd+rgb(0.5,1,0.83));
label(minipage(
"\centering\scriptsize
\textbf{
\LARGE {\tt Your Title}\\
\smallskip
\small The authors}\\
\smallskip
\today\\
",6cm),(0,0.5));
label("Your Texts",(-0.6,0));
label("Your Texts",(0.6,0));
label(graphic("logo.pdf","height=2cm"),(0,-0.5));
label(graphic("filename-2.eps"),(0,0));
clip(unitcircle^^(scale(0.15)*unitcircle),evenodd);
\end{asy}
\begin{asy}
// https://asymptote.sourceforge.io/gallery/CDlabel.asy
settings.tex="latex";
size(10cm);
import labelpath;
labelpath("\textbf{ \large MACROPODS - Their Care, Breeding and the Rearing of Their Young\, by: David McCauley}",
reverse(arc((0,0),0.88,-80,260)));
label(graphic("logo.pdf","height=2cm"),(0,-0.5));
path c=circle((0,0),1);
draw(c,white);
\end{asy}
\end{document}