Graphics, Figures & TablesColumn alignments and seperation in psmatrix for flowchart

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
spikenard
Posts: 2
Joined: Sun Jan 23, 2011 12:24 am

Column alignments and seperation in psmatrix for flowchart

Post by spikenard »

Hello All,

I've been using LaTeX for about two weeks and this is my first post on the forum. I'd like to begin by thanking in advance anyone who reads this for the time they spend doing so, I'm very grateful.

I know that the matter of alignment in matrices has been dealt with already in a number of other threads and I've read these without being able to solve my problem so I hope that my post won't be considered a waste of anyone's time. In previous posts the problem of column alignment in matrices appears to have been solved by either:

(A) Suggesting the use of an alignment or array environment instead of a matrix environment that already allows for column alignment arguments.
(B) A new definition of the matrix environment to include alignment possibilities.

I'm not sure if the alternative environments of the (A) type solution would allow for the use of the environment as a node map for the subsequent flowchart and I'm afraid that the type (B) solutions on the forum are specific to other people's problems and I don't understand how one might redefine an environment to solve my difficulty.

My problem is tidying up the alignment of the following flowchart:

Code: Select all


\documentclass[a5paper,twoside]{article}
\usepackage{amsmath,pst-all,geometry,fancyhdr}

\begin{document}

\pagestyle{fancy}
\fancyhf{}
\fancyhead[CO]{The Article Name}
\fancyhead[CE]{The Journal Name}
\fancyfoot[CO,CE]{\thepage}
\parindent=0pt

\begin{psmatrix}[colsep=-2cm,rowsep=0.5cm]
& \ensuremath{~~(10) \rotateright{\rotateright{A}}w\rotateright{\rotateright{A}}y\neg(Gywa@)} \\ %1
& \ensuremath{~~(11) Eao} \\ %2
& \ensuremath{~~(12) \rotateright{\rotateright{A}}x \rotateright{\rotateright{A}} w\rotateright{\rotateright{A}}v(Exw\wedge \neg Exv\rightarrow Gxwxv)} \\ %3
& \ensuremath{ \neg (13) \neg Ea@ \vee Gbma@} \\ %line 4
\ensuremath{Ea@}&&\ensuremath{Gbma@}\\ %line 5
\ensuremath{(12) (Ean\wedge\neg Ea@ ) \rightarrow Gana@}&&\ensuremath{(10) \frac{\displaystyle \neg Gbma@}{\displaystyle X}} \\ %line 6
\ensuremath{Gana@}&&\ensuremath{\neg (Ean\wedge \neg Ea@)} \\ %line 7
\ensuremath{(10) \frac{\displaystyle \neg Gbma@}{\displaystyle X}} & \ensuremath{\neg Ean} & \ensuremath{\frac{\displaystyle Ea@}{\displaystyle X}} \\ %line 8
& \ensuremath{(12) (Ean\wedge \neg Ea@ ) \rightarrow Gana@} \\ %line 9
\ensuremath{Gaoa} & & \ensuremath{\neg(Ean \wedge \neg Ea@)} \\ %line 10
\ensuremath{(10) \frac{\displaystyle \neg Gbma@}{\displaystyle X}} & \ensuremath{\neg Eao} & \ensuremath{\frac{\displaystyle Ea@}{\displaystyle X}} \\ %line 11
& \ensuremath{\frac{\displaystyle Eao}{\displaystyle X}} \\ %12
\end{psmatrix}

\psset{nodesep=3pt,arrows=-}
\ncline{4,2}{5,1}\ncline{4,2}{5,3} %line 4->5
\ncline{5,1}{6,1}\ncline{5,3}{6,3} %line 5->6
\ncline{6,1}{7,1}\ncline{6,1}{7,3} %line 6-7
\ncline{7,1}{8,1}\ncline{7,3}{8,2}\ncline{7,3}{8,3} %line 7->8
\ncline{8,2}{9,2} %line 8->9
\ncline{9,2}{10,1}\ncline{9,2}{10,3}%9->10
\ncline{10,1}{11,1}\ncline{10,3}{11,2}\ncline{10,3}{11,3} %10->11
\ncline{11,2}{12,2} %11->12

\end{document}

Problem (1): The first four rows of the matrix contain statements that are currently center aligned in the second column. I want to left align the statements of the first four rows in the second column so that the statement numbers in the first four rows are vertically aligned with each other. [Left aligning the second column in the first four rows might lead to pushing the third column off the page and a bad box error or it might lead to alignment problems in rows 8, 9, 11 and 12 which I'm not sure how to handle - maybe I need to use two environments or renew the psmatrix environment after the first four lines?]

Problem (2): As the third column of the matrix contains no long statements it appears slightly crushed up against the second column. Is it possible to even the distance between the 2nd column and the 1st and 3rd columns or adjust the column separation for these columns separately without the whole thing falling off the right side of the page again?

Problem (3): The capital 'x' fraction denominator appears to contact the dividing line of the fraction, can a tiny bit of extra space be placed between the top of the 'x' and this line?

Many thanks for any time that you have spent considering this post!
Last edited by spikenard on Sun Jan 30, 2011 11:35 pm, edited 1 time in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

spikenard
Posts: 2
Joined: Sun Jan 23, 2011 12:24 am

Re: Column alignments and seperation in psmatrix for flowcha

Post by spikenard »

I've nibbled away at these problems and came up with the following somewhat inelegant solutions:

Problem (1) I separated the first four lines of the matrix into a separate array and then fiddled with tilde spacing for the final alignment of this array over the matrix. This left some unwanted vertical space between the array and the matrix but otherwise looks fine on the page.

Problem (2) More fiddling around with tilde spacing in the right hand side column until LaTeX would automatically balance the left and right hand sides.

Problem (3) I just try to ignore this problem and think about something else.
CrazyHorse
Posts: 351
Joined: Sat Aug 02, 2008 8:47 am

Column alignments and seperation in psmatrix for flowchart

Post by CrazyHorse »

spikenard wrote:I've nibbled away at these problems and came up with the following somewhat inelegant solutions:

Problem (1) I separated the first four lines of the matrix into a separate array and then fiddled with tilde spacing for the final alignment of this array over the matrix. This left some unwanted vertical space between the array and the matrix but otherwise looks fine on the page.

Problem (2) More fiddling around with tilde spacing in the right hand side column until LaTeX would automatically balance the left and right hand sides.

Problem (3) I just try to ignore this problem and think about something else.
1) Use \makebox[3cm][l]{...} then all entries are of the same width

Herbert
Post Reply