Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with redefining a language and using babel #122

Open
oalbiez opened this issue Sep 15, 2020 · 7 comments
Open

Problem with redefining a language and using babel #122

oalbiez opened this issue Sep 15, 2020 · 7 comments

Comments

@oalbiez
Copy link

oalbiez commented Sep 15, 2020

I am working on a french book. I redefined the translation for french using :

\RequirePackage[french]{babel}
\setlength\parindent{2em}
\newcommand\figref[1]{\textbf{Figure}~\ref{#1}}
\newcommand\tabref[1]{\textbf{Tableau}~\ref{#1}}
\renewcommand{\chaptername}{Chapitre \thechapter}
\newcommand{\authorname}{\textbf{auteur: }}
\newcommand{\institutename}{\textbf{Institut: }}
...

When I use

\documentclass[12pt,mode=fancy,cite=authoryear,titlestyle=display,lang=fr]{elegantbook}

The generated document does not have the chapter number in french, it is only present in english when lang=en.

The only difference I see is in french I use babel, in english not. In spite of this, I am unable to correct the problem. Do you have any ideas?

@sikouhjw
Copy link
Contributor

Please provide MWE.

@oalbiez
Copy link
Author

oalbiez commented Sep 15, 2020

\documentclass[12pt,mode=fancy,cite=authoryear,titlestyle=display]{elegantbook}
\usepackage[utf8]{inputenc}
\usepackage[french]{babel}

% == Translation in french
\renewcommand{\chaptername}{Chapitre \thechapter}

\begin{document}
\maketitle
\chapter{Test}
\end{document}

If you comment the line \usepackage[french]{babel} the translation is correct with the chapter number. With babel, the chapter number is missing.

@sikouhjw
Copy link
Contributor

I can't solve this problem in my ability, sorry.

@EthanDeng
Copy link
Member

EthanDeng commented Sep 17, 2020

The missing number is known problem in version 3, I have fix it in version 4, later in this year, version 4 will be released.

This problem is caused by different logic when dealing with the chapter counter and chapter name for different languages.

@gcorrad
Copy link

gcorrad commented Nov 15, 2020

Yes I deal with the same problem in spanish, it's because babel use {lang}chaptername instead of \chaptername.
In spanish i use \spanishcheptername... why you dont try with \frenchchaptername... anyway I tried it with the Italian in the same way without success.

\renewcommand{\spanishchaptername}{Capítulo \thechapter}

@jbwoods
Copy link

jbwoods commented Nov 2, 2021

Seeing the update from 17 september 2020, I presume this has been fixed in 4.0?
Recently I used in Overleaf the Elegant book template and ran into this problem.
Can this template be updated?
Thanks.

@EthanDeng
Copy link
Member

Seeing the update from 17 september 2020, I presume this has been fixed in 4.0? Recently I used in Overleaf the Elegant book template and ran into this problem. Can this template be updated? Thanks.

The overleaf version is older version (3.x), I didn't upload the latest version to overleaft, you can check the lastest version on your local machine, I will upload 4.x to overleaft later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants