14

This is my first LaTeX Project. I am using XelaTeX to compile the tex file.

I am having an issue with Even Line Spacing in my arabic document. The baseline grid is fine on the first page but the text from page 2 and onwards shifts. I dont know why the first is coming out fine but not the rest.

\documentclass[a4paper, twoside, openany, 12pt]{memoir}
\settrimmedsize{29.7cm}{21cm}{*}
\settrims{0mm}{0mm}
\settypeblocksize{*}{\lxvchars}{1.618}
    % Tried it with using only ratio to achieve golden section 
    %  but the inner margins would become wide and outer thin. 
    %  So had to specify the mergins using \setlrmarginsandblock{*}{3.5115cm}{1.618} 
    %\setlrmargins{*}{*}{1.618}
\setlrmarginsandblock{*}{3.5115cm}{1.618} 
\setulmargins{*}{*}{1.618}
\setheadfoot{0.7cm}{0.74cm}
\setheaderspaces{*}{*}{1.618}
\checkandfixthelayout
\usepackage{fontspec}
\usepackage{layouts}
\usepackage{atbegshi,picture,xcolor}
    \AtBeginShipout{%
      \AtBeginShipoutUpperLeft{%
        {\color{red}%
        \put(\dimexpr -1in-\oddsidemargin,
             -\dimexpr 1in+\topmargin+\headheight+\headsep+\topskip)%
          {%
           \vtop to\dimexpr\vsize+\baselineskip{
             \hrule
             \leaders\vbox to\baselineskip{\hrule width\hsize\vfill}\vfill
           }%
          }%
      }}%
    }
\usepackage{leading} 
\usepackage{polyglossia}
\setmainlanguage[numerals=mashriq]{arabic}
\setotherlanguage{english}
\newfontfamily\arabicfont[Script=Arabic,Scale=2.0]{Traditional Arabic}
\let\arabicfonttt\ttfamily 
\setsansfont[Script=Arabic,Scale=1.5]{Traditional Arabic}
\defaultfontfeatures{Mapping=tex-text}
\begin{document}
\lineskiplimit=-\maxdimen
    %\lineskiplimit=-1000pt
\linespread{2.282}
    %\leading{33.1pt}
    %\renewcommand{\baselinestretch}{2.282}\normalsize


\mainmatter



