6

I'm trying to create a table of contents for a Hebrew document (specifically, with Hebrew section and subsection names) I'm writing in LyX. When I try to compile my file I get a lot of error messages in form of

...C {\hebvav }\IeC {\hebtav }}{\@@number {2}} Your command was ignored. Type I <command> <return> to replace it with another command, or <return> to continue without it.

I'm using systems encoding (which did no problems without the TOC). How can I get rid of these annoying problems?

EDIT: Here is example of the code (in this specific there are two of this type but in the full there are around twenty):

% Preview source code

%% LyX 2.0.6 created this file.  For more info, see http://www.lyx.org/.
%% Do not edit unless you really know what you are doing.
\documentclass[hebrew,english]{article}
\usepackage{amstext}
\usepackage{amssymb}
\usepackage{fontspec}
\PassOptionsToPackage{normalem}{ulem}
\usepackage{ulem}

\makeatletter
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands.
\usepackage{color} 
\definecolor{Dark}{gray}{.2} 
\definecolor{Medium}{gray}{.6} 
\definecolor{Light}{gray}{.8} 
\newcommand*{\plogo}{\fbox{$\mathcal{PL}$}}
\date{ }
\everymath{\displaystyle}

\makeatother

\begin{document}
\thispagestyle{empty}
\begingroup
\centering
\vspace*{0.08\textheight}
{\Huge\bfseries Assisting Material }\\[\baselineskip]
{\scshape Course}\\[\baselineskip]
{\scshape Lecturer:}\\[\baselineskip] 
{\large\scshape Prof. }\par
\vfill  {\plogo}\\[0.5\baselineskip]
{\scshape Concluded by Coargo,2013}\par 
\vspace*{0.16\textheight}  
\endgroup


\tableofcontents{}

\selectlanguage{hebrew}%

\title{נוסחאון }

\maketitle

\part{הסתברות}


\section*{{\beginL 1\endL}. הסתברות בדידה - \L{$\text{Discrete Probability}$}}


\section*{{\beginL 2\endL}. משתנים מקרים בדידים}


