Take the 2-minute tour ×
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.

I'd like to save the PSTicks code for my images in seperate files and then include them with \include{image.tex}. This works fine with normal figure floats. But when I use subfloats, I get the error:

(./newfile1.aux (./file.tex.aux))
! Missing } inserted.
<inserted text> 
                }
l.11    }

This minimal example works fine (file.tex can be also empty), but throws an error when the comment marks are removed:

\documentclass[english]{article}
\usepackage{pst-plot}
\usepackage{pstricks}
\usepackage{pst-node}
\usepackage{subfig}
\begin{document}
    \begin{figure}

    %\subfloat[]{
        \include{file.tex}
    %}

    \caption{Caption}

    \end{figure}

\end{document}

The minimal example works as expected also if the include command is replaced by the content of the file.

share|improve this question

1 Answer 1

up vote 3 down vote accepted

\include is the wrong command for sure. It's meant for parts of the document structure like chapters which get their own .aux files.

Try \input.

share|improve this answer
    
Thanks, that solved everything. I didn't think about that, because it was working with out subfloats and I was using \include a lot before, but it was wrong everywhere... –  lumbric Mar 26 '12 at 7:55

Your Answer

 
discard

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.