Graphics, Figures & TablesArrow problems in Ferrers Diagrams

Information and discussion about graphics, figures & tables in LaTeX documents.
sinita
Posts: 9
Joined: Fri Mar 18, 2011 12:58 am

Arrow problems in Ferrers Diagrams

Post by sinita »

Hi there,
I am having trouble inserting an arrow in the middle of two Ferrers diagrams

Code: Select all

\begin{center}
\parbox[b]{10pc}{
\begin{renewcommand}{\latticebody}{%
\ifnum\latticeA=1 \ifnum\latticeB=4 \drawsq\drawsqlabel{} \fi\fi
\ifnum\latticeA=2 \ifnum\latticeB=4 \drawsq\drawsqlabel{} \fi\fi
\ifnum\latticeA=3 \ifnum\latticeB=4 \drawsq\drawsqlabel{} \fi\fi
\ifnum\latticeA=4 \ifnum\latticeB=4 \drawsq\drawsqlabel{} \fi\fi
\ifnum\latticeA=5 \ifnum\latticeB=4 \drawsq\drawsqlabel{} \fi\fi
\ifnum\latticeA=6 \ifnum\latticeB=4 \drawsq\drawsqlabel{6} \fi\fi
\ifnum\latticeA=1 \ifnum\latticeB=3 \drawsq\drawsqlabel{} \fi\fi
\ifnum\latticeA=2 \ifnum\latticeB=3 \drawsq\drawsqlabel{} \fi\fi
\ifnum\latticeA=3 \ifnum\latticeB=3 \drawsq\drawsqlabel{} \fi\fi
\ifnum\latticeA=4 \ifnum\latticeB=3 \drawsq\drawsqlabel{4} \fi\fi
\ifnum\latticeA=1 \ifnum\latticeB=2 \drawsq\drawsqlabel{} \fi\fi
\ifnum\latticeA=2 \ifnum\latticeB=2 \drawsq\drawsqlabel{} \fi\fi
\ifnum\latticeA=3 \ifnum\latticeB=2 \drawsq\drawsqlabel{3} \fi\fi
\ifnum\latticeA=1 \ifnum\latticeB=1 \drawsq\drawsqlabel{1} \fi\fi
}
\drawsqlat
\end{renewcommand}}
$\Longrightarrow$
\parbox[b]{10pc}{
\begin{renewcommand}{\latticebody}{%
\ifnum\latticeA=1 \ifnum\latticeB=6 \drawsq\drawsqlabel{} \fi\fi
\ifnum\latticeA=2 \ifnum\latticeB=6 \drawsq\drawsqlabel{} \fi\fi
\ifnum\latticeA=3 \ifnum\latticeB=6 \drawsq\drawsqlabel{} \fi\fi
\ifnum\latticeA=4 \ifnum\latticeB=6 \drawsq\drawsqlabel{4} \fi\fi
\ifnum\latticeA=1 \ifnum\latticeB=5 \drawsq\drawsqlabel{} \fi\fi
\ifnum\latticeA=2 \ifnum\latticeB=5 \drawsq\drawsqlabel{} \fi\fi
\ifnum\latticeA=3 \ifnum\latticeB=5 \drawsq\drawsqlabel{3} \fi\fi
\ifnum\latticeA=1 \ifnum\latticeB=4 \drawsq\drawsqlabel{} \fi\fi
\ifnum\latticeA=2 \ifnum\latticeB=4 \drawsq\drawsqlabel{} \fi\fi
\ifnum\latticeA=3 \ifnum\latticeB=4 \drawsq\drawsqlabel{3} \fi\fi
\ifnum\latticeA=1 \ifnum\latticeB=3 \drawsq\drawsqlabel{} \fi\fi
\ifnum\latticeA=2 \ifnum\latticeB=3 \drawsq\drawsqlabel{2} \fi\fi
\ifnum\latticeA=1 \ifnum\latticeB=2 \drawsq\drawsqlabel{1} \fi\fi
\ifnum\latticeA=1 \ifnum\latticeB=1 \drawsq\drawsqlabel{1} \fi\fi
}
\drawsqlat
\end{renewcommand}}
\end{center}
How to I put it exactly in the middle of these two Ferrers diagrams
Any help will be appreciated
Many Thanks

Recommended reading 2024:

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

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

User avatar
Stefan Kottwitz
Site Admin
Posts: 10324
Joined: Mon Mar 10, 2008 9:44 pm

Re: Arrow problems in Ferrers Diagrams

Post by Stefan Kottwitz »

Hi sinita,

which package do you use for creating the diagrams? It would be good if you would show a small compilable example.
I just can see you use a strange syntax for \renewcommand.

Stefan
LaTeX.org admin
sinita
Posts: 9
Joined: Fri Mar 18, 2011 12:58 am

Arrow problems in Ferrers Diagrams

Post by sinita »

I used

Code: Select all

\documentclass[12pt]{article}
\pagestyle{empty}
\setlength{\paperwidth}{8.5in}
\setlength{\paperheight}{11in}

