Margin notes for Arabic quotes in LaTeX

April 26, 2016
Tags: -typography -latex
Length: medium

Update 2021-10-15 — Editing.

Update 2017-03-03 — Had I when I wrote this post known what I know now, I would have used the stretchable kashida to justify the margin notes, rather than having them flush right.

This posts describes a way of showing quoted Arabic text in the margin in non-Arabic environments and how this can be achieved in LaTeX. For sentence length quotes this has several advantages over the traditional method of having the transcribed Arabic inserted in the running text. It circumvents problems with directionality, avoids aesthetic clashes between the Latin and the Arabic script, the arabophone reader can read it more easily, and the non-arabophone reader can more easily skip it. It also makes for an interesting and nice looking page.

Often when one wants to quote an Arabic source in a non-Arabic text, the quote is transcribed. Transcribing the quote makes sense if a single word or short expression is quoted, since then also the reader who is not very familiar with Arabic can read it and learn or recognize it. For longer quotes, transcription serves no real purpose. The reader who is not very familiar with Arabic will not be able to read it and for the reader who is familiar with Arabic it would be easier to read it in the original Arabic script. I find that to read a longer stretch of Arabic text in transcription I often have to read it aloud to understand, it since I am not familiar with the visual shape of the transcribed words. Furthermore, transcribing Arabic necessarily means adding vowels that are not there in the original text, thus adding information to the text that was not there in the source. It is then not possible to tell which of these vowels, if any, were there in the original text. It is in other words not an exact quote. Quotes inserted this way also make for a cumbersome read, as illustrated in the following extract1.

Article with lengthy Arabic transliteration

The alternative, then, is to give the translation together with the original in Arabic script. For block quotes, this usually works fine, as the translation and the Arabic original are in two separate paragraphs and there is no problem with directionality. Sentence length quotes are best used in the running text, but the switch from left-to-right (LTR) to right-to-left (RTL) script can be quite annoying to read. This is especially problematic if there is a line break in the Arabic quote. The reader (who wishes to read the Arabic quote) must then go to the right end of the line where the RTL text begins, read to left to the middle of the line, then go the middle of the next line where the Arabic text continues, read to the left end of the line, go back to the middle of the line and continue reading the LTR Latinate text. Add to this the aesthetic problems of having a lucid and round Arabic script inserted into the angular and strict forms of a Roman typeface.

In my dissertation I have several such sentence length Arabic quotes and I wanted to avoid the directionality-mess described above. The way I did this was to have the translated quote in the running text and the original Arabic text in the margin. This is illustrated in the image below, showing page 24 of the dissertation. Note how the first row of the Arabic text is aligned with the first row of the translation in the running text. This way, the quote is readily available for the interested reader without mixing reading direction, and the result is more aesthetically pleasing since the Arabic and the Latin texts are kept separate. The reader who does not know Arabic is not disturbed by it.

Page with Arabic quotes in the margin.

The rest of this post is a description of how this can be achieved in LaTeX. First, this method uses the following packages that must be called in the preamble:


The polyglossia package makes it relatively easy to use several languages and scripts in one document. It requires the XeTeX engine. marginnote provides the function with the same name to produce, well, margin notes. This is preferable to the \marginpar command in default LaTeX which does not work in footnotes, figures, and other such “outerpar” material. Note that marginnotes requires two runs of compilation to render correctly.

Now, for a minimal example we also need to set up a font for Arabic script. This is done with the fontspec package which is called by polyglossia. I use the free and very nice Amiri font here, but you could use any Arabic font that is installed in the operating system.


The command I used to print original Arabic in the margin is defined in the preamble as follows (with some annotation):2

% \araquote
  % [<vertical offset>] optional. default=0pt
  % {<inline translation>}
  % {<arabic text in margin>}

  [#1]% voffset

Whenever in the text you want to quote an Arabic source inline you can then do the following to get the Arabic source text in the margin:

Text text text text text text
text \araquote{translated qoute
(Author 1999)}{النص العري الأصلي} text text text.

The method is not completely automatic since if the margin note is at the bottom of the page it will extend down below the text block, and this must be fixed manually. It is almost guaranteed to happen if you have Arabic quotes in a footnote, as I have in the example from my dissertation above. To fix this the command has an optional argument that takes a length expression that adjusts the vertical position of the margin note. The best way to use this optional argument is when the text is finished and compiled. Then you go through the document to see if there are Arabic margin notes that extends below the text block, count how many lines it extends below, and add a negative dimension with \baselineskip accordingly. So if a margin note extends two lines below the text block, you add [-2\baselineskip] between \araquote and the two arguments in curly brackets. This pushes the margin note upwards two lines to have the bottom line of the margin note aligned with the bottom line of the main text block.

Lastly, the width of the text block in a margin note is generally to narrow for the text to be justified. I chose to have all the margin notes set flush right. In principle I would like to do like Bringhurst in his book The Elements of Typographic Style,3 where margin notes are flush right on left hand pages and flush left on right hand pages. This gives a nice balanced cohesion to the page spread and makes the margin notes always look nicely tucked in next to the text. For Arabic script, flush left text often looks very bad. The reason is that many word-final letter forms in Arabic have long leftward swashes, such as ـب ـف ـق and others. This often gives the left edge of the text block a ragged look even in a flush left environment. What is even worse is that the right hand side often looks strange with the many word-initial alifs. These alifs have a strong vertical character that looks odd when not aligned. In the example below you get the feeling that the text wants to be aligned to the right. Hence the choice to have all margin notes flush right.

Flush left narrow Arabic text block.

In summary, Arabic quotes in the margin and the translation in the running text: pretty and practical.

  1. Suleiman, Y., 1996. “The Simplification of Arabic Grammar and the Problematic Nature of the Sources.” Journal of Semitic Studies, 41(1), pp.99–119. 

  2. The \null in the last line is necessary to avoid LaTeX misinterpreting instances where the translated text begins with square brackets to signal that some word has been added for the sake of translation. 

  3. Bringhurst, R., 2012. The Elements of Typographic Style, Seattle: Hartley & Marks.