tufte-latex
tufte-latex copied to clipboard
full textwidth caption width for figure* and table*
I see little reason why we would want the default horizontally narrow caption box. For these environments, should the caption width not default to the length of the figure?
My current solution is to wrap the cpation into an \mbox{}, but there must be a better way...
Any ideas? I'd be fine with anything, a new command \fullcaption{} or perhaps even better, an argument that specifies width, like how \includegraphics{} can take an image scale, or can be set to \textwidth.
If this feature is already available, then this issue should simply be one of adding to documentation, as my search cane up empty.
Great package, by the way, it really motivates me to good work.
Well, the idea of the default is probably indeed to have a caption in the right column which then is parallel to the main text, such as in this example (having a \begin{figure*}[t], ie figure at the top, and a short caption below which is in the margin column):

I think this is a reasonable default, but I second the idea to introduce an alternative!
Especially, in fullwidth mode, the behaviour of the captions should be full width by default.
I wrote a PR that adds a new environment (figurefw) that has a full width caption. I would be happy for anyone testing this. However I did not manage to make this the default behaviour in fullwidth mode. Any hints on how to do that are appreciated.
I'm currently editing the tufte-common and class files because I wanted different paper size. I also have the same problem, where I have a full-width, full-page table that needs a caption below, instead of on the side. I want the tables to show up in the tables page, get numbers, etc., so I don't want to do anything ad-hoc. Does your new environment handle that? I was going to say PM me, but it doesn't look like we get PMs. If you feel like it would help, I'd love to roll it into the files as a command, because I'm going to need to write one anyway. It would save some time.
@Tafnab The tablefw environment should do that. You can check out the corresponding branch in my fork to give it a try. Placing tufte-book.cls (or tufte-handout.cls), tufte-common.def, and tufte.bst in the same folder as your latex document should be enough.
Thanks. I'll check it out. What I was doing in the mean time is creating full page PDF tables in small LaTeX files, exporting to PDF, then importing PDF as a full page fig or table. It has the one advantage that I can avoid font and command conflicts that occur in the larger document. Can you think of any disadvantage to this approach? I'm still going to try the FW table. I'm having various small troubles with tufte not playing well with others. I want to occasionally put in a few FW pages, captions on the bottom, etc. that I need to find solutions to at some point. This project is just starting, so I still have time. Thanks again.
@HenningTimm : Having problems. I replaced the fullwidth environment with your tablefw. Previously, it rendered with tables overlapping because it wasn't actually getting the full width. It's still overlapping, but actually going the fullwidth. So, there's some sort of scaling problem. I'm using a bunch of packages that might not be compatible. I'm using subcaption & caption with compatibility mode off, because I couldn't get it to run otherwise.
\documentclass[a4paper,openany]{tufte-book} % Use the tufte-book class which in turn uses the tufte-common class \usepackage[svgnames]{xcolor} % Required to specify font color \PassOptionsToPackage{table,dvips}{xcolor} \PassOptionsToPackage{top=0.25in,left=0.80in,bottom=0.75in,right=0.80in,portrait,width=8.5in,height=14in}{geometry} \usepackage{microtype} % Improves character and word spacing \usepackage{lipsum} % Inserts dummy text \usepackage{pdfpages} \graphicspath{{graphics/}} % Sets the default location of pictures \setkeys{Gin}{width=\linewidth,totalheight=\textheight,keepaspectratio} % Improves figure scaling \usepackage{fancyvrb} % Allows customization of verbatim environments \fvset{fontsize=\normalsize} % The font size of all verbatim text can be changed here \usepackage{Tabbing} \usepackage{adforn} % provides a fleurism \usepackage{calligra} % Used for script font \usepackage[T1]{fontenc} \usepackage{fouriernc} \usepackage[T1]{fontenc} \usepackage{rustic} \usepackage[T1]{fontenc} \usepackage{emerald} \usepackage[T1]{fontenc} \usepackage{foekfont} \usepackage[T1]{fontenc} \usepackage{microtype} \usepackage{array} \usepackage{graphicx,colortbl,booktabs,environ,hhline} \usepackage[table]{xcolor} \usepackage{tcolorbox,longfbox} \usepackage{tikz} \usetikzlibrary{shapes,snakes} \usepackage{amsmath,amssymb} \usepackage{wasysym} % mars & sun sumbols
\usepackage{relsize} % gives commands to make text larger relative to current, using for logic symbols \input cyracc.def \font\tencyr=wncyr10 \def\cyr{\tencyr\cyracc} \usepackage{cleveref} % used for references \usepackage{listings} \usepackage{marginfix} % attempt to fix wandering side notes \usepackage{csquotes}english=american,strict=true,csdisplay=true,threshold=words,parthreshold=true] % tries to fix quotes, might go badly %\usepackage{sidenotes} % trying to get better margin figures \usepackage{enumitem} % gives more options for lists \usepackage{ulem} % for strikethrough \usepackage[figurename=Fig.,compatibility=false]{caption}
\usepackage{subcaption} % allows to assemble graphics \captionsetup{compatibility=false}
My incantation for the two tables goes like this
\begin{tablefw} \caption[t]{Title for both tables} \subcaptionbox{title for this table} \begin{subtable}[t]{0.4\textwidth} \begin{tabular} % END EVERYTHING BUT tablefw \hfil \subcaptionbox{title for this table} \begin{subtable}[t]{0.4\textwidth} \begin{tabular} % END EVERYTHING BUT tablefw \end{tablefw}
Issues:
- The tables are somehow rescaling themselves. They slightly overlap, but go the full text width. No space between, even though I put some there.
- How to get the title on top, as opposed to the bottom
- The subcaptions are smack up against the left side of the tables. It looks very awkward. Ironically, the subcaptions look appropriately spaced. But since this is a table, it looks weird to have them not centered on the subtables.
- After the mode exits, the text is right up against the tables. I've tried \vspace, \bigskip. I had to insert a line of white on white text to give myself any space. It looks like the environment is somehow not establishing the bottom edge of its box. I have no idea how this could happen.
Do you think you can take a look?
So, I've sort of fixed the problem. Just apply a \scalebox{0.8}{} around each subcaptionbox & subtable. It works, but it's not right. Still doing the white on white text after the \end{tablefw} to get proper paragraph spacing. Haven't figured out how to get the title on top, but that's probably something I'm doing wrong.
@Tafnab Thank you for your feedback! Unfortunately I am unable to to look into this right now as I am facing a very restrictive deadline. I mentioned this post in the PR (#145) with the hope that someone can find a solution for that.