微型打字弄亂了桌子

微型打字弄亂了桌子

我正在使用 longtable 來排版詞彙表。

啟用微類型後,由於單元格中換行文字的第一行向右移動,它開始看起來錯誤。微量元素:

\documentclass{article}
\usepackage{array}
\usepackage{microtype}

\begin{document}

\begin{tabular}{@{}
    >{\raggedleft\arraybackslash}p{3cm}
    >{\raggedright\arraybackslash}p{6cm}
    @{}}
    MWE: & \emph{Why} does microtype break this table? \emph{Why} does microtype break this table? \emph{Why} does microtype break this table? \\
\end{tabular}

\end{document}

結果如下:

上述程式碼的結果。壞的。

如果我在\usepackage{microtype}上面註解掉,看起來不錯:

在此輸入影像描述

沒有 \emph 也會發生這種情況,我剛剛測試了各種文本,這個例子使這個問題特別明顯。

這是來自 texlive 2024.2 的 pdflatex

為什麼會發生這種情況以及如何解決它?

編輯:我現在正在透過禁用表的微類型來解決這個問題這個答案

答案1

微型無法在第一行應用左側突出。但你可以手動添加它:

\documentclass{article}
\usepackage{array}
\usepackage{microtype}

\begin{document}

\begin{tabular}{@{}
    >{\raggedleft\arraybackslash}p{3cm}
    >{\raggedright\arraybackslash}p{6cm}
    @{}}
    MWE: & \leftprotrusion\emph{Why} does microtype break this table? \emph{Why} does microtype break this table? \emph{Why} does microtype break this table? \\
\end{tabular}

\end{document}

在此輸入影像描述

相關內容