LaTeX 套件可協助將一種語言翻譯成另一種語言

LaTeX 套件可協助將一種語言翻譯成另一種語言

我正在學習土耳其語,並希望在 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}.在這種語法中,「符號」是一行,儘管 a\parbox[t]可以克服這一點。 「要刪除的行」必須由使用者計算/計算,以使所有符號都適合。我目前使用前導\unskip和尾隨\ignorespaces以避免必須記住用%標記尾隨所有行,但如果後來證明這些行有問題,則可以將它們從巨集定義中刪除。

需要解決的有趣怪癖。我不能使用\upbracefill下支撐,因為它的最小寬度大於單個字母,並且OP顯然有單個字母需要下支撐的情況。因此,我使用我的scalerel包將 h 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}

在此輸入影像描述

相關內容