9
\documentclass[a4paper,10pt]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}%
\usepackage{lmodern}
\usepackage[nomarginpar, textwidth = 16cm]{geometry}
\usepackage[svgnames,x11names]{pstricks}%%, pdf
\usepackage{pstricks-add}
\usepackage{multido}
\usepackage{mathtools}

\pagestyle{empty}
\begin{document}


\psset{nodesep=2pt}
\newpsstyle{DblDash}{linestyle=dashed, dash=1pt 1.5pt, doubleline}
\begin{psmatrix}[mnode=r,colsep=0.6,rowsep=0.5]

& &[name=1] $D_5$ \\
 && [name=2] $\{e,a,a^2,a^3,a^4\}$ &\\
[name=3] $\{e,ab\}$ &  [name=4] $\{e,a^2b\}$  &  && [name=5] $\{e,a^3b\}$ & [name=6]$\{e,a^4b\}$\\

& & [name=7] $\{e\}$
\ncline{11}{21}\ncline{12}{22}
\ncline{21}{32}\ncline{22}{32}

\ncline{1}{2}
\ncline{2}{3}\ncline{2}{4}\ncline{2}{5}\ncline{2}{6}
\ncline{3}{7}\ncline{4}{7}\ncline{5}{7}\ncline{6}{7}



\end{psmatrix}

\end{document} 

enter image description here

I drew the arrows with microsoft paint but i want to draw them with latex. I look up online, and got this

\todo[inline, color=green!40]{This is an inline comment.}

but it tampers with the picture :'(. Any suggestions?`

How can I add coordinates so that I can make the arrow point where I want to, sort of like the answer to this Drawing arrow with text using TikZ

  • \ncline{11}{21}\ncline{12}{22} makes no sense. There are no such nodenames. I suppose you mean \ncline{1,1}{2,1}\ncline{1,2}{2,2} – user2478 Apr 16 '14 at 7:22
6

It's better to use alpha-numeric names.

The following inserts two extra nodes at a distance of 15pt (nodesep=15pt) to the right of node F (horizontally), one on the same level as node B and the other at the same level as node F (vertically). Then, the two arrows are drawn, followed by the placement of the labels using a [l]eft reference point.

enter image description here

\documentclass{article}
\usepackage[svgnames,x11names]{pstricks}
\usepackage{pstricks-add}

\pagestyle{empty}
\begin{document}

\psset{nodesep=2pt}
\SpecialCoor
\newpsstyle{DblDash}{linestyle=dashed, dash=1pt 1.5pt, doubleline}
\begin{psmatrix}[mnode=r,colsep=0.6,rowsep=0.5]
  & & [name=A] $D_5$ \\
  & & [name=B] $\{e,a,a^2,a^3,a^4\}$ & \\
  [name=C] $\{e,ab\}$ & [name=D] $\{e,a^2b\}$ & & & [name=E] $\{e,a^3b\}$ & [name=F]$\{e,a^4b\}$\\
  & & [name=G] $\{e\}$
  \ncline{A}{B}
  \ncline{B}{C}\ncline{B}{D}\ncline{B}{E}\ncline{B}{F}
  \ncline{C}{G}\ncline{D}{G}\ncline{E}{G}\ncline{F}{G}
  \pnode([nodesep=15pt]F|B){B-right}
  \pnode(B-right|F){F-right}
  \ncline{<-}{B}{B-right}\rput[l]([nodesep=5pt]B-right){Sylow 5-subgroup}
  \ncline{<-}{F}{F-right}\rput[l]([nodesep=5pt]F-right){Sylow 2-subgroups}
\end{psmatrix}

\end{document}

Here's a view on the reference points (from the pstricks documentation, section 24 Placing and rotating whatever, p 42):

enter image description here

  • Can you explain what these lines do? \pnode([nodesep=15pt]F|B){B-right} \pnode(B-right|F){F-right} \ncline{<-}{B}{B-right}\rput[l]([nodesep=5pt]B-right){Sylow 5-subgroup} \ncline{<-}{F}{F-right}\rput[l]([nodesep=5pt]F-right){Sylow 2-subgroups} – abe15 Apr 16 '14 at 5:43
  • @abe15: This uses notation as defined by \SpecialCoor (section 54 Special coordinates, p 145 of the pstricks documentation): \pnode(<coor>){<node>} places a node <node> at location <coor>. <coor>, specified as [nodesep=15pt]F|B, takes the x-coordinate of the X and the y-coordinate of Y in the format X|Y. [nodesep=15pt]F is situated 15pt to the right of F. – Werner Apr 16 '14 at 5:50
  • 1
    using \rput with \ncline is awkward. \ncline{->}{B-right}{B}>{Sylow 5-subgroup} does the same more elegant. – user2478 Apr 16 '14 at 7:41
  • @Herbert: Thanks; didn't know about that notation. Any documentation on that? – Werner Apr 16 '14 at 14:25
  • sure, see texdoc pst-node pp 19--21 – user2478 Apr 16 '14 at 14:40
