TransWikia.com

What's the best way to write over an image?

TeX - LaTeX Asked by Jeanne LR on December 17, 2020

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)
  uput[ur](0,0){includegraphics[width=20.6cm,height=3cm]{images/Bandeau.jpg}}
  uput[u](10,2){textbf{LARGE{Rapport 1 mois de stage}}}
  uput[u](10,1){textbf{large{JLR}}}
  uput[u](10,0.5){textbf{4A GBM}}
  uput[u](10,0){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 Answers

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

Answered by Ulrike Fischer on December 17, 2020

Run with xelatex:

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

begin{pspicture}(wdIBox,htIBox)
rput[lb](0,0){useboxIBox}%
psline[linecolor=white,linewidth=5pt](wdIBox,htIBox)%
psline[linecolor=white,linewidth=5pt](0,htIBox)(wdIBox,0)
psline[linecolor=white,linewidth=2pt](0,0.5htIBox)(wdIBox,0.5htIBox)
psline[linecolor=white,linewidth=2pt](0.5wdIBox,htIBox)(0.5wdIBox,0)
end{pspicture}

end{document}

enter image description here

Answered by user187802 on December 17, 2020

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP