2

I am using TeXworks (Windows 10, MiKTeX), compiling (XeLatex) a document that contains several languages, but attached is a simplified MWE which contains only Hebrew and English. Inside the Hebrew environment, I would like to be able to control most of the properties of the label, primarily its position and style: altering the position from the typical right to the left, and controlling style through independent control of size, a different font, boldface, color, etc. I followed the comments and solutions provided in the forum, but the position of the label does not change. Here is my code:

\documentclass[12pt]{article}
\usepackage[a4paper,vmargin=2cm,hmargin=2cm,showframe=false]{geometry}
\usepackage{fontspec}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{polyglossia}
\usepackage{bidi}

\makeatletter\chardef\l@hebrew=255 \makeatother %removes the Hebrew hyphenation problem/warning

\setmainlanguage{english}

\setotherlanguages{hebrew} 

\newfontfamily\hebrewfont[Mapping=tex-text,Script=Hebrew,Scale=1,FakeBold=0]{Taamey Frank CLM}


\title{Hebrew and English Math AND Text in \LaTeX}

\begin{document}
\maketitle
This is a mainly English document which contains other languages.

\section{Hebrew and English}
Here's some Hebrew and English text:

\begin{hebrew}
שיוויון פשוט:\newline

\begingroup
\makeatletter
\input{leqno.clo}
\makeatother
\begin{equation}
\label{1}
a=b
\end{equation}
\endgroup

\end{hebrew}
\end{document} 

Any help would be greatly appreciated!

1

If you always want numbers on the left, load bidi with the leqno option. Otherwise you can change it whenever you want by setting \veqno be equal to \leqno.

You can change the equation number style by redefining \theequation. (See also the amsmath \numberwithin macro.)

You can change the format of the tag by redefining \tagform@. Note that bidi also redefines this in amsmath-xetex-bidi.def.

Silly MWE

\documentclass{article}
\usepackage{amsmath}
\usepackage{xcolor}
\usepackage{polyglossia}
\setmainlanguage{english}
\setotherlanguages{hebrew} 
\newfontfamily\hebrewfont[Script=Hebrew]{SBL BibLit}
\begin{document}
\section{Hebrew and English}
Here's some Hebrew and English text:

\begin{hebrew}
שיוויון פשוט:

\begingroup
\renewcommand{\theequation}{\emph{\thesection}\textcolor{green}{.}\textbf{\arabic{equation}}}
\makeatletter
\def\tagform@#1{\maketag@@@{\Large\if@nonlatin\beginR\fi\textcolor{blue}{+}\kern\z@\ignorespaces#1\unskip\@@italiccorr\textcolor{red}{+}\if@nonlatin\endR\fi}}
\makeatother
\let\veqno\leqno
\begin{equation}
\label{1}
a=b
\end{equation}
\endgroup

\end{hebrew}

See equation \ref{1}.
\end{document} 

enter image description here

  • Thank you so much! A very simple and clear solution that actually works! Much obliged, Gideon – Gideon Feb 1 '18 at 14:13
  • @Gideon you should accept answers that you think fit best to your questions. This way, other users will know that this is a suitable answer to your question. :) – Jasper Habicht Feb 5 '18 at 19:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.