%% %% This is file `eftci.sty' %% It contains a redefinition of 4 tests which endfloat.sty %% uses, in order to accomodate TCI's Scientific Word or %% Scientific WorkPlace, version 2.5. %% %% VERY IMPORTANT -- these changes are specific to SW version 2.5. %% THEY WILL NOT WORK WITH SW/SWP version 2.0/2.01. %% %% The changes are: %% %% 1. the end-of-table test looks for the string \end{table}% ie with %% an ending comment (the original endfloat.sty didn't have the comment). %% 2. so does the end-of-figure test -- see below for more on this, and %% on how to handle floating figures in the SW context %% %% These changes are based on my looking at the way encapsulated TeX %% fields are handled by SW. If TCI changes this, the changes %% will no longer work. It is important to make these changes because %% the endfloat package looks for a line like \end{table} to tell %% it when to stop reading from the additional files it creates. The %% problem is, under TCI's scheme, the text \end{table} will appear %% twice: once in a comment, generated by the encapsulated TeX field, %% and once for real. Fortunately, the real version seems always to be %% followed by a comment symbol %, which is why the changes in this package work. %% %% Usage %% ===== %% %% 1. place endfloat.sty and eftci.sty in a directory somewhere %% under \tex\macros of your sw[p] installation. The \float %% subdirectory is one possibility, though personally I tend %% to put all my own additions to the system in a new subdirectory %% called, say, \personal so I can differentiate my stuff from %% what's in the truetex LaTeX distribution. %% %% 2. in your SW document, do File DocInfo Preamble. After any %% code that's there, insert the following lines IN THIS ORDER %% \RequirePackage{endfloat} %% \RequirePackage{eftci} %% \usepackage will of course also work. The difference is that %% with \usepackage, SW copies the commands so that they %% are accessible only through the File Style dialog (rather than %% File DocInfo). Note that even though the package order in File Style %% may look wrong, as far as the TeX system is concerned, the order %% is the one you specified in File DocInfo. %% Personally, I prefer to keep control of this, which is why I %% recommend \RequirePackage. %% However, if you're going to wrap your document, you may want to %% use \usepackage: the SW document manager will automatically %% pick up packages referred to in \usepackage for inclusion in the %% .msg file; but it won't pick up those names in \RequirePackage. %% %% The endfloat package has many options, which you specify %% as optional arguments to the endfloat call, for example %% \RequirePackage[nolists]{endfloat} %% which inhibits production of the List of Tables and List of Figures, %% which would otherwise appear before the pages containing the tables or %% figures. I tend to think that the ease of changing the options in the %% \RequirePackage setting is another argument for avoiding \usepackage. %% %% 3. endfloat can produce Lists of Tables and/or Figures at the end of %% your document, just before the tables figures themselves. If you %% want these, you need to make sure that SW runs LaTeX at least twice. %% SW will know to do this only if you include something like a %% Bibliography field in your document --- including encapsulated %% TeX fields doesn't do it. If SW seems to be compiling with just %% one LaTeX run, manually increase the number to 2. %% %% %% Handling figures. %% ================= %% %% TCI places figures in the document using the \FRAME macro. I haven't %% tried to handle this directly, but there is a work-around. %% The work-around is to place all figures in 1-element hand-floated TABLES %% (ie hand-floated LaTeX \tabular's) using the supplied macros for tables. %% "Hand-floated" just means that you need to use TeX fields, rather %% than rely on the built-in support for floating figures. %% %% In detail, this is what you do, assuming that you want to insert a %% floating figure called malm1.wmf into your document: %% %% 1. Insert the fragment table4_3. This places a 4 x 3 table %% and surrounding tex fields in your document %% 2. Edit the table to make it 1 x 1, and empty the cell. %% 3. Edit the tex field B, just before the table. %% Change "\begin{table}[tbp]" to "\begin{figure}[tbp]" %% 4. Edit the tex field E, after the table. %% Change "\end{table}" to "\end{figure}". %% 5. Edit the tex field "caption" %% and supply your caption and reference %% 6. Import your picture (here malm.wmf) into the table cell, using %% File ImportPicture %% 7. Change the properties of the picture to make it in-line, %% ie non-floating %% %% Note that this should produce the right kind of float even if you're %% not using the endfloat package, so you might as well insert your floating %% figures this way from the start and save yourself some trouble. %% The only disadvantages over the standard SW handling %% of the floating figure are: you've got to edit the "caption" field by hand %% instead of using the SW dialog; you don't see the caption on the screen, %% and there are more TeX fields in your document, which some people don't like. %% %% Suggestion: if you're going to be doing this often, it makes sense %% to save a customized fragment, say floatfig.frg, which would be the %% result of importing table4_3 and doing steps 1--4 above. %% %% TROUBLESHOOTING %% ================= %% %% If you get no end floats at all, but everything else is ok, %% are you using an old version of the harvard bibliography package? %% Missing endfloats are a symptom of this. Get the latest %% version of harvard.sty from CTAN, in macros/latex/contrib/harvard. %% That'll fix the problem. %% %% %% GOOD LUCK!! Remember, though, that this is a pretty makeshift %% solution; and it will fail if TCI changes the way %% encapsulated TeX fields are handled. %% %% Phil Viton %% pviton@magnus.acs.ohio-state.edu {\escapechar=-1% \xdef\ef@endfiguretest{\string\\end\string\{figure\string\}\string\%}% \xdef\ef@enddblfiguretest{\string\\end\string\{figure*\string\}\string\%}% }% {\escapechar=-1 \xdef\ef@enddbltabletest{\string\\end\string\{table*\string\}\string\%} \xdef\ef@endtabletest{\string\\end\string\{table\string\}\string\%} } %% %% The only changes are to add "\string\%" to the end of each of the xdef's. %% End of file `eftci.sty'.