I have a situation here. I am designing an IPA Vowel Chart and I have created a new font environment for the IPA characters using the IPA font Doulos SIL like this: \newfontfamily{\ipafont}{Doulos SIL}

Now I would like to use this command in the title to write "IPA" phonetically in the IPA alphabet inside of \NewEnviron{heading} using the environ package (found just before \begin{document}).

Problem Upon adding the \ipafont{} command to a line, instead of the brackets containing the font to be changed, the command simply applies itself to the rest of the line, messing up my nice title. See the code and picture below:

%%% -*- mode:latex; mode:font-lock; -*-
\lhead{\textsc{Sounds in American English}} \chead{\textsc{}} \rhead{\textsc{} 
\lfoot{\textsc{created on \today \space \currenttime}} \cfoot{\textsc{}}} \rfoot{\textsc{-\thepage-}}
\usepackage{soul} % use this (many fancier options)
%\setmainfont{Doulos SIL}
\newfontfamily{\ipafont}{Doulos SIL}%ADD FONT IN PREAMBLE, USAGE IN BODY: \otherfont{some text}
%OR {\fontspec{Zapfino} different text} IN BODY FOR ONE-TIME USE



    \pgfpathrectangle{\pgfpoint{0pt}{0pt}}{\pgfpoint{\wd #2}{\ht #2}}%
    \pgfusepath{use as bounding box}%
    \node[anchor=base west, fill=orange!30,outer sep=0pt,inner xsep=0.2em, inner ysep=0.1em,  #1]{\usebox{#2}};

  {\btHL[fill=#1!10,draw=#1,rounded corners]#2}%



\NewEnviron{heading}{\begin{figure}[h!]\centering\begin{tikzpicture}[align=center,background rectangle/.style={fill=white!05},framed]\node  {\BODY};\end{tikzpicture}\end{figure}}

% \nopagebreak[4]
\Large IPA [\ipafont{aɪ pʰiː eɪ}] Vowel Chart for\\\Large Californian English
            \putvowel[l]{\vl{i} \ex{b\textbf{ea}d}}{0pt}{0pt}
        \putcvowel[r]{\vl{y} \ex{\st{f\textbf{üh}len}}}{1}
        \putcvowel[l]{\vl{e} \ex{b\textbf{ay}ed}}{2}
        \putcvowel[r]{\vl{ø} *}{2}
        \putcvowel[l]{\vl{ɛ} \ex{b\textbf{e}t,b\textbf{e}d}}{3}
           \putcvowel[r]{\vl{œ} *}{3}
            \putcvowel[l]{\vl{a} *}{4}
            \putcvowel[r]{\vl{ɶ} *}{4}
        \putcvowel[l]{\vl{ɑ} \ex{p\textbf{o}d}}{5}
            \putcvowel[r]{\vl{ɒ} *}{5}
            \putcvowel[l]{\vl{ʌ} \ex{b\textbf{u}d}}{6}
            \putcvowel[r]{\vl{ᴐ} \ex{b\textbf{o}y (diphthong)}}{6}
            \putcvowel[l]{\vl{ɤ} *}{7}
            \putcvowel[r]{\vl{}o \ex{b\textbf{o}de}}{7}
            \putcvowel[l]{\vl{ɯ} *}{8}
            \putcvowel[r]{\vl{u} \ex{b\textbf{oo}ed}}{8}
            \putcvowel[l]{\vl{ɨ} *}{9}
            \putcvowel[r]{\vl{ʉ} *}{9}
            \putcvowel[l]{\vl{ɘ} *}{10}
            \putcvowel[r]{\vl{ɵ} *}{10}
            \putcvowel{\vl{ə} \ex{\textbf{a}bout,\textbf{a}bove}}{11}
            \putcvowel[l]{\vl{ɜ} \oex{b\textbf{u}st} *}{12}
            \putcvowel[r]{\vl{ɞ} *}{12}
            \putcvowel[l]{\vl{I} \ex{b\textbf{i}d}}{13}
           \putcvowel[r]{\vl{Y} *}{13}
            \putcvowel{\vl{ʊ} \ex{g\textbf{oo}d}}{14}
            \putcvowel{\vl{ɐ} *}{15}
            \putcvowel{\vl{æ} \ex{b\textbf{a}d}}{16}
\tikzhighlight[blue]{CA English} \hspace{.5em}\tikzhighlight[green]{OH English}
/i/ as in seat \\
/ɪ/ as in sit \\
/eɪ/ as in cake \\
/ɛ/ as in met \\
/æ/ as in cat \\
/ɑ/ as in father \\
/ə/ as in bun \\
/ɔ/ as in law \\
/oʊ/ as in boat \\
/ʊ/ as in wood \\
/u/ as in two \\
/ər/ as in heard \\
/aɪ/ as in mine \\
/aʊ/ as  in mouse \\
/ɔɪ/ as in boy \\

IPA Vowel Chart

  • I don't see the messed up part in the picture. What is it? Sep 6, 2012 at 19:08
  • 2
    \small, \Large and \ipafont are not commands with an argument, but declarations: so {\ipafont #1}, for example, not \ipafont{#1}. The same for \small and \Large
    – egreg
    Sep 6, 2012 at 19:14
  • The messed up part is in the title "Vowel Chart for" Sep 6, 2012 at 19:26
  • Thanks egreg for the info. Could you please tell me how to isolate a declaration? Sep 6, 2012 at 19:27
  • 1
    As @egreg said: Use {\ipafont aɪ pʰiː eɪ}. Curly braces limit scope, brackets do not. I'd also advise to slip a \par somewhere in the node, because your use of \Large messes up the like skip, but I don't know where it is allowed... Sep 6, 2012 at 19:55

1 Answer 1


Commands such as the standard \small and \Large, but also your font selection command \ipafont are not commands with an argument (similarly to \textbf, to make an example).

So your commands must be defined differently:

\newcommand{\vl}[1]{{\Large[{\ipafont #1}]}}

In the last command, for instance, \vl{x} will be replaced by

{\Large[{\ipafont x}]}

where the outer pair of braces isolates the \Large declaration, the inner one isolates the \ipafont font selection. Thus x will be printed in "Large" size and Doulos SIL, while the brackets will be in the main document font.

The same for the code

\Large IPA [\ipafont{aɪ pʰiː eɪ}] Vowel Chart for\\\Large Californian English

which should be

\Large IPA [{\ipafont aɪ pʰiː eɪ}] Vowel Chart for\\Californian English

There's no need of braces to isolate \Large, because an environment forms a group that bounds the action of declarations.

If you prefer a command for selecting Doulos SIL like \textbf, then issue in your preamble the code


and then you'll be able to write

\textipa{aɪ pʰiː eɪ}

whence only the argument will be typeset in Doulos SIL with no leaking.

Actually, I don't see much sense in embedding the contents of heading as a single \node in a tikzpicture. Moreover, using a figure environment for it is surely wrong. Just say


and now

IPA [{\ipafont aɪ pʰiː eɪ}] Vowel Chart for\\Californian English

will give the correct result (with a correct distance between the two lines which is not obtained in a \node).

However, if you really need the tikzpicture and this is only a simplified version, don't use figure, but center.

  • I know that's not strictly what's asked, but maybe you could comment on the fact that \Large foo\\bar without a \par inside the same group is not a good idea? Sep 6, 2012 at 20:39
  • @StephanLehmke In this case it doesn't make any difference, as the text is passed on to \node. But your comment is quite useful.
    – egreg
    Sep 6, 2012 at 20:52
  • And does \node add a \par without wrapping the text in a group first? The two heading lines look awfully cramped on the example... Sep 6, 2012 at 20:54
  • @StephanLehmke Yes, they are wrong, but \node doesn't produce paragraphs, AFAIK. So adding \par doesn't help. I've added something to my answer.
    – egreg
    Sep 6, 2012 at 21:01
  • 1
    @macmadness86 So probably a tabular inside heading is better to ensure correct spacing between lines.
    – egreg
    Sep 8, 2012 at 17:42

You must log in to answer this question.

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