Who is online

In total there are 27 users online :: 1 registered, 0 hidden and 26 guests (based on users active over the past 5 minutes)
Most users ever online was 1327 on Tue Nov 05, 2013 7:11 pm

Users browsing this forum: W3C [Validator] and 26 guests

compil \pbox with pdflatex

Add tags LaTeX specific issues not fitting into one of the other forums of this category.

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.
jcdemay

Posts: 4
Joined: Fri Oct 17th, 2008

Re: compil \pbox with pdflatex

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 13.1 (Linux 3.11.10), TeX Live 2013 (vanilla), TeXworks 0.5 (r1351)
² Posting stopped indefinitely due to offenses

localghost
Site Moderator

Posts: 9219
Joined: Fri Feb 2nd, 2007
Location: Braunschweig, Germany

Re: compil \pbox with pdflatex

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:
Code: Select all  •  Open in writeLaTeX
\pbox{0.95\textwidth}{}{linewidth=2mm,framearc=0.3,linecolor=lightblue,fillstyle=gradient,gradangle=0,gradbegin=white,gradend=whiteblue,gradmidpoint=1.0,framesep=1em}{        \begin{minipage}[c][9cm][c]{0.78\textwidth}                \begin{center}                        {\sc \Huge Hello World !}\\[10mm]                        {\Large From me\\[7.5mm]for you}                \end{center}        \end{minipage}}

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.
jcdemay

Posts: 4
Joined: Fri Oct 17th, 2008

Re: compil \pbox with pdflatex

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 13.1 (Linux 3.11.10), TeX Live 2013 (vanilla), TeXworks 0.5 (r1351)
² Posting stopped indefinitely due to offenses

localghost
Site Moderator

Posts: 9219
Joined: Fri Feb 2nd, 2007
Location: Braunschweig, Germany

Re: compile \pbox with pdflatex

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:
Code: Select all  •  Open in writeLaTeX
\documentclass[a4paper,10pt,svgnames]{article}\usepackage{tikz}\usetikzlibrary{shadows}\newcommand{\pbox}[4]{%  \begin{tikzpicture}    \node[#3] {\begin{minipage}[t][#2][t]{#1}%      #4    \end{minipage}};  \end{tikzpicture}}\begin{document}\pbox{5cm}{}{rectangle,drop shadow,rounded corners=18pt,inner sep=10pt,             shade,top color=LightSlateBlue, bottom color=AliceBlue}             {\centering{\Huge Test}\par This is just a test.}\pbox{3cm}{}{rectangle,drop shadow,rounded corners=5pt,inner sep=10pt,             shade,top color=DarkOrange, bottom color=LightGoldenrod}             {\centering{\Large Test}\par Another one.}\bigskip\pbox{.7\textwidth}{}{rectangle,drop shadow,rounded corners=5pt,inner sep=5pt,  shade,left color=DarkRed, right color=Tomato}  {\centering\textcolor{white}{\textbf{This is the last line for this demonstration.}}}\end{document}

Stefan

Stefan_K

Posts: 6565
Joined: Mon Mar 10th, 2008
Location: Hamburg, Germany

Re: compil \pbox with pdflatex

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 17th, 2008

Re: compile \pbox with pdflatex

Stefan_K wrote:you could try pgf/TikZ. I've made this short example for you, compile it with pdflatex:
Code: Select all  •  Open in writeLaTeX
\documentclass[a4paper,10pt,svgnames]{article}\usepackage{tikz}\usetikzlibrary{shadows}\newcommand{\pbox}[4]{%  \begin{tikzpicture}    \node[#3] {\begin{minipage}[t][#2][t]{#1}%      #4    \end{minipage}};  \end{tikzpicture}}\begin{document}\pbox{5cm}{}{rectangle,drop shadow,rounded corners=18pt,inner sep=10pt,             shade,top color=LightSlateBlue, bottom color=AliceBlue}             {\centering{\Huge Test}\par This is just a test.}\pbox{3cm}{}{rectangle,drop shadow,rounded corners=5pt,inner sep=10pt,             shade,top color=DarkOrange, bottom color=LightGoldenrod}             {\centering{\Large Test}\par Another one.}\bigskip\pbox{.7\textwidth}{}{rectangle,drop shadow,rounded corners=5pt,inner sep=5pt,  shade,left color=DarkRed, right color=Tomato}  {\centering\textcolor{white}{\textbf{This is the last line for this demonstration.}}}\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.
jcdemay

Posts: 4
Joined: Fri Oct 17th, 2008

Re: compil \pbox 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

¹ System: openSUSE 13.1 (Linux 3.11.10), TeX Live 2013 (vanilla), TeXworks 0.5 (r1351)
² Posting stopped indefinitely due to offenses

localghost
Site Moderator

Posts: 9219
Joined: Fri Feb 2nd, 2007
Location: Braunschweig, Germany