1

I would like to create a newspaper article and I found the command \byline to include my title and my name. The problem is that I need to publish my article in French and the command displays the English word By. Does anyone know how to translate this word to Rédigé par <Written by>? Note that I previously tried something kind of this.

Here is an example:

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[francais]{babel}
\usepackage[T1]{fontenc}
\usepackage{microtype}
\usepackage{newspaper}

\begin{document}
\byline{Pas d'orchidées pour Miss Blandish}{Matt}
\end{document}
Matt
  • 267

2 Answers2

1

Unlike most packages that support translation by putting all strings in simple macros such as \xxxname this package has the English text embedded in the formatting, however the macros are quite simple, for example \byline is defined as

\newcommand\byline[2]{\begin{center} #1 \\%
            {\footnotesize\bf By \MakeUppercase{#2}} \\ %
            \rule[3pt]{0.4\hsize}{0.5pt}\\ \end{center} \par}

so in your preamble after loading the package you can do

\renewcommand\byline[2]{\begin{center} #1 \\%
            {\footnotesize\bf Rédigé par \MakeUppercase{#2}} \\ %
            \rule[3pt]{0.4\hsize}{0.5pt}\\ \end{center} \par}
David Carlisle
  • 757,742
1

The By is hard-coded in the \byline macro and therefore doesn't use any regional/language adaptations. Patch it to suit your needs:

enter image description here

\documentclass{article}

\usepackage[utf8]{inputenc}
\usepackage{newspaper}
\usepackage{etoolbox}

% \patchcmd{<cmd>}{<search>}{<replace>}{<success>}{<failure>}
\patchcmd{\byline}{By}{Rédigé par}{}{}

\begin{document}

\byline{Pas d'orchidées pour Miss Blandish}{Matt}

\end{document}
Werner
  • 603,163