more on import of tables

pviton's picture

SWP 6.0.19 on MSWin

A few days ago I posted a note pointing out that
a simple tex file consisting of just the
SWP55 floating table fragment didn't import
correctly: the caption wasn't printed,
and cross-referencing didn't work.

At the time I thought that the problem probably involved
the interpretation of the TeX fields introduced
by SWP55. I now think this may be wrong (or
at least isn't the full story). There seem to be
problems in importing any floating table, and in
converting an imported inline table to a

Importing floating tables

The attached test2.tex is a plain-latex file
produced outside SWP (see below for how)
consisting of a long-ish table/tabular structure.
It compiles without error in non-swp tex.
But as best I can see, when imported to SWP6 and
previewed, the caption doesn't appear, and an
attempt to use the cross-ref fails. There's also
a strange phrase at the beginning of the imported
file: "msi@begin@tableB", which I just deleted.

This suggests that SWP6 has problems in
importing any floating table, not just the ones
produced using SWP55's fragment.

Non-floating tables

Test3.tex is the same tabular, but this time
without the table structure (ie it's going to
be displayed, if you don't do anything about it).
Import it into SWP6. Now do Table -> Properties
and set the following on the Placement tab:
- Location: floating
- Float : on a page of floats
- Caption: below
- cross ref key : table1
Now exit the dialog. Add a cross reference
"Here is a cross-reference [ref to table1]" before
the table.

It seems that this setup doesn't make the
table behave like a float:

*** There seems to be no space for a caption
in the SWP editor.

*** When previewed, what I get on p. 2 (p. 1 is
blank, presumably due to the length of the table) is

Here is a cross-reference ?? [then the table right alongside]

(so, not on a page-of-floats, as requested)

*** the purported cross reference is not resolved
(the ?? )

All this suggests that the attempt to float the
table hasn't worked. Am I dong something wrong?

Other issues

Something seems to go a bit screwy when I added
some text before the test3.tex table. If I put the cursor
in the 1,1 (empty) cell at top-left, then press the left
arrow and type "Here is a cross-reference"
what I get is (// indicates a line break on screen):

[indent]Here // is // a // cross //reference

What's going on? As noted above, it previews
as one line, so this is mostly an on-screen
appearance issue.


The test files were produced by an R package which
is designed to format the results of statistical analyses
very flexibly for inclusion in papers. So it's possible that
it involves some 'nonstandard' latex, though a quick scan
suggests that this isn't so. (The only thing I don't recall
seeing before is the space between the column alignment
entries in the \begin{tabular} declaration; however,
the files themselves compile outside SWP6 with no

The R package is texreg, and is something that empirical
SWP users (particularly economists) would find very
helpful if it could be made to work with SWP6. (Especially
since the facilities provided by MuPad are useless for serious
empirical research). It isn't quite "reproducible research"
a la knitr, but it's a sight better than having to retype
results yourself.

These tables represent about the largest (vertical)
tables that can be accomodated by latex. The next step
would be to go to longtables. It's unfortunate that SWP6
--- unlike LyX --- includes no support for longtables.

Finally, a display issue. SWP6's display of tables has much
more white space than tables did in SWP55, and the user has
do do a fair amount of scrolling to get around them. For large
tables like these, it would be very helpful if some way
could be found to "iconify" or collapse them, in much the
same way that sections (or notes or graphics) can be.

The Advanced Edit button, present on most of the tabs
in the Table Properties dialog, doesn't do anything.

It would be nice to have an explanation of what the
settings in this dialog actually do : some (eg the Test
Wrapping on the Cells tab) are non-obvious (or perhaps
aren't working, it's hard to say). If you're re-writing
the relevant sections of Creating Documents, why not
imitate Knuth and post draft sections online as they

Off topic: start SWP6, with the StdLatex Article
as the default opened document. Now, without doing
anything else, click the "x" icon at the top-right
to close down. You're asked if you want to save the
document, even though you've made no changes at all.
This behavior appears to be new: is it what you want?

test2.tex4.04 KB
test3.tex3.92 KB