1

I'm working on an moderncv and trying to edit the default attachfile icon (Pushpin) to use the Paperclip, but it returns an error.

Here is my MWE:

\documentclass[11pt,spanish,a4paper,sans]{moderncv}

\usepackage[utf8]{inputenc} 
\usepackage[unicode]{attachfile}

\firstname{Peter} % Your first name
\familyname{Peter Peter} % Your last name

%--------------------------------------------------------------------------
%ATTACHFILE: pdf-generating mode 
\RequirePackage{ifpdf}
\ifpdf
\else
    \PackageWarningNoLine{attachfile}{%
        attachfile works _only_ with pdfLaTeX and LuaLaTeX\MessageBreak
        and _only_ in PDF-generating mode. For this run,\MessageBreak
        placeholders will be substituted for all\MessageBreak
        attachfile commands%
}
\fi

%ATTACHFILE: packages required
\RequirePackage{keyval}
\RequirePackage{calc}
\RequirePackage{color}
%--------------------------------------------------------------------------



\begin{document}

%Recreate Adobe Acrobat’s Paperclip icon
\newcommand{\atfi@acroPaperclip@data}{%
    q 0.75 G 0 i 2.5 w 1 J 4 M 1.9619 11.7559 m 1.9619 3.3037
    1.9619 2.5059 v 1.9619 1.707 4.0947 1.25 y 7.4141 1.25 l 9.4292
    1.8223 9.4292 3.3066 v 9.4292 4.79 9.4292 16.8945 y 9.7852
    18.1514 8.481 18.1514 v 7.1768 18.1514 5.1616 18.1514 y 3.8574
    17.9209 3.8574 16.8945 v 3.8574 15.8652 3.8574 6.6172 y 4.3325
    5.418 5.1025 5.418 v 5.8726 5.418 6.5845 5.418 y 7.6812 5.6455
    7.6812 6.4736 v 7.6812 7.3027 7.6812 11.5264 y S 0 G 1.2495
    12.4404 m 1.2495 3.9883 1.2495 3.1895 v 1.2495 2.3906 3.3833
    1.9326 y 6.7026 1.9326 l 8.7178 2.5068 8.7178 3.9902 v 8.7178
    5.4736 8.7178 17.5781 y 9.0732 18.834 7.769 18.834 v 6.4653
    18.834 4.4497 18.834 y 3.146 18.6055 3.146 17.5781 v 3.146
    16.5498 3.146 7.3018 y 3.6201 6.1016 4.3911 6.1016 v 5.1611
    6.1016 5.873 6.1016 y 6.9692 6.3301 6.9692 7.1572 v 6.9692
    7.9863 6.9692 12.21 y S \atfi@color@rgb\space RG 1 w
    1.2495 12.4404 m 1.2495 3.9883 1.2495 3.1895 v 1.2495 2.3906
    3.3833 1.9326 y 6.7026 1.9326 l 8.7178 2.5068 8.7178 3.9902 v
    8.7178 5.4736 8.7178 17.5781 y 9.0732 18.834 7.769 18.834 v
    6.4653 18.834 4.4497 18.834 y 3.146 18.6055 3.146 17.5781 v
    3.146 16.5498 3.146 7.3018 y 3.6201 6.1016 4.3911 6.1016 v
    5.1611 6.1016 5.873 6.1016 y 6.9692 6.3301 6.9692 7.1572 v
    6.9692 7.9863 6.9692 12.21 y S Q
}

%Draw \atfi@acroPaperclip@data in a box of the appropriate size
\DeclareRobustCommand{\atfi@acroPaperclip}{%
    \raisebox{-1.25bp}{\parbox[b][21bp]{12bp}{%
        \rule{0pt}{0pt}\pdfliteral{\atfi@acroPaperclip@data}}%  
    }%
}

The ERROR:

! Missing number, treated as zero. a l.55 } A number should have been here; I inserted 0'. (If you can't figure out why I needed to see a number, look upweird error' in the index to The TeXbook.)

1

I don't understand why you think that you need to recreate something, the paperclip works by default:

\documentclass[11pt,spanish,a4paper,sans]{moderncv}

\usepackage[utf8]{inputenc}
\usepackage[unicode]{attachfile}

\firstname{Peter} % Your first name
\familyname{Peter Peter} % Your last name

\begin{document}
\attachfile[icon=Paperclip]{article.cls}
article.cls

\end{document}

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.