\setlength{\topmargin}{0.00in}
\setlength{\headsep}{0.00in}
\setlength{\headheight}{0.00in}
\setlength{\evensidemargin}{0.00in}
\setlength{\oddsidemargin}{0.00in}
\setlength{\textwidth}{6.5in}
\setlength{\textheight}{9.00in}
\setlength{\voffset}{0.00in}
\setlength{\hoffset}{0.00in}
\setlength{\marginparwidth}{0.00in}
\setlength{\marginparsep}{0.00in}
\setlength{\parindent}{0.00in}
\setlength{\parskip}{0.15in}

\usepackage{html}

\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{amsfonts}

\usepackage[all,web]{xypic}

\makeatletter
\@ifundefined{bibname}{}{\renewcommand{\bibname}{References}}
\makeatother

\def\drawsqlat{%
\begin{xy}{
  0;<1.7pc,0pc>:<0pc,1.7pc>::
  \xylattice{0}{6}{0}{6}}
\end{xy}}
\def\drawsq{\ar@{-}c;c+(1,0)\ar@{-}c;c+(0,1)\ar@{-}c+(1,0);c+(1,1)\ar@{-}c+(0,1);c+(1,1)}
\def\drawsqlabel#1{\save c+(0.5,0.5)*\txt<2pc>{#1} \restore}
Also how do i enter a diagonal line of symmetry on the ferrers diagrams?
User avatar
Stefan Kottwitz
Site Admin
Posts: 10324
Joined: Mon Mar 10, 2008 9:44 pm

Arrow problems in Ferrers Diagrams

Post by Stefan Kottwitz »

Hi Sinita,

now that you posted the definitions of \drawsq, \drawsqlabel etc. I could test your code.

The parboxes in the code have the argument for bottom alignment. If you simply remove it, they would be vertically centered to each other and to the arrow, this way the arrow would be in the middle. Here's a screenshot, also for other readers:
diagram screenshot
diagram screenshot
ferrer.png (2.39 KiB) Viewed 5849 times
For vertical alignment, you could also use \vcenter like here, Big arrows between images:

Code: Select all

$\vcenter{\hbox{contents to align}}$
Note, \vcenter has to be used in math mode.

Stefan
LaTeX.org admin
sinita
Posts: 9
Joined: Fri Mar 18, 2011 12:58 am

Re: Arrow problems in Ferrers Diagrams

Post by sinita »

Thankyou so much for the help!!!!:)
One last thing....i have been trying to put captions to these Ferrers diagrams as figures but was not able to!
How do i do so?
User avatar
Stefan Kottwitz
Site Admin
Posts: 10324
Joined: Mon Mar 10, 2008 9:44 pm

Arrow problems in Ferrers Diagrams

Post by Stefan Kottwitz »

Hi sinita,

to get one caption for both diagrams, use a figure environment.

To get a caption for each diagram, I would use the subcaption package. Alternatively, use the subfig package.

I could create a code example. However, not today, tomorrow I would find time after work, now I have to leave for today.

Stefan
LaTeX.org admin
sinita
Posts: 9
Joined: Fri Mar 18, 2011 12:58 am

Re: Arrow problems in Ferrers Diagrams

Post by sinita »

Hi Stefan,
I will try those packages and fiddle around with them. That's ok I can wait till tomorrow :)

Sinita
sinita
Posts: 9
Joined: Fri Mar 18, 2011 12:58 am

Re: Arrow problems in Ferrers Diagrams

Post by sinita »

I don't want only a subcaption....i wish to make the ferrers diagram into a figure "\begin{figure}...\end{figure}" so that in the caption it automatically puts Figure 1:..... for its caption by labelling it as \label "fig1" but when I put "\begin{figure}...\end{figure}" around my ferrers graph it displaces itself from where it supposed to be on my latex document.

Do you understand what I am trying to do?

Many Thanks
Sinita
User avatar
Stefan Kottwitz
Site Admin
Posts: 10324
Joined: Mon Mar 10, 2008 9:44 pm

Arrow problems in Ferrers Diagrams

Post by Stefan Kottwitz »

Hi Sinita,

use options to the figure environment, such as

Code: Select all

\begin{figure}[!htbp]
or use the float package and the H option:

Code: Select all

\usepackage{float}
...
\begin{figure}[H]
...
\end{figure}
It's also explained here: Prevent floating of figures or tables.

Stefan
LaTeX.org admin
sinita
Posts: 9
Joined: Fri Mar 18, 2011 12:58 am

Re: Arrow problems in Ferrers Diagrams

Post by sinita »

Hi Stefan,
I have an emergency problem that I need to solve....I keep on getting this error
"Runaway argument?
{{42}{21}{Proof of Rogers-Ramanujan identities\re
! File ended while scanning use of \@newl@bel.
<inserted text>
\par
1.45 \begin{document}"

I have no clue what this means and i keep trying to find a mistake but still cant find any!!!This is very worrying as I need to do this project by Monday!!:(
Please help!!!!
Thanks so much!!!
Sinita
Post Reply