1

Using xy package, I have produced a figure. But I have a problem:

I am trying to center a figure, but it just goes beyond the right. How can I centre the flow chart? (in fact, it is inclined or deviated to the right).

\documentclass[reqno]{amsart}
\usepackage{enumitem}
\usepackage[all]{xy}
\usepackage{newlfont}
\usepackage[centertags]{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{plain}
\usepackage{mathrsfs}

\setcounter{page}{1}
\renewcommand{\baselinestretch}{1.5}
\oddsidemargin=.25cm \evensidemargin=.25cm \textwidth=15cm
\topmargin=0cm \textheight=21cm
\begin{document}
\title{Graphical Abstract}
\maketitle

\begin{figure}[!h]
\small
{\[\xymatrix{
\framebox[0.33\textwidth]{\textbf{Partition of Unity}\quad \textbf{\&}\ar[d] \quad \textbf{State}}  & &  \framebox[0.42\textwidth]{\textbf{State}\quad \textbf{\&} \quad \textbf{Hyper Injective Mapping}} \ar[d] \\
\framebox[0.36\textwidth]{\textbf{Entropy of a Partition of Unity}}\ar[d] \ar[r] & \ar[d]  & \framebox[0.45\textwidth]{\textbf{Hyper Injective Hyper $MV$--Algebra DS}} \ar[l] \\
\framebox[0.2\textwidth]{\textbf{Properties}} \ar[d] & \framebox[0.2\textwidth]{h(T, U)} \ar[d] \ar[r] \ar[l] & \framebox[0.2\textwidth]{\textbf{Calculations}} \ar[d] \\
\framebox[0.3\textwidth]{\textbf{Theorem of Isomorphism}} \ar[r] & \framebox[0.2\textwidth]{h(T)} \ar[ul] \ar[ur] \ar[l] \ar[r] & \framebox[0.32\textwidth]{\textbf{Kolmogorov-Sinai Theorem}} \ar[l] \\
\framebox[0.45\textwidth]{\textbf{Hyper Injective Hyper $MV$--Algebra DS}} \ar[dr] & \ar[r] \ar[l] & \framebox[0.48\textwidth]{\textbf{Semi-Independent Hyper $MV$--Algebra DS}} \ar[dl] \\
& \framebox[0.2\textwidth]{\textbf{$MV$--Algebra DS}} \ar[ul] \ar[ur]& }
\]}
\caption{\label{1}}
\end{figure}
\end{document}
2

I think the answer is already here: Is there a way to resize a figure created with xymatrix?

Try with \resizebox:

\documentclass[reqno]{amsart}
\usepackage{enumitem}
\usepackage[all]{xy}
\usepackage{newlfont}
\usepackage[centertags]{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{plain}
\usepackage{mathrsfs}
\usepackage{graphicx} % line inserted

\setcounter{page}{1}
\renewcommand{\baselinestretch}{1.5}
\oddsidemargin=.25cm \evensidemargin=.25cm \textwidth=15cm
\topmargin=0cm \textheight=21cm
\begin{document}
\title{Graphical Abstract}
\maketitle

\begin{figure}[!h]
\resizebox{\textwidth}{!}{% line inserted
\small
\xymatrix{ % line modified
\framebox[0.33\textwidth]{\textbf{Partition of Unity}\quad \textbf{\&}\ar[d] \quad \textbf{State}}  & &  \framebox[0.42\textwidth]{\textbf{State}\quad \textbf{\&} \quad \textbf{Hyper Injective Mapping}} \ar[d] \\
\framebox[0.36\textwidth]{\textbf{Entropy of a Partition of Unity}}\ar[d] \ar[r] & \ar[d]  & \framebox[0.45\textwidth]{\textbf{Hyper Injective Hyper $MV$--Algebra DS}} \ar[l] \\
\framebox[0.2\textwidth]{\textbf{Properties}} \ar[d] & \framebox[0.2\textwidth]{h(T, U)} \ar[d] \ar[r] \ar[l] & \framebox[0.2\textwidth]{\textbf{Calculations}} \ar[d] \\
\framebox[0.3\textwidth]{\textbf{Theorem of Isomorphism}} \ar[r] & \framebox[0.2\textwidth]{h(T)} \ar[ul] \ar[ur] \ar[l] \ar[r] & \framebox[0.32\textwidth]{\textbf{Kolmogorov-Sinai Theorem}} \ar[l] \\
\framebox[0.45\textwidth]{\textbf{Hyper Injective Hyper $MV$--Algebra DS}} \ar[dr] & \ar[r] \ar[l] & \framebox[0.48\textwidth]{\textbf{Semi-Independent Hyper $MV$--Algebra DS}} \ar[dl] \\
& \framebox[0.2\textwidth]{\textbf{$MV$--Algebra DS}} \ar[ul] \ar[ur]& }
} % line modified
\caption{\label{1}}
\end{figure}
\end{document}

enter image description here

0

Before resizing something or using smaller fonts, you should always try to reformat your graph in order to make it fit. It will look much more pleasing speaking about the typographical aspect.

The centering it self seems to be done by your document class already.

I did two tricks here: I reduced the column separator of your graph by subtracting -.2em from the default value and I have reformatted the bigger cells to be two line cells. Like this, it easily fits and looks much better.

% arara: pdflatex

\documentclass{amsart}
\usepackage[cmtip,all]{xy}
\setlength{\oddsidemargin}{.25cm}
\setlength{\evensidemargin}{.25cm}
\setlength{\textwidth}{15cm}
\setlength{\textheight}{21cm}
\setlength{\topmargin}{0cm}\calclayout
\newcommand{\specialcell}[2][c]{%
    \begin{tabular}[#1]{@{}c@{}}#2\end{tabular}
    }

\begin{document}
    \title{Graphical Abstract}
    \maketitle
    \begin{figure}[!h]
        \xymatrix@C=-.2em{%
            \fbox{\bfseries Partition of Unity \& State} \ar[d] & & \fbox{\bfseries State \& Hyper Injective Mapping} \ar[d] \\
            \fbox{\textbf{\specialcell{Entropy of a Partition\\ of Unity}}} \ar[d] \ar[r] & \ar[d]  & \fbox{\textbf{\specialcell{Hyper Injective Hyper\\ $MV$--Algebra DS}}} \ar[l] \\
            \fbox{\textbf{Properties}} \ar[d] & \fbox{$h(T, U)$} \ar[d] \ar[r] \ar[l] & \fbox{\textbf{Calculations}} \ar[d] \\
            \fbox{\textbf{Theorem of Isomorphism}} \ar@{<->}[r] & \fbox{$h(T)$} \ar[ul] \ar[ur] \ar@{<->}[r] & \fbox{\textbf{Kolmogorov-Sinai Theorem}} \\
            \fbox{\textbf{\specialcell{Hyper Injective Hyper\\ $MV$--Algebra DS}}} \ar@{<->}[dr] & \ar[r] \ar[l] & \fbox{\textbf{\specialcell{Semi-Independent Hyper\\ $MV$--Algebra DS}}} \ar@{<->}[dl] \\
            & \fbox{\textbf{$MV$--Algebra DS}}& 
        }
        \caption{}\label{1}
    \end{figure}
\end{document}

enter image description here

Please note that such graphs are much easier done in TikZ, tikz-cd or alike as you do not have to manually surround any cell with a box.

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.