\paragraph*{הגדרות ומונחים:}
\begin{itemize}
\item מ\char`\"{}מ \L{$X:\Omega\to\mathbb{R}$}
\item הסתברות למאורע \L{$P(X=x)=P(A_{x})={\displaystyle \sum_{\omega:X(\omega)=x}P(\omega)}$}. 
\end{itemize}

\paragraph*{משפטים והערות}
\begin{enumerate}
\item \L{$Var(X)=\mathbb{E[}[X^{2}]-\mathbb{E}[X]^{2}$}. 
\item \L{$\text{Law of Repeated Expectation/Partition Theorm}$}: \L{$\mathbb{E}[\mathbb{E}[X\mid Y]]=\mathbb{E}[X]$}. 
\end{enumerate}

\section*{{\beginL 3\endL}.מרחבי הסתברות כללים ומשתנים מקרים רציפים}


\paragraph*{מרחבי הסתברות כללים}

בנוסחאון זה בחר המחבר לא להכניס דברים יסודיים עליהם היה סבור לא ינתנו
שאלות במבחן, דוגמת הגדרת מרחב מדגם,מידת הסתברות, אלגברת בורל וכד'.
למעוניין בהרחבת אופקים הנושא נידון בהרחבה יתרה בקלסר. 


\paragraph*{משתנה מקרי רציף}


\subparagraph*{\uline{הגדרות:}}
\begin{itemize}
\item משתנה מקרי רציף הוא \L{$X:\Omega\to\mathbb{R}$}כך ש\L{$\forall x\in\mathbb{R}:X^{-1}((-\infty,x])\in\mathcal{F}$}. 
\end{itemize}

\subparagraph*{\uline{משפטים והערות}}


\paragraph*{תכונות ה\L{$cdf,pdf$}}
\begin{enumerate}
\item תכונות של \L{$F(x)$}:

\begin{enumerate}
\item \L{$x\ge y\Rightarrow f(x)\ge f(y)$}.
\item \L{$ $}\L{${\displaystyle \lim_{x\to-\infty}F(x)=0}$}
\item \L{$ $}\L{${\displaystyle \lim_{x\to\infty}F(x)=1}$}
\item \L{$F$}רציפה מימין אך איננה רציפה משמאל )ואם כן אזי \L{$P(X=x)=0$}(
\end{enumerate}
\selectlanguage{english}%
\item \end{enumerate}

\end{document}

EDIT 2: and the lyx file itself:

6
  • You posted LaTeX code. If you want a purely LaTeX answer, that is the right thing to do. If you are looking for a LyX answer, you should post a .lyx file (in addition).
    – scottkosty
    Commented Sep 22, 2013 at 22:38
  • In your exported .tex file, does replacing \usepackage{babel} with \usepackage[hebrew]{babel} solve the problem? I get the following pdf: dropbox.com/s/f3hj8m6079dq7s5/mckup.pdf
    – scottkosty
    Commented Sep 25, 2013 at 15:18
  • Really strange... In my files I found this line doesn't exist. I tried including in the preamble manually in LyX but it doesn't solve the problem. Commented Sep 25, 2013 at 16:04
  • Is the pdf correct? I unfortunately cannot read Hebrew. If it is correct, I will post the .tex code and LyX solution.
    – scottkosty
    Commented Sep 25, 2013 at 18:44
  • Almost. The toc is empty even though when I double clicked the TOC in LyX, it seemed like I do have chapters and sub-chapters. Thanks Commented Sep 25, 2013 at 18:49

1 Answer 1

2
+50

The following .tex code compiles to pdf:

%% LyX 2.1.0dev created this file.  For more info, see http://www.lyx.org/.
%% Do not edit unless you really know what you are doing.
\documentclass[hebrew,english]{article}
\usepackage[T1]{fontenc}
\usepackage[cp1255,latin9]{inputenc}
\usepackage{amstext}
\usepackage{amssymb}
\PassOptionsToPackage{normalem}{ulem}
\usepackage{ulem}

\makeatletter
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands.
\usepackage{color} 
\definecolor{Dark}{gray}{.2} 
\definecolor{Medium}{gray}{.6} 
\definecolor{Light}{gray}{.8} 
\newcommand*{\plogo}{\fbox{$\mathcal{PL}$}}
\date{ }
\everymath{\displaystyle}

\makeatother

\usepackage[hebrew]{babel}
\begin{document}
\thispagestyle{empty}
\begingroup
\centering
\vspace*{0.08\textheight}
{\Huge\bfseries Assisting Material }\\[\baselineskip]
{\scshape Course}\\[\baselineskip]
{\scshape Lecturer:}\\[\baselineskip] 
{\large\scshape Prof. }\par
\vfill  {\plogo}\\[0.5\baselineskip]
{\scshape Concluded by Coargo,2013}\par 
\vspace*{0.16\textheight}  
\endgroup


\tableofcontents{}

\selectlanguage{hebrew}%
\inputencoding{cp1255}%

\title{ðåñçàåï }

\maketitle

\part{äñúáøåú}


\section*{{\beginL 1\endL}. äñúáøåú áãéãä - \L{$\text{Discrete Probability}$}}


\section*{{\beginL 2\endL}. îùúðéí î÷øéí áãéãéí}


\paragraph*{äâãøåú åîåðçéí:}
\begin{itemize}
\item î\char`\"{}î \L{$X:\Omega\to\mathbb{R}$}
\item äñúáøåú ìîàåøò \L{$P(X=x)=P(A_{x})={\displaystyle \sum_{\omega:X(\omega)=x}P(\omega)}$}. 
\end{itemize}

