## LaTeX forum ⇒ General ⇒ compil \pbox with pdflatex

LaTeX specific issues not fitting into one of the other forums of this category.
jcdemay
Posts: 4
Joined: Fri Oct 17, 2008 8:51 pm

### compil \pbox with pdflatex

I have a latex file I can smoothly compil using pslatex. I would like to compil it with pdflatex, however, because the latex file is containing some \pbox sequences, I can't.

Is there a way to make pdflatex understand the \pbox sequences ? Or maybe I can replace the \pbox sequences by a pdflatex equivalent ?

And no, I don't want to play with ps2pdf (long story...)

Regards.

localghost
Site Moderator
Posts: 9206
Joined: Fri Feb 02, 2007 12:06 pm
Location: Braunschweig, Germany
It's not really clear to me where the problem is, but I think that using PSNFSS is the better way to get access to postscript fonts. To clarify this issue you should provide some code in the sense of a minimal working example (MWE). Please read carefully the advices on the linked page when creating this MWE.

Best regards and welcome to the board
Thorsten¹
LaTeX Community Moderator

¹ System: openSUSE 42.2 (Linux 4.4.52), TeX Live 2016 (vanilla), TeXworks 0.6.1

jcdemay
Posts: 4
Joined: Fri Oct 17, 2008 8:51 pm
localghost wrote:It's not really clear to me where the problem is, but I think that using PSNFSS is the better way to get access to postscript fonts. To clarify this issue you should provide some code in the sense of a minimal working example (MWE). Please read carefully the advices on the linked page when creating this MWE.

I don't see how my problem is related to a font problem.

here is a sample:
2. {
3. \begin{minipage}[c][9cm][c]{0.78\textwidth}
4. \begin{center}
5. {\sc \Huge Hello World !}\\[10mm]
6. {\Large From me\\[7.5mm]for you}
7. \end{center}
8. \end{minipage}
9. }

This code compils with pslatex, but not with pdflatex because of the pbox sequence. However, I really need to use pdflatex (long story), so I was wonderered if there was a way to make pdflatex understand pbox or if there is a pdflatex compatible sequence that could do the same job.

localghost
Site Moderator
Posts: 9206
Joined: Fri Feb 02, 2007 12:06 pm
Location: Braunschweig, Germany
jcdemay wrote:[...] I don't see how my problem is related to a font problem. [...]

That's because your understanding of pslatex is very misleading. What you call "pslatex" is simply the latex compiler. The pslatex package I expected is font related. Therefore I requested a MWE, which is still necessary because I don't know where the \pbox command comes from. But as I now see from this code snippet, there are some arguments which are normally used with PSTricks. And that is the reason why this can't be compiled with pdflatex.
LaTeX Community Moderator

¹ System: openSUSE 42.2 (Linux 4.4.52), TeX Live 2016 (vanilla), TeXworks 0.6.1

Stefan Kottwitz
Posts: 8598
Joined: Mon Mar 10, 2008 9:44 pm
Location: Hamburg, Germany
Contact:
Hi,

jcdemay wrote:if there is a pdflatex compatible sequence that could do the same job.

you could try pgf/TikZ. I've made this short example for you, compile it with pdflatex:
1. \documentclass[a4paper,10pt,svgnames]{article}
2. \usepackage{tikz}
4. \newcommand{\pbox}[4]{%
5. \begin{tikzpicture}
6. \node[#3] {\begin{minipage}[t][#2][t]{#1}%
7. #4
8. \end{minipage}};
9. \end{tikzpicture}}
10.
11. \begin{document}
12. \pbox{5cm}{}{rectangle,drop shadow,rounded corners=18pt,inner sep=10pt,
13. shade,top color=LightSlateBlue, bottom color=AliceBlue}
14. {\centering{\Huge Test}\par This is just a test.}
15. \pbox{3cm}{}{rectangle,drop shadow,rounded corners=5pt,inner sep=10pt,
16. shade,top color=DarkOrange, bottom color=LightGoldenrod}
17. {\centering{\Large Test}\par Another one.}
18.
19. \bigskip
20. \pbox{.7\textwidth}{}{rectangle,drop shadow,rounded corners=5pt,inner sep=5pt,
21. shade,left color=DarkRed, right color=Tomato}
22. {\centering\textcolor{white}{\textbf{This is the last line for this demonstration.}}}
23.
24. \end{document}

Stefan

jcdemay
Posts: 4
Joined: Fri Oct 17, 2008 8:51 pm
localghost wrote:
jcdemay wrote:[...] I don't see how my problem is related to a font problem. [...]

That's because your understanding of pslatex is very misleading. What you call "pslatex" is simply the latex compiler. The pslatex package I expected is font related.


jcdemay
Posts: 4
Joined: Fri Oct 17, 2008 8:51 pm
Stefan_K wrote:you could try pgf/TikZ. I've made this short example for you, compile it with pdflatex:
1. \documentclass[a4paper,10pt,svgnames]{article}
2. \usepackage{tikz}
4. \newcommand{\pbox}[4]{%
5. \begin{tikzpicture}
6. \node[#3] {\begin{minipage}[t][#2][t]{#1}%
7. #4
8. \end{minipage}};
9. \end{tikzpicture}}
10.
11. \begin{document}
12. \pbox{5cm}{}{rectangle,drop shadow,rounded corners=18pt,inner sep=10pt,
13. shade,top color=LightSlateBlue, bottom color=AliceBlue}
14. {\centering{\Huge Test}\par This is just a test.}
15. \pbox{3cm}{}{rectangle,drop shadow,rounded corners=5pt,inner sep=10pt,
16. shade,top color=DarkOrange, bottom color=LightGoldenrod}
17. {\centering{\Large Test}\par Another one.}
18.
19. \bigskip
20. \pbox{.7\textwidth}{}{rectangle,drop shadow,rounded corners=5pt,inner sep=5pt,
21. shade,left color=DarkRed, right color=Tomato}
22. {\centering\textcolor{white}{\textbf{This is the last line for this demonstration.}}}
23.
24. \end{document}

Stefan

Impressive, with this few information (my bad, see previous post), you managed to provide a perfect replacement ! Great job, thank you ^^.

So, tikz is the pdflatex equivalent of pstricks. I'll try to port the class to it, thanks for the tips.

localghost
Site Moderator
Posts: 9206
Joined: Fri Feb 02, 2007 12:06 pm
Location: Braunschweig, Germany

In the meantime I found out that a \pbox command is also provided by the pbox package. So, you can see that there is a lot potential for confusion.
LaTeX Community Moderator

¹ System: openSUSE 42.2 (Linux 4.4.52), TeX Live 2016 (vanilla), TeXworks 0.6.1