GeneralNeed help with table of figures formatting

LaTeX specific issues not fitting into one of the other forums of this category.
jaredm
Posts: 8
Joined: Tue Oct 07, 2008 5:46 am

Re: Need help with table of figures formatting

Post by jaredm »

I've attached an MWE that illustrates the problem. Both the List of Tables and List of Figures have the same problem. Once the number of entries is greater than 10, it places a single space between the figure/table number and the start of the caption. My School's format calls for there to be at least 2 spaces there. Sorry about the .zip, but I was having trouble attaching more than 3 files.

I'm using compatibilty mode because the files that my University provided me for my thesis are old and I'm a LaTeX beginner so my efforts to update them didn't work, and I'm running into a deadline :(.

Thanks for your help

Jared
Attachments
MWE.zip
A zip with the neccessary MWE files.
(11.07 KiB) Downloaded 266 times

Recommended reading 2024:

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

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

Juanjo
Posts: 657
Joined: Sat Jan 27, 2007 12:46 am

Re: Need help with table of figures formatting

Post by Juanjo »

I've adapted the files you provided to LaTeX2e, so you can stop typesetting in compatibility mode. Read the remarks I've written in the tex file. Now you have at your disposal a new documentclass named thesis08 which moreless behaves as the old style you were using. The result is not identical, but quite approximate. Your advisor may tell you if it is satisfying. If there are some aspects really essential that remain to be adapted, feel free to ask.

Please note that thesis08 is basically the report document class, with the same options. IMHO, the original style was not beatifully and coherently designed. Since thesis08 tries to mimic it, this class does not yield too much attractive documents and some inconsistencies may appear with options 10pt or 11pt, for example. Anyway, if you can continue writing your thesis while fully exploiting the LaTeX2e features, I think that the goal is achived.
Attachments
MWE08.zip
(5.72 KiB) Downloaded 297 times
The CTAN lion is an artwork by Duane Bibby. Courtesy of www.ctan.org.
jaredm
Posts: 8
Joined: Tue Oct 07, 2008 5:46 am

Re: Need help with table of figures formatting

Post by jaredm »

Thank you so much for helping me with the class file. I've almost finished converting my thesis to use your class, and it is much cleaner and easier to work with.
I've got a question about formatting the captions that are on the figures/tables themselves. Right now when a multi-line caption is added, it is made flush left with the "F" in Figure number:

Figure 1.1 A caption that takes
more than one line.

How do I set the caption so it is flush left with the "A"?

Figure 1.1 A caption that takes
-------------->more than one line.

Thanks,
Jared
Attachments
mwe.tex
An example that illustrates the behavior
(749 Bytes) Downloaded 293 times
thesis08.cls
The class file I'm using.
(8.6 KiB) Downloaded 309 times
User avatar
Juanjo
Posts: 657
Joined: Sat Jan 27, 2007 12:46 am

Need help with table of figures formatting

Post by Juanjo »

Add in the preamble the following line:

Code: Select all

\usepackage[format=hang,labelsep=space]{caption}
Read the documentation of the caption package. It may be useful.
The CTAN lion is an artwork by Duane Bibby. Courtesy of www.ctan.org.
jaredm
Posts: 8
Joined: Tue Oct 07, 2008 5:46 am

Re: Need help with table of figures formatting

Post by jaredm »

That fixes my caption problem, thank you for helping me with that!

I have two more questions that I haven't been able to figure out though. I'm trying to get the \@dottedtocline on the intial entry in my table of contents for each chapter, in addition to each section, but I just get errors when I try adding it to my class file in the block

\renewcommand*\l@chapter[2]{%
\ifnum \c@tocdepth >\m@ne
\addpenalty{-\@highpenalty}%
%\vskip 2em \@plus\p@
\setlength\@tempdima{2.5em}%
\begingroup
\parindent \z@ \rightskip \@pnumwidth
\parfillskip -\@pnumwidth
\leavevmode %\bfseries
\advance\leftskip\@tempdima
\hskip -\leftskip
\textbf{\MakeUppercase{#1}}\nobreak\hfil \nobreak% JM
%\textbf{\MakeUppercase{#1}}\nobreak \dotfill \nobreak% JM
\hb@xt@\@pnumwidth{\hss #2}\par
\penalty\@highpenalty
\endgroup
%\vskip .5em plus 1pt
\fi}

Should I be adding it somewhere else?

Also, I would like to make a slight change to the way that the appendices get numbered. Currently they get numbered alphabetically like "A.". I need to get rid of the period, and I'm pretty sure that it is coming from the block

\def\@chapter[#1]#2{
\ifnum \c@secnumdepth >\m@ne
\refstepcounter{chapter}
\typeout{\@chapapp\space\thechapter.}
\addcontentsline{toc}{chapter}{%
\protect\numberline{\thechapter.}#1}%
\else
\addcontentsline{toc}{chapter}{#1}%
\fi
\chaptermark{#1}%
\if@twocolumn
\@topnewpage[\@makechapterhead{#2}]
\else
\@makechapterhead{#2} \@afterheading
\fi}

but how do I change it for the appendix without changing the behavior for the other chapters?

Thank you again for all of your help,
Jared
Attachments
thesis08.cls
The document class that I'm using
(8.91 KiB) Downloaded 268 times
mwe.tex
A mwe illustrating the behavior
(308 Bytes) Downloaded 254 times
User avatar
Juanjo
Posts: 657
Joined: Sat Jan 27, 2007 12:46 am

Need help with table of figures formatting

Post by Juanjo »

I attach a new version of thesis08.cls that solves, I hope, your issues. You'll see changes in the definitions of \@chapter and \l@chapter. There is also a redefinition of \appendix. From now on you don't need the appendix package. Your MWE could be:

Code: Select all

\documentclass[12pt,letterpaper]{thesis08}

\begin{document}
\tableofcontents
\chapter{Test Chapter}
Some text in the chapter.
\section{A section}

\appendix
\chapter{}
Something in the appendix.
\chapter[\hspace*{-2em}]{}
Something in the appendix
\end{document}
Look at the table of contents and please note the difference between the two appendix entries. You should add an optional argument like above (or redefine \chapter for the appendices) if you are providing empty appendix titles. Likewise, the separated page with the "Appendices" title has now an style coherent with that of parts.

I've also undone or modified some of your changes, since, IMHO, they introduce some inconsistencies:
  • Def. of \@part: Why inhibit the part counter to increase? If you don't need numbered parts, you should use \part* and then \addcontentsline to put it in the table of contents. You could also redefine \@spart to incorporate \addcontentsline and simply use \part*.
  • In \l@part and \l@chapter, you have removed some commands leaving vertical space. The result is a table of contents excessively tight. I've put there the default values for the report class.
  • The lists of figures and tables should be considered as chapters and appear as so in the TOC. This affects the new \addcontentsline in the def. of \listoffigures and \listoftables.
I've also added \addcontentsline to thebibliography.
Attachments
thesis08.cls
(9.32 KiB) Downloaded 312 times
The CTAN lion is an artwork by Duane Bibby. Courtesy of www.ctan.org.
jaredm
Posts: 8
Joined: Tue Oct 07, 2008 5:46 am

Re: Need help with table of figures formatting

Post by jaredm »

This works great, I just sent my thesis off for its final review! Thank you so much for your patience and all of your help.

Jared
jaredm
Posts: 8
Joined: Tue Oct 07, 2008 5:46 am

Need help with table of figures formatting

Post by jaredm »

Juanjo,

I've attached my edited thesis08.cls, along with several .tex files to make a working example document. The main .tex file is UAH_Sample.tex, and I used it to demonstrate how I used the class. I also placed some comments in the .cls file to briefly explain some of the options that were available, as well as documenting the few changes that I made to adjust the formatting for my University's requirements (marked by an "edited by JM...").
There is one thing that I had to do that seems kind of hackish and I'd like to know a better way to do it. In UAH_Sample.tex I add the following

Code: Select all

% Adds the "Chapter" word between List of Symbols and chapter 1
\addcontentsline {toc}{part}{Chapter}
The university requires that it be there, and it shouldn't have a page number. The way that I got rid of the page number was by editing the .toc file before the final compile. If you have any suggestions or corrections please let me know.

Thanks for taking a look,
Jared
Attachments
UAH_Sample_Commented.zip
(71.58 KiB) Downloaded 214 times
jaredm
Posts: 8
Joined: Tue Oct 07, 2008 5:46 am

Re: Need help with table of figures formatting

Post by jaredm »

These the files that were previously available from the website that is now forbidden.

Jared
Attachments
FilesFromUAH.zip
(129.76 KiB) Downloaded 247 times
Post Reply