[XeTeX] bidi-problem --> problems with lines not starting in position 1 (even comments)

Christian Boitet Christian.Boitet at imag.fr
Fri Nov 18 22:57:42 CET 2016

Hi Johann,						18/11/16

I tried with the latest XeLaTeX, using the latest TeXShop and MacTeX distribution under Mac OS El Capitan.
I put some comments in a file called "[XeTeX] bibi-problem.tex" derived from your e-mail.

At the beginning, I could not compile, event when replacing the font "Linux Libertine O" (unknown on Mac) by "Times Roman"

Then I got strange error messages saying "Missing \begin{document}"

I  then put a "%" at the beginning of each white line (before the line "\begin{document}")
TeX still complained: "Missing \begin{document}"
on the \ DeclareGraphicsExtensions lines below:


until I pushed each of the \DeclareGraphicsExtensions lines to the 1st position:

%    \DeclareGraphicsExtensions{.png,.pdf,.jpeg,.jpg,.mps} 
%     \DeclareGraphicsExtensions{.eps,.ps}

Then it compiled, and produced (I hope) what you expected.

Note that I still get an error (but not the same as you) if I enable the bidi package, hence I left the line commented: 

%\usepackage{bidi}			%% with XeLaTeX, 

All in an attached archive.

Maybe you are using some "fragile" constructs (see the problems with white lines), or maybe the packages you use are not all compatible or not all in their last version.
I can't say anything more as this "bidi" package is new to me. 
Dick Koch is a specialist and might give some light on this mystery.



> Le 18 nov. 2016 à 10:49, Johann Spies <johann.spies at alterit.co.za> a écrit :
> I am working on a document in which I keep notes of my readings. It is a
> long standing document on which I have been working for the past 20
> years.

%!TEX encoding = UTF-8 Unicode
% Ch.Boitet (Grenoble)
% Some trials to debug Johann Spies file 
% This file is: [XeTeX] bibi-problem.tex
% I had to download hevea.sty.

%De: Johann Spies <johann.spies at alterit.co.za>
%Objet: [XeTeX] bidi-problem
%Date: 18 novembre 2016 à 10:49:08 UTC+1
%À: <xetex at tug.org>
%Répondre à: johann.spies at alterit.co.za, "XeTeX \(Unicode-based TeX\) discussion." <xetex at tug.org>
%I am working on a document in which I keep notes of my readings. It is a
%long standing document on which I have been working for the past 20
%Some recent update caused this problem:
%Location on CTAN: /macros/xetex/latex/bidi
%* Issue tracker: https://github.com/vafa/bidi/issues
%* Support: persian-tex at tug.org
%! LaTeX Error: Command \XeTeX already defined.
%              Or name \end... illegal, see p.192 of the manual.
%See the LaTeX manual or LaTeX Companion for explanation.
%Type  H <return>  for immediate help.
%I have removed all the includes and some other stuff to be able to show
%the file to you.
%When I remove the useage of the bidi package, the compilation ends with:
%! Missing number, treated as zero.
%<to be read again> 
%                  \protect 
%l.104 \begin{document}
%Last time (a few weeks ago) it compiled the more than 500 pages without
%a problem.
%I need the bidi package because the document include some Hebrew texts
%What is going on here?
%Is there a new problem with /usr/share/texmf/tex/latex/tipa/t3cmr.fd
%The file:

\usepackage{fontspec} % Gebruik met xelatex
\usepackage{xltxtra,graphicx} % Gebruik met xelatex

%\setmainfont[Ligatures=TeX]{Linux Libertine O}		% TeX complains about white spaces (font not available under Mac OS)
%\setmainfont[Ligatures=TeX]{"Linux Libertine O"}		% TeX said here "Missing \begin{document}"
\setmainfont[Ligatures=TeX]{Times Roman}			% TeX did not complain here with this font

%\begin{document}				% tried here because TeX said here "Missing \begin{document} -- failed"
\mdfdefinestyle{myFigureBoxStyle}{backgroundcolor=yellow!10,, roundcorner=25pt,tikzsetting={draw=blue, line width=1pt}}%
\newcommand\fs at myRoundBox{\def\@fs at cfont{\bfseries}\let\@fs at capt\floatc at plain
 \def\@fs at pre{\begin{mdframed}[style=myFigureBoxStyle]}%
 \def\@fs at mid{\vspace{\abovecaptionskip}}%
 \def\@fs at post{\end{mdframed}}\let\@fs at iftopcapt\iffalse}
\makeindex[intoc] %
\setlength{\parindent}{0pt} %Maak dat die paragrawe links begin
\setlength{\parskip}{1ex plus 0.5ex minus 0.2ex} %bepaal oop lyn tussen
%                                                %paragrawe
\setlength{\parfillskip}{30pt plus 1 fil}
\title{Aanhalings en verwysings}% Declares the document's title.
\author{J.H. Spies}% Declares the author's name.
\date{}% Deleting this command produces today's date.
\listfiles % lys al die lêers wat gebruik word in die .log-ler.
\lfoot{\tiny \jobname}
\renewcommand{\headrulewidth} {0pt}
\renewcommand{\p at enumii}{\theenumi.} %Companion bladsy 56,57
\renewcommand{\p at enumiii}{\theenumi.\theenumii.}
\renewcommand{\p at enumiv}{\theenumi.\theenumii.\theenumiii.}
 %    \DeclareGraphicsExtensions{.png,.pdf,.jpeg,.jpg,.mps} 
%     \DeclareGraphicsExtensions{.eps,.ps}
%\usepackage{bidi}			%% with XeLaTeX, 
\newcommand{\lk}[3]{\hspace{0.#1\linewidth}\parbox{0.#2\linewidth}{\raggedright #3}}
\lfoot{\tiny \jobname}
\chapter{Algemene wyshede}

``Alleen 'n teologie wat uit die openbaring\index{openbaring} vertrek,
kan bevrydend wees.  Elke vorm van subjektivisme\index{subjektivisme}
voer terug na 'n vorm van bedompigheid, omdat dit die mens werp op
homself en sy eie ervaring, in plaas daarvan dat dit hom op Christus
werp'' \cite[167,168]{jonker_gees_1981}.


%%% Local Variables:
%%% coding: utf-8
%%% mode: latex
%%% TeX-engine: xelatex
%%% TeX-master: t
%%% End:

%J.H. Spies - Tel. 021-982 2694 / 082 782 0336 / 021-808 4699(w)  
%            Posbus 4668, Tygervallei 7536
%    "For by grace are ye saved through faith; and that not
%     of yourselves: it is the gift of God: Not of works, 
%     lest any man should boast."    Ephesians 2:8,9 
%Subscriptions, Archive, and List information, etc.:
% http://tug.org/mailman/listinfo/xetex

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://tug.org/pipermail/xetex/attachments/20161118/14d81333/attachment-0002.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: [XeTeX] bidi-problem.zip
Type: application/zip
Size: 56907 bytes
Desc: not available
URL: <http://tug.org/pipermail/xetex/attachments/20161118/14d81333/attachment-0001.zip>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://tug.org/pipermail/xetex/attachments/20161118/14d81333/attachment-0003.html>

More information about the XeTeX mailing list