Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

In the following code, how can I replace the "Go‎ ‎to‎‎ ToC" with this image in the output pdf?

\documentclass{article}
\usepackage[top]{background}
\usepackage{lipsum}
\pagestyle{empty}
\usepackage[]{hyperref}
\usepackage{blindtext}
‎\SetBgContents{\hyperlink{toc}{Go‎ ‎to‎‎ ToC}}
\SetBgAngle{0}
\SetBgColor{black!40}
\SetBgScale{1}
\SetBgHshift{50}
\SetBgVshift{-9}
\begin{document}
\addtocontents{toc}{\protect\hypertarget{toc}{}}
\tableofcontents\newpage
\section{sec one}
\blindtext
\newpage
\section{sec two}
\blindtext
‎\end{document}‎

Edit:
Please note that the image should be created with something like tiKz. Because I want to send the output pdf to someone else.

share|improve this question
    
Welcome to TeX.sx! –  Andrew Swann Dec 29 '12 at 12:04
add comment

1 Answer

Saved the image down into the folder then modified as follows:

\documentclass{article}
\usepackage[top]{background}
\usepackage{lipsum}
\pagestyle{empty}
\usepackage[]{hyperref}
\usepackage{blindtext}

\SetBgAngle{0}
\SetBgColor{black!40}
\SetBgScale{1}
\SetBgHshift{50}
\SetBgVshift{-9}

\begin{document}
‎\SetBgContents{\hyperlink{toc}{\includegraphics[scale=1]{image.png}}}
\addtocontents{toc}{\protect\hypertarget{toc}{}}
\tableofcontents\newpage
\section{sec one}
\blindtext
\newpage
\section{sec two}
\blindtext
‎\end{document}‎

Result Below: Note Box around Image, which comes from the hyperlink.

result

share|improve this answer
    
Thanks ADP, but I want to send the output pdf to someone else. Isn't there a way to create the image using something like Tikz? –  Sisabe Dec 29 '12 at 12:06
    
I dont get it, once you have compiled it, the image is in the pdf, you can send it to anyone you want... –  Nicholas Hamilton Dec 29 '12 at 12:12
    
Ok, you are right, but the link to the ToC, does not work! How can I solve this problem? –  Sisabe Dec 29 '12 at 12:16
    
It works for me, I compile using TexMaker IDE and PDFLaTeX. See the updated post, above. –  Nicholas Hamilton Dec 29 '12 at 12:24
    
but with Xelatex, it does not work! –  Sisabe Dec 29 '12 at 12:27
show 5 more comments

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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