将垂直对齐的单词排列成段落

将垂直对齐的单词排列成段落

我正在编写一篇拉丁文文本,需要在每个单词下面添加发音指南。实际单词的字体大小要大于其下方的指南,这样指南的长度就不会超过其上方的单词。我想以这种方式构建一个完整的段落,将每个单词与其发音相匹配。我计划构建一个,\newcommand以便我可以输入两段文本,一段是拉丁文,另一段由发音指南组成,然后将它们压缩在一起 - 否则这个项目将永远无法完成。我正在尝试执行类似命令的操作\underset

现在我正在尝试使用tabularxminipage。这里有两个问题:

  1. 我的迷你页面无法自动完美排列。
  2. 表格在段落下方添加了太多空间,可能是因为命令\raisebox

或者,有没有办法将单个单词向左移动其前一个单词的长度?一定有类似的东西,但我找不到。

这个问题与我想要的类似,但不完全相同,因为我必须合并两段文字。

以下是我目前所掌握的信息:

\documentclass[11pt, twoside, notitlepage]{article}

\usepackage{geometry}
\geometry{letterpaper}
\usepackage{showframe}
\usepackage{libertine}
\usepackage{tabularx}
\usepackage{float}

\begin{document}

\begin{minipage}{0.18\textwidth}
\begin{tabularx}{\textwidth}{|@{}l@{}|}
\Large{\raisebox{-1ex}{juventútem}} \\
\small{\raisebox{3ex}{yoo-ven-too-tem}} \\
\end{tabularx}
\end{minipage}%
\begin{minipage}{0.18\textwidth}
\begin{tabularx}{\textwidth}{|X|}
\Large{\raisebox{-1ex}{juventútem}} \\
\small{\raisebox{3ex}{yoo-ven-too-tem}} \\
\end{tabularx}
\end{minipage}%

% ALTERNATIVE: move the \small{} to the left, inline with the \Large{}
\Large{juventútem}%
\small{\raisebox{-2ex}{yoo-ven-too-tem}}

% THIS IS NOT QUITE WHAT I NEED: 
% $\underset{juventútem}{yoo-ven-too-tem}$

\end{document}

编辑:这正是我想要实现的,但使用 Steven B. Segletes 的解决方案,只需一个函数/命令,而不是所需的 20 个左右。这还不错,只是写出来比较耗时:

Suscipiat 示例

代码:

\newcommand{\server}[1]{%
    \noindent
    #1
    }
\newcommand{\subword}[2]{%
    \noindent
    \begin{justifying}
    \stackunder{\Large\ #1}{\tiny\ #2}%
    \end{justifying}
    }
\server{\subword{Suscípiat}{Soo-shee´pee-ott} \subword{Dóminus}{Doh´mee-noos} \subword{sacrifícium}{sah-kree-fee´chee-oom} \subword{de}{day} \subword{mánibus}{mah´nee-boose} \subword{tuis,}{too-eese,} \subword{ad}{ahd} \subword{laudem}{lou´dem} \subword{et}{ett} \subword{glóriam}{gloh´ree-ahm} \subword{nominis}{noh´mee-neese} \subword{sui,}{soo´ee,} \subword{ad}{ahd} \subword{utilitátem}{oo-tee-lee-tah´tem} \subword{quoque}{quoh´quay} \subword{nostram,}{noh´strahm,} \subword{totiúsque}{tohd-see-oos´quay} \subword{Ecclésiæ}{at-clay´see-ay} \subword{suæ}{soo´ay} \subword{sanctæ.}{sahnk´tay.}}

答案1

一种方法stackengine。请参阅补充为了实现自动化版本,以某种方式实现。

\documentclass[11pt, twoside, notitlepage]{article}
\usepackage{geometry}
\geometry{letterpaper}
\usepackage{showframe}
\usepackage{libertine}
%\usepackage{tabularx}
%\usepackage{float}
\usepackage{stackengine,scalerel}
\newcommand\pronounce[2]{%
  \stretchleftright{|}
  {\stackengine{10pt}{\Large #1\strut}{\small #2\strut}{U}{c}{F}{F}{L}}
  {|}%
}
\begin{document}
\noindent
\pronounce{juventútem}{yoo-ven-too-tem}
\pronounce{fubar}{foo-barr}
\pronounce{juventútem}{yoo-ven-too-tem}
\pronounce{fubar}{foo-barr}
\pronounce{juventútem}{yoo-ven-too-tem}
\pronounce{fubar}{foo-barr}
\pronounce{juventútem}{yoo-ven-too-tem}
\pronounce{fubar}{foo-barr}
\pronounce{juventútem}{yoo-ven-too-tem}
\pronounce{fubar}{foo-barr}
\pronounce{juventútem}{yoo-ven-too-tem}
\pronounce{fubar}{foo-barr}
\end{document}

在此处输入图片描述

补充

这是创建一种自动化形式的尝试,假设段落及其发音形式具有相同的空格和标点符号格式。

\documentclass[11pt, twoside, notitlepage]{article}
\usepackage{geometry}
\geometry{letterpaper}
\usepackage{showframe}
\usepackage{libertine}
%\usepackage{tabularx}
%\usepackage{float}
\usepackage{stackengine,scalerel,listofitems}
\newcommand\pronounce[2]{%
  \stretchleftright{|}
  {\stackengine{10pt}{\Large #1\strut}{\small #2\strut}{U}{c}{F}{F}{L}}
  {|}%
}
\newcommand\pronouncepars[2]{%
  \setsepchar{ ||,||.||?||!}%
  \readlist\thewords{#1}%
  \readlist\thepronunciations{#2}%
  \foreachitem\z\in\thewords[]{%
    \ifx\z\empty\else
      \pronounce{\z}{\thepronunciations[\zcnt]}%
    \fi
    \thewordssep[\zcnt]%
  }%
}
\begin{document}
\pronouncepars{Give me liberty, or give me death! 
  These are the words of Patrick Henry.}
{Giv mee lib-er-tee, or giv mee deth!
  Theez ar the wordz of Pat-rik Hen-ree.}
\end{document}

在此处输入图片描述

答案2

请原谅我,但我忍不住要展示我记得的最长的拉丁文本;使用 Steven B. Segletes 答案的代码显示两行。在此处输入图片描述

答案3

我借用了 Setven 的示例文本,但这里仅使用表格。

在此处输入图片描述

\documentclass[11pt, twoside, notitlepage]{article}
\usepackage{geometry}
\geometry{letterpaper}
\usepackage{showframe}
\usepackage{libertine}
%\usepackage{tabularx}
%\usepackage{float}

\newcommand\pronounce[2]{%
  \begin{tabular}[t]{@{}c@{}}#1\\\footnotesize#2\end{tabular}%
}
\begin{document}
\raggedright

\noindent
\pronounce{juventútem}{yoo-ven-too-tem}
\pronounce{fubar}{foo-barr}
\pronounce{juventútem}{yoo-ven-too-tem}
\pronounce{fubar}{foo-barr}
\pronounce{juventútem}{yoo-ven-too-tem}
\pronounce{fubar}{foo-barr}
\pronounce{juventútem}{yoo-ven-too-tem}
\pronounce{fubar}{foo-barr}
\pronounce{juventútem}{yoo-ven-too-tem}
\pronounce{fubar}{foo-barr}
\pronounce{juventútem}{yoo-ven-too-tem}
\pronounce{fubar}{foo-barr}
\end{document}

相关内容