LaTeX forum ⇒ Generalcompil \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

Postby jcdemay » Fri Oct 17, 2008 9:05 pm

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.

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

Postby localghost » Fri Oct 17, 2008 10:49 pm

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
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes


¹ 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

Postby jcdemay » Fri Oct 17, 2008 11:17 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:
  1. \pbox{0.95\textwidth}{}{linewidth=2mm,framearc=0.3,linecolor=lightblue,fillstyle=gradient,gradangle=0,gradbegin=white,gradend=whiteblue,gradmidpoint=1.0,framesep=1em}
  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.

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

Postby localghost » Fri Oct 17, 2008 11:37 pm

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
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes


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

User avatar
Stefan Kottwitz
Site Admin
Posts: 8253
Joined: Mon Mar 10, 2008 9:44 pm
Location: Hamburg, Germany
Contact:

Postby Stefan Kottwitz » Sat Oct 18, 2008 1:53 am

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}
  3. \usetikzlibrary{shadows}
  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
Site admin

jcdemay
Posts: 4
Joined: Fri Oct 17, 2008 8:51 pm

Postby jcdemay » Sat Oct 18, 2008 10:43 am

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.

Well on my system, latex is a symbolic link to either pslatex or pdflatex depending on which one is your default compiler, but you were right, it's not like I knew what I was doing, after a few minutes of inspection, I got to know that pbox is a newcommand used in the academic poster class I downloaded, newcommand which is using psshadowbox, which is from the pstricks package, and which therefore can't be used with pdflatex.

jcdemay
Posts: 4
Joined: Fri Oct 17, 2008 8:51 pm

Postby jcdemay » Sat Oct 18, 2008 10:46 am

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}
  3. \usetikzlibrary{shadows}
  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.

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

Postby localghost » Sat Oct 18, 2008 10:54 am

jcdemay wrote:Well on my system, latex is a symbolic link to either pslatex or pdflatex depending on which one is your default compiler, but you were right, it's not like I knew what I was doing, after a few minutes of inspection, I got to know that pbox is a newcommand used in the academic poster class I downloaded, newcommand which is using psshadowbox, which is from the pstricks package, and which therefore can't be used with pdflatex.

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
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes


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


Return to “General”

Who is online

Users browsing this forum: Bing [Bot] and 4 guests