4

I am learning Turkish and wanted to work on translating some Turkish text to English with the help of TeX. I think it would be better suited for the job. Wondering if a package exists to help with what I want or if there was something close.

Ideally, I would like a package that could render the following as the end result:

  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 

Second example:

   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 

Third example:

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

The "-" and "`--'" are horizontal curly braces.

3
  • 1
    Crosspost to comp.text.tex
    – Johannes_B
    Mar 25, 2014 at 20:17
  • Welcome to TeX.SX! Please help us to help you and add a minimal working example (MWE) that illustrates your problem. It will be much easier for us to reproduce your situation and find out what the issue is when we see compilable code, starting with \documentclass{...} and ending with \end{document}.
    – Johannes_B
    Mar 25, 2014 at 20:29
  • Right now, what your are asking for is pretty specific. Maybe more visual help would be useful, a screenshot or something similar. That way, you can show exactly what you want.
    – Johannes_B
    Mar 25, 2014 at 20:32

1 Answer 1

5

This answer uses nested stacks to achieve the result. In addition to the \Longstack macro of the stackengine package, which I use to set the top-most word stacks, I introduce one additional macro.

That macro is \notate{embraced letters}{lines to drop}{notation}. In this syntax, "notation" is a single line, though a \parbox[t] can overcome that. The "lines to drop" must be counted/figured by the user, so as to make all the notations fit. I currently use a leading \unskip and trailing \ignorespaces to avoid having to remember trailing all lines with % marks, but if those later prove problematic, they can be removed from the macro definition.

Interesting quirks that needed resolution. I couldn't use \upbracefill for underbracing, because it has a minimum width which is larger than a single letter, and the OP clearly had cases where a single letter needed underbracing. So I used my scalerel package to stretchhh a \{ to the proper height and rotate it sideways, converting that height into a width.

Also, I don't have any tikz tricks up my sleeve for making an elbow turn in the notation arrow, so I just used a kerned \hookrightarrow to achieve something that visually works (I hope).

EDIT. Legibility could possibly be enhanced by setting the notation in a smaller size. For example, here in \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}

enter image description here

1
  • @user3461326 I cleaned up the answer a bit. Please see revision. Mar 26, 2014 at 13:55

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .