字母間距對齊

字母間距對齊

所以我正在寫一份作業,要我列出字母的排列方式。

我目前有這樣的東西

如何使第二行中的每個字母位於第一行字母的正下方?

答案1

使用等寬字體,將小寫和大寫字母設定為相同的寬度:

在此輸入影像描述

\documentclass{article}

\begin{document}

\noindent
{\ttfamily
  a b c d e \\
  E D C B A
}

\end{document}

或者,使用 排列字母tabular

在此輸入影像描述

\documentclass{article}

\begin{document}

\noindent
{\ttfamily\begin{tabular}{ *{5}{c} }
  a & b & c & d & e \\
  E & D & C & B & A
\end{tabular}}

\end{document}

後者方法適用於非等寬字體,您可以調整\tabcolsep以適當地間距字母。

相關內容