
Ich schreibe ein hebräisches (RTL) Dokument mit Gleichungen und kompiliere es mit xelatex. Die Gleichungsnummern sind falsch und ich habe festgestellt, dass das Platzieren eines \LTR
Tags vor der Gleichung das Problem behebt. Ich habe eine Umgebung erstellt, die damit funktioniert, aber etwas stimmt nicht. Wenn ich beispielsweise versuche, dies zu kompilieren:
\documentclass[11pt]{article}
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{hyperref}
\usepackage{xltxtra}
\usepackage{bidi}
\setmainfont{Arial}
\tolerance=1000
\providecommand{\alert}[1]{\textbf{#1}}
\newenvironment{ltreq}[1]{
\LTR
\begin{equation}
{1}}
{\end{equation}
\RTL}
\begin{document}
\RTL
\begin{ltreq}
\left . \frac{\partial f}{\partial y} \eta \right |_{x_1}^{x_2} -\int_{x_1}^{x_2} \frac{\partial f}{\partial y'} \eta dx
\end{ltreq}
\RTL
\end{document}
Ich erhalte diesen Fehler:
l.22 ...frac{\partial f}{\partial y} \eta \right |
_{x_1}^{x_2} -\int_{x_1}^{...
Da war ich wohl etwas zu naiv. Wie kann ich das erreichen?
Antwort1
Sie haben angegeben, dass die Umgebung ein Argument hat, sodass sie am Anfang der Gleichung ltreq
das schluckt . Wenn Sie das aus der Definition entfernen, funktioniert es:\left
[1]
\documentclass[11pt]{article}
\usepackage{amssymb}
\usepackage{amsmath}
\usepackage{hyperref}
\usepackage{xltxtra}
\usepackage{bidi}
\setmainfont{Arial}
\tolerance=1000
\providecommand{\alert}[1]{\textbf{#1}}
\newenvironment{ltreq}{
\LTR
\begin{equation}}
{\end{equation}
\RTL}
\begin{document}
\RTL
\begin{ltreq}
\left . \frac{\partial f}{\partial y} \eta \right |_{x_1}^{x_2} -\int_{x_1}^{x_2} \frac{\partial f}{\partial y'} \eta dx
\end{ltreq}
\RTL
\end{document}