2

Using the grid-system package http://www.ctan.org/tex-archive/macros/latex/contrib/grid-system

Very little documentation on it. When I tried adding a \figure in a cell, I get Latex error.

\documentclass[12pt,notitlepage]{article}%
\usepackage{float}
\usepackage{grid-system}
\begin{document}

\begin{Row}%
\begin{Cell}{2} 
      test
\end{Cell}
\begin{Cell}{1}

\begin{figure}
    test
\end{figure}

\end{Cell}
\end{Row}

\end{document}

now, when I compile this using texstudio on windows (Miktex 2.9) I get the error:

Mathematica graphics

when I compile on Linux, using texlive 2013, I get:

Mathematica graphics

  • not sure if it would make sense to put a float in one of these Cell environments; just use the relevant image code without the \begin{figure}...\end{figure} – cmhughes Mar 18 '14 at 2:35
  • Or use [H] postition specifier as you are already loading float package. – user11232 Mar 18 '14 at 2:35
  • 1
    You do not get the error you show (that would be if you didn't load the grid package). You get ! LaTeX Error: Not in outer par mode. which means you can't use figure there (but it wouldn't make sense to use figure there anyway.) – David Carlisle Mar 18 '14 at 2:36
  • @DavidCarlisle I was using texstudio on windows, which gives different error and did not notice the error changes when I switch to Linux to compile the file so I can more easily copy the error. texlive 2013 on Linux gives the error I show. But texstudio on windows gives the error you show. Will correct the question now with the correct error message – Nasser Mar 18 '14 at 2:40
  • @cmhughes yes, when I removed figure it worked. I wish documentation of the package said that so new users would know. If you like to post this as answer so I can accept it. thanks. – Nasser Mar 18 '14 at 2:52
1

Floating environments such as figure and table must be allowed to roam freely in your document- when you try to cage them in a box such as minipage, vbox, parbox, and in your case, Cell, you will necessarily get an error.

Details of the inner workings of the floats and the algorithm controlling their placement are given in How to influence the position of float environments like figure and table in LaTeX?, which is one of the definitive and comprehensive guides on the subject.

To move forward with your current document, you can simply grab the contents of your figure environment and place them in the Cell; if you need captions, then you can use captionof from the caption package.

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.