2

I am relatively new to Latex and don't know the deeper commands yet. For my Msc thesis I downloaded a template published by the Faculty, however they have changed some regulations and have yet to update their latex template.

Basically, the new regulations require 1.5/double space. Easy enough to do with

\usepackage{setspace}
\doublespacing

But I get some errors which says \spacing has already been defined. So I look into the class file of the template and I find:

\newcommand{\spacing}[1]{\renewcommand{\baselinestretch}{#1}%
  \large\normalsize}

This command in being used in the following places:

\renewcommand\appendix{\par
  \setcounter{chapter}{0}%
  \setcounter{section}{0}%
  \gdef\@chapapp{\appendixname}%
  \gdef\thechapter{\@Alph\c@chapter}
  \ifthenelse{\boolean{saving}}{\spacing{1}}{\spacing{2}}}

and

\ifthenelse{\boolean{saving}} {%
  \setlength {\topmargin}{0.0in}
  \setlength {\textheight}{\paperheight-2.5in}
  \setlength {\oddsidemargin}{0.0in}
  \setlength {\evensidemargin}{0.0in}
  \setlength {\textwidth}{\paperwidth-2in}
  \spacing{1}
  } {%
  \setlength {\topmargin}{0.65in}
  \setlength {\textheight}{\paperheight-3.05in}
  \setlength {\oddsidemargin}{0.6in}
  \setlength {\evensidemargin}{0.1in}
  \setlength {\textwidth}{\paperwidth-2.65in}
  \setlength {\footskip}{0.3in}
  \spacing{2}
  \renewenvironment{quote}{\oldquote\spacing{1}}%
       {\oldendquote\spacing{2}}
  \renewenvironment{quotation}{\oldquotation\spacing{1}}%
       {\oldendquotation\spacing{2}}
  \renewenvironment{verse}{\oldverse\spacing{1}}%
       {\oldendverse\spacing{2}}}

And some other (probably irrelevant) sections.

My question is that can I just rename this command something else and replace it everywhere it shows up in the class file? This way it won't clash with setspace package. Additionally, do I have to somehow recompile the class file or register it with latex?

masfenix
  • 1,429
  • Before changing anything in the class file, check the license, you may not be allowed to make changes. – Johannes_B Aug 30 '15 at 18:40
  • @Johannes_B I will keep that in mind. My department buddy's thesis actually got rejected and they told him make several revisions. I am not sure how one would go about making those revisions without editing the class file though. – masfenix Aug 30 '15 at 18:41
  • What/Who is providing the template? If it is an official template, poke the guys responsible. If it is just some stuff handed over from one year to the next year of students .... Wanna be a LaTeX-class-file-maintainer? ;-) – Johannes_B Aug 30 '15 at 18:57
  • I am fairly certain it was developed by a student at some point. Since the official university faculty website has no mention of it. I pasted the CTAN link below. After I finish my thesis, I do plan on cleaning up the class file (and learning some deep latex). Hopefully I can submit my work to the faculty and they can start using it as the official template. – masfenix Aug 30 '15 at 18:58
  • Just saw the link: I'd suggest to write Diane a polite email referring to this question and asking her to update to match the current specs. The introduction is quite clear: You are responsible. Rename the class file to e.g. masfenix.cls, add a comment with your name and date inside and start hacking. – Johannes_B Aug 30 '15 at 19:04
  • @Johannes_B Thanks. Last question: So a latex template is purely defined by its class file? Is a class file merely commands to keep the actual document cleaner, and that all the commands from the class file can actually be put in the .tex file itself? – masfenix Aug 30 '15 at 19:07

1 Answers1

0

Yes, you can rename the command if you replace the name everywhere in the class and in every other file linked to your thesis.

For your second question, I assume that you refer to the class locally and that you have a private copy. No, you don't have to recompile the class or register it anywhere, just save it.

JJM Driessen
  • 1,353
  • Is there a better solution? I am not sure if there are other files linked to my thesis. I downloaded the template from https://www.ctan.org/tex-archive/macros/latex/contrib/york-thesis?lang=en

    Would it be better to change something in the setspace package instead?

    – masfenix Aug 30 '15 at 18:43
  • @masfenix -- setspace is posted on ctan and is included in tex live. it has much wider distribution than any thesis class, so it would be a very bad idea to modify it, especially without a name change. – barbara beeton Aug 30 '15 at 19:08
  • Okay thanks. I think the best bet would be just to replace the definition in the class file. – masfenix Aug 30 '15 at 19:09