# Modify Wiley wileySev.cls for spanish

I-ve been using LaTeX for over 10 years, but only basic out-of-the-box stuff. I am now setting up a book I wrote in spanish and I want to use Wiley's template. However, I need to modify the wileySev.cls file so that chapters are named "Capítulo" instead of Chapter, and that the headings say "Prefacio" rather than "Preface". I looked at the cls file and thought that just changing the following lines would do the trick>

\newcommand{\contentsname}{CONTENTS}
\newcommand{\listfigurename}{Lista de Figuras}
\newcommand{\listtablename}{Lista de Cuadros}
\newcommand{\bibname}{Bibliografia}
\newcommand{\indexname}{INDEX}
\newcommand{\figurename}{Figura}
\newcommand{\tablename}{Cuadro}
\newcommand{\partname}{PART}
\newcommand{\chaptername}{Capitulo}
\newcommand{\appendixname}{Apendice}


but that had no effect at all.

I was wondering if it would be a simple task to change the "cls" file or is it a better idea to start modifying the memoir book from scratch?

Can someone help me understand what needs to be changed in the "cls" file in order to make it spanish compatible? I tried to understand it, but the language is just too complex for me.

Thanks for any suggestion.

The wiley template can be found here> http://www.latextemplates.com/template/wiley-book-style

Eric,

• Are you loading babel with the spanish option? – Gonzalo Medina Feb 20 '15 at 17:35
• It's very peculiar that the class defines \chaptername, but then uses an explicit CHAPTER string in \@makechapterhead. – egreg Feb 20 '15 at 17:56
• Yes, I added babel from the beginning and I also tried to redefine the langue in very aspect. It did't work. – Efuchs Feb 22 '15 at 2:46

## 1 Answer

Sorry, there's no way to use the class with languages different from English, without extensive work. It uses several \font declarations and the same happens in the accompanying w-bookps.sty file.

This is due to the fact that Wiley uses proprietary fonts for the final printout. Accents are all wrong or swallowed.

There are other horrible features in the class. For instance, besides defining \chaptername, the class hardwires “CHAPTER” in the definition of \@makechapterhead, so no matter how you redefine \chaptername it will have no effect. Similarly, the definition of \listoffigures is

\newcommand{\listoffigures}{%
\startonoddpage
\global\titletrue
\chapter*{List of Figures
\@mkboth{\uppercase{List of Figures}}{\uppercase{List of Figures}}}%
\addcontentsline{toc}{schapter}{List of Figures}
\vskip-9pt
\bgroup\parskip=2pt
{\def\numberline##1{\def\one{##1}%
\hb@xt@\@tempdima{\expandafter\splitintwo\one*\hfil}}
\normalsize\tocfonts
\hyphenpenalty=10000
\@starttoc{lof}%
}


and you can clearly see that “List of Figures” is hardwired.

• Thanks for pointing this out. I was able to get a working copy by modifying these "hardwired" definitions. For example in the above example, in the fifth and following lines you change \uppercase{Lista de Figuras} and also change it on line 693 for chapter. So basically I hardwired the names into spanish. I also had to change fonts in the sty file to get accents to print correctly. For example helvetica had to be redefined from  \def\helvetica{phvr}  to \def\helvetica{phvr8t}. That made it work. Don't know if this is going to break later, but it seems to be working now. Thx – Efuchs Feb 22 '15 at 2:51