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.

Like classes in java (if that means anything to anyone)? Can you have a document which handles all the graphing, another which handles the figures where you can call parts when you need them in your main document.

The reason I ask is that one of the things that trips me up about latex is I get totally lost trying to find bits of the document. I am trying to find a way to do it. Texmaker has some ways of figuring out where you are by letting you click on a section but it has other disadvantages and I would be interested if there are more possibilities that I have not tapped into yet.

share|improve this question
5  
have you looked at the standalone bundle? as described in outsourcing-tikz-code for example... –  cmhughes Jan 30 '13 at 22:04
    
With TeXnicCenter you can double click the word in your pdf file (use SumatraPDF) and TeXnicCenter jumps to the file and the line were your word is written in your tex code. To be clear: if you have a main.tex, inside calling \include{experiment} containing your searched word TeXnicCenter shows this file and the proper line ... What disadvantages do you mean? –  Kurt Jan 31 '13 at 0:22

1 Answer 1

The boxhandler package has a figure and table deferral option that I sometimes use to do what you desire. Basically, you tell the document to hold back on printing the figures, then you input all the figures from a separate file (but they are not printed). Then, as you wish to print one, you use the \nextFigure command. It also has separate provisions for doing this for tables too. You have to change your figure and table definitions to the format used by boxhandler, which uses a command (\bxfigure{}{}) rather than an environment format.

Here's an example. First, my figure file myfigs.tex

\bxfigure[ht]{Caption to fig 1}{\fbox{DATA FOR FIG 1}}

\bxfigure[ht]{Caption to fig 2}{\fbox{DATA FOR FIG 2}}

\bxfigure[ht]{Caption to fig 3}{\fbox{DATA FOR FIG 3}}

And here is the source file that employs them:

\documentclass{article}
\usepackage{boxhandler}
\begin{document}
\holdFigures
\input{myfigs.tex}

This is the first part of my text
\nextFigure

Then the next section
\nextFigure

And the last section of text
\nextFigure

\end{document}

enter image description here

share|improve this answer
    
I don't follow what is going on here. Can you please elaborate on what you mean by the data and how the directories would be structured? –  Magpie Mar 12 '13 at 11:00
    
@Magpie I'm not sure about directories, but the technique described allows all the LaTeX code for the figures & tables to be defined in a separate file, which is then \input to the preamble. With boxhandler's \hold... feature, the figures (and tables) are not printed out, but rather put into LaTeX boxes, to be later recalled (in sequence) by commands like \nextFigure and \nextTable. The result is that the text of the source document is not cluttered up with a bunch of figure and tabular definitions, which can get in the way of editing legibility. –  Steven B. Segletes Mar 12 '13 at 11:07

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.