1

In the shown MWE:

The page numbering is set to Chapter-page format. However:

  • Regarding the bibliography, the page numbering continues normally from the previous page and the chapter identifier in the page number disappears. I am supposed to have a bibliography at the end of each chapter, and a bibliography at the end of the document.

    • For the one at the end of the document, I need it to have its separate numbering (page number start from 1 and need to set a chapter identifier for it)

    • How to add a bibliography at the end of each chapter, while having a page numbering which continues normally within the chapter page numbering

  • Regarding the appendix: Page numbering for the appendix continues from the previous section and does not start at 1, how can it be set so as to start from 1, also sometimes the chapter identifier disappears from the page numbering.

Here is the MWE:

\documentclass[a4paper,12pt]{book}

\usepackage[nil,bidi=basic-r,layout=counters]{babel}
\babelprovide[import=ar,mapdigits,main]{arabic}
\babelprovide[import=en,language=Default]{english}
\babelfont{rm}{Latin Modern Roman}
\babelfont[arabic]{rm}{Amiri}

\usepackage{fancyhdr} 
\pagestyle{fancy}
\fancyhead[L]{\rightmark}
\fancyhead[R]{\leftmark}
\renewcommand{\headrulewidth}{2pt}
\renewcommand{\footrulewidth}{2pt}

\makeatletter
\renewcommand{\thepage}{\thechapter-\csname @arabic\endcsname\c@page}
\makeatother

\usepackage[hidelinks,colorlinks=true,allcolors=blue]{hyperref}

\usepackage{etoolbox}

\gappto\captionsarabic{\renewcommand{\chaptername}{الباب}}

\newcommand\words[1]{\expandafter\xwords\csname c@#1\endcsname}
\def\xwords#1{%
  \ifcase#1\or
  الأول\or
  الثاني\or
  الثالث\or
  الرابع\or
  \else
  I need more words\fi}    
\makeatletter
\pretocmd{\Hy@org@chapter}
  {\begingroup \renewcommand{\thechapter}{{\words{chapter}}}}
  {}
  {}
