LuaTeX 및 em 대시

LuaTeX 및 em 대시

LuaLaTeX는 삼중 대시 주위에 공간이 없으면 엠 대시를 삽입하지 않습니다. 유니코드 em 대시를 사용하거나 매크로 를 명시적으로 사용할 때 제대로 작동합니다 \textemdash.

MWE는 다음과 같습니다.

\documentclass{article}

\begin{document}

\begin{enumerate}
  \item en--dash
  \item em---dash
  \item em --- dash space
\end{enumerate}
\begin{enumerate}
  \item en–dash unicode
  \item em—dash unicode
  \item em — dash space unicode
\end{enumerate}
\begin{enumerate}
  \item en\textendash{}dash macro
  \item em\textemdash{}dash macro
  \item em \textemdash{} dash space macro
\end{enumerate}

\end{document}

다음을 생성합니다.

엠 대시가 없어

LuaTeX 버전 1.07.0(TeX Live 2018)을 사용하여 컴파일됨

질문은 ~이야:

주변 공백이 없는 전각 대시 합자가 PDF 출력에서 ​​전각 대시로 렌더링되지 않는 이유를 알고 싶습니다. 나에게는 버그처럼 보입니다. 어떻게 고칠 수 있나요?

답변1

\automatichyphenmode=1전문에 다음을 추가할 수 있습니다 .

\documentclass{article}
\automatichyphenmode=1
\begin{document}

\begin{enumerate}
  \item en--dash
  \item em---dash
  \item em --- dash space
\end{enumerate}
\begin{enumerate}
  \item en–dash unicode
  \item em—dash unicode
  \item em — dash space unicode
\end{enumerate}
\begin{enumerate}
  \item en\textendash{}dash macro
  \item em\textemdash{}dash macro
  \item em \textemdash{} dash space macro
\end{enumerate}

\end{document}

코드 출력

답변2

2019년 3월 업데이트

이 버그는 다음 luaotfload 업데이트에서 해결될 예정입니다.

================================================= ============

Alan의 답변을 조금 확장하려면 다음을 수행하십시오.

이는 분명히 컨텍스트에서 가져온 글꼴 로더의 버그입니다(설정한 경우 컨텍스트에서도 동일하게 표시됨 \automatichyphenmode=0). 글꼴이 다음으로 렌더링되는 경우에만 발생합니다 mode=node.

\documentclass{article}

\begin{document}
\font\test={file:lmroman10-regular.otf:mode=node;+tlig}
\test

A---B

\font\test={file:lmroman10-regular.otf:mode=base;+tlig}
\test

A---B
\end{document}

여기에 이미지 설명을 입력하세요

문제의 원인은 \automatichyphenmode=0luatex가 처음에 마지막 하이픈을 임의의 문자로 변환하여 줄 바꿈을 허용한다는 것입니다.

A---B  ---> A--\discretionary{-}{}{-}B

라인이 설정된 후에는 다시 로 변환되어야 하며 ---이 단계는 실패한 것 같습니다.

문제가 보고되었으나 수정될지는 불분명합니다.

\automatichyphenmode=1많은 경우에 하이픈을 임의의 단어로 변환하지 않음으로써 문제를 피합니다. 따라서 다음과 같은 경우에 줄 바꿈이 억제된다는 사실을 알아야 합니다.

\documentclass[parskip=half-]{scrartcl}
\begin{document}


\parbox[t]{1pt}{%
\textbf{0}

\automatichyphenmode=0
A-B

A--B

A---B

-begin

A!-B}
\hspace{2cm}
\parbox[t]{1pt}{\automatichyphenmode=1
\textbf{1}

A-B

A--B

A---B

-begin

A!-B}

\end{document}

여기에 이미지 설명을 입력하세요

관련 정보