Text FormattingModifications to custom Class File

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
Post Reply
ps001
Posts: 4
Joined: Mon Feb 18, 2013 12:15 am

Modifications to custom Class File

Post by ps001 »

I need help editing a class file. I have no idea where I have to change the code to get what I want as I am not familiar with the class files syntax. The class file is attached.

I would like to understand how to change the chapter format. The chapter, right now, as you will see, gives me something like (in plain font):

Chapter 1

Theory

I would like to know how to modify it so the font would be bold and a big bigger. Or for example how to make it show like.

Chapter 1: Theory


Any help would be much appreciated.

Thanks!
Attachments
thesis.cls
(22.77 KiB) Downloaded 378 times

Recommended reading 2024:

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

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

localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Re: Modifications to custom Class File

Post by localghost »

Are you bounded to the standards from the »Thesis and Dissertation Style Guide« of the University of Maryland?


Best regards and welcome to the board
Thorsten
ps001
Posts: 4
Joined: Mon Feb 18, 2013 12:15 am

Re: Modifications to custom Class File

Post by ps001 »

Hi Thorsten,

Yes, I think I am. I am sure I can make some modifications to the headings. I believe the main standards that I should keep unchanged are things like font size, spacing, margins, etc.

Any hints, please?

Thanks!

-PS
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Modifications to custom Class File

Post by localghost »

ps001 wrote:[…] Yes, I think I am. […]
Do you think or do you know? If you are, you should not use this class. It has been designed according to the standards of 2005. Let's take a look at the beginning of the class.

Code: Select all

% thesis.cls is based on report.cls (D. Brosius, August 2006) - These
% changes were made to comply with the requirements set forth in the
% University of Maryland, College Park, Thesis and Dissertation Style
% Guide, 2005-2006, Spring 2006 Edition for the submittal of Ph.D. and
% Masters dissertations and theses to the University of Maryland.
But on »Electronic Thesis and Dissertations (ETD) at UM« I have found the latest style guide from 2012 and you class is not really complaint to this guide. But I'm not sure if this is the right one. If not, please give a corresponding link where to get it. The guide also mentions that you should confer with your department about the exact standards.

Finally, it is not really necessary to use a custom class. Most of the demanded settings can be made by some additional packages. As far as I can see from the style guide, the desired formatting is not very difficult.
ps001
Posts: 4
Joined: Mon Feb 18, 2013 12:15 am

Re: Modifications to custom Class File

Post by ps001 »

What I am trying to say is that I would like to know how to change a class file to get the formatting that I wanted, regardless if I have to use this standard or not.
I just dont know how to change a class file and I was hoping someone could teach me/ help me or point to some good references or examples.

But anyway.. I'll contact the person who wrote that class file.
Thanks
User avatar
Stefan Kottwitz
Site Admin
Posts: 10345
Joined: Mon Mar 10, 2008 9:44 pm

Modifications to custom Class File

Post by Stefan Kottwitz »

Working with class file code can be a bit challenging, requiring some deeper LaTeX knowledge. A good starting point for getting that is reading source2e, the commented LaTeX source code, and the code of the standard classes.

When you would like to use a class with changes, there are for example these four ways:
  • Use this class via \documentclass, load a package which is spezialized in doing the customiziation you need. Here I would use titlesec. However, it requires a compatibility of class and package, which is often the case.
  • Use this class via \documentclass and make desired changes via \renewcommand or \renewenvironment.
  • Make a derived class file with another name, which loads this class.
  • Make a copy of the class, give it a different name (important!), also in the source code (\ProvidesClass), and make your changes in the new file.
The first option is recommendable for users who don't like to deal much with internals. The second one is for authors, who just do small changes, occasionally, and know how to do. The third one is for advanced users who like to use the class several times or like to share it with others, the last one is apparently a straightforward way which sometimes also beginners quickly choose. It could lead to mess with different class files and names, that's why clear renaming is required. For example, today there's a lot of classes which have been called thesis by the developers but are very different.

Stefan
LaTeX.org admin
ps001
Posts: 4
Joined: Mon Feb 18, 2013 12:15 am

Re: Modifications to custom Class File

Post by ps001 »

Thank you Stefan, very much!

I'll explore those options and will post again if I make progress.
User avatar
Stefan Kottwitz
Site Admin
Posts: 10345
Joined: Mon Mar 10, 2008 9:44 pm

Modifications to custom Class File

Post by Stefan Kottwitz »

Some additions:
  • The titlesec manual provides a very good starting point with the examples of standard class headings in the manual appendix. They can easily be taken and modified, such as the section settings for the \chapter definition, adding a \centering, changing the font size or similar.
  • Redefing can often be made this way:

    Code: Select all

    \documentclass{thesis}
    ...
    \makeatletter
    \renewcommand{\macron@me}{...}
    % or \def ...
    \makeatother
    This means: copy & paste the original code from the class into your document preamble, modify it, change it from \newcommand to \renewcommand or keep \def. If internal macros are used, those with the @ in the name, use \makeatletter and \makeatother around to bypass LaTeX's protection of internal macros (see here, why: \makeatletter and \makeatother).
Stefan
LaTeX.org admin
Post Reply