LaTeX 软件包帮助将一种语言的翻译图表化为另一种语言

LaTeX 软件包帮助将一种语言的翻译图表化为另一种语言

我正在学习土耳其语,想借助 TeX 将一些土耳其语文本翻译成英语。我认为 TeX 更适合这项工作。想知道是否存在可以帮助我实现目标的软件包,或者是否有类似的软件包。

理想情况下,我想要一个能够呈现以下内容作为最终结果的包:

  home     to go 
  Eve    gidiyorum 
    -      -`----' 
    |      |  | 
    |      |  `- present progressive tense (first person - singular) 
    |      `- git->gid (t->d) sound change ending 
    `- dative case ending for gitmek 

  I want to go home 

第二个例子:

   home     to go 
  Eveniz  gidiyoruz 
    -`-'    -`----' 
    | |     |  | 
    | |     |  `- present progressive tense (first person - plural) 
    | |     `- git->gid (t->d) sound change ending 
    | `- possessive suffix (second person - plural) 
    `- dative case ending for gitmek 

We are going to your home 

第三个例子:

German  class  to buy; to get;    to continue 
               to take, receive 
Almanca dersi       almaya       devam ediyorum 
            -         `--'              -`----' 
            |          |                |  | 
            |          |                |  `- present progressive 
            |          |                |     tense (first person - 
            |          |                |     singular) 
            |          |                `- devam et->devam ed (t->d) 
            |          |                   sound change ending 
            |          `- verbal noun -mA, dative for devam etmek 
            `- accusative case ending for almak 

   I want to continue taking German class

“-”和“`--'”是水平花括号。

答案1

本答案使用嵌套堆栈来实现结果。除了我用来设置最顶层单词堆栈\Longstack的包宏之外,我还引入了一个额外的宏。stackengine

该宏是\notate{embraced letters}{lines to drop}{notation}。在此语法中,“符号”是一行,尽管\parbox[t]可以克服这一点。“要删除的行”必须由用户计算/计算,以使所有符号都合适。我目前使用前导\unskip和尾随\ignorespaces来避免必须记住尾随所有带%标记的行,但如果后来证明这些行有问题,则可以将它们从宏定义中删除。

有趣的怪癖需要解决。我不能用它\upbracefill来进行下支撑,因为它的最小宽度大于单个字母,而 OP 显然有单个字母需要下支撑的情况。所以我用我的scalerel包将 a 拉伸\{到合适的高度并将其横向旋转,将该高度转换为宽度。

另外,我没有任何tikz技巧可以让符号箭头转弯,所以我只是使用了字距调整\hookrightarrow来实现视觉上可行的效果(我希望)。

编辑。可以通过将符号设置为较小的尺寸来增强易读性。例如,此处的\footnotesize

\documentclass{article}
\usepackage[usestackEOL]{stackengine}
\usepackage{scalerel}
\usepackage{graphicx}
\parskip \baselineskip
\def\myupbracefill#1{\rotatebox{90}{\stretchto{\{}{#1}}}
\def\rlwd{.5pt}
\newcommand\notate[3]{%
  \unskip\def\useanchorwidth{T}%
  \setbox0=\hbox{#1}%
  \def\stackalignment{c}\stackunder[-6pt]{%
    \def\stackalignment{c}\stackunder[-1.5pt]{%
      \stackunder[-2pt]{\strut #1}{\myupbracefill{\wd0}}}{%
    \rule{\rlwd}{#2\baselineskip}}}{%
  \strut\kern7pt$\hookrightarrow$\rlap{ \footnotesize#3}}\ignorespaces%
}
\begin{document}
\hrulefill

  \Longstack{home\\Ev
   \notate{e}{4}{dative case ending for gitmek}
  }
~~\Longstack{to go\\gi
   \notate{d}{3}{git$\rightarrow$gid (t$\rightarrow$d) sound change ending}
   \notate{iyorum}{2}{present progressive tense (first person - singular)}
  }

I want to go home \par\hrulefill

  \Longstack{German\\ \\Almanca}
~~\Longstack{class\\ \\ders
   \notate{i}{8}{accusative case ending for almak}}
~~\Longstack{to buy; to get;\\to take; receive\\al
   \notate{maya}{7}{verbal noun -mA, dative for devam etmek}}
~~\Longstack{to continue\\ \\devam e
   \notate{d}{5}{%
     \parbox[t]{2in}{devam et$\rightarrow$devam ed (t$\rightarrow$d)\\
                     sound change ending}
   }
   \notate{iyorum}{2}{%
     \parbox[t]{2in}{present progressive\\
                     tense (first person -\\
                     singular)}
   }
  }

I want to continue taking German class \par\hrulefill
\end{document}

在此处输入图片描述

相关内容