Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Can somebody help me to generate two overlapping boxes in a psmatrix? What I need is an ncbox from {3,3} to {8,8} and one from {3,3} to {3,8}. I know it's possible to draw them in a separate figure, but I can't manage to put them in the same psmatrix.

\documentclass[12pt,oneside,english]{book}
\usepackage[T1]{fontenc}
\usepackage[latin9]{inputenc}
\usepackage{geometry}
\geometry{verbose,tmargin=3cm,bmargin=3cm,lmargin=3cm,rmargin=3cm}
\pagestyle{plain}
\setcounter{secnumdepth}{3}
\setcounter{tocdepth}{3}
\usepackage{float}
\usepackage{amsmath,qtree, amssymb, amsthm, graphicx,graphics, makeidx,esint,bm,pstricks,pst-node,pst-tree}


\begin{document}
\begin{figure}[H]
\begin{align*}
\psmatrix[colsep=0.7cm,rowsep=0.15cm]
\cdot \\
 \cdot  &  \cdot \\
 \cdot  &  \cdot  &  \cdot \\
 \cdot  &  \cdot  &  \cdot & \cdot \\
 \cdot  &  \cdot  &  \cdot  &  \cdot &  \cdot \\
 \cdot  &  \cdot  &  \cdot  &  \cdot  &  \cdot  &  \cdot \\
 \cdot  &  \cdot  &  \cdot &  \cdot  &  \cdot  &  \cdot  &  \cdot \\
 \cdot  &  \cdot  &  \cdot &  \cdot  &  \cdot  &  \cdot  & \cdot  & \cdot 
\ncbox[nodesep=.25cm,boxsize=.25,linearc=.2]{3,3}{8,8}
\endpsmatrix
\end{align*}\caption{\label{fig:equal sets in matrix}}
\end{figure}

\end{document}
share|improve this question
    
Welcome to TeX.sx! A tip: If you indent lines by 4 spaces, they'll be marked as a code sample. You can also highlight the code and click the "code" button (with "{}" on it). –  percusse Dec 22 '12 at 13:57

1 Answer 1

it has nothing to do with psmatrix. It is a problem with undefined array cells and you'll have the same problems with horizontal lines. When you use \\ before you you have used all cells in a row then some cells are not defined. Define in the 3rd row all cells and everything will be fine:

\documentclass{book}
\usepackage{amsmath,pst-node}

\begin{document}
\begin{align*}
\psmatrix[colsep=0.7cm,rowsep=0.15cm]
 \cdot \\
 \cdot & \cdot \\
 \cdot & \cdot & \cdot & & & & &\\ % define all cells!
 \cdot & \cdot & \cdot & \cdot \\
 \cdot & \cdot & \cdot & \cdot & \cdot \\
 \cdot & \cdot & \cdot & \cdot & \cdot & \cdot \\
 \cdot & \cdot & \cdot & \cdot & \cdot & \cdot & \cdot \\
 \cdot & \cdot & \cdot & \cdot & \cdot & \cdot & \cdot & \cdot 
\ncbox[nodesep=.25cm,boxsize=.25,linearc=.2,
       fillstyle=solid,fillcolor=red!30]{3,3}{8,8}
\ncbox[nodesep=.25cm,boxsize=.25,linearc=.2,
       fillstyle=solid,fillcolor=blue!50,opacity=0.5]{3,3}{3,8}
\endpsmatrix
\end{align*}

\end{document}

enter image description here

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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