GeneralList of Figure Problem

LaTeX specific issues not fitting into one of the other forums of this category.
Post Reply
Keith Emmert
Posts: 12
Joined: Sat Nov 08, 2008 9:24 pm

List of Figure Problem

Post by Keith Emmert »

Good Morning!

I am trying to write a class file based upon the report style file.

I have disabled the automatic resetting of the figure number when the chapter counter is incremented. However, there is a 10pt space included in the LOF and LOT between figures in different chapters.

I know that

Code: Select all

\addtocontents{lof}{\vspace*{-10pt}}
\addtocontents{lot}{\vspace*{-10pt}}

will put a bandaid on things by adding a negative space to counter the positive space, but this sort of thing annoys me. (I assume that there is a more permanent way to do this).

Below is the class file I'm working on...done a lot of internet scavenging for the code, so please assume that I know very little about writing style files.

Any ideas?

Keith

Code: Select all

\NeedsTeXFormat{LaTeX2e}
\ProvidesClass{MathThesis}

\DeclareOption*{\PassOptionsToClass{\CurrentOption}{report}}

\ProcessOptions

\LoadClass[12pt]{report}

\RequirePackage[total={6in, 8.5in}, top=1.5in, left=1.5in, headheight=15pt, headsep=0.5in, footskip=0.5in]{geometry}
\RequirePackage[reqno]{amsmath}
\RequirePackage{amsthm}
\RequirePackage{amsfonts}
\RequirePackage[mathscr]{eucal}
\RequirePackage{setspace}
\RequirePackage{cite}
\RequirePackage{fancyhdr}
\RequirePackage{graphicx}
\RequirePackage{subfigure}
\RequirePackage[subfigure]{tocloft}
\RequirePackage{remreset}


%
% ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
% Modifications of the base class begin here
% ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
%


%
% Definitions for Theorems, Corollaries, etc.
%
\newtheorem{corollary}{Corollary}[section]
\newtheorem{lemma}{Lemma}[section]
\newtheorem{theorem}{Theorem}[section]
\newtheorem{proposition}{Proposition}[section]
\newtheorem{definition}{Definition}[section]


%
% Fix the page layout
%
\pagestyle{fancy}
 \renewcommand{\headrulewidth}{0pt}
 \renewcommand{\footrulewidth}{0pt}
 \fancyhf{}
 \fancyhead[R]{\thepage}
 \fancypagestyle{plain}{\fancyhead{}\fancyfoot[C]{\thepage}\renewcommand{\headrulewidth}{0pt}}

\newenvironment{PlainPages}  % Used to fix the Table of Contents, etc.
{
\pagestyle{plain}%
}
{\relax}  

%
% Fix the naming and numbering schemes
%
\renewcommand{\contentsname}{TABLE OF CONTENTS}
\renewcommand{\listfigurename}{FIGURES}
\renewcommand{\listtablename}{TABLES}
\renewcommand{\bibname}{BIBLIOGRAPHY}
\renewcommand{\figurename}{FIGURE}
\renewcommand{\tablename}{TABLE}
\renewcommand{\chaptername}{CHAPTER}


%
% Table of Contents, Figures, Tables, Equations
%
\setcounter{tocdepth}{1}  % Only display chapter and section levels

\renewcommand{\cftsecdotsep}{\cftnodots}  % Disable the dots in the leaders for subsections
\setlength{\cftbeforetoctitleskip}{0.175in}
\setlength{\cftaftertoctitleskip}{0.5\baselineskip}
\renewcommand{\cfttoctitlefont}{\hfill\bfseries}
\renewcommand{\cftaftertoctitle}{\hfill}

\renewcommand{\cftfigdotsep}{\cftnodots} % Disable the dots in the leaders for List of Figures
\setlength{\cftbeforeloftitleskip}{0\baselineskip}
\setlength{\cftafterloftitleskip}{0.5\baselineskip}
\renewcommand{\cftloftitlefont}{\bfseries}
\cftpagenumbersoff{subfigure}        % Don't include subfigures in List of Graphics

