0

Someone provided me the following class called existingclass.cls:

\NeedsTeXFormat{LaTeX2e} 
\ProvidesClass{existingclass}
\ProcessOptions\relax
\LoadClass[12pt,a4paper]{report}
\RequirePackage{ifthen}
\RequirePackage[utf8]{inputenc}
\RequirePackage{fancyhdr}
\pagestyle{myheadings}
\markright{}
\setlength{\parindent}{.3in}

\RequirePackage{geometry}
\geometry{
  a4paper,
  right = 1in,
  left = 1.5in,
  top = 1in,
  bottom = 1in
}

\renewcommand{\baselinestretch}{1.5}
\renewcommand{\contentsname}{TABLE OF CONTENTS} 
\renewcommand\@biblabel[1]{}
\renewcommand\thechapter{\Roman{chapter}}

\def\@makechapterhead#1{
    {
        \thispagestyle{empty}
        \centering
        \ifnum \c@secnumdepth >\m@ne
            \bfseries CHAPTER \thechapter
            \par\nobreak
            \vskip 20\p@    
        \fi
        \interlinepenalty\@M
        \bfseries #1\par\nobreak
        \vskip 30\p@
    }
}
\def\@makeschapterhead#1{
    {
        \thispagestyle{empty}
        \centering
        \interlinepenalty\@M
        \bfseries  #1\par\nobreak
        \vskip 30\p@
    }
}

and is loaded to the following tex file:

\documentclass[12pt,a4paper]{existingclass}

\begin{document}
    \addcontentsline{toc}{chapter}{TABLE OF CONTENTS}
    \tableofcontents    
    \newpage
    \pagenumbering{arabic}\setcounter{page}{1}
    \include{chapter1}
\end{document}

having inserted the following (minimal) chapter1.tex:

\chapter{THE PROBLEM}

When you run this code, it will output the following:

enter image description here enter image description here

MY QUESTION: How do I change the chapter (header) numbering found in the document to Arabic while retaining the chapter sectioning in the TOC (Table of Contents) to Roman Numerals?

I looked for the following similar problems:

Chapter Roman in tableofcontents

Roman number in chapter header but not in TOC

Roman numerals for table of contents, arabic for main text in footer

Change number after chapter in table of contents

Chapter headings and table of contents

Roman Numerals in ToC : Error in \settowidth

Table of contents with roman, arabic, and no page numbers

Page numbering with a mixed Roman numeral-Arabic numeral format

Roman numbering of pages on ToC, but arabic on document

Page numbering resets after table of contents (roman/arabic)

but none, so far, answered my question

P.S.: I am not an expert in pure TeX codes. :)

11
  • Are you sure you are allowed to share the class and/or change its name?
    – Johannes_B
    Commented Dec 14, 2019 at 4:23
  • @Johannes_B Any particular reason to think not?
    – cfr
    Commented Dec 14, 2019 at 5:14
  • \thechapter -> \arabic{chapter}? Are you expert in impure TeX codes? They're definitely the best kind ;).
    – cfr
    Commented Dec 14, 2019 at 5:16
  • @cfr License stuff.
    – Johannes_B
    Commented Dec 14, 2019 at 5:17
  • @Johannes_B Yes, but we don't routinely ask this about class files, so why this one? Or would you ask this about any code an OP included which the OP wanted to adapt?
    – cfr
    Commented Dec 14, 2019 at 5:27

0

You must log in to answer this question.

Browse other questions tagged .