Hot answers tagged

17

In general, I advise against using bold and slanted in Arabic for emphasis: they work poorly in Arabic, especially the slant which is not always as visible and is quite alien to Arabic typesetting traditions. (Even though my own Amiri font has them, they are there to avoid the fake bold and slanted synthesized by GUI applications which are very very poor and ...


15

I don't know whether this fact is documented (I can't see it in the manual, though), but the arabicfnt.sty that's automatically loaded has \DeclareRobustCommand{\times}{\fontfamily{artimes}\selectfont} which explains the mystery. You can solve the problem by adding to your document \DeclareMathSymbol{\mtimes}{\mathbin}{symbols}{"02} and using \mtimes ...


15

The 'proper' (internal) name of the primitive has always been \textdir, but for various reasons it used to be 'activated' as \luatextextdir in LuaLaTeX. The LaTeX team have recently revised this approach and all primitives now have their 'natural' names in LuaLaTeX. Thus you should either update your code or add \directlua{ tex.enableprimitives("luatex",...


14

In texmf-dist/doc/latex/arabi/user_guide.pdf, pages 50–51 give samples of fonts from Microsoft and from arabeyes.org (there are .ttf versions of the latter in Debian’s fonts-arabeyes package). And the documentation for dad shows examples of its output. Of course, with xetex and luatex, you can use any unicode, OpenType font, whether free or commercial. ...


13

Because Arabic is complex, characters are connected to form a word, unlike English and Latin, it can not bend to follow a path easily. To remedy this, you have to break the text into separate words using text format delimiters={|}{|} and activate the font at the begining of the tikzpicture by adding \arabicfont\fontsize{12pt}{20}\selectfont. \documentclass[...


11

For pdfTeX: \documentclass{report} \pagenumbering{Roman} \begin{document} \chapter{chap1} Bla bla bla \cleardoublepage % Best place at the start of the Arabic numbered pages % after \cleardoublepage and before the page number is % reset in \pagenumbering{arabic}. \pdfcatalog{% /PageLabels<<% /Nums[% % Page numbers are zero based. ...


11

What you are trying to do can be achieved but it will be difficult and frustrating. Questions tagged grid-typesetting contain many details on the matter. Long story short, (Xe)LaTeX is the wrong tool for grid typesetting: you would have to eliminate any glue and set every dimension to a multiple of the grid step. You can only do this manually, and every ...


11

Ideally, one could fix the problem using an OpenType feature file loaded at runtime through a ConTeXt typescript. In practice, that's not (yet) possible; as Hans Hagen told me the new font loaders doesn't support fea files (i have a basic parser but it's not included as i'm still not sure if it should be .. fea files assume stable fonts and so) ...


10

This is a solution. The option hyperfootnotes is the culprit of this behavior. So, when loading beamer, pass the option hyperfootnotes=false to hyperref, in this way: \documentclass[hyperref={hyperfootnotes=false},10pt]{beamer} At this point, however, footnotes won't be printed... To avoid that, we need to add the following lines in the preamble: \...


10

To get the Unicode bidirectional algorithm working correctly, you need to use babel. There are many clever things babel can now do with lualatex and right-to-left languages. Have a look through the manual. Try this (with lualatex): \documentclass[12pt,a4paper]{article} \usepackage[nil,bidi=basic-r]{babel} \babelprovide[import=ar,main]{arabic} \babelfont[...


10

This here should probably work (to really make use of the HarfBuzz Render you need either texlive 2020 or should use the lualatex-dev format): \documentclass{article} \usepackage{fontspec} \usepackage[bidi=basic]{babel} \babelprovide[import=ur,mapdigits]{urdu} \babelfont[urdu]{rm}[Renderer=HarfBuzz]{Amiri} \begin{document} My urdu test \selectlanguage{...


9

You can use only one mapping file at a time; so the solution is to merge the map files. Prepare a file texarabicdigits.map containing ; TECkit mapping for TeX input conventions <-> Unicode characters LHSName "TeX-text" RHSName "UNICODE" pass(Unicode) ; ligatures from Knuth's original CMR fonts U+002D U+002D <> U+2013 ; -- -> ...


9

You have to switch to text mode: \documentclass[10pt,a4paper]{report} \usepackage{amsthm} \usepackage{amsmath} \usepackage{setspace} \usepackage{fontspec} \usepackage{polyglossia} \usepackage{xunicode} \usepackage{xcolor} \usepackage{pifont} \usepackage{enumitem} \setmainlanguage{english} \setotherlanguage{arabic} \newfontfamily\arabicfont[Script=Arabic,...


9

You can do it, but I don't think your readers will be happy. \documentclass{article} \usepackage{amsmath} \DeclareRobustCommand{\waw}{{\text{\usefont{U}{xnsh}{m}{n}\symbol{240}}}} \begin{document} $\waw+3=x_{\waw}$ \end{document} You can create a table of the font with \documentclass{article} \usepackage{fonttable} \begin{document} \xfonttable{U}{xnsh}{...


8

Probably your file is not saved in UTF-8 encoding. Apparently TeXshop allows you to put % !TEX encoding = UTF-8 Unicode as the first line, although since it's now the 21st Century you should probably make that the editor default. This can be done in the main preferences of TeXShop in the Source panel (Encoding). To summarize: Install polyglossia (which ...


8

The following can be improved in various ways (e.g. using tikz is probably a bit overkill and also doesn't work well in RTL mode; there should be a way to select the glyphs which gets a frame and to change the colors; glue and other nodes are currently ignored, so it works only for single words) but it shows that it is basically possible to inspect the words,...


8

There are many ways to work with the Arabic script. My preference is the arabluatex package, which requires you to choose LuaLaTeX as your compiler. With arabluatex, your desired output can be obtained as simply as this: \documentclass{article} \usepackage{arabluatex} \begin{document} \begin{arab} \arbmark{slm} \end{arab} \end{document} That uses the ...


7

The below functionality is available as the manchuxetex package on GitHub. A minimal example as to demonstrate Khaled Hosny’s point of hacking Manchu/Mongolian into top-to-bottom, left-to-right: % !TEX TS-program = xelatex \documentclass{scrartcl} \usepackage{fontspec} \newfontfamily{\dcw}[]{DaicingWhite}% \begin{document} \noindent Line above\\% to ...


7

The first thing to note is that the problem really has nothing to do with TikZ. Consider \documentclass{article} \begin{document} العائلة \end{document} which produces a blank page when compiled with LuaLaTeX. This is not surprising: the default configuration supports English and uses fonts with a limited range of characters, all Latin script. To ...


7

You didn't say what you had tried, but with xelatex, this works \documentclass{article} \begin{document} Muḥammad ibn Mūsā al-Khwārizmī \end{document}


7

Don't use the xltxtra package, it is outdated (and gives your error). The space is a bug which has been already reported: https://github.com/reutenauer/polyglossia/issues/459 Until polyglossia is updated you can hide the space like this: \documentclass{book} \usepackage{fontspec} \usepackage{polyglossia} \setdefaultlanguage[variant=usmax]{english}% \...


6

Without a minimal example, I don’t know why you’re experiencing difficulties. But with an up-to-date TeX Live, this example (adapted from the minimal example in the arabxetex documentation) works. Perhaps the voc or fullvoc options are what you need? If not, perhaps the font you’re using isn’t up to the task. \documentclass[12pt]{article} \usepackage[utf]...


6

The answer might be too late but for anyone else who might have the same problem.. You need just to put tikz package before setting languages: \usepackage{setspace} \usepackage{fontspec} \usepackage{polyglossia} \usepackage{tikz} \usepackage{etoolbox} \setmainlanguage{arabic} \setotherlanguage{english} \newfontfamily\arabicfont[Script=Arabic,Scale=1.1]{...


6

One of solution is this. first define your listingstyle like this before \begin{document} If your main Language is persian then: \documentclass[11pt]{book} \usepackage{listings} \usepackage{xepersian} \lstdefinestyle{MyXML}{ language=XML, escapeinside={\%*}{*)}, morekeywords={encoding, xs:schema,xs:element,xs:complexType,xs:...


6

You must change format of section , subsection , subsubsection in toc using the command \setRTL from bidi pachage This can be done with : \setbeamertemplate{section in toc}{% \setRTL \myenum{\inserttocsectionnumber} \inserttocsection\par } \setbeamertemplate{subsection in toc}{% \setRTL \myitem \inserttocsubsection\par% } \setbeamertemplate{...


6

I'd say that adding \usepackage{newunicodechar} and \newunicodechar{ً}{\lowan} should do. \documentclass{article} \usepackage{polyglossia} \usepackage{newunicodechar} \newfontfamily\arabicfont[Script=Arabic ,Scale=MatchUppercase ,RawFeature={+ss01,+ss02} % ss01 = mode dot in baa down when clashing. % ss02 = ...


6

I don't know arabic, so I don't even know what the correct quotes are in this case. But what I can tell you is that the command \DeclareQuoteOption can be used only in a configuration file csquotes.cfg. This file can contain new options which can then be used at loading time by the csquotes package. In fact it is loaded by csquotes before processing its ...


6

As I see now, my answer is a little bit off from the originally intended question. Nevertheless, I find the idea of the inverted colors nice and if you don't mind I keep the answer for a future reader who looks for something like this. I had to mock up the missing R3 picture for the background. So, you will have to adapt the following length settings to ...


6

The problem is resolved by adding \bodydir TRT to the definition of the syriac environment. So, the correct definition is \newenvironment{syriac} {\par% Syriac paragraph \pardir TRT\textdir TRT\bodydir TRT\syriacfont} {\par} There is hardly any documentation available of the LuaTeX text direction infrastructure.


Only top voted, non community-wiki answers of a minimum length are eligible