\paragraph*{îùôèéí åäòøåú}
\begin{enumerate}
\item \L{$Var(X)=\mathbb{E[}[X^{2}]-\mathbb{E}[X]^{2}$}. 
\item \L{$\text{Law of Repeated Expectation/Partition Theorm}$}: \L{$\mathbb{E}[\mathbb{E}[X\mid Y]]=\mathbb{E}[X]$}. 
\end{enumerate}

\section*{{\beginL 3\endL}.îøçáé äñúáøåú ëììéí åîùúðéí î÷øéí øöéôéí}


\paragraph*{îøçáé äñúáøåú ëììéí}

áðåñçàåï æä áçø äîçáø ìà ìäëðéñ ãáøéí éñåãééí òìéäí äéä ñáåø ìà éðúðå
ùàìåú áîáçï, ãåâîú äâãøú îøçá îãâí,îéãú äñúáøåú, àìâáøú áåøì åëã'.
ìîòåðééï áäøçáú àåô÷éí äðåùà ðéãåï áäøçáä éúøä á÷ìñø. 


\paragraph*{îùúðä î÷øé øöéó}


\subparagraph*{\uline{äâãøåú:}}
\begin{itemize}
\item îùúðä î÷øé øöéó äåà \L{$X:\Omega\to\mathbb{R}$}ëê ù\L{$\forall x\in\mathbb{R}:X^{-1}((-\infty,x])\in\mathcal{F}$}. 
\end{itemize}

\subparagraph*{\uline{îùôèéí åäòøåú}}


\paragraph*{úëåðåú ä\L{$cdf,pdf$}}
\begin{enumerate}
\item úëåðåú ùì \L{$F(x)$}:

\begin{enumerate}
\item \L{$x\ge y\Rightarrow f(x)\ge f(y)$}.
\item \L{$ $}\inputencoding{latin9}\L{${\displaystyle \lim_{x\to-\infty}F(x)=0}$}
\item \inputencoding{cp1255}\L{$ $}\inputencoding{latin9}\L{${\displaystyle \lim_{x\to\infty}F(x)=1}$}
\item \inputencoding{cp1255}\L{$F$}øöéôä îéîéï àê àéððä øöéôä îùîàì )åàí
ëï àæé \L{$P(X=x)=0$}(
\end{enumerate}
\selectlanguage{english}%
\item \end{enumerate}

\end{document}

As far as the LyX solution, all I had to do was export to LaTeX (pdflatex) and change \usepackage{babel} to \usepackage[hebrew]{babel}. the reason our exported .tex files were different is because of our versions. I'm using LyX 2.1 beta 1. You can download it here: ftp://ftp.lyx.org/pub/lyx/devel/lyx-2.1/lyx-2.1.0beta1

If you happen to use Ubuntu, installing 2.1.0dev is even easier. See: http://wiki.lyx.org/LyX/LyXOnUbuntu#toc3

EDIT: here is a LyX solution that works for me. We have different operating systems and different TeX distributions (e.g. different versions of the babel package) so it's possible it will not work for you.

  1. Go to Document > Settings > Preamble and add the following:

    \usepackage[english,hebrew]{babel}

  2. Go to Document > Settings > Local Layout and put the following:

    Provides babel 1

  3. Click on "Validate" and then on "OK".

Your LyX file should compile.

29
  • Seems really strange but I totally forgot how to switch between tex and lyx (I know i posted latex code but can't remember how I did so). How can I do it? side-question: why do you use lyx 2.1dev? which advantage it has? Commented Sep 26, 2013 at 0:33
  • @CoarguAliquis File > Export. I use LyX 2.1dev mainly because I'm a LyX developer. Besides many bug fixes, there are many new features: wiki.lyx.org/LyX/NewInLyX21
    – scottkosty
    Commented Sep 26, 2013 at 1:18
  • thanks but how can I add \usepackage[hebrew]{babel} to my original lyx (from which I took the mock up)? Commented Sep 26, 2013 at 1:31
  • @CoarguAliquis I did not make any other edits to the original .lyx file that you posted. All I did was export it, make the change, and run pdflatex.
    – scottkosty
    Commented Sep 26, 2013 at 1:51
  • But I can't export lyx file if i have errors in it,can I? Commented Sep 26, 2013 at 2:22

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .