Featured Book

LaTeX Beginners Guide

Who is online

In total there are 12 users online :: 1 registered, 0 hidden and 11 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: Yahoo [Bot] and 11 guests

Partner Sites

TeXwelt - Fragen und Antworten goLaTeX
TeXblog
TeXnicCenter
TeXample

compil \pbox with pdflatex

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

compil \pbox with pdflatex

Postby jcdemay on Fri Oct 17th, 2008

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

Postby localghost on Fri Oct 17th, 2008

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 13.1 (Linux 3.11.10), TeX Live 2013 (vanilla), TeXworks 0.5 (r1351)
² Posting stopped indefinitely due to offenses
User avatar
localghost
Site Moderator
 
Posts: 9219
Joined: Fri Feb 2nd, 2007
Location: Braunschweig, Germany

Re: compil \pbox with pdflatex

Postby jcdemay on Fri Oct 17th, 2008

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

Postby localghost on Fri Oct 17th, 2008

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 13.1 (Linux 3.11.10), TeX Live 2013 (vanilla), TeXworks 0.5 (r1351)
² Posting stopped indefinitely due to offenses
User avatar
localghost
Site Moderator
 
Posts: 9219
Joined: Fri Feb 2nd, 2007
Location: Braunschweig, Germany

Re: compile \pbox with pdflatex

Postby Stefan_K on Sat Oct 18th, 2008

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
LaTeX Community Administrator
User avatar
Stefan_K
Site Admin
 
Posts: 6414
Joined: Mon Mar 10th, 2008
Location: Hamburg, Germany

Re: compil \pbox with pdflatex

Postby jcdemay on Sat Oct 18th, 2008

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

Re: compile \pbox with pdflatex

Postby jcdemay on Sat Oct 18th, 2008

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

Postby localghost on Sat Oct 18th, 2008

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 13.1 (Linux 3.11.10), TeX Live 2013 (vanilla), TeXworks 0.5 (r1351)
² Posting stopped indefinitely due to offenses
User avatar
localghost
Site Moderator
 
Posts: 9219
Joined: Fri Feb 2nd, 2007
Location: Braunschweig, Germany


Return to General

Who is online

Users browsing this forum: Yahoo [Bot] and 11 guests