2

I am drawing oral and nasal vowel charts of my language using the package vowel. There is a neutralization between mid-open and mid-closed vowel in that there is only ɛ̰ and ɔ̰ for that. But in my chart, there is a horizontal line that remains in the chart of nasal vowels that my director is asking to remove (I colored the line to remove in yellow on the picture). Could you please help me with that? Thanks

Here is the minimal code:

\documentclass[10pt,a4paper]{article}
\usepackage{fontspec}
\setmainfont{Times New Roman}

\usepackage{vowel}

\begin{document}


\parbox{0.5\textwidth}{
    \centering
    \begin{center}
\begin{vowel}
\putcvowel{i}{1}
\putcvowel{u}{8}
\putcvowel{e}{2}
\putcvowel{ɛ}{3}
\putcvowel{a}{15}
\putcvowel{ɔ}{6}
\putcvowel{o}{7}
\end{vowel}
\end{center}
}
\parbox{0.5\textwidth}{
    \centering
\begin{center}
\begin{vowel}
\putcvowel{ḭ}{1}
\putcvowel{ṵ}{8}
\putcvowel{ɛ̰}{3}
\putcvowel{a̰}{15}
\putcvowel{ɔ̰}{6}
\end{vowel}
\end{center}
}

\end{document}

vowel chart

1 Answer 1

3

In the vowel package the macro responsible for drawing the lines (among other things) is \@@vowel. You can remove the command that draws the unwanted line from that macro.

To do this easily you can use the \patchcmd macro from the etoolbox package. This command can be used to modify existing macros by search and replace. There are five arguments: the macro to modify, the search string, the replace string, and two arguments that are executed when the patch is successful or not, respectively. The two final arguments can be left empty, and also the replace string is empty in this case because you want to delete something.

The line drawing command to delete is \@vwldgmhline\c@rdhposii\vowelvunit, meaning "vowel diagram horizontal line on card position 2 measured in vowel vertical units". Therefore the patch is as follows:

\makeatletter
\patchcmd{\@@vowel}{\@vwldgmhline\c@rdhposii\vowelvunit}{}{}{}
\makeatother

There are various @ signs in the arguments, therefore you need to surround the patch with \makeatletter and \makeatother.

Of course for other charts you might want to keep the horizontal line. Therefore you need to store the original definition of the macro and restore this definition once the relevant chart is processed.

MWE (note that I changed the font because I don't have Times New Roman):

\documentclass[10pt,a4paper]{article}
\usepackage{fontspec}
\setmainfont{DejaVu Serif}

\usepackage{vowel}
\usepackage{etoolbox}
% store original definition of \@@vowel in \oldvowel
\makeatletter
\let\oldvowel\@@vowel
\makeatother

\begin{document}
\parbox{0.5\textwidth}{
    \centering
    \begin{center}
\begin{vowel}
\putcvowel{i}{1}
\putcvowel{u}{8}
\putcvowel{e}{2}
\putcvowel{ɛ}{3}
\putcvowel{a}{15}
\putcvowel{ɔ}{6}
\putcvowel{o}{7}
\end{vowel}
\end{center}
}
% remove line drawing command from \@@vowel
\makeatletter
\patchcmd{\@@vowel}{\@vwldgmhline\c@rdhposii\vowelvunit}{}{}{}
\makeatother
\parbox{0.5\textwidth}{
    \centering
\begin{center}
\begin{vowel}
\putcvowel{ḭ}{1}
\putcvowel{ṵ}{8}
\putcvowel{ɛ̰}{3}
\putcvowel{a̰}{15}
\putcvowel{ɔ̰}{6}
\end{vowel}
\end{center}
}
% restore original definition for further diagrams
\makeatletter
\let\@@vowel\oldvowel
\makeatother
\end{document}

Result:

enter image description here

1
  • Great ! Thanks for this clear explanation and the solution. It solves the issue. Aug 8, 2022 at 9:55

You must log in to answer this question.

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