LaTeX forum ⇒ GeneralList of Figure Problem

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

List of Figure Problem

Postby Keith Emmert » Sat Nov 08, 2008 9:34 pm

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

  1. \addtocontents{lof}{\vspace*{-10pt}}
  2. \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

  1. \NeedsTeXFormat{LaTeX2e}
  2. \ProvidesClass{MathThesis}
  3.  
  4. \DeclareOption*{\PassOptionsToClass{\CurrentOption}{report}}
  5.  
  6. \ProcessOptions
  7.  
  8. \LoadClass[12pt]{report}
  9.  
  10. \RequirePackage[total={6in, 8.5in}, top=1.5in, left=1.5in, headheight=15pt, headsep=0.5in, footskip=0.5in]{geometry}
  11. \RequirePackage[reqno]{amsmath}
  12. \RequirePackage{amsthm}
  13. \RequirePackage{amsfonts}
  14. \RequirePackage[mathscr]{eucal}
  15. \RequirePackage{setspace}
  16. \RequirePackage{cite}
  17. \RequirePackage{fancyhdr}
  18. \RequirePackage{graphicx}
  19. \RequirePackage{subfigure}
  20. \RequirePackage[subfigure]{tocloft}
  21. \RequirePackage{remreset}
  22.  
  23.  
  24. %
  25. % ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  26. % Modifications of the base class begin here
  27. % ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  28. %
  29.  
  30.  
  31. %
  32. % Definitions for Theorems, Corollaries, etc.
  33. %
  34. \newtheorem{corollary}{Corollary}[section]
  35. \newtheorem{lemma}{Lemma}[section]
  36. \newtheorem{theorem}{Theorem}[section]
  37. \newtheorem{proposition}{Proposition}[section]
  38. \newtheorem{definition}{Definition}[section]
  39.  
  40.  
  41. %
  42. % Fix the page layout
  43. %
  44. \pagestyle{fancy}
  45. \renewcommand{\headrulewidth}{0pt}
  46. \renewcommand{\footrulewidth}{0pt}
  47. \fancyhf{}
  48. \fancyhead[R]{\thepage}
  49. \fancypagestyle{plain}{\fancyhead{}\fancyfoot[C]{\thepage}\renewcommand{\headrulewidth}{0pt}}
  50.  
  51. \newenvironment{PlainPages} % Used to fix the Table of Contents, etc.
  52. {
  53. \pagestyle{plain}%
  54. }
  55. {\relax}
  56.  
  57. %
  58. % Fix the naming and numbering schemes
  59. %
  60. \renewcommand{\contentsname}{TABLE OF CONTENTS}
  61. \renewcommand{\listfigurename}{FIGURES}
  62. \renewcommand{\listtablename}{TABLES}
  63. \renewcommand{\bibname}{BIBLIOGRAPHY}
  64. \renewcommand{\figurename}{FIGURE}
  65. \renewcommand{\tablename}{TABLE}
  66. \renewcommand{\chaptername}{CHAPTER}
  67.  
  68.  
  69. %
  70. % Table of Contents, Figures, Tables, Equations
  71. %
  72. \setcounter{tocdepth}{1} % Only display chapter and section levels
  73.  
  74. \renewcommand{\cftsecdotsep}{\cftnodots} % Disable the dots in the leaders for subsections
  75. \setlength{\cftbeforetoctitleskip}{0.175in}
  76. \setlength{\cftaftertoctitleskip}{0.5\baselineskip}
  77. \renewcommand{\cfttoctitlefont}{\hfill\bfseries}
  78. \renewcommand{\cftaftertoctitle}{\hfill}
  79.  
  80. \renewcommand{\cftfigdotsep}{\cftnodots} % Disable the dots in the leaders for List of Figures
  81. \setlength{\cftbeforeloftitleskip}{0\baselineskip}
  82. \setlength{\cftafterloftitleskip}{0.5\baselineskip}
  83. \renewcommand{\cftloftitlefont}{\bfseries}
  84. \cftpagenumbersoff{subfigure} % Don't include subfigures in List of Graphics
  85.  
  86. \renewcommand{\cfttabdotsep}{\cftnodots} % Disable the dots in the leaders for List of Tables
  87. \setlength{\cftbeforelottitleskip}{0.5\baselineskip}
  88. \setlength{\cftafterlottitleskip}{0.5\baselineskip}
  89. \renewcommand{\cftlottitlefont}{\bfseries}
  90.  
  91. \renewcommand{\theequation}{\Roman{chapter}.\arabic{equation}}
  92. \@removefromreset{figure}{chapter} % Keeps \thefigure counter from resetting between chapters
  93. \renewcommand{\thefigure}{\arabic{figure}} % Number things the way the grad school wants
  94. \@removefromreset{table}{chapter} % Keeps \thefigure counter from resetting between chapters
  95. \renewcommand{\thetable}{\Roman{table}} % Number things the way the grad school wants
  96.  
  97. \renewcommand{\textfraction}{0.15}
  98. \renewcommand{\topfraction}{0.85}
  99. \renewcommand{\bottomfraction}{0.65}
  100. \renewcommand{\floatpagefraction}{0.60}
  101.  
  102. \setlength{\@fptop}{0pt} % This is the vertical spacing above the top floatpage float.
  103. % The default is 0pt plus 1.0fil (fil is infinitely strechable = \vfill
  104. \setlength{\@fpsep}{8pt} % This is the vertical spacing between floatpage floats.
  105. % The default is 8pt plus 2.0fil
  106. \setlength{\@fpbot}{0pt} % This is the vertical spacing below the bottom floatpage float.
  107. % The default is 0pt plus 1.0fil
  108.  
  109.  
  110.  
  111.  
  112.  
  113. %
  114. % Fix the spacing
  115. %
  116. \doublespacing % Turn on double spacing
  117.  
  118.  
  119. %
  120. % Fix the Chapter Headings
  121. %
  122. \renewcommand\chapter{\if@openright\cleardoublepage\else\clearpage\fi
  123. \thispagestyle{plain}%
  124. \global\@topnum\z@
  125. \@afterindentfalse
  126. \secdef\@chapter\@schapter}
  127. \def\@chapter[#1]#2{\ifnum \c@secnumdepth >\m@ne
  128. \refstepcounter{chapter}%
  129. \typeout{\@chapapp\space\Roman{chapter}.}%
  130. \addcontentsline{toc}{chapter}% This adds the Chapter and Number as Chapter Heading
  131. {\protect\numberline{CHAPTER \Roman{chapter}}}%
  132. \addcontentsline{toc}{section}% This adds the Chapter Title as Section Heading
  133. {\protect\numberline{#1}}% % Print the Chapter Title
  134. \else
  135. \addcontentsline{toc}{chapter}{#1}%
  136. \fi
  137. \chaptermark{#1}%
  138. \addtocontents{lof}{\protect\addvspace{10\p@}}%
  139. \addtocontents{lot}{\protect\addvspace{10\p@}}%
  140. \if@twocolumn
  141. \@topnewpage[\@makechapterhead{#2}]%
  142. \else
  143. \@makechapterhead{#2}%
  144. \@afterheading
  145. \fi}
  146. \renewcommand{\@makechapterhead}[1]{%
  147. %\vspace*{50\p@}%
  148. {%
  149. \ifnum \c@secnumdepth >\m@ne
  150. \centering\bfseries \@chapapp\space \Roman{chapter} % Chapter number
  151. %\par\nobreak
  152. \vskip 0.75\baselineskip
  153. \fi
  154. \interlinepenalty\@M
  155. \centering #1\par % Chapter title
  156. \nobreak
  157. \vskip 0.75\baselineskip
  158. }}
  159.  
  160.  
  161. %
  162. % Fix the Section Headings
  163. %
  164. \renewcommand{\section}{\@startsection
  165. {section}% % Then name
  166. {1}% % The "section" level
  167. {0mm}% % The indentation
  168. {0.75\baselineskip}% % The before skip
  169. {0.125\baselineskip}% % The after skip
  170. {\bfseries}}% % The style
  171.  
  172. \renewcommand{\@seccntformat}[1]{Section \Roman{chapter}.\arabic{section}\quad }
  173.  
  174.  
  175. %
  176. % Fix the Bibliography
  177. %
  178. \renewcommand*{\bibname}{\vspace*{-1.5in}}
  179.  
  180.  
  181.  
  182. %
  183. % Basic paragraph layout commands
  184. %
  185. \raggedright % < ----- Graduate school wants ragged right margins
  186. \raggedbottom % < ---- Grad school wants this
  187. \parindent 0.5in
  188.  
  189.  
  190. \endinput

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

Postby Juanjo » Sun Nov 09, 2008 1:15 am

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:
  1. \addtocontents{lof}{\protect\addvspace{10\p@}}%
  2. \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

Postby Keith Emmert » Sun Nov 09, 2008 1:27 am

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: 495
Joined: Mon Apr 09, 2007 4:20 pm

Postby sommerfee » Sun Nov 09, 2008 10:17 am

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


  1. \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
  1. \renewcommand \thesection {\@arabic\c@section}

which is equivalent to
  1. \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

Postby Keith Emmert » Sun Nov 09, 2008 10:01 pm

Hey,

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

  1. \addtocontents{lof}{\protect\addvspace{10\p@}}%
  2. \addtocontents{lot}{\protect\addvspace{10\p@}}%


and tried using

  1. \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: 495
Joined: Mon Apr 09, 2007 4:20 pm

Postby sommerfee » Mon Nov 10, 2008 11:18 am

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

Postby Keith Emmert » Tue Nov 11, 2008 4:14 am

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

Postby alexhenry1977 » Wed Dec 10, 2008 7:49 am

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,


Return to “General”

Who is online

Users browsing this forum: No registered users and 8 guests