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.

I need to plot the following hasse diagrams: 1) enter image description here

2)enter image description here

I tried using xypic. For the first I worte the following code

\xymatrix{
  &{G}\ar@{-}[dr]\ar@{-}[dl] \\
  {\mathbb{Z}_p}\ar@{-}[dr] & & \mathbb{Z}_q}\ar@{-}[dl]}\\
  {{e}} \\
}

but it displays nothing. About second one, I don't really know from where to start. I can write also this wrong code:

\xymatrix{
  & {HK}\ar@{-}[dr]\ar@{=}[dl]\\
  H@\ar{=}[dr] & K@\ar{-}[dl]\\
  {H\cap K}
}

How can I plot them both? Where is my mistake?

share|improve this question
1  
I'd suggest you tikz-cd. –  Gonzalo Medina Aug 26 '13 at 15:52
    
I asked one of my proffesors and that's what he suggested. I don't know tikz-cd. –  Danis Fischer Aug 26 '13 at 15:53
1  
Please see my answer below for an example of the necessary code using tikz-cd. tikz-cd has an advantage in that it allows you to use the power of TikZ. (You can respectfully tell you teacher about this package also :-)). –  Gonzalo Medina Aug 26 '13 at 15:59
    
What about you other posting about Hasse diagrams and the solution proposed there? –  Christoph Aug 26 '13 at 18:22
    
there I wanted to get basic intution in which tool to use. then I got answer from my prof. It failed so I opened new thread. Thanks. –  Danis Fischer Aug 26 '13 at 18:49

2 Answers 2

up vote 8 down vote accepted

If you're not bound to use xy, I'd suugest you to use the powerful and more modern tikz-cd package instead:

\documentclass{article}
\usepackage{amssymb}
\usepackage{tikz-cd}

\begin{document}

\begin{tikzcd}[column sep=0.3cm]
{} & G\arrow[dash]{dr}\arrow[dash]{dl}
 & \\
\mathbb{Z}_p\arrow[dash]{dr} & & \mathbb{Z}_q\arrow[dash]{dl} \\
& \lbrace e\rbrace
\end{tikzcd}

\begin{tikzcd}[column sep=0.3cm]
{} & HK\arrow[equal]{dr}\arrow[dash]{dl}
 & \\
H\arrow[equal]{dr} & & K\arrow[dash]{dl} \\
& H\cap K
\end{tikzcd}

\end{document}

enter image description here

share|improve this answer
    
when I put the first in math-field in lyx it seems as a code and not as a diagram... –  Danis Fischer Aug 26 '13 at 16:08
    
@CoarguAliquis you need to load the package, and then to introduce the diagrams using my code as LaTeX code. I am not familiar with LyX, but it must be pretty much the same you were doing with your xy diagrams. –  Gonzalo Medina Aug 26 '13 at 16:12

This works with xy:

\documentclass{article}
\usepackage{amssymb}
\usepackage[all,cmtip]{xy}
\begin{document}
\[
\xymatrix{
  & G \ar@{-}[dr] \ar@{-}[dl] \\
  \mathbb{Z}_p \ar@{-}[dr] & & \mathbb{Z}_q \ar@{-}[dl] \\
  & \{e\}
}
\qquad
\xymatrix{
  & HK \ar@{=}[dr] \ar@{-}[dl]\\
  H \ar@{=}[dr] & & K \ar@{-}[dl]\\
  & H\cap K
}
\]
\end{document}

enter image description here

share|improve this answer
    
not in lyx. I added to latex-prwmble usepackage{xypic}, added in formula these sketches but nothing seems to happen except long code. –  Danis Fischer Aug 26 '13 at 16:15
    
@CoarguAliquis Sorry, but LyX is something I can't think to. My opinion is that it makes more difficult, rather than simpler, inputting LaTeX code. –  egreg Aug 26 '13 at 16:16
    
Reseted lyx and now works like a charm. Thanks :) –  Danis Fischer Aug 26 '13 at 16:21
    
When you get a useful answer to a question you should accept it, and vote it up. You can even vote up more than one answer. Please go back to your other questions and take care of this there too. –  Ethan Bolker Aug 26 '13 at 17:08

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.