5
\documentclass[a4paper,10pt]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}%
\usepackage{lmodern}
\usepackage[nomarginpar, textwidth = 16cm]{geometry}
\usepackage[svgnames,x11names]{pstricks}%%, pdf
\usepackage{pstricks-add}
\usepackage{multido}
\usepackage{mathtools}

\pagestyle{empty}

\begin{document}

\psset{nodesep=2pt}
\newpsstyle{DblDash}{linestyle=dashed, dash=1pt 1.5pt, doubleline}
\begin{psmatrix}[mnode=r,colsep=0.6,rowsep=0.5]
& &[name=1] $D_5$ \\
 && [name=2] $\{e,a,a^2,a^3,a^4\}$ &\\
[name=3] $\{e,ab\}$ &  [name=4] $\{e,a^2b\}$  &  && [name=5] $\{e,a^3b\}$ & [name=6]$\{e,a^4b\}$\\

& & [name=7] $\{e\}$
\ncline{11}{21}\ncline{12}{22}
\ncline{21}{32}\ncline{22}{32}

\ncline{1}{2}
\ncline{2}{3}\ncline{2}{4}\ncline{2}{5}\ncline{2}{6}
\ncline{3}{7}\ncline{4}{7}\ncline{5}{7}\ncline{6}{7}

\psline[linewidth=1pt]{<-}(1,2)(4,2)
\rput[l](4.2,2){Sylow 5-subgroup}
\psline[linewidth=1pt]{<-}(5.2,1)(6,1)
\rput[l](6.2,1){Sylow 2-subgroups}
\end{psmatrix}

\end{document}

enter image description here

4

Use always relative coordinates:

\documentclass{article}
\usepackage{pst-node}
\pagestyle{empty}
\begin{document}

\psset{nodesep=2pt}
\begin{psmatrix}[mnode=r,colsep=0.6,rowsep=0.75]
                    &                      &[name=1] $D_5$                 & \\
                    &                      &[name=2] $\{e,a,a^2,a^3,a^4\}$ &[name=A]\\
[name=3] $\{e,ab\}$ &[name=4] $\{e,a^2b\}$ & & & [name=5] $\{e,a^3b\}$ &    
        [name=6]$\{e,a^4b\}$  & [name=B]                                            \\
                    &                      &[name=7] $\{e\}$
\ncline{1}{2}
\ncline{2}{3}\ncline{2}{4}\ncline{2}{5}\ncline{2}{6}
\ncline{3}{7}\ncline{4}{7}\ncline{5}{7}\ncline{6}{7}
\ncline[linewidth=1pt,arrows=->,nodesepA=2cm]{A}{A}>{Sylow 5-subgroup}
\ncline[linewidth=1pt,arrows=->,nodesepA=1cm]{B}{B}>{Sylow 2-subgroups}
\end{psmatrix}

\end{document}

enter image description here

or without using nodesep and a simple connection:

\documentclass{article}
\usepackage{pst-node}
\pagestyle{empty}
\begin{document}

\psset{nodesep=2pt}
\begin{psmatrix}[mnode=r,colsep=0.6,rowsep=0.75]
                    &                      &[name=1] $D_5$                 & \\
                    &                      &[name=2] $\{e,a,a^2,a^3,a^4\}$ 
      & & & & & [name=A] Sylow 5-subgroup\\
[name=3] $\{e,ab\}$ &[name=4] $\{e,a^2b\}$ &                               & 
      &[name=5] $\{e,a^3b\}$ &[name=6]$\{e,a^4b\}$  & &[name=B]Sylow 2-subgroups \\
                    &                      &[name=7] $\{e\}$
\ncline{1}{2}
\ncline{2}{3}\ncline{2}{4}\ncline{2}{5}\ncline{2}{6}
\ncline{3}{7}\ncline{4}{7}\ncline{5}{7}\ncline{6}{7}
\ncline[linewidth=1pt,arrows=->]{A}{2}
\ncline[linewidth=1pt,arrows=->]{B}{6}
\end{psmatrix}

\end{document}

enter image description here

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.