TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to write an assigment using an LaTeX template I found. However, I would like to change the template so that the text next to the title whenever the \chapter command is used is "Section" instead of "Chapter" as I don't think the assignment is big enough to name it "Chapters". It would be greatly appreciated if you can help me do that.

If you need my code you can find it below. However, it is quite long. I don't know how to format code in another than indenting by 4 spaces, which is quite tiresome for this amount of code.

%\RequirePackage[l2tabu, orthodox]{nag} % Old habits die hard

% Stock and paper layout

\checkandfixthelayout                 % Check if errors!
\sideparmargin{outer}                 % Put sidemargins in outer position (why the fuck is this option not default by the class?)

% Large environments

\usepackage{listings}                 % Source code printer 
% Symbols
\usepackage{amsmath,amssymb, latexsym} % AMS and other symbols

% Graphics and colors
\usepackage{graphicx}                 % Including graphics and using colours
\usepackage{xcolor}                   % Defined more color names
\usepackage{eso-pic}                  % Watermark and other bag

% Floating objets, captions and references
\usepackage[noabbrev,nameinlink,capitalise]{cleveref} % Clever references. Options: "fig. !1!" --> "!Figure 1!"
\letcountercounter{figure}{table}     % Consecutive table and figure numbering

% Table of contents (TOC)
\setcounter{tocdepth}{1}              % Depth of table of content
\setcounter{secnumdepth}{2}           % Depth of section numbering

% Todos
\usepackage{totcount}                 % For total counting of counters
\usepackage[colorinlistoftodos]{todonotes} % Todonotes package for nice todos
                                           % (disable by option [disable])
\newtotcounter{todocounter}           % Creates counter in todo
\newcommand*{\mylistoftodos}{% Only show list if there are todos

% Prefrontmatter

% Chapterstyle



        \vphantom{\printchaptername\chapternamenum\chapnumfont 1}

    % egen ændring


    \renewcommand*{\printchaptertitle}[1]{\raggedleft \chaptitlefont ##1}
    \renewcommand*{\afterchaptertitle}{\vskip0.5\onelineskip \hrule \vskip1.3\onelineskip}


% Header and footer
\copypagestyle{cleared}{myruled}      % When \cleardoublepage, use myruled instead of empty
\makeevenhead{cleared}{\hffont\thepage}{}{} % Remove leftmark on cleared pages

\makeevenfoot{plain}{}{}{}            % No page number on plain even pages (chapter begin)
\makeoddfoot{plain}{}{}{}             % No page number on plain odd pages (chapter begin)

share|improve this question
Welcome to TeX.SX! A tip: If you indent lines by 4 spaces, they'll be marked as a code sample. You can also highlight the code and click the "code" button (with "{}" on it) or just press <CTRL-K> – Christian Hupfer Jun 14 '14 at 17:31
Please help us to help you and add a minimal working example (MWE) that illustrates your problem. It will be much easier for us to reproduce your situation and find out what the issue is when we see compilable code, starting with \documentclass{...} and ending with \end{document}. – Christian Hupfer Jun 14 '14 at 17:32
Your code is by far too long and contains a lot of unnecessary statements for the question itself and its otherwise incomplete. – Christian Hupfer Jun 14 '14 at 17:33
You could use \renewcommand{\chaptername}{Section} in the preamble of the document or switch to a class which does not know of chapters. – Christian Hupfer Jun 14 '14 at 17:34
Yes, I am sorry about the length of the code. The thing is that I am struggling to understand it and don't want to remove anything that may be important information. I'll add a MWE :) – pir Jun 14 '14 at 17:36
up vote 4 down vote accepted

enter image description here

share|improve this answer
Thank you for this code - it worked perfectly. I don't know why, but the code provided by Christian Hupfer had no effect. This is very likely due to all the initial code used for the template. – pir Jun 15 '14 at 0:33
I suppose you are using Babel, then everything is set after \begin{document}. The reason why settings from the preamble are overwritten. With \addto\captions... the changes are done by Babel itself. – Herbert Jun 15 '14 at 6:12
Ah, that makes sense! Thanks :) – pir Jun 15 '14 at 11:54

Just use \renewcommand{\chaptername}{Section} in the preamble (preferably).




\chapter{And now I am a section}%

\section{I am a true section, but without "Section" }


enter image description here

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.