Menu

styled Tables with captions don't work in LTX

Deplate
2008-01-29
2013-04-17
  • Hunter Kelly

    Hunter Kelly - 2008-01-29

    So, I've been poking around, trying to figure out why scriptsize, etc, don't seem to work for me.

    I think I've got it figured out:  Using deplate, for source that looks like this:

    || --------------------------------------------- ||
    ||    || Wood || Fire || Earth || Metal || Water ||
    | Direction | East | South | Center | West | North |
    | Season | Spring | Summer | Long Summer | Autumn | Winter |
    || --------------------------------------------- ||
    #OPT: style=scriptsize,dense08,formal
    #OPT: align=center floatAlign=center
    #OPT: here!
    #CAP: Stuff

    I get tex that looks like this:

    \label{file000}\label{file001}
    \begin{formalBlock}
    \begin{dense08Block}
    \begin{smallBlock}
    \renewcommand{\arraystretch}{0.8}
    \setlength{\tabcolsep}{0.8\tabcolsep}
    \small{}
    \begin{table}[hptb]
    \centering{}
    \begin{tabular}{llllll}
    \hline
            \hline
             & Wood & Fire & Earth & Metal & Water \\ \hline
            Direction & East & South & Center & West & North \\         Season & Spring & Summer & Long Summer & Autumn & Winter \\         \hline
    \hline
    \end{tabular}
    \label{tab000001}
    \caption{\normalsize{Wu3 Xing2 Correspondances}}
    \end{table}
    \normalsize{}
    \setlength{\tabcolsep}{1.25\tabcolsep}
    \renewcommand{\arraystretch}{1.0}
    \end{smallBlock}
    \end{dense08Block}
    \end{formalBlock}

    However, when I generate a PDF, the fontsize of the table hasn't changed.

    However, if the begin/end smallBlock is moved _inside_ the begin/end table region, and get rid of the extra \small{}/\normalsize{} decls , it works (and seems cleaner, to boot!).  It looks like something about \begin{table} overrides stuff in the declared environments.

    So I think the style environments should be declared _after_ the table env has begun.  The table env only seems to be declared if there is a caption, however, which is why this may not have been noticed before.  And since these environments are only for tables, anyway, I think it makes sense that they are included _after_ the table environment has begun.

    I think this would allow the custom code for at least some of the styles (small, footnotesize, scriptsize) to be removed from latex-styles.rb - I think it can all be handled in deplate.sty.

    I'll poke around and see if I can come up with a patch, but I see all kinds of stuff about advice and whatnot, and I just don't know the codebase that well to know exactly how it works with invokers and advice and overridden methods, etc, so it may be easier for someone who knows what they are doing to fix :)

     
    • Tom Link

      Tom Link - 2008-01-30

      Thanks. The latex-styles module now (CVS version) sets the font size within the table environment. There are still some conflicts with the standard handling of the style-property.

       
      • Tom Link

        Tom Link - 2008-01-30

        I think it's better to leave this in latex-styles since table formatting as done by the latex formatter is slightly confused. But the formatter now has a blacklist variable so that latex-styles can disable the standard style handling for tables.

         

Log in to post a comment.