3

I want to add an Arabic abstract before the English abstract, at the beginning of an English document.

I also want the title of the abstract to appear in Arabic (ملخص) in the Table of Contents. here you are an example:

\documentclass[a4paper,12pt,oneside]{book}  % ociamthesis
\bibliographystyle{unsrt}
\usepackage[a4paper,inner=30mm,outer=20mm,top=30mm,bottom=30mm]{geometry}


\begin{document}

\clearpage \pagenumbering{roman}
\setcounter{page}{5}
\selectlanguage{arabic}
\chapter*{ملخص}
\addcontentsline{toc}{chapter}{\foreignlanguage{arabic}{\arabicabstractname}}

اء المعلومات هي تقنية متقدمة لإخفاء الييااات حيث تم اليحث فيها على اطاق واسع في السنوات الأخيرة اظر

\selectlanguage{english}

\chapter*{Abstract}
\addcontentsline{toc}{chapter}{Abstract}

Data masking is an advanced data hiding technique where it has been extensively researched in recent years

\tableofcontents
\addcontentsline{toc}{chapter}{Table of contents}


\end{document}

PS: i want that the code will not change my original font which is Charter BT. Also, if it is possible, i want to build the file using pdftex, not xetec

1
  • 2
    Can you please add a MWE showing your language set up. e.g., do you use polyglossia or babel or arabtex or … and which engine: pdflatex, xelatex, or lualatex. Apr 9, 2019 at 14:13

1 Answer 1

4

I would have a better idea what you’re looking for if you’d provided a Minimal Working Example, but you might try tweaking this:

\documentclass{article}
\usepackage[bidi=default]{babel}
\usepackage{fontspec}

% Solely to make the output narrow enough for TeX.SX:
\usepackage[paperwidth=10cm]{geometry}

\babelprovide[import=ar]{arabic}
\babelprovide[main, import=en, language=Default]{english}

\babelfont{rm}
          [Scale=1.0, Ligatures={Common, TeX}, Numbers=OldStyle]{Libertinus Serif}
\babelfont[arabic]{rm}
          [Scale=MatchLowercase]{Amiri}
% You might also want to define \babelfont{sf} and \babelfont{tt}.

\renewcommand{\arabicabstractname}{ملخص}

\begin{document}
  \addcontentsline{toc}{section}{\foreignlanguage{arabic}{\arabicabstractname}}
  \selectlanguage{arabic}
  \begin{abstract}
    الخط الأميري خط نسخي موجه لطباعة الكتب و النصوص الطويلة.

    \selectlanguage{english}
    Amiri is a classical Arabic typeface in Naskh style for typesetting
    books and other running text.
  \end{abstract}

  \selectlanguage{english}
% From here on out, use \begin{otherlanguage}{arabic} for paragraphs, or
% \foreignlanguage{arabic} for short phrases.

  \tableofcontents

  \section{Example}

\end{document}

Amiri/Libertinus sample

11
  • Thank you so much, it works Apr 10, 2019 at 14:05
  • however, the original font of the document changed, what can i do to preserve it ? Apr 10, 2019 at 14:20
  • Also, make sure you have version 3.27 or higher of the babel package. That’s what I tested with.
    – Davislor
    Apr 10, 2019 at 16:06
  • The font is determined by the \babelfont commands. Since you did’t specify them or give an example, I picked Khaled Hosny’s Libertinus and Amiri. Choose any other TrueType or OpenType fonts you want instead.
    – Davislor
    Apr 10, 2019 at 16:13
  • I want to preserve the font of the template, how can know the type used by template? and use it with babel? Apr 11, 2019 at 18:02

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .