1

I have such preamble and the code.

    \documentclass[a4paper,14pt ]{report}
\usepackage[T2A]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[russian,english]{babel}
\usepackage{amssymb,amsfonts,amsmath,mathtext,cite,enumerate,float}
\usepackage{graphicx}
\usepackage[14pt]{extsizes}
\usepackage{times}
\usepackage{hyperref}
\usepackage{tikz}
\usepackage[labelsep=period]{caption}
\usepackage{parallel,enumitem}
\DeclareCaptionLabelSeparator{par}{\par}
\captionsetup{labelsep=par,justification=centering}
\graphicspath{{images/}}


\newcommand\tablecaption[1]{
\captionsetup{labelsep=par,justification=centering}
\caption{#1}
}

\renewcommand{\baselinestretch}{1.5}\normalsize
\makeatletter
\renewcommand{\@biblabel}[1]{#1.}
\makeatother


\usepackage{geometry}
\geometry{left=3cm}
\geometry{right=1cm}
\geometry{top=2cm}
\geometry{bottom=2cm}

\renewcommand{\theenumi}{\arabic{enumi}}
\renewcommand{\labelenumi}{\arabic{enumi}}
\renewcommand{\theenumii}{.\arabic{enumii}}
\renewcommand{\labelenumii}{\arabic{enumi}.\arabic{enumii}.}
\renewcommand{\theenumiii}{.\arabic{enumiii}}
\renewcommand{\labelenumiii}{\arabic{enumi}.\arabic{enumii}.\arabic{enumiii}.}
\renewcommand{\rmdefault}{ftm}

     \begin{document}
\begin{Parallel}{0.40\textwidth}{0.65\textwidth}
\ParallelLText{\noindent
    \begin{enumerate}[itemsep=1ex]
      \item{Vertices are sorted in the following order 0,5,1,2,4,3}
      \item{Depth 1: \textbf{0},5,1,2,4,3} \\
      Depth 2: \textbf{1},2 \\
      Depth 3: \textbf{2} \\
      Depth 2: 1,\textbf{2}
      \item{Depth 1: 0,\textbf{5},1,2,4,3} \\
      Depth 2: \textbf{4},3 \\
      \item{Depth 1: 0,5,\textbf{1},2,4,3} \\
      Depth 2: \textbf{2},3,4 \\
      Depth 3: \textbf{3},4 \\
      Depth 4: \textbf{4} \\
      Depth 3: 3,\textbf{4} \\
      Depth 2: 2,3,\textbf{4} \\
      \item{Depth 1: 0,5,1,\textbf{2},4,3}
    \end{enumerate}
    }
\ParallelRText{\noindent
    \\\\ (the bold face node is expanded)
    \\\\
    Cannot expand, so $CBC$ is \{0,1,2\} with size 3 \\
    $d + (m - i)= 2 + (2 - 2) = 2 < 3,$ so we prune \\\\
    $2 + (2-1)=3 \le CBC$, so we prune
   \\\\ \\\\
    becomes our new $CBC$ with size 4 \\
    $3 + (2 - 2) = 3 < 4$, so we prune \\
    $2 + (3 - 2) = 3 < CBC$, so we prune \\\\
    $1 + (6 - 4) = 3 < CBC$, as depth = 1, we stop
}
\ParallelPar
\end{Parallel}
    \end{document} 

I have compiled it and have a good result, but when I have added it to the document with such preambula the border has changed. enter image description here

How can I do it as it shown at the picture:

enter image description here

  • Sorry, but how can your MWE compile? There are two preambles inside. – Claudio Fiandrino Apr 27 '12 at 15:37
  • I'm sorry, i have 2 preambles. I have corrected the mistake. – user565447 Apr 27 '12 at 15:54
  • @user565447 Leave off the hyperref package and everything looks as in your second image. – Thorsten Apr 27 '12 at 16:27
  • @user565447 Please don't delete the code of your question. Leaving the question as it is now won't help other users with the same or with a similar problem. – Thorsten Apr 28 '12 at 7:38
4

Of course, this depends on your actual usage/document layout, but I would rather go with a tabularx layout than use the parallel package. For one, the code is structured on a line-by-line basis, rather than left-and-right chunks separated in blocks, improving readability in your code.

Here's your example, "minimimalised" for the sake of brevity:

enter image description here

\documentclass[a4paper]{report}
\usepackage{tabularx}% http://ctan.org/pkg/tabularx

\renewcommand{\baselinestretch}{1.5}\normalsize

\usepackage{geometry}% http://ctan.org/pkg/geometry
\geometry{left=3cm,right=1cm,top=2cm,bottom=2cm}

\begin{document}

\noindent
\begin{tabularx}{\textwidth}{rl@{\quad}X}
  1 & \multicolumn{2}{l}{Vertices are sorted in the following order 0,5,1,2,4,3} \\[\baselineskip]
  2 & Depth 1: \textbf{0},5,1,2,4,3 & (the bold face node is expanded) \\
    & Depth 2: \textbf{1},2 \\
    & Depth 3: \textbf{2} & Cannot expand, so $CBC$ is \{0,1,2\} with size 3 \\
    & Depth 2: 1,\textbf{2} & $d + (m - i)= 2 + (2 - 2) = 2 < 3,$ so we prune \\[\baselineskip]
  3 & Depth 1: 0,\textbf{5},1,2,4,3 \\
    & Depth 2: \textbf{4},3 & $2 + (2-1)=3 \le CBC$, so we prune \\[\baselineskip]
  4 & Depth 1: 0,5,\textbf{1},2,4,3 \\
    & Depth 2: \textbf{2},3,4 \\
    & Depth 3: \textbf{3},4 \\
    & Depth 4: \textbf{4} & becomes our new $CBC$ with size 4 \\
    & Depth 3: 3,\textbf{4} & $3 + (2 - 2) = 3 < 4$, so we prune \\
    & Depth 2: 2,3,\textbf{4} & $2 + (3 - 2) = 3 < CBC$, so we prune \\[\baselineskip]
  5 & Depth 1: 0,5,1,\textbf{2},4,3 & $1 + (6 - 4) = 3 < CBC$, as depth = 1, we stop
\end{tabularx}

\end{document}

The gap between the "Depth" and "description" is \quad.

The only drawback is that this implementation will not break across the page boundary. However, I'm not sure whether this is at all necessary.

4

One way is to leave hyperref as suggested by @Thorsten. But if you want to keep hyperref this will be helpful.

\documentclass[a4paper,12pt ]{report}
\usepackage[T2A]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[russian,english]{babel}
\usepackage{amssymb,amsfonts,amsmath,mathtext,cite,enumerate,float}
\usepackage{graphicx}
\usepackage[14pt]{extsizes}
\usepackage{times}
\usepackage{hyperref}
\usepackage{tikz}
\usepackage{setspace}
\usepackage[labelsep=period]{caption}
\usepackage{parallel}
\usepackage{enumitem}
\DeclareCaptionLabelSeparator{par}{\par}
\captionsetup{labelsep=par,justification=centering}
\graphicspath{{images/}}


\newcommand\tablecaption[1]{
\captionsetup{labelsep=par,justification=centering}
\caption{#1}
}

\onehalfspacing
% \renewcommand{\baselinestretch}{1.5}\normalsize
\makeatletter
\renewcommand{\@biblabel}[1]{#1.}
\makeatother


\usepackage{geometry}
\geometry{left=3cm}
\geometry{right=1cm}
\geometry{top=2cm}
\geometry{bottom=2cm}

\renewcommand{\theenumi}{\arabic{enumi}}
\renewcommand{\labelenumi}{\arabic{enumi}}
\renewcommand{\theenumii}{.\arabic{enumii}}
\renewcommand{\labelenumii}{\arabic{enumi}.\arabic{enumii}.}
\renewcommand{\theenumiii}{.\arabic{enumiii}}
\renewcommand{\labelenumiii}{\arabic{enumi}.\arabic{enumii}.\arabic{enumiii}.}
\renewcommand{\rmdefault}{ftm}

\begin{document}

    \begin{enumerate}[parsep=-10pt,itemsep=3ex,leftmargin=0.5cm]
      \item{Vertices are sorted in the following order 0,5,1,2,4,3}
    \end{enumerate}

\begin{Parallel}{0.35\textwidth}{0.63\textwidth}
\ParallelLText{\noindent
    \begin{enumerate}[resume*,parsep=0pt,itemsep=3ex,leftmargin=0.5cm,rightmargin=.65\textwidth]
      \item{Depth 1: \textbf{0},5,1,2,4,3} \\
      Depth 2: \textbf{1},2 \\
      Depth 3: \textbf{2} \\
      Depth 2: 1,\textbf{2}
        \end{enumerate}
      }
\ParallelRText{\noindent
\\\\(the bold face node is expanded)
    \\\\
    Cannot expand, so $CBC$ is \{0,1,2\} with size 3 \\
    $d + (m - i)= 2 + (2 - 2) = 2 < 3,$ so we prune

}
\ParallelPar
\ParallelLText{\noindent
\begin{enumerate}[resume*,parsep=0pt,itemsep=3ex,leftmargin=0.5cm,rightmargin=.65\textwidth]
      \item{Depth 1: 0,\textbf{5},1,2,4,3} \\
      Depth 2: \textbf{4},3 
          \end{enumerate}
      }
\ParallelRText{\noindent
 \\\\ \\$2 + (2-1)=3 \le CBC$, so we prune
}
\ParallelPar
\ParallelLText{\noindent
\begin{enumerate}[resume*,parsep=0pt,itemsep=3ex,leftmargin=0.5cm,rightmargin=.65\textwidth]
      \item{Depth 1: 0,5,\textbf{1},2,4,3} \\
      Depth 2: \textbf{2},3,4 \\
      Depth 3: \textbf{3},4 \\
      Depth 4: \textbf{4} \\
      Depth 3: 3,\textbf{4} \\
      Depth 2: 2,3,\textbf{4}
    \end{enumerate}
}
\ParallelRText{\noindent
  \\\\\\\\\\ becomes our new $CBC$ with size 4 \\
    $3 + (2 - 2) = 3 < 4$, so we prune \\
    $2 + (3 - 2) = 3 < CBC$, so we prune 

}
\ParallelPar
\ParallelLText{\noindent 
\begin{enumerate}[resume*,parsep=0pt,itemsep=3ex,leftmargin=0.5cm,rightmargin=.65\textwidth]
      \item{Depth 1: 0,5,1,\textbf{2},4,3}
    \end{enumerate}
    }
\ParallelRText{\noindent
 \\\\ $1 + (6 - 4) = 3 < CBC$, as depth = 1, we stop
}
\ParallelPar
\end{Parallel}

\end{document}

enter image description here

  • than you for answer it has helped – user565447 Apr 28 '12 at 7:15

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.