1

I have two dot2tex graphs that have a relatively large height and small width. The combined width of the graphs is considerably smaller than the text width.

For example:

\documentclass[12pt]{scrbook}

\usepackage{dot2texi}
\usepackage{tikz}
\usetikzlibrary{shapes,arrows}

\begin{document}

\begin{figure}
  \centering
  \begin{dot2tex}[dot,options=-tmath --autosize --cache]
    digraph {
    u[label="u"];
    }
  \end{dot2tex}
  \begin{dot2tex}[dot,options=-tmath --autosize --cache]
    digraph {
    v[label="v"];
    }
  \end{dot2tex}
\end{figure}

\end{document}

Compile with

pdflatex --shell-escape test.tex

These graphs should be placed next to each other like if they were in a table spanning the entire text width and each of them centered in its own column.

Unfortunately, none of the approaches mentioned in Putting two images next to each other that are 0.5\textwidth wide has worked for me so far, both fail with error "! Argument of \verbatim@ has an extra }." at the end of the centerline or makebox directives.

I tried aligning the graphs using a table as described in How to force a table into page width? but could not get any of the approaches to work. I could not find the right options for tabularx to get my desired result, both tabu and tabularx fail with "! Forbidden control sequence found while scanning use of \verbatim@."

Is it expected that these packages don't play nice with dot2tex? And is there any other way to achieve what I am trying to do?


To clarify what the problem is:

\begin{figure}
  \centering
  \begin{tabularx}{\textwidth}{XX}
  \begin{dot2tex}[dot,options=-tmath --autosize --cache]
    digraph {
    u[label="u"];
    }
  \end{dot2tex}
  &
  \begin{dot2tex}[dot,options=-tmath --autosize --cache]
    digraph {
    v[label="v"];
    }
  \end{dot2tex}
  \end{tabularx}
\end{figure}

This should give me the layout I want. However, upon compiling this yields the following error message:

! Forbidden control sequence found while scanning use of \verbatim@.
1
  • Please, show us a MWE. Jun 25, 2014 at 11:05

1 Answer 1

2

Your question is totally unclear but guessing from the error message I'm assuming that the markup you show is replaced by a verbatim environment by some pre-processor before being seen by LaTeX. To get two verbatim environments side by side you want two minipage so I assume you can do

\begin{figure}
  \centering
  \begin{minipage}{.4\textwidth}
  \begin{dot2tex}[dot,options=-tmath --autosize --cache]
    digraph {
    u[label="u"];
    }
  \end{dot2tex}
  \end{minipage} %space
  \begin{minipage}{.4\textwidth}
  \begin{dot2tex}[dot,options=-tmath --autosize --cache]
    digraph {
    v[label="v"];
    }
  \end{dot2tex}
   \end{minipage}
\end{figure}
10
  • Thanks for your answer. How can I make my question more clear? I tried to use your solution in a tabularx environment but unfortunately the error message is the same as before.
    – Chris
    Jun 25, 2014 at 11:35
  • @Chris You can't use verbatim in the argument to another command (which as documented also applies to tabularx) Why would you want to put it in tabularx? It presumably has a fixed width layout so tabularx X columns are not appropriate Jun 25, 2014 at 11:47
  • @Chris To make your question more clear: all questions should have a complete document so people can reproduce the problem. If using a non standard processor as here you might also say something about how to run the example. Jun 25, 2014 at 11:48
  • Sorry, I will amend my question in that way. I am not really familiar with the inner workings of tabularx and dot2tex so I did not realize that those do not go together. Do you have any other suggestion to achieve the layout I described?
    – Chris
    Jun 25, 2014 at 11:50
  • @Chris the answer above should make the layout you ask for tabularx is totally inappropriate there (even if it worked) Jun 25, 2014 at 11:51

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .