我想使用他们提供的亲吻我腋窝的照片剪辑器形状来回答我们可以用 LaTeX 制作爱心吗?。但是,我希望心形周围的背景为红色(图片除外)。有人能帮我吗?
\documentclass[border=12pt,pstricks]{standalone}
\usepackage{graphicx}
\newsavebox\IBox
\savebox\IBox{\includegraphics{pretty}}
\usepackage{pst-plot}
\def\x(#1){sin(#1)^3}
\def\y(#1){(13*cos(#1)-5*cos(2*#1)-2*cos(3*#1)-cos(4*#1))/16}
\psset
{
algebraic,
plotpoints=100,
xunit=.5\wd\IBox,
yunit=.5\ht\IBox,
}
\usepackage{mathtools}
\begin{document}
\begin{pspicture}[showgrid=false](-1,-1)(1,1.5)
\begin{psclip}{\psparametricplot[origin={0,0.15}]{0}{\psPiTwo}{\x(t)|\y(t)}}
\rput(0,0){\usebox\IBox}
\end{psclip}
\rput(0,1.25){%
\color{red}\large
$\displaystyle\!
\begin{aligned}
% x(t)&=\sin^3 t\\
% y(t)&=(13\cos t -5\cos 2t -2\cos 3t -\cos 4t)/16
\end{aligned}$}
\rput(0,1){
%HAPPY BIRTHDAY
}
\end{pspicture}
\end{document}
答案1
您可以使用该pagecolor
包来执行此操作:
\documentclass[border=12pt,pstricks]{standalone}
\usepackage{graphicx}
\newsavebox\IBox
\savebox\IBox{\includegraphics{duck}}
\usepackage{pst-plot}
\usepackage{pagecolor}
\pagecolor{red}
\def\x(#1){sin(#1)^3}
\def\y(#1){(13*cos(#1)-5*cos(2*#1)-2*cos(3*#1)-cos(4*#1))/16}
\psset
{
algebraic,
plotpoints=100,
xunit=.5\wd\IBox,
yunit=.5\ht\IBox,
}
\usepackage{mathtools}
\begin{document}
\begin{pspicture}[showgrid=false](-1,-1)(1,1.5)
\begin{psclip}{\psparametricplot[origin={0,0.15}]{0}{\psPiTwo}{\x(t)|\y(t)}}
\rput(0,0){\usebox\IBox}
\end{psclip}
\end{pspicture}
\end{document}