2

I try to reproduce the answer Photo Clipper of kiss my armpit to the question Photo Clipper but it is not succeeding. As I do not have any clue what might be the problem I would like to know if there is anything I have to take into account to get the desired result (such as picture size...):

\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}

Edit 1. The resulting picture is this: enter image description here

9
  • So you have copied the code, commented out some content and then what? Maybe you can show us what result you get when you put in your desired picture? Is it too big, too small?
    – Huang_d
    Jun 12, 2017 at 12:17
  • @Huang_d: Thank you. I edited the question but I am not able to say anything more than it does not work.
    – Philip
    Jun 12, 2017 at 12:24
  • Well… Is your picture named pretty.png (or .jpg or any other that is accepted by \includegraphics? Have you tried the options of \includegraphics such as [scale=] or [width=\textwidth]? (4kg of potatoes? You must be german)
    – Huang_d
    Jun 12, 2017 at 12:28
  • 2
    I've copied your code, changed pretty by example-image, compiled with xelatex and it worked. I get example-image clipped inside a hart line.
    – Ignasi
    Jun 12, 2017 at 16:40
  • 2
    Same as @Ignasi, copied, put an image into the same folder, named it pretty.png and compiled it with XeTeX. Does that work for you? What error do you get in that case?
    – Huang_d
    Jun 12, 2017 at 16:43

0

Browse other questions tagged or ask your own question.