TransWikia.com

Issues combining ExPeX with Tabular

TeX - LaTeX Asked on July 3, 2021

I need to make tables of interlinear gloss. I have successfully made that happen, but the result is ugly. I have two issues in particular:

  1. The baselines of the three cells don’t line up.
  2. The table doesn’t align with the left edge of the page.

MWE:

%XeLaTeX
documentclass[11pt]{scrbook}

usepackage[
    paperwidth=8in,
    paperheight=10in,
    inner=0.5in,
    outer=0.5in,
    bindingoffset=0.25in,
    top=0.75in,
    bottom=0.75in,
    twoside,
    showframe
    ]{geometry}

usepackage{scrlayer-scrpage} 
usepackage{microtype}
usepackage{booktabs,multirow,graphicx,adjustbox,makecell} 

usepackage{polyglossia}
    setdefaultlanguage{english}
    setotherlanguage{hebrew}
    newfontfamilyhebrewfont[Script=Hebrew]{Linux Libertine O}
    newfontfamilyenglishfont[Ligatures=NoCommon]{Linux Libertine O}
            
usepackage{expex}

makeatletter
define@lingincdimenkeys{numoffset,textoffset,numvoffset}

lingset{
    everygla=LARGE, 
    everyglb=footnotesizeenglishfont,
    everyglc=footnotesizeenglishfont,
    everyglft=footnotesizeenglishfont,
    glwordalign=center,
    glhangindent=0em,
    glrightskip=0pt,
    glhangstyle=none,
    numvoffset=.3ex,   
    aboveglbskip=-0.7ex,
    aboveglcskip=-0.7ex
}

begin{document}

begin{tabular}{|p{.1textwidth}|p{.2textwidth}|p{.6textwidth}|}
multicolumn{3}{c}{begin{LARGE}texthebrew{א־ב־ד}end{LARGE}} 
hline
parbox[t]{.1textwidth}{
smallskip Adjective%
} 
&
parbox[t]{.2textwidth}{
begin{hebrew}begingl
gla אבוד //
glb avud //
glc lost //
endglend{hebrew}%
} 
&
parbox[t]{.6textwidth}{
begin{hebrew}begingl
gla הקורס הזה קשה, אני אבודה לגמרי. //
glb hakurs haze kasha ani avuda legamre //
glc textenglish{the course} textenglish{the this} difficult I lost completely //
glft textenglish{This course is difficult, I am completely lost.} //
endglend{hebrew}%
} 
hline
end{tabular}

end{document}

enter image description here

One Answer

UPDATED

(1) A noindent at the beginning takes care of the left unwanted space.

(2) The misalignment of the hebrew lines is cause by the ascender of the Lamed. Using parbox[b] and the same settings for all three cells keeps all baselines aligned.

(3) No need to use p columns. Use begin{tabular}{|c|c|c|}

% !TeX TS-program = xelatex 

documentclass[11pt]{scrbook}

usepackage[
paperwidth=8in,
paperheight=10in,
inner=0.5in,
outer=0.5in,
bindingoffset=0.25in,
top=0.75in,
bottom=0.75in,
twoside,
showframe
]{geometry}

usepackage{scrlayer-scrpage} 
usepackage{microtype}
usepackage{booktabs,multirow,graphicx,adjustbox,makecell} 

usepackage{polyglossia}
setdefaultlanguage{english}
setotherlanguage{hebrew}
newfontfamilyhebrewfont[Script=Hebrew]{Linux Libertine O}
newfontfamilyenglishfont[Ligatures=NoCommon]{Linux Libertine O}
    
usepackage{expex}

makeatletter
define@lingincdimenkeys{numoffset,textoffset,numvoffset}
makeatother

lingset{
    everygla=LARGE, 
    everyglb=footnotesizeenglishfont,
    everyglc=footnotesizeenglishfont,
    everyglft=footnotesizeenglishfont,
    glwordalign=center,
    glhangindent=0em,
    glrightskip=0pt,
    glhangstyle=none,
    numvoffset=.3ex,   
    aboveglbskip=-0.7ex,
    aboveglcskip=-0.7ex
}

begin{document}
    
noindent   begin{tabular}{|c|c|c|} % changed<<<<<<<
    multicolumn{3}{c}{begin{LARGE}texthebrew{א־ב־ד} end{LARGE}} 
    hline
    parbox[b]{.1textwidth}{% % changed <<<<<<<   parbox bottom aligned
        begin{english}
            begingl[everygla=normalsize] 
            gla Adjective //
            endgl
        end{english}%
    }
    &
    parbox[b]{.2textwidth}{% changed <<<<<<<   parbox bottom aligned
        begin{hebrew}
            begingl
            gla אבוד //
            glb avud //
            glc lost //
            endgl
        end{hebrew}%
    } 
    &
    parbox[b]{.6textwidth}{% changed <<<<<<<   parbox bottom aligned
        begin{hebrew}
            begingl
            gla  הקורס הזה קשה, אני אבודה לגמרי. //
            glb hakurs haze kasha ani avuda legamre //
            glc textenglish{the course} textenglish{the this} difficult I lost completely //
            glft textenglish{This course is difficult, I am completely lost.} //
            endgl
        end{hebrew}%
    } 
    
    hline
end{tabular}


end{document}

z

Answered by Simon Dispa on July 3, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP