描述在框架内缩进过多(希伯来语)

描述在框架内缩进过多(希伯来语)

我正在使用 lyx 用希伯来语写讲义。我使用该framed包将我的定理放在一个漂亮的灰色框中。一切似乎都运行良好,直到我尝试将描述列表放入其中时,我注意到一种奇怪的行为。

它看起来是这样的: 在此处输入图片描述

我尝试为您创建英语版 MWE,但没有出现这样的问题,因此显然它与希伯来语有关。相比之下,它看起来如下: 在此处输入图片描述

两者在文档序言中使用完全相同的代码:

\usepackage{xcolor}
\usepackage{framed}
\usepackage{amsthm}
\definecolor{shadecolor}{rgb}{.8, .8, .8}
\newenvironment{myframe}{
\def\FrameCommand{\colorbox{shadecolor}}%
\MakeFramed {\advance\hsize-\width }}
{\endMakeFramed}

\newtheorem{newThm}[thm]{\bfseries Theorem}
\renewenvironment{thm}
{\begin{myframe}\begin{newThm}\begin{normalfont}}
{\end{normalfont}\end{newThm}\end{myframe}}

所以我不知道如何定位问题。如果有人有任何想法,我很乐意听听。另外,如果这个问题写得不正确,我很抱歉,我是新来的……谢谢!

编辑:这是我的 MWE 的完整 Latex 代码,由 Lyx 生成。很抱歉,它太长了,这是我能做的最好的了!

\documentclass[a4paper,english,hebrew]{article}
\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{fontspec}
\setmainfont[Mapping=tex-text]{David}
\setsansfont[Mapping=tex-text]{Arial}
\setmonofont{Miriam Fixed}
\usepackage{fancyhdr}
\pagestyle{fancy}
\setlength{\parskip}{\medskipamount}
\setlength{\parindent}{0pt}

\makeatletter

% LyX specific LaTeX commands.
\pdfpageheight\paperheight
\pdfpagewidth\paperwidth


% Textclass specific LaTeX commands.
\theoremstyle{plain}
\newtheorem{thm}{\protect\theoremname}
\@ifundefined{date}{}{\date{}}

% This is the preamble!
\usepackage{xcolor}
\usepackage{framed}
\usepackage{amsthm}
\definecolor{shadecolor}{rgb}{.8, .8, .8}
\newenvironment{myframe}{
\def\FrameCommand{\colorbox{shadecolor}}%
\MakeFramed {\advance\hsize-\width }}
{\endMakeFramed}

\newtheorem{newThm}[thm]{\bfseries Theorem}
\renewenvironment{thm}
{\begin{myframe}\begin{newThm}\begin{normalfont}}
   {\end{normalfont}\end{newThm}\end{myframe}}
%This is the end of the preamble!

\AtBeginDocument{
  \def\labelitemi{\normalsize\(\bullet\)}
}

\makeatother

\usepackage{polyglossia}
\setdefaultlanguage{hebrew}
\setotherlanguage{english}
\addto\captionsenglish{\renewcommand{\theoremname}{Theorem}}
\addto\captionshebrew{\renewcommand{\theoremname}{משפט}}
\providecommand{\theoremname}{משפט}

\begin{document}
\begin{thm}
לורם איפסום:
\begin{enumerate}
\item דולור סיט אמט.
\item דולור סיט אמט.
\end{enumerate}
\end{thm}

\begin{thm}
לורם איפסום:
\begin{description}
\item [{דולור.}] סיט אמט.
\item [{דולור.}] סיט אמט.
\end{description}
\end{thm}


\end{document}

答案1

坏消息是我无法重现您的错误。好消息是,我没有重现您的错误。如果没有 MWE,我无法告诉您为什么会出现该错误,但这里有一个可以运行的 MWE(在 TeX Live 2020 中使用 LuaLaTeX)。

\documentclass[a4paper]{article}
\tracinglostchars=2
\usepackage{amsmath, amsthm}
\usepackage[bidi=basic, layout=sectioning.tabular, nil]{babel}
\usepackage{xcolor} % For \colorbox
\usepackage{framed} % For \MakeFramed
\usepackage{unicode-math}
\usepackage[english,hebrew]{translator} % For \providetranslation, \trnaslate

\defaultfontfeatures{ Scale=MatchUppercase, Ligatures=TeX, Renderer=HarfBuzz }

% The Culmus fonts are free for download at
% https://sourceforge.net/projects/culmus/
\defaultfontfeatures[DavidCLM]{
   UprightFont = *-Medium,
   ItalicFont = *-MediumItalic,
   BoldFont = *-Bold,
   BoldItalicFont = *-BoldItalic,
   Extension = .otf }

\defaultfontfeatures[MiriamCLM]{
  UprightFont = *-Book,
  BoldFont = *-Bold,
  Extension = .ttf }

\babelprovide[import]{english}
\babelfont{rm}
          [Scale=1.0, Language=Default]{NewComputerModernBook}
\babelfont{sf}
          [Language=Default]{NewComputerModernSansBook}
\babelfont{tt}
          [Language=Default]{NewComputerModernMonoBook}

\babelprovide[import, main]{hebrew}
\babelfont[hebrew]{rm}
          [Language=Default]{DavidCLM}
\babelfont[hebrew]{sf}
          [Language=Default]{MiriamCLM}
\babelfont[hebrew]{tt}
          [Language=Default]{MiriamMonoCLM}

\setmathfont{NewCMMath-Book}
\setmathrm{NewComputerModernBook}
\setmathsf{NewComputerModernSansBook}
\setmathtt{NewComputerModernMonoBook}

\providetranslation[to=Hebrew]{Theorem}{משפט}

\definecolor{shadecolor}{rgb}{.8, .8, .8}
\newenvironment{myframe}{
\def\FrameCommand{\colorbox{shadecolor}}%
\MakeFramed {\advance\hsize-\width }}
{\endMakeFramed}

\newcounter{thm}
\newtheorem{newThm}[thm]{\bfseries \translate{Theorem}}
\newenvironment{thm}
{\begin{myframe}\begin{newThm}\begin{normalfont}}
{\end{normalfont}\end{newThm}\end{myframe}}

\begin{document}
\begin{thm}{לורם איפסום}
\begin{description}
\item[לורם]
איפסום

\item[דולור]
טיט אמט
\end{description}
\end{thm}

\begin{otherlanguage}{english}
\begin{thm}{Lorem Ipsum}
\begin{description}
\item[Lorem]
Ipsum

\item[Dolor]
Sit amet
\end{description}
\end{thm}
\end{otherlanguage}

\end{document}

David CLM / 新电脑现代样本

相关内容