\patchcmd{\Hy@org@chapter}
  {\addcontentsline{toc}{chapter}{\protect\numberline{\thechapter}#1}}
  {\addcontentsline{toc}{chapter}{\@chapapp\space\words{chapter}\space#1}}
  {}
  {}
\apptocmd{\Hy@org@chapter}
  {\endgroup}
  {}
  {}
\patchcmd{\@makechapterhead}
  {\thechapter}
  {\words{chapter}}
  {}
  {}
\makeatother


%==================================================
%References%
%===================================================
\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@book{Sharoni1969,
 author = {ميخائيل، ملاك  and  الشاروني، حبيب},
 date = {1969},
 title = {المرجع فى قواعد اللغة القبطية},
 location = {الاسكندرية},
 publisher = {جمعية مارمينا العجايبي},
 langid = {arabic}
}
@book{Browning1983,
 author = {Browning, Robert},
 date = {1983},
 title = {Medieval and Modern Greek},
 publisher = {Cambridge University Press},
 langid = {english}
}
@misc{CBible2015,
 date = {2015},
 title = {\foreignlanguage{english}{Coptic Bible} الكتاب المقدس القبطي},
 langid = {arabic}
}
@online{Website:Elpenor,
 title = {ELPENOR - Home of the Greek Word - Ellopos},
 date = {2015-05},
 url = {https://www.ellopos.net/elpenor/Default.asp},
 langid = {english}
}
\end{filecontents}



%=============================================================
%BIBLIOGRAPHY SETTINGS%
%=============================================================
%Translate Bibaltex localization strings to another language, Those are known as localization strings, since currently there is no arabic, so you replace the english ones, these settings do the following:
% make footnote citations and bibliography change from right to left or left to right according to language
%Localized items (the words edition, page,seenote,and), how to remove them or make them appear according to the citation language
% You have to create arabic.lbx for strings for biblatex and define Arabic quotes for csquotes (Arabic quotes are created لاثمخص)

\begin{filecontents}{arabic.lbx}
\ProvidesFile{arabic.lbx}
\InheritBibliographyExtras{english}
% Translations thanks to Google Translate.
% I haven't provided abbreviations, because I don't know Arabic.
% You'll need to add more for other strings you use.
% Look in `english.lbx` for the string name.
\DeclareBibliographyStrings{%
  inherit          = {english},
  and              = {{و}{و}},
  page             = {{صفحة}{صفحة}},
  pages            = {{صفحات}{صفحة}},
  references       = {{مراجع}{مراجع}},
  seenote          = {{انظر الملاحظة}{انظر الملاحظة}},
}
\end{filecontents}


\usepackage{csquotes}
\DeclareQuoteStyle{arabic}
  {\guillemotleft}
  {\guillemotright}
  {\textquotedblright}
  {\textquotedblleft}



\usepackage[%
  language=auto,
  autolang=other,
  citestyle=verbose-note,
  bibstyle=authortitle,
  doi=false,
  isbn=false]{biblatex} 
\addbibresource{\jobname.bib} % Onlyused with biblatex, do not put spaces in the original file name, this is the file where citations are placed

\defbibenvironment{bibliography}
  {\list
     {}
     {\setlength{\leftmargin}{\bibhang}%
      \setlength{\itemindent}{-\leftmargin}%
      \setlength{\itemsep}{\bibitemsep}%
      \setlength{\parsep}{\bibparsep}}}
  {\endlist}
  {\item\leavevmode}% add \leavevmode to align English bibliography items RTL

% Always use Arabic digits for see note.
\usepackage{xpatch}
\xpatchbibmacro{footcite:note}
  {\ref{cbx@\csuse{cbx@f@\thefield{entrykey}}}}
  {\foreignlanguage{arabic}{\ref{cbx@\csuse{cbx@f@\thefield{entrykey}}}}}
  {}
  {}

% Just to test if quotes work
\DeclareFieldFormat{title}{\mkbibquote{\mkbibemph{#1}}}

\begin{document}
\tableofcontents{}

\chapter{سيسس}
يبيسبسيبسيبسيبسيب
\footcite{Browning1983}
\section{سيسس}
بيسببببببببببببببيسيب
\footcite{Website:Elpenor}
\subsection{سيسس}
بيسيببببببببببببببببب
\footcite{Sharoni1969}
\subsection{سيسس}
بيسسسسسسسسسببس
\subsection{سيسس}

\clearpage

\section{سيسس}

\subsection{سيسس}

\subsection{سيسس}

\subsection{سيسس}
\newpage
\printbibliography
\appendix
\chapter{تعريفات}
\section{اffggfgf}
\begin{center}
\textbf{
يسبسيبسيبيسب
}
\end{center}
\newpage
\newpage
sdfffffffffffffff
sddddddddddddd

dddddddddddddd\\
\\
\\
\\
\\

\end{document}

1 Answer 1

2

For the final bibliography you could simply reset the page counter (\setcounter{page}{0}) and \thepage macro to it's normal value (\arabic{page}, prefixed by what you want as chapter-like name) before the last \printbibliography.

About the per-chapter bib, they don't appear in your (not really minimal) example, and your question is not clear : do you want something like '2-33' for the third page of bib list of second chapter , assuming yhat this chapter has 30 pages ? Or something else ? In any case you would have to add refsection=chapter to the options passed to biblatex package, to automatically parse the references by chapter. Then the command \printbibliography[heading=subbibliograhy] at the end of the chapter will add the expected bib \section.

About the appendices the question is also not very clear. Especially, the "sometimes the chapter identifier disappears from the page numbering" is rather vague. You should take into account that \appendix changes the formatting of \thechapter to switch from \arabic to \Alph numbering. Once again, \setcounter{page}{0} before \appendix could help.

If these partial anwers don't match your needs, please post a new question for each sub question, with for each of them a really minimal example, and specify what you get and what you would like to get.

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.