Document Classesrevtex4-1 style for French articles ?

Information and discussion about specific document classes and how to create your own document classes.
User avatar
Cham
Posts: 937
Joined: Sat Apr 02, 2011 4:06 pm

revtex4-1 style for French articles ?

Post by Cham »

I like pretty much the stylings in the revtex4-1 class, but there's some aesthetical glitches with the figures and tables captions for a French document, and there are some restrictions on its customization. I'm getting this typical warning during compilation :
Package frenchb.ldf Warning: Figures' and tables' captions might look like
(frenchb.ldf) `Figure 1:' which is wrong in French.
(frenchb.ldf) Check your class or packages to change this;
(frenchb.ldf) reported on input line 17.
Here's a MWE code showing that class and a few options :

Code: Select all

\RequirePackage[l2tabu,orthodox]{nag}
\documentclass[11pt,nofootinbib,eqsecnum,twosides]{revtex4-1}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[french]{babel}
\usepackage{amsfonts}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{graphicx,xcolor}
\usepackage{here}
\usepackage{hyperref}
\usepackage{subfigure}

\begin{document}

\title {Some article title in French}

\author{Some Guy}
\email{email@somewhere.ca}
\affiliation{Some departement}

\begin{abstract}

Some French text.

\end{abstract}

\maketitle

\section{Introduction}

Some introduction.

\section{Some title}

Something here.

\begin{figure}[htbp]
	\centering
	\subfigure[Description 1.]{\includegraphics[width=0.4\textwidth]{example-image-a}}
	\qquad
	\subfigure[Description 2.]{\includegraphics[width=0.4\textwidth]{example-image-b}}
	\caption{Some description.}
	\label{ } 
\end{figure}

\section*{Remerciements}

A few thanks.

\begin{thebibliography}{999}

\bibitem{bibitem1}
A.~Someone \& B.~Someonelse, ``Titre de l'article 1'', Found.\ Phys.\  \textbf{11}, no. 8, 299 (2037).
  
\bibitem{bibitem2}
C.~Someone \& D.~Someonelse, ``Titre de l'article 2'', Phys.\ Rev.\ D \textbf{12}, 103522 (2052).
    
\end{thebibliography}

\end{document}
I know that the revtex4 class has a few severe restrictions for the customization, since it's a specific class designed for publications in some English journals. So is there another class that do the same stylings (adapted for a French article), without all the restrictions, and without recreating all of it from scratch using the paper or the article class? It would be a pain in the arse to redo all the same styling as customization of another class.

I'm expecting that the answer is "no", and that I'll have to customize another class all from scratch, but maybe I'm wrong.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics TikZによるLaTeXグラフィックス
User avatar
Stefan Kottwitz
Site Admin
Posts: 10290
Joined: Mon Mar 10, 2008 9:44 pm

revtex4-1 style for French articles ?

Post by Stefan Kottwitz »

Hi Cham,

if you know what style details have to be changed, it can be redefined one by one. I guess it's more than just the figure numbers.

Stefan
LaTeX.org admin
User avatar
Cham
Posts: 937
Joined: Sat Apr 02, 2011 4:06 pm

revtex4-1 style for French articles ?

Post by Cham »

Stefan,

apparently, the revtex class doesn't adapt the Figures and Tables ":" (after the number) to the language. I don't know if there are other things "frozen" in the code. I also get these weird warnings in the compilation console :

Code: Select all

Class revtex4-1 Warning: Repair the float package.


LaTeX Warning: Unused global option(s):
    [twosides].
and while I don't even use \it, I get this (probably from one of the packages in the code I gave above) :

Code: Select all

Package nag Warning: Command \it is an old LaTeX 2.09 command. 
(nag)                Use \itshape or \textit instead on input line 31.
I don't want to recreate all the titles styles and format with another class. I guess it may be easier (?) to fix the few wrong things than recreate all the rest.
User avatar
Stefan Kottwitz
Site Admin
Posts: 10290
Joined: Mon Mar 10, 2008 9:44 pm

revtex4-1 style for French articles ?

Post by Stefan Kottwitz »

Hi Cham,

I guess you mean that in French there's an additional space before the :. You can change it this way:

Code: Select all

\makeatletter
\renewcommand*{\@caption@fignum@sep}{ : }
\makeatother
Regarding the other warnings:
  • change twosides to twoside
  • "Repair" is meant as "Repairing" and actually means that revtex is patching the float package macros successfully.
The nag warning appears because revtex4-1 uses \it internally. You can fix it by

\renewcommand*{\frontmatter@affiliationfont}{\normalfont\itshape}

as above, after \makeatletter.

Stefan
LaTeX.org admin
User avatar
Cham
Posts: 937
Joined: Sat Apr 02, 2011 4:06 pm

revtex4-1 style for French articles ?

Post by Cham »

It's all working great. Thanks Stefan.

But I thought that the revtex class was internally very "frozen", without much possibilities for customization. I'm now wondering what other problems I may encounter with it, if I start using this class. I remember having a problem with commas and the icomma package before. Maybe I should stay with the standard classes instead. :?
User avatar
Stefan Kottwitz
Site Admin
Posts: 10290
Joined: Mon Mar 10, 2008 9:44 pm

revtex4-1 style for French articles ?

Post by Stefan Kottwitz »

It's just LaTeX, so anything can be redefined and customized. It just doesn't provide such a great interface like KOMA-Script classes or memoir. And, since packages are usually written and tested with standard classes, it can be possible that some may not be compatible with revtex definitions. But, changes and "hacks" are no problem.

Stefan
LaTeX.org admin
User avatar
Cham
Posts: 937
Joined: Sat Apr 02, 2011 4:06 pm

revtex4-1 style for French articles ?

Post by Cham »

You're now giving me the impression that I just scratched the surface of classes in LaTeX. I extensively used the usual "book", "article", "paper" and a few others before, which fit my usual needs. But I like to play and experiment with other possibilities, and I now suspect that I didn't used the optimal classes for what I need to do. I don't know any of the KOMA classes.
User avatar
Stefan Kottwitz
Site Admin
Posts: 10290
Joined: Mon Mar 10, 2008 9:44 pm

revtex4-1 style for French articles ?

Post by Stefan Kottwitz »

Oh, yes. For me,
  • komascript: is the new and modern standard
  • memoir: is similar regarding capabilities, but not modular, directly includes package functions (like copying) so hardly can stay up-to-date
  • base classes: for me not standard any more, I rather call them base classes, and they are in the base directory of the TeX tree. They did not change since 10 years or more.
So base classes are ok for examples in forums for testing and sharing ;-) but not if you would like to use the modern benefits of LaTeX - in that case either use base classes with 50 packages on top, or KOMA-Script classes that are modular and developed continuously throughout the last many years.

KOMA-Script classes can be used like standard classes, so they are somehow backwards compatible, just with different default layout. But, there's a base compatibility mode if one still likes the fat, serif headings. ;-) I remember, when I started with LaTeX, I hesitated to deal with KOMA-Script since it appeared to me like I would have to learn something different. But it turned out that I can use it like standard classes but with many optional settings via key=value instead of complicated redefinitions and patches. A lot of customizations, requiring macro programming or using packages, is just a simple key=value setting in KOMA-Script. So, one could go ahead and use it (scrbook instead of book, etc.), and just use the scrguien manual as a reference. Though it's good stuff for reading.

Stefan
LaTeX.org admin
User avatar
Cham
Posts: 937
Joined: Sat Apr 02, 2011 4:06 pm

revtex4-1 style for French articles ?

Post by Cham »

Stefan,

while not exactly related to the topic, I started creating a folder of examples documents for all the main classes, and I noticed that the "paper" and "revtex" (not "revtex-1") classes also have a problem with French version of its Figures and Tables numbers (with the spacing before ":"). The code you gave above do not work :

Code: Select all

\makeatletter
\renewcommand*{\@caption@fignum@sep}{ : }
\makeatother
What would be the proper modification to solve this issue, for the paper and revtex classes ?
User avatar
Stefan Kottwitz
Site Admin
Posts: 10290
Joined: Mon Mar 10, 2008 9:44 pm

revtex4-1 style for French articles ?

Post by Stefan Kottwitz »

Everything can be redefined or patched.

With paper:

Code: Select all

\usepackage{etoolbox}
\makeatletter
\patchcmd{\@makecaption}{#1:}{#1 :}{}{}
\makeatother
revtex: do you really want to patch a class or package from the stone age? ;-) Perhaps continue with revtex4-1 or revtex4, otherwise I need to see that old revtex.cls or revtex.sty file to patch...

Stefan
LaTeX.org admin
Post Reply