\renewcommand{\cfttabdotsep}{\cftnodots} % Disable the dots in the leaders for List of Tables
\setlength{\cftbeforelottitleskip}{0.5\baselineskip}
\setlength{\cftafterlottitleskip}{0.5\baselineskip}
\renewcommand{\cftlottitlefont}{\bfseries}

\renewcommand{\theequation}{\Roman{chapter}.\arabic{equation}}
\@removefromreset{figure}{chapter} % Keeps \thefigure counter from resetting between chapters
\renewcommand{\thefigure}{\arabic{figure}}  % Number things the way the grad school wants
\@removefromreset{table}{chapter} % Keeps \thefigure counter from resetting between chapters
\renewcommand{\thetable}{\Roman{table}}  % Number things the way the grad school wants

\renewcommand{\textfraction}{0.15}
\renewcommand{\topfraction}{0.85}
\renewcommand{\bottomfraction}{0.65}
\renewcommand{\floatpagefraction}{0.60}

\setlength{\@fptop}{0pt} % This is the vertical spacing above the top floatpage float. 
                         % The default is 0pt plus 1.0fil  (fil is infinitely strechable = \vfill
\setlength{\@fpsep}{8pt} % This is the vertical spacing between floatpage floats. 
                         % The default is 8pt plus 2.0fil
\setlength{\@fpbot}{0pt} % This is the vertical spacing below the bottom floatpage float.
                         % The default is 0pt plus 1.0fil





%
% Fix the spacing
%
\doublespacing  % Turn on double spacing


%
% Fix the Chapter Headings
%
\renewcommand\chapter{\if@openright\cleardoublepage\else\clearpage\fi
                    \thispagestyle{plain}%
                    \global\@topnum\z@
                    \@afterindentfalse
                    \secdef\@chapter\@schapter}
\def\@chapter[#1]#2{\ifnum \c@secnumdepth >\m@ne
                         \refstepcounter{chapter}%
                         \typeout{\@chapapp\space\Roman{chapter}.}%
                         \addcontentsline{toc}{chapter}%  This adds the Chapter and Number as Chapter Heading
                                   {\protect\numberline{CHAPTER \Roman{chapter}}}%
                         \addcontentsline{toc}{section}%  This adds the Chapter Title as Section Heading
                                   {\protect\numberline{#1}}%  % Print the Chapter Title 
                    \else
                      \addcontentsline{toc}{chapter}{#1}%
                    \fi
                    \chaptermark{#1}%
                    \addtocontents{lof}{\protect\addvspace{10\p@}}%
                    \addtocontents{lot}{\protect\addvspace{10\p@}}%
                    \if@twocolumn
                      \@topnewpage[\@makechapterhead{#2}]%
                    \else
                      \@makechapterhead{#2}%
                      \@afterheading
                    \fi}
\renewcommand{\@makechapterhead}[1]{%
%\vspace*{50\p@}%
{%
\ifnum \c@secnumdepth >\m@ne
	\centering\bfseries \@chapapp\space \Roman{chapter}		% Chapter number
	%\par\nobreak
	\vskip 0.75\baselineskip
\fi 
\interlinepenalty\@M
\centering  #1\par	% Chapter title
\nobreak
\vskip 0.75\baselineskip
}}


%
% Fix the Section Headings
%
\renewcommand{\section}{\@startsection
{section}%          							% Then name
{1}%                							% The "section" level
{0mm}%              							% The indentation
{0.75\baselineskip}%   							% The before skip
{0.125\baselineskip}% 							% The after skip
{\bfseries}}%		% The style

\renewcommand{\@seccntformat}[1]{Section \Roman{chapter}.\arabic{section}\quad }


%
% Fix the Bibliography
%
\renewcommand*{\bibname}{\vspace*{-1.5in}} 



%
% Basic paragraph layout commands
%
\raggedright % < ----- Graduate school wants ragged right margins
\raggedbottom % < ---- Grad school wants this
\parindent 0.5in


\endinput

Recommended reading 2024:

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

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

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

List of Figure Problem

Post by Juanjo »

If you really want to avoid the vertical space of 10pt added between chapters in the LOF and LOT, just remove the following lines from the definition of \@chapter:

Code: Select all

\addtocontents{lof}{\protect\addvspace{10\p@}}%
\addtocontents{lot}{\protect\addvspace{10\p@}}%
The CTAN lion is an artwork by Duane Bibby. Courtesy of www.ctan.org.
Keith Emmert
Posts: 12
Joined: Sat Nov 08, 2008 9:24 pm

Re: List of Figure Problem

Post by Keith Emmert »

Wow. Thanks so very much! I've been trying to solve this for way too long.

Do you know of a reference that explains the language used in style files? Is that TeX...or a hybrid of TeX and the internals needed to ensure that LaTeX works?

Keith
User avatar
sommerfee
Posts: 503
Joined: Mon Apr 09, 2007 4:20 pm

List of Figure Problem

Post by sommerfee »

Keith Emmert wrote:Wow. Thanks so very much! I've been trying to solve this for way too long.

Code: Select all

\usepackage[figurewithin=none]{caption}
would be a solution, too, when using version 3.1g or newer of the caption package.
Is that TeX...or a hybrid of TeX and the internals needed to ensure that LaTeX works?
Both. So you need to know about the LaTeX internals you want to change, but usually need to learn TeX, too. Unfortunately very much of the source of LaTeXs class and package files is written in TeX because of runtime and memory efficiency which is IMHO not relevant in our times anymore but makes the code hard to read for beginners. For example \thesection is defined within article.cls as

Code: Select all

\renewcommand \thesection {\@arabic\c@section}
which is equivalent to

Code: Select all

\renewcommand \thesection {\arabic{section}}
while the latter one would IMHO be more readable since it uses no LaTeX internals.
Keith Emmert
Posts: 12
Joined: Sat Nov 08, 2008 9:24 pm

List of Figure Problem

Post by Keith Emmert »

Hey,

For fun, I re-enabled the lines I previously deleted

Code: Select all

\addtocontents{lof}{\protect\addvspace{10\p@}}%
\addtocontents{lot}{\protect\addvspace{10\p@}}%
and tried using

Code: Select all

\usepackage[figurewithin=none]{caption}
It didn't have the desired effect. I suppose that MiKTeX 2.7 is not using Caption 3.5 or later...

Anyway, thanks for the info. I'll try and learn some TeX in my spare time...when I can find spare time.

Keith
User avatar
sommerfee
Posts: 503
Joined: Mon Apr 09, 2007 4:20 pm

List of Figure Problem

Post by sommerfee »

Keith Emmert wrote:I suppose that MiKTeX 2.7 is not using Caption 3.5 or later...
Since MikTeX has an update manager, the version number of MikTeX is telling less about the version numbers of the packages.

So for finding out which version number the caption package has, take a look at your log file. Or just update the caption package using the MikTeX update wizard.
Keith Emmert
Posts: 12
Joined: Sat Nov 08, 2008 9:24 pm

Re: List of Figure Problem

Post by Keith Emmert »

I updated MiKTeX...it is using caption ver 3.1j now...still doesn't work. Ah well, will use the other solution.

Keith
alexhenry1977
Posts: 1
Joined: Wed Dec 10, 2008 7:42 am

Re: List of Figure Problem

Post by alexhenry1977 »

Hi Mr Sommerfee and Keith,

I am new in Latex. I am writing my report but I am having problem that there is a 10pt space included in the LOF and LOT between figures in different chapters (the same as Keith problem). I tried to copy keith command but seems to be conflicting with my other format..
Is there any command just to remove the 10pt space? without making a new definition of the chapter.
Thanks,
Post Reply