LyXTitle and footnotes in tables

Information and discussion about LyX, a WYSIWYM editor, available for Linux, Windows and Mac OS X systems.
Matias
Posts: 20
Joined: Sun Jan 17, 2010 11:40 pm

Title and footnotes in tables

Post by Matias »

I'm using LyX 1.6.5.

Is there a way of getting a title and footnotes for a table? I want the footnotes to be right under the table. Do I have to do this "manually"?
Last edited by Matias on Sun Jan 24, 2010 9:20 pm, edited 1 time in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

meho_r
Posts: 823
Joined: Tue Aug 07, 2007 5:28 pm

Title and footnotes in tables

Post by meho_r »

You mean footnotes inside a table? You may take a look here. Basically, put a table in a minipage and footnotes will work (and will be positioned under the table).

As for table captions, you should use floats and simply put a table above its caption. Note that space between the table and its caption can be larger than wanted. You may correct it with a negative \vspace (use ERT box for it). You'll find an example in attachment.
Attachments
test.lyx.zip
(1.13 KiB) Downloaded 477 times
Matias
Posts: 20
Joined: Sun Jan 17, 2010 11:40 pm

Re: Title and footnotes in tables

Post by Matias »

Thank you for your reply. I didn't like the line that came over the footnotes, and I couldn't get to align the title as I wanted to. Therefore I'm currently just going with making the title over the table "manually" and the footnotes with superscript.
Last edited by Matias on Mon Jan 25, 2010 10:53 am, edited 1 time in total.
meho_r
Posts: 823
Joined: Tue Aug 07, 2007 5:28 pm

Title and footnotes in tables

Post by meho_r »

You may remove footnote rule with the command:

Code: Select all

\renewcommand{\footnoterule}{}
However, before trying manual approach to both footnotes and captions, consider another solution: threeparttable. For captions, you may use caption package, or, for some more advanced features regarding positioning and customizing floats and captions in general, take a look at floatrow package.

In attachment is an example of simple use of threeparttable and caption packages.
Attachments
test.lyx.zip
(1.38 KiB) Downloaded 431 times
Matias
Posts: 20
Joined: Sun Jan 17, 2010 11:40 pm

Re: Title and footnotes in tables

Post by Matias »

Really good, I'm gonna go with your new approach. However, I'm also looking to rotate a table (landscape view). Is this possible when using threeparttable (combined with maybe rotating package or floatrow)?

Rotating package has a "sidewaystable" command, but how do I combine with the ability to make footnotes?
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Title and footnotes in tables

Post by localghost »

Matias wrote:[...] Is this possible when using threeparttable (combined with maybe rotating package or floatrow)? [...]
Why don't you just try? In case of upcoming problems just ask further questions.
Matias wrote:[...] Rotating package has a "sidewaystable" command, but how do I combine with the ability to make footnotes? [...]
Just use rotating and threeparttable in combination. Read the according manuals carefully and start a first approach.


Best regards
Thorsten
Matias
Posts: 20
Joined: Sun Jan 17, 2010 11:40 pm

Re: Title and footnotes in tables

Post by Matias »

Hi, localghost.

Yes, I do try to read and search Google before I ask. Some things are, however, not so easy for a newbie like me. Maybe I don't try hard enough, but there is also a line between asking and spending countless hours trying to figure it out myself (though you may learn better that way).

I will continue trying to find a solution for this.
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Title and footnotes in tables

Post by localghost »

Don't use a search engine. With your degree of experience you might not always be able to interpret the results in the right way. Propose targeted questions. Produce some code and present your efforts by means of a minimal working example (MWE).
Matias
Posts: 20
Joined: Sun Jan 17, 2010 11:40 pm

Re: Title and footnotes in tables

Post by Matias »

I don't completely agree with the use of search engines. If I have some small question I often find what I need with no misinterpretation. I don't know about the minimal working example (MWE). As I see it's more when you get errors and such. This is also the LyX forum, and it's a little bit different than the more raw LaTeX editors. Maybe I can find another forum also, so that I can divide my stupid questions so that I don't flood your forum.

As it is now, I have a threeparttable (described by meho_r) inside a float. I want to rotate this whole float to landscape view. I read the rotating and threeparttable manuals, but I still have problems getting it to work.
meho_r
Posts: 823
Joined: Tue Aug 07, 2007 5:28 pm

Title and footnotes in tables

Post by meho_r »

The point is that, when using rotating package, it puts tables/figures on an empty page as a float, so don't use LyX's Insert>Float>Table mechanism, but use the environment provided by rotating package, e.g. (part of the code from the attached .lyx file):

Code: Select all

\begin{sidewaystable}

\begin{threeparttable}
\begin{tabular}{|c|c|c|c|c|c|c|}
\hline 
test\tnote{1} & test & test & test & test & test & test\tabularnewline
\hline
\hline 
test & test & test & test & test & test\tnote{a} & test\tabularnewline
\hline
\end{tabular}

\begin{tablenotes}% to print footnotes below the table
\footnotesize% to get a little bit smaller font of footnotes
\item[1]Text for the first footnote
\item[a]Text for the second footnote
\end{tablenotes}
\caption{And a table with a lot larger title than previous to show how it looks like in more than one line}
\label{ATableC}
\end{threeparttable}

\end{sidewaystable}
So, the difference is that there is no \begin{table}...\end{table} here. Captions and labels should be used as usual (in spite of LyX's complaints in form of Senseless!!! message for putting a caption "outside" of a float).
Attachments
test.lyx.zip
(2.17 KiB) Downloaded 309 times
Post Reply