TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Ihave stumbled upon strange behavior (at least for me). I am generating a document composed of a set of blank framed boxes, each with a text attached above, and it will always be most likely necessary to span more than page. But as soon as the number of boxes-texts warrants a new page, pdfLaTeX simply refuses to do so, throwing a "Missing $ inserted" error.

I'm attaching my source, trying as much as possible to keep it short. The companylogo is placed next to this .tex file (But curious enough, it does not appear in the output).

Thank you.


\usepackage[spanish,es-tabla]{babel}  % The original content is written in spanish.

% Document margins
\usepackage[top=1cm, bottom=1cm, left=1cm, right=1cm]{geometry}

% Headers Config.

% Footers Config.
% Use dot as decimal point
% Enable page-broken equations
% Command macros
\newcommand{\elembox}[1]{\begin{center}#1 \\ \emptybox{3cm}{3cm} \end{center}}


% Remove author and date info from title
  {\LARGE \@title}%
 \par} \makeatother


\elembox{1206 (1)}
\elembox{2512 (2)}
\elembox{0805 (1)}
\elembox{carbon-resistor-0.5W (1)}
\elembox{oar-5 (1)}
\elembox{1206 (2)}
\elembox{0603 (2)}
\elembox{2416 (1)}
\elembox{oar-5 (1)}
\elembox{carbon-resistor-0.5W (1)}
\elembox{qfn40 (1)}
\elembox{dip44 (2)}
% Up to this many \elemboxes this compiles. but if you uncomment the one below, BOOM.

% \elembox{dip8 (2)}
% More \elemboxes to follow, but starting from the one above, pdfLaTeX throws the error.

share|improve this question
That's the point at which you get a page break. If I uncomment the last one I get the error that companylogo is not found. If I replace the includegraphics with "AAAA" it works without error, so I guess it is failing while reading the eps file to find the bounding box. – David Carlisle May 8 '12 at 19:59
I don't get any error (at least not after using the demo option for graphicx to ignore the missing companylogo). I enabled the last \elembox, which should have been enabled from the start. Examples should always produce the error. – Martin Scharrer May 8 '12 at 20:00
If I use one of my images instead of your logo, your example works OK in my system. What happens if you add demo to graphicx; i.e., if you load the package like this: \usepackage[demo]{graphicx}? – Gonzalo Medina May 8 '12 at 20:00
I seem to remember that the spanish babel setup has some "interesting" catcode assignments which may trip up characters that appear in that file if they appear before the bounding box. – David Carlisle May 8 '12 at 20:02
Thank you all for your comments. I didn't know about the demo option in graphicx. The code compiled correctly with this option set. In other to make it work without it (and so making the companylogo appear), I had to use the file's absolute path (I was using the path relative to ~/, which seems not to work. I have always worked with relative paths containing ../ without an issue. – Luis E. May 10 '12 at 13:04
up vote 3 down vote accepted

As pointed out in the comments your code works well.

Something goes wrong with your picture. However LaTeX can handle relative paths.

A relative path is setup with ../. You can also use \graphicspath:

How to use \graphicspath + epstopdf

Note that spaces in paths need special handling.

There might also be a problem in using ~/ for denoting a path, as ~ has special meaning. You might try \string~/ instead.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.