LaTeX forum ⇒ Graphics, Figures & TablesNeed help with inserting figures with a old style file

Information and discussion about graphics, figures & tables in LaTeX documents.
animagupta
Posts: 2
Joined: Mon Aug 24, 2015 10:03 pm

Need help with inserting figures with a old style file

Postby animagupta » Thu Aug 27, 2015 7:03 am

I am using the following custom style sheet with
\documentclass[12pt,gensymb,lmodern,textcomp]{iiscthes} and for
some strange reason the \figure and caption commands does not work. Please suggest. I have used \usepackage{cclicenses,graphicx} and \usepackage{caption} for graph processing.
I have a PhD thesis to submit in 2 days and have written for support from the style sheet creator- if anybody can help me here, it willbe really nice :-)
  1. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  2. % iiscthes.sty %
  3. % ------------ %
  4. % Indian Institute of Science thesis style %
  5. % -- modifications to the report style %
  6. % For LaTeX version 2.09 %
  7. % %
  8. % By Sanjay R. Chitnis, CSA %
  9. % %
  10. % Based on the Stanford University and MIT thesis styles. %
  11. % Send any bugs / suggestions for modifications to %
  12. % csa!chitnis@vigyan.ernet.in %
  13. % %
  14. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  15. % %
  16. % Version 1.1 Nov. 19, 1991 %
  17. % New fonts for title page %
  18. % Version 1.0 April 14,1991 %
  19. % iisclogo added %
  20. % Version 0.0 Sept 14,1990 %
  21. % %
  22. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  23. % %
  24. % You are free to copy and modify this style; however if you modify, %
  25. % you should change the name to something other than iiscthes.sty. %
  26. % If you do not have any of the used style files / fonts etc., you %
  27. % will have to modify this style. %
  28. % %
  29. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  30.  
  31. \typeout{Document Style Option `iiscthes' Ver 1.0 <14 Apr 91>.}
  32. \input report.sty
  33.  
  34. \long\def\comment#1{}
  35. \comment{
  36.  
  37. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  38.  
  39. Contents:
  40. ---------
  41. 1. Example of use :removed to thessamp.tex
  42. 2. Documentation :removed to thessamp.tex
  43. 3. Error checking
  44. 4. Page layout
  45. 5. Line spacings
  46. 6. Macros,fonts for title page
  47. 7. Some additional macros
  48. 8. Modifications of some predefined macros
  49. }
  50. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  51. %3. Error Checking
  52. %-----------------
  53.  
  54. % First thing we do is make sure that report has been loaded. A
  55. % common error is to try to use iiscthesis as a documentstyle.
  56. %\@ifundefined{chapter}{\@latexerr{The `iiscthesis' option should be used
  57. %with the `report' document style}{You should probably read the
  58. %iiscthesis documentation.}}{}
  59.  
  60. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  61. %4. Page layout
  62. %--------------
  63.  
  64. % We need 1" margins except on the binding edge, where it is 1 1/2"
  65. % Theses are single-sided, so we don't care about \evensidemargin
  66. \oddsidemargin 0.5cm \evensidemargin 0.5cm
  67. \marginparwidth 40pt \marginparsep 10pt
  68. \topmargin 0pt \headsep 40pt
  69. \textheight 635pt \textwidth 450pt
  70.  
  71. % Disallow page breaks at hyphens (this will give some underfull vbox's,
  72. % so an alternative is to use \brokenpenalty=100 and manually search
  73. % for and fix such page breaks)
  74. \brokenpenalty=10000
  75.  
  76. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  77. %5. Line spacing
  78. %---------------
  79.  
  80. % from doublespace.sty
  81. % Lifted from LaTeX style archive at Clarkson university.
  82. %
  83. % Note: This version sets a baselinestretch of 1.5. If this is too much,
  84. % put \setstretch{1.3} (or some appropriate value) before the
  85. % \begin{document} command. To print the document with single spacing
  86. % again, without removing "singlespace" environments, just put a
  87. % \setstretch{1} at the top of the document.
  88. %
  89. % PLEASE REPORT ANY BUGS
  90. %
  91. % Modified by: Jean-Francois Lamy
  92. % lamy@ai.toronto.edu
  93. % lamy@utai.uucp
  94. %
  95. % Author: Stephen Page -- sdpage@prg.oxford.ac.uk
  96. % sdpage%prg.oxford.ac.uk@cs.ucl.ac.uk
  97. %
  98. % Release date: 6 July 1986 - September 3, 1986
  99. %
  100. % Known bugs:
  101. % . It might be nice if spacing before the footnote rule (\footins)
  102. % were provided in a tidier way.
  103. % . Increasing struts may possibly cause some other obscure part of
  104. % formatting to fall over.
  105. % . \begin{singlespace}\begin{quote} produces the wrong spacing before
  106. % the quote (extra glue is inserted).
  107. % . shouldn't @setsize stretch parskip as well?
  108. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  109.  
  110. %---Set up 1.5 spacing
  111.  
  112. \def\baselinestretch{1.5}
  113.  
  114.  
  115. %---New command "\setstretch" (slightly more mnemonic... and easier to type)
  116.  
  117. \def\setstretch#1{\renewcommand{\baselinestretch}{#1}}
  118.  
  119. %---Stretch the baseline BEFORE calculating the strut size. This improves
  120. % spacing below tabular environments etc., probably...
  121. % Comments are welcomed.
  122.  
  123. \def\@setsize#1#2#3#4{\@nomath#1%
  124. \let\@currsize#1\baselineskip
  125. #2\baselineskip\baselinestretch\baselineskip
  126. \parskip\baselinestretch\parskip
  127. \setbox\strutbox\hbox{\vrule height.7\baselineskip
  128. depth.3\baselineskip width\z@}%
  129. \normalbaselineskip\baselineskip#3#4}
  130.  
  131.  
  132. %---Increase the space between last line of text and footnote rule.
  133. % This is a very untidy way to do it!
  134.  
  135. \skip\footins 20pt plus4pt minus4pt
  136.  
  137.  
  138. %---Reset baselinestretch within footnotes and floats. Originally stolen
  139. % from Stanford thesis style.
  140.  
  141. % Redefine the macro used for floats (including figures and tables)
  142. % so that single spacing is used.
  143. % (Note \def\figure{\@float{figure}set single spacing} doesn't work
  144. % because figure has an optional argument)
  145.  
  146. \def\@xfloat#1[#2]{\ifhmode \@bsphack\@floatpenalty -\@Mii\else
  147. \@floatpenalty-\@Miii\fi\def\@captype{#1}\ifinner
  148. \@parmoderr\@floatpenalty\z@
  149. \else\@next\@currbox\@freelist{\@tempcnta\csname ftype@#1\endcsname
  150. \multiply\@tempcnta\@xxxii\advance\@tempcnta\sixt@@n
  151. \@tfor \@tempa :=#2\do
  152. {\if\@tempa h\advance\@tempcnta \@ne\fi
  153. \if\@tempa t\advance\@tempcnta \tw@\fi
  154. \if\@tempa b\advance\@tempcnta 4\relax\fi
  155. \if\@tempa p\advance\@tempcnta 8\relax\fi
  156. }\global\count\@currbox\@tempcnta}\@fltovf\fi
  157. \global\setbox\@currbox\vbox\bgroup
  158. \def\baselinestretch{1}\small\normalsize
  159. \boxmaxdepth\z@
  160. \hsize\columnwidth \@parboxrestore}
  161.  
  162. % Redefine the macro used for footnotes to use single spacing
  163. \long\def\@footnotetext#1{\insert\footins{\def\baselinestretch{1}\footnotesize
  164. \interlinepenalty\interfootnotelinepenalty
  165. \splittopskip\footnotesep
  166. \splitmaxdepth \dp\strutbox \floatingpenalty \@MM
  167. \hsize\columnwidth \@parboxrestore
  168. \edef\@currentlabel{\csname p@footnote\endcsname\@thefnmark}\@makefntext
  169. {\rule{\z@}{\footnotesep}\ignorespaces
  170. #1\strut}}}
  171.  
  172. % Stolen from MIT.
  173. %
  174. % A single spaced quote (say) is done by surrounding singlespace with quote.
  175. %
  176. \def\singlespace{%
  177. \vskip\parskip%
  178. \vskip\baselineskip%
  179. \def\baselinestretch{1}%
  180. \ifx\@currsize\normalsize\@normalsize\else\@currsize\fi%
  181. \vskip-\parskip%
  182. \vskip-\baselineskip%
  183. }
  184.  
  185. \def\endsinglespace{\par}
  186.  
  187. % spacing, doublespace and onehalfspace all are meant to INCREASE the
  188. % spacing (i.e. calling onehalfspace from within doublespace will not
  189. % produce a graceful transition between spacings)
  190. %
  191. \def\spacing#1{\par%
  192. \def\baselinestretch{#1}%
  193. \ifx\@currsize\normalsize\@normalsize\else\@currsize\fi}
  194.  
  195. \def\endspacing{\par%
  196. \vskip \parskip%
  197. \vskip \baselineskip%
  198. \endgroup%
  199. \vskip -\parskip%
  200. \vskip -\baselineskip%
  201. \begingroup}
  202.  
  203. \def\onehalfspace{\spacing{1.5}}
  204. \let\endonehalfspace=\endspacing
  205.  
  206. \def\doublespace{\spacing{2}}
  207. \let\doublespace=\endspacing
  208.  
  209. % Fix up spacing before and after displayed math
  210. % (arraystretch seems to do a fine job for inside LaTeX displayed math,
  211. % since array and eqnarray seem to be affected as expected)
  212. % Changing \baselinestretch and doing a font change also works if done here,
  213. % but then you have to change @setsize to remove the call to @nomath)
  214. %
  215. \everydisplay{
  216. \abovedisplayskip \baselinestretch\abovedisplayskip%
  217. \belowdisplayskip \abovedisplayskip%
  218. \abovedisplayshortskip \baselinestretch\abovedisplayshortskip%
  219. \belowdisplayshortskip \baselinestretch\belowdisplayshortskip}
  220.  
  221. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  222.  
  223. %6. Macros and fonts for title page
  224. %------------------------
  225.  
  226. \newenvironment{frontmatter}{\pagenumbering{roman}}{\newpage \pagenumbering{arabic}}
  227.  
  228. % \author, \title are defined in report; here are the rest of the
  229. % front matter defining macros
  230. \def\dept#1{\gdef\@dept{#1}}
  231. \def\enggfaculty{\gdef\@faculty{Faculty of Engineering}}
  232. \def\sciencefaculty{\gdef\@faculty{Faculty of Science}}
  233. \def\degreein#1{\gdef\@faculty{#1}}
  234. \def\submitdate#1{\gdef\@submitdate{#1}}
  235. \def\degree#1{\gdef\@degree{#1}}
  236. \def\phd{\gdef\@degree{Doctor of Philosophy}}
  237. \def\mscengg{\gdef\@degree{Master of Science (Engineering)}}
  238. \def\me{\gdef\@degree{Master of Engineering}\metrue}
  239. \def\bibtitle#1{\gdef\@bibtitle{#1}}
  240. \def\faculty#1{\gdef\@faculty{#1}}
  241.  
  242. % defaults for title, author, faculty and department etc.
  243. \def\@title{I have not decided my title yet!}
  244. \def\@author{Lord Kaliyuga Krishna}
  245. \def\@dept{Department of Computer Science and Automation}
  246. \def\@faculty{Faculty of Engineering}
  247. \def\@degree{Doctor of Philosophy}
  248. \def\@bibtitle{Bibliography}
  249. \def\@submitdate{\ifcase\the\month\or
  250. JANUARY\or FEBRUARY\or MARCH\or APRIL\or MAY\or JUNE\or
  251. JULY\or AUGUST\or SEPTEMBER\or OCTOBER\or NOVEMBER\or DECEMBER\fi
  252. \space \number\the\year}
  253.  
  254. \newif\iffigurespage \newif\iftablespage
  255. \newif\ifiisclogo
  256. \newif\ifme % To print project report in the title page
  257.  
  258. \figurespagetrue \tablespagefalse
  259. \iisclogofalse \mefalse
  260.  
  261. \def\iisclogo#1{
  262. % For first call, load the file iisclogo.sty which will
  263. % redefine this macro!
  264. \makeatletter\input{iisclogo.sty}\makeatother
  265. \iisclogo{#1}
  266. }
  267.  
  268. % Font to print the name of the degree on the title page
  269. % Use any other font of your choice if this is not available.
  270.  
  271. \nonstopmode % Do not stop if the font is not available
  272. % boldface
  273. \newfont{\degfntbf}{eufb10 scaled\magstep1}
  274. %\newfont{\degfntbf}{eufby10 scaled\magstep1}
  275. % Bigger
  276. %\newfont{\degfnt}{eufmy10 scaled\magstep3}
  277. \errorstopmode % revert back to stop on error
  278.  
  279. % Font to print title on the cover page
  280. % Use any other font of your choice if this is not available.
  281. % Use \titlefnt if you want smaller font
  282.  
  283. \nonstopmode % Do not stop if the font is not available
  284. \newfont{\titlefnt}{cmssdc10 scaled\magstep3}
  285. \newfont{\Titlefnt}{cmssdc10 scaled\magstep4}
  286. \errorstopmode % revert back to stop on error
  287.  
  288. % From titlepage.sty 27 Jan 85
  289. \def\maketitle{%
  290. \begin{titlepage}
  291. \setcounter{page}{0}
  292. %\null
  293. \vskip -1.0in
  294. %{\baselineskip 1cm
  295. {%\baselinestretch{2}
  296. \begin{center}
  297. %\Huge\uppercase\expandafter{\@title}
  298. {\huge \bf \Titlefnt \@title}
  299. \end{center} \par} % The spacing between second and third line
  300. % is not proper
  301. \vfill
  302. \begin{center}
  303. \sc A \ifme Project Report \else Thesis \fi \\
  304. Submitted \ifme in partial fulfilment of the \\
  305. requirements for \else For \fi the Degree of\\
  306. {\degfntbf \@degree} \\
  307. %{\degfnt \@degree} \\
  308. \sc in \ifme \\ \else the \fi \@faculty
  309. \end{center}
  310. \vfill
  311. {\lineskip .75em
  312. \begin{center}
  313. by \\[0.75em]
  314. {\large \bf \@author}
  315. \end{center}\par}
  316. \vfill
  317. \ifiisclogo
  318. \vfill
  319. \begin{center}
  320. \iisclogo{600}
  321. \end{center}
  322. \fi
  323. \vfill
  324. \begin{center}
  325. \@dept \\
  326. Indian Institute of Science \\
  327. BANGALORE -- 560 012\\[0.75em]
  328. \@submitdate\\
  329. \end{center}
  330. \vskip -0.5in
  331. \null
  332. %YNS
  333. \newpage
  334. \ \ \ \ \ \
  335.  
  336. \vspace{3in}
  337. \begin{center}
  338. {\large\bf \copyright \@author \\ \@submitdate\\All rights reserved}
  339. \end{center}
  340. \end{titlepage}
  341. %\pagenumbering{roman} % Already in frotmater env!
  342. } %maketitle
  343.  
  344. \renewenvironment{abstract}{\null\vfil\prefacesection{Abstract}}{\par\vfill\null}
  345.  
  346. \def\prefacesection#1{%
  347. \chapter*{#1}
  348. \addcontentsline{toc}{chapter}{#1}}
  349.  
  350. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  351. % Added by Y.N. Srikant
  352. \def\keywords{\prefacesection{Keywords}}
  353. \def\notations{\prefacesection{Notation and Abbreviations}}
  354. \def\acknowledgements{\prefacesection{Acknowledgements}}
  355. \def\vita{\prefacesection{Vita}}
  356. \def\publications{\prefacesection{Publications based on this Thesis}}
  357. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  358.  
  359. \def\makecontents{\newpage
  360. \begin{singlespace}
  361. \tableofcontents
  362. \newpage
  363. \iftablespage
  364. \listoftables
  365. \newpage
  366. \fi
  367. \iffigurespage
  368. \listoffigures
  369. \newpage
  370. \fi
  371. \end{singlespace}
  372. }
  373. \def\chapters{%
  374. \pagenumbering{arabic}
  375. \pagestyle{headings}}
  376.  
  377. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  378. %7. Some additional macros
  379. %-------------------------
  380.  
  381. % dedication environment
  382. \newenvironment{dedication}{\thispagestyle{plain}\setcounter{page}{0}\null\vfill}{\par\vfill\null}
  383.  
  384. % New pagestyle for boldface headings instead of default uppercase slanted.
  385. % It underlines the headings as well as in the latex book
  386. %
  387. % Usage: \pagestyle{bfheadings}
  388.  
  389.  
  390. \if@twoside \def\ps@bfheadings{\let\@mkboth\markboth
  391. \def\@oddfoot{}\def\@evenfoot{}\def\@evenhead{\rm \thepage\hfill \bf
  392. \leftmark}\def\@oddhead{\hbox{}\bf \rightmark \hfill
  393. \rm\thepage}\def\chaptermark##1{\markboth {\ifnum \c@secnumdepth
  394. >\m@ne
  395. \@chapapp\ \thechapter. \ \fi ##1}{}}\def\sectionmark##1{\markright
  396. {\ifnum \c@secnumdepth >\z@
  397. \thesection. \ \fi ##1}}}
  398. \else \def\ps@bfheadings{\let\@mkboth\markboth
  399. \def\@oddfoot{}\def\@evenfoot{}\def\@oddhead{\underline{\makebox[\textwidth]{\hbox {}\bf \rightmark \hfill
  400. \rm\thepage}}}\def\chaptermark##1{\markright {\ifnum \c@secnumdepth
  401. >\m@ne
  402. \@chapapp\ \thechapter. \ \fi ##1}}}
  403. \fi
  404.  
  405. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  406. %7. Modifications of some predefined macros
  407. %------------------------------------------
  408.  
  409. % Redefine \thebibliography to go to a new page and put an entry in the
  410. % table of contents
  411.  
  412. \def\nobiblabels{\gdef\@thesbiblabel{}\gdef\bibspace{\hskip -\labelwidth \hskip -\labelsep}}
  413. \gdef\@thesbiblabel{[\arabic{enumi}]}
  414. \gdef\bibspace{\relax}
  415.  
  416. \def\thebibliography#1{%
  417. \chapter*{\@bibtitle\@mkboth
  418. {\uppercase\expandafter{\@bibtitle}}
  419. {\uppercase\expandafter{\@bibtitle}}}
  420. \addcontentsline{toc}{chapter}{\@bibtitle}\list
  421. {\@thesbiblabel}{\settowidth\labelwidth{[#1]}\leftmargin\labelwidth
  422. % {[\arabic{enumi}]}{\settowidth\labelwidth{[#1]}\leftmargin\labelwidth
  423. \advance\leftmargin\labelsep
  424. \usecounter{enumi}}
  425. \def\newblock{\hskip .11em plus .33em minus .07em}
  426. \sloppy\clubpenalty4000\widowpenalty4000
  427. \sfcode`\.=1000\relax}
  428. \let\endthebibliography=\endlist
  429.  
  430. % Redefine \theindex to go to a new page and put an entry in the
  431. % table of contents
  432. \newif\if@restonecol
  433. \def\theindex{%
  434. %\addcontentsline{toc}{chapter}{Index}
  435. \@restonecoltrue\if@twocolumn\@restonecolfalse\fi
  436. \columnseprule \z@
  437. \columnsep 35pt\twocolumn[\@makeschapterhead{Index}]
  438. \addcontentsline{toc}{chapter}{Index}
  439. \@mkboth{INDEX}{INDEX}\thispagestyle{plain}\parindent\z@
  440. \parskip\z@ plus .3pt\relax\let\item\@idxitem}
  441. \def\@idxitem{\par\hangindent 40pt}
  442. \def\subitem{\par\hangindent 40pt \hspace*{20pt}}
  443. \def\subsubitem{\par\hangindent 40pt \hspace*{30pt}}
  444. \def\endtheindex{\if@restonecol\onecolumn\else\clearpage\fi}
  445. \def\indexspace{\par \vskip 10pt plus 5pt minus 3pt\relax}
  446.  
  447. %Redefine \enddocument to print the index
  448.  
  449. \let\@enddocument=\enddocument
  450. \def\enddocument{\@input{\jobname.ind}\@enddocument}%
  451.  
  452. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  453. % Misc.
  454. % From makeidx.sty 20-Jan-87
  455. \def\see#1#2{{\em see\/} #1}
  456.  
  457. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  458. % Start out normal
  459. \pagestyle{headings}
  460. \makeindex
  461. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Tags:

User avatar
Johannes_B
Site Moderator
Posts: 3790
Joined: Thu Nov 01, 2012 4:08 pm

Postby Johannes_B » Thu Aug 27, 2015 1:47 pm

It is impossible to use modern package commands with LaTeX2.09

  1. \documentstyle[graphicx]{iiscthes}
  2. \begin{document}
  3. \begin{figure}
  4. \includegraphic[width=.5\textwidth]{example-image-a}
  5. \caption{is this working?}
  6. \end{figure}
  7. hallo
  8. \end{document}


Using documentclass as in your example should fail in that very line with the file iiscthes.sty.


Do you need that file? Try report instead of iiscthes.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.


Return to “Graphics, Figures & Tables”

Who is online

Users browsing this forum: Bing [Bot] and 3 guests