2

is there a way I can have the keywords go automatically in different languages as it did with the abstract. I created the command of keywords but it won't change as the language change is all the way in English or something else

\documentclass[12pt,a4paper,notitlepage]{report}

\usepackage[utf8]{inputenc}

\usepackage[arabic,english,french]{babel}

%%%%%%%%%%%Abstract :::

\renewenvironment{abstract}
{\quotation{\bfseries\centering\abstractname} \\[\dimexpr-\baselineskip+1mm+2pt] \rule{\linewidth}{0.2pt}\\[\dimexpr-\baselineskip+1.5mm+3pt]\rule{\linewidth {3pt}\medskip }{\par\noindent\rule{\linewidth}{2.9pt}\\[\dimexpr-\baselineskip+1mm+1pt]\rule{\linewidth}{0.2pt}\endquotation}

% Keywords command

\providecommand{\keywords}[1]
{\par\hspace{\parindent}\small\textbf{\bfseries\centering Keywords :} #1 }

\begin{document}

\begin{abstract}
\par Abstract in French
\end{abstract}

\keywords{un, deux, trois, quatre}  % <------ the result wanted is: mot-clé :

\bigskip

\begin{otherlanguage}{english} 

\begin{abstract}
\par Abstract in English
\end{abstract}

\keywords{one, two, three, four}

\end{otherlanguage}

\bigskip

\begin{otherlanguage}{arabic} 

\begin{abstract}
\par ملخص بالعربية
\end{abstract}

\keywords{واحد, اثنين, ثلاتة,اربعة.} % <------ the result wanted is:
.الكلمات المفتاحية : واحد, اثنين, ثلاتة,اربعة

\end{otherlanguage}

\end{document}
3

Something like this, to ease input:

\documentclass[12pt,a4paper,notitlepage]{report}

\usepackage[utf8]{inputenc}
\usepackage[LAE,LFE,T1]{fontenc}

\usepackage[arabic,english,french]{babel}

\addto\captionsenglish{\renewcommand{\keywordsname}{Keywords}}
\addto\captionsfrench{\renewcommand{\keywordsname}{Mots-clés}}
\addto\captionsarabic{\renewcommand{\keywordsname}{اثنين, ثلاتة,اربع}}

\providecommand{\keywordsname}{Keywords}

\newif\ifotherlanguage

% Abstract
\renewenvironment{abstract}[1][]
 {%
  \if\relax\detokenize{#1}\relax\else
    \otherlanguagetrue
    \begin{otherlanguage}{#1}%
  \fi
  \begin{quotation}
  {\bfseries\centering\abstractname\par}
  \vspace{\dimexpr-\baselineskip+1mm+2pt}
  \noindent\rule{\linewidth}{0.2pt}\\[\dimexpr-\baselineskip+1.5mm+3pt]
  \noindent\rule{\linewidth}{3pt}
  \medskip
 }
 {%
  \par
  \noindent\rule{\linewidth}{2.9pt}\\[\dimexpr-\baselineskip+1mm+1pt]
  \noindent\rule{\linewidth}{0.2pt}
  \end{quotation}%
  \ifotherlanguage
    \end{otherlanguage}
  \fi
 }

% Keywords command

\providecommand{\keywords}{}
\renewcommand{\keywords}[2][]{%
  \par
  \if\relax\detokenize{#1}\relax\else\begin{otherlanguage}{#1}\fi
  \small\centering
  \textbf{\keywordsname:} #2\par
  \if\relax\detokenize{#1}\relax\else\end{otherlanguage}\fi
}

\begin{document}

\begin{abstract}
Abstract in French
\end{abstract}

\keywords{un, deux, trois, quatre}  % <------ the result wanted is: mot-clé :

\bigskip

\begin{abstract}[english]
Abstract in English
\end{abstract}

\keywords[english]{one, two, three, four}

\bigskip

\begin{abstract}[arabic]
ملخص بالعربية
\end{abstract}

\keywords[arabic]{واحد, اثنين, ثلاتة,اربعة.} 

\end{document}

enter image description here

  • It neat, effective and well organized, it's just what I was in need for. Thank you very much. – hanaa chan May 5 '19 at 19:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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