\begin{Arabic}
    \chapter*{\centerline{كِتَاب الطَّهَارَةِ}}

    اَلْمِيَاهُ ثَلَاثَةٌ\\
    اَلْأَوَّلُ: طَهُورٌ وَهُوَ اَلْبَاقِي عَلَى خِلْقَتِهِ وَمِنْهُ مَكْرُوهٌ كَمُتَغَيِّرٍ بِغَيْرِ مُمَازِجٍ وَمُحَرَّمٌ لَا يَرْفَعُ اَلْحَدَثَ وَيُزِيلُ اَلْخَبَثَ وَهُوَ اَلْمَغْصُوب وَغَيْرُ بِئْرِ النَّاقَةِ مِنْ ثَمُودَ .\\    
            اَلثَّانِي: طَاهِرٌ لَا يَرْفَعُ اَلْحَدَثَ وَلَا يُزِيلُ اَلْخَبَثَ وَهُوَ اَلْمُتَغَيِّرُ بِمُمَازِجٍ طَاهِر وَمِنْهُ يَسِيرٌ مُسْتَعْمَلٌ فِي رَفْعِ حَدَثٍ . \\
            اَلثَّالِثُ: نَجِسٌ يَحْرُمُ اِسْتِعْمَالُهُ مُطْلَقًا وَهُوَ مَا تَغَيَّرَ بِنَجَاسَةٍ فِي غَيْرِ مَحِلِّ تَطْهِيرٍ أَوْ لَاقَاهَا فِي غَيْرِهِ وَهُوَ يَسِيرٌ وَالْجَارِي كَالرَّاكِدِ وَالْكَثِيرُ قُلَّتَانِ وَهُمَا مِائَةُ رِطْلٍ وَسَبْعَةُ أَرْطَالٍ وَسُبْعُ رِطْلٍ بِالدِّمَشْقِيِّ وَالْيَسِيرُ مَا دُونَهُمَ . 
    \section*{  طَهَارَةُ اَلْآنِيَةِ }
            كُلُّ إِنَاءٍ طَاهِرٍ يُبَاحُ اِتِّخَاذُهُ وَاسْتِعْمَالُهُ إِلَّا أَنْ يَكُونَ ذَهَبًا أَوْ فِضَّةً أَوْ مُضَبَّبًا بِأَحَدِهِمَا لَكِنْ تُبَاحُ ضَبَّةٌ يَسِيرَةٌ مِنْ فِضَّةٍ لِحَاجَةٍ وَمَا لَمْ تُعْلَمْ نَجَاسَتُهُ مِنْ آنِيَةِ كُفَّارٍ وَثِيَابُهُمْ طَاهِرَةٌ وَلَا يَطْهُرُ جِلْدُ مَيِّتَةٍ بِدِبَاغٍ وَكُلُّ أَجْزَائِهَا نَجِسَةٌ إِلَّا شَعْرًا وَنَحْوَهُ  وَالْمُنْفَصِلُ مِنْ حَيٍّ كَمَيْتَتِهِ . 
    \section*{  اَلِاسْتِنْجَاءُ وَالِاسْتِجْمَارُ }
            اَلِاسْتِنْجَاءُ وَاجِبٌ مِنْ كُلِّ خَارِجٍ إِلَّا اَلرِّيحَ وَالطَّاهِرَ وَغَيْرَ اَلْمُلَوَّث وَسُنَّ عِنْدَ دُخُولِ خَلَاءٍ قَوْلُ : بِسْمِ اَللَّهِ اَللَّهُمَّ إِنِّي أَعُوذُ بِكَ مِنْ اَلْخُبُثِ وَالْخَبَائِثِ وَبَعْدَ خُرُوجٍ مِنْهُ : غُفْرَانَكَ، اَلْحَمْدُ لِلَّهِ اَلَّذِي أَذْهَبَ عَنِّي اَلْأَذَى وَعَافَانِي.        

            وَتَغْطِيَةُ رَأْسٍ وَانْتِعَالٌ وَتَقْدِيمُ رِجْلِهِ اَلْيُسْرَى دُخُولًا وَاعْتِمَادُهُ عَلَيْهَا جُلُوسًا وَالْيُمْنَى خُرُوجًا عَكْسُ مَسْجِدٍ وَنَعْلٍ وَنَحْوِهِمَا وَبُعْد ٌ فِي فَضَاءٍ وَطَلَبُ مَكَانٍ رَخْوٍ لِبَوْلٍ وَمَسْحُ اَلذِّكْرِ بِالْيَدِ اَلْيُسْرَى إِذَا اِنْقَطَعَ اَلْبَوْلُ مِنْ أَصْلِهِ إِلَى رَأْسِهِ ثَلَاثًا وَنَتْرُهُ ثَلَاثًا .\\ 
            وَكُرِهَ دُخُولُ خَلَاءٍ بِمَا فِيهِ ذَكَرُ اَللَّهِ -تَعَالَى - وَكَلَامٌ فِيهِ بِلَا حَاجَةٍ وَرَفْعُ ثَوْبٍ قَبْلَ دُنُوٍّ مِنَ اَلْأَرْضِ وَبَوْلٌ فِي شَقٍّ وَنَحْوِهِ وَمَسُّ فَرْجٍ بِيَمِينٍ بِلَا حَاجَةٍ وَاسْتِقْبَالُ اَلنَّيِّرَيْنِ وَحَرُمَ اِسْتِقْبَالُ قِبْلَةٍ وَاسْتِدْبَارُهَا فِي غَيْرِ بُنْيَانٍ وَلُبْثٌ فَوْقَ اَلْحَاجَةِ وَبَوْلٌ فِي طَرِيقٍ مَسْلُوكٍ وَنَحْوِهِ وَتَحْتَ شَجَرَةٍ مُثْمِرَةٍ ثَمَرًا مَقْصُودًا. \\
     \section*{اَلسِّوَاكُ وَتَوَابِعُهُ }
            يَسُنُّ اَلسِّوَاكُ بِالْعُودِ كُلَّ وَقْتٍ إِلَّا لِصَائِمٍ بَعْدَ اَلزَّوَالِ فَيُكْرَه ُ. وَيَتَأَكَّدُ عِنْدَ صَلَاةٍ وَنَحْوِهَا وَتَغَيُّرِ فَمٍ وَنَحْوِهِ . 
            وَسُنَّ بُدَاءَةٌ بِالْأَيْمَنِ فِيهِ وَفِي طُهْرٍ وَشَأْنِهِ كُلِّهِ وَادِّهَانٌ غِبًّا وَاكْتِحَالٌ فِي كُلِّ عَيْنٍ ثَلَاثًا وَنَظَرٌ فِي مِرْآةٍ وَتَطَيُّبٌ وَاِسْتِحْدَاد ٌ وَحَفُّ شَارِبٍ وَتَقْلِيمُ ظُفُرٍ وَنَتْفُ إِبِط ٍ وَكُرِهَ قَزَع ٌ وَنَتْفُ شَيْبٍ وَثَقْبُ أُذُنِ صَبِيٍّ وَيَجِبُ خِتَانُ ذَكَرٍ وَأُنْثَى "بُعَيْدَ بُلُوغٍ مَعَ أَمِنِ اَلضَّرَرِ وَيُسَنُّ قَبْلَهُ وَيُكْرَهُ سَابِعَ وِلَادَتِهِ وَمِنْهَا إِلَيْهِ". 

\end{Arabic}
\end{document}

Screenshot of pages 1 to 2: Pages 1 to 2

Screenshot of pages 3 to 4: Pages 3 to 4

Ibn Saeed
  • 531
  • 1
  • the vertical spaceing used with chapter and section is not the same try \chapter*{\centerline{كِتَاب الطَّهَارَةِ}} with \section*{\centerline{كِتَاب الطَّهَارَةِ}} and 2) not related. there is better way to center chapter heading.
  • – touhami Dec 29 '15 at 07:46
  • 1
    here is a related question http://tex.stackexchange.com/questions/262879/document-layout-styles/ – touhami Dec 29 '15 at 08:03
  • note if you remore \chapter*{\centerline{كِتَاب الطَّهَارَةِ}} horizontal rules do not match to text lines. – touhami Dec 31 '15 at 17:30