Skip to content

alea latex quran

Christian Lück edited this page Dec 20, 2024 · 1 revision

Index of the Citations from Quran

In the ALEA project, books come with a index of citations from Quran. The index generation is very similar to the general index generation. Again, the index entries are not written directly to the index file, but only translation keys are passed to the \index macro. The index name is surah.

The XSLT package xsl/projects/alea/latex/libsurahidx.xsl contains all components for generating the index and translations.

  <xsl:use-package
    name="https://scdh.zivgitlabpages.uni-muenster.de/tei-processing/transform/xsl/projects/alea/latex/libsurahidx.xsl"
    package-version="1.0.0">
    <xsl:accept component="template" names="surah:*" visibility="final"/>
  </xsl:use-package>

The namespace is xmlns:surah="http://scdh.wwu.de/transform/surah#".

Example use case is in xsl/projects/alea/latex/prose.xsl.

Filling the Index

The XSLT package xsl/projects/alea/latex/libsurahidx.xsl contains the named template surah:index which does all the business logic for filling the index. It can be called from templates in mode text:text, and expects the element with the citation (or the reference) as context item. Here's an example:

  <xsl:use-package
    name="https://scdh.zivgitlabpages.uni-muenster.de/tei-processing/transform/xsl/latex/libtext.xsl"
    package-version="1.0.0">
  <xsl:override>

      ...

         <!-- make an index entry for encodings like in Prosa/Sag -->
   <xsl:template mode="text:text"
    match="quote[@source eq 'bib:quran' and @type eq 'verbatim-holy']">
    <xsl:call-template name="surah:index"/>
   </xsl:template>

    </xsl:override>
  </xsl:use-package>

The surah:index template will try to get structured information about the citation from a related bibl/biblScope element holding information about the Surah number and the verses.

The output into the text looks like this:

\index[surah]{\surahind{\GetTranslation{surah-<NUMBER>}}{VERSES}}

The macros \surahind and \GetTranslation will only get expanded by print index.

Make Index

In order to have imakeidx make a surah index, surah has to be added to the indexes via the stylesheet parameter rend:indices or rend:indices-csv.

Translations

The translations are generated by the i18n utilities in xsl/latex/libi18n.xsl. Translations from xsl/projects/alea/html/locales/quaran are used. They come for free by using the named macro that adds header components:

<xsl:call-template name="surah:latex-header"/>

This also adds a macro definition for \surahind.

Print Index

The index is printed automatically if the general utilities for making LaTeX indexes are used. Otherwise just use:

\printindex[surah]
Clone this wiki locally