7

In the following MWE I get a single page with the two graphics within:

\documentclass[multi]{standalone}

\standaloneenv{pspicture}
\usepackage[dvipsnames, svgnames, prologue]{xcolor}
\colorlet{BaseColor}{Crimson}
\usepackage{pstricks}

\begin{document}
\begin{pspicture}(0.5,0.5)
\psline[linecolor = BaseColor](0.5,0.5)
\end{pspicture}
\begin{pspicture}(1,1)
\psline(1,1)
\end{pspicture}
\end{document}

On the other hand, I get the graphics split in two pages if I say:

\documentclass[pstricks,multi]{standalone}

\standaloneenv{pspicture}
%\usepackage[dvipsnames, svgnames, prologue]{xcolor}
%   \colorlet{BaseColor}{Crimson}
%\usepackage{pstricks}

\begin{document}
\begin{pspicture}(0.5,0.5)
\psline(0.5,0.5)  % linecolor key not used anymore. See below
\end{pspicture}
\begin{pspicture}(1,1)
\psline(1,1)
\end{pspicture}
\end{document}

My problem about the last MWE is that if I pass the pstricks option to standalone, there is a clash with the options I need for the xcolor package.

I have the same problem (a single page) if I use the option class = memoir.

How can these issues be solved?

EDIT: Well, I solved the problem about the splitting in two pages by just typing the line \standaloneenv{pspicture} after loading the pstricks package, but I do not get any actual graphics on the pdf file either through dvi -> ps -> pdf or dvi -> pdf. This is due to the linecolor I am using.

The problem with class = memoir remains, too. I don't get any contents if I use that option -- the pages are there at the correct bounding box sizes, though, but they are empty.

Is it possible to solve these issues?

4
\RequirePackage[dvipsnames, svgnames, prologue]{xcolor}
\documentclass[multi,pstricks]{standalone}

\colorlet{BaseColor}{Crimson}

\begin{document}
\begin{pspicture}(0.5,0.5)
\psline[linecolor = BaseColor](0.5,0.5)
\end{pspicture}
\begin{pspicture}(1,1)
\psline(1,1)
\end{pspicture}
\end{document}

enter image description here

If you have [pstricks] as optional argument for standalone then the package loads pstricks and pstricks itself xcolor. This is the reason why you can't load xcolor later with other optional arguments.

With memoir you get only one page:

\documentclass{memoir}
\usepackage[dvipsnames, svgnames, prologue]{pstricks}
\colorlet{BaseColor}{Crimson}
\usepackage{auto-pst-pdf}

\begin{document}
\begin{pspicture}(0.5,0.5)
\psline[linecolor = BaseColor](0.5,0.5)
\end{pspicture}
\begin{pspicture}(1,1)
\psline(1,1)
\end{pspicture}

\end{document}

running it with pdflatex --shell-escape <file> will give the expected output.

3

It takes 257 characters.

\documentclass[pstricks,dvipsnames,svgnames,prologue]{standalone}
\colorlet{BaseColor}{Crimson}

\begin{document}
\begin{pspicture}(.5,.5)
\psline[linecolor=BaseColor](.5,.5)
\end{pspicture}
\begin{pspicture}(1,1)
\psline(1,1)
\end{pspicture}
\end{document}

enter image description here

The last resort

The following takes 363 characters.

\documentclass[dvipsnames,svgnames,prologue]{memoir}
\usepackage{pstricks}

\colorlet{BaseColor}{Crimson}
\usepackage[tightpage,active]{preview}
\PreviewEnvironment{pspicture}
\PreviewBorder=12pt\relax

\begin{document}
\begin{pspicture}(.5,.5)
\psline[linecolor=BaseColor](.5,.5)
\end{pspicture}
\begin{pspicture}(1,1)
\psline(1,1)
\end{pspicture}
\end{document}
  • Herbert's answer takes 297 characters. – kiss my armpit Jan 17 '14 at 7:21
  • @{Code Mocker, Herbert}: LOL! Both answers are right, although the first to point out at this was Speravir by means of his comment (I believe it is "his"). Nonetheless, the problem with class = memoir remains. – Marcos Jan 17 '14 at 10:46
  • @Marcos: See my update. – kiss my armpit Jan 17 '14 at 12:29
  • @Marcos Yepp, you believe right. – Speravir Jan 17 '14 at 21:11
  • @Speravir: That's what I expected from your profile pic ;-) Now, if you'd only had any hints on why the class = memoir option fails, and provided an answer including the "color affair", I think it'd be just fair checking yours. – Marcos Jan 18 '14 at 6:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.