2

I'm trying to write text over an image like this exemple: enter image description here

I've read a lot about this topic but as I'm quite a beginner with Latex I'm lost (I'm using Overleaf with pdflatex btw).

I did the exemple with this code:

preambule.tex
\usepackage{pst-all}
\usepackage[miktex]{pdftricks} 
\usepackage{auto-pst-pdf}

main.tex \input{preambule} \begin{document} \begin{pspicture}(2.6,0)(21,3) \uputur{\includegraphics[width=20.6cm,height=3cm]{images/Bandeau.jpg}} \uputu{\textbf{\LARGE{Rapport 1 mois de stage}}} \uputu{\textbf{\large{JLR}}} \uputu{\textbf{4A GBM}} \uputu{\textbf{Octobre 2020}} \end{pspicture}

\section{Environnement}

But I still have some warnings that I don't really understand:

Package pdftricks Warning: **************************************** No \write 18 capability. You'll have to run a script by yourself! ****************************************.

Package pdftricks Warning: **************************************** Package pdftricks v,1.16 loaded [psTricks support in PDF (CVR, ACL)] ****************************************.

So, I would like to know if it is a good solution and how I can remove those warnings. Or do I have to use tikz (such as this answer) even if I find it more difficult than pstricks ? What's the real difference(s) between this two solutions?

I've also read about pdftex--shell-escape or \write18 but I don't know where to introduce it in my document because I do not use commands.

Well, if someone can clarify those points... Thanks!

2 Answers2

5

There is no need for pstricks or complicated stuff. You can simple go back and write over a picture:

\documentclass{article}

\usepackage{graphicx}

\begin{document} \includegraphics{example-image-duck}\raisebox{3cm}{\hspace{-4cm}\Huge Some Text} \end{document}

enter image description here

Ulrike Fischer
  • 327,261
1

Run with xelatex:

\documentclass[border=10pt,pstricks]{standalone}
\usepackage{graphicx,mwe}
\usepackage{pstricks}
\newsavebox\IBox
\sbox\IBox{\includegraphics{example-grid-100x100pt.png}}
\begin{document}

\begin{pspicture}(\wd\IBox,\ht\IBox) \rputlb{\usebox\IBox}% \pslinelinecolor=white,linewidth=5pt% \pslinelinecolor=white,linewidth=5pt(\wd\IBox,0) \pslinelinecolor=white,linewidth=2pt(\wd\IBox,0.5\ht\IBox) \pslinelinecolor=white,linewidth=2pt(0.5\wd\IBox,0) \end{pspicture}

\end{document}

enter image description here

user187802
  • 16,850