title: How can I insert a tie between notes in different voices?
body: <p>I have a piano score with two voices in the right-hand (treble) part.
  How can I insert a tie between two notes of the same pitch in different voices?</p>
  
  <p>This is what I have so far.
  I want to tie the last note of line (A) to the first note of line (B), and the last note of line (C) to the first note of line (D).</p>
  
  <pre class="lang-tex prettyprint-override"><code>\version "2.16.2"
  \relative c'' {
    \time 12/8
    \key f \minor
    &lt;&lt;
      {
        aes2.~ \mp
        aes8 ees bes' c bes aes~
      } \\
      {
        ees2. s2.
      }
    &gt;&gt; |
    &lt;&lt;
      {
        aes2.~
        aes8 ees bes' c bes aes~      % (A)
      } \\
      { }
    &gt;&gt; |
    &lt;&lt;
      {
        c2.~
        c8 ees, bes' c bes aes~       % (C)
      } \\
      {
        aes4. ees4.~ ees8 s8 s8 s4.   % (B)
      }
    &gt;&gt; |
    &lt;&lt;
      {
        bes'2.~ bes8 ees, bes' c bes aes
      } \\
      {
        aes4. ees4.~ ees8 s8 s8 s4.   % (D)
      }
    &gt;&gt; |
  }
  </code></pre>
  
  <p>Here's the output:</p>
  
  <p><img src="https://i.stack.imgur.com/vAJjf.png" alt="Output from the above LilyPond score"></p>
  
  <p>LilyPond gives me the following warnings when typesetting:</p>
  
  <pre><code>mwe.ly:18:26: warning: unterminated tie
        aes8 ees bes' c bes 
                            aes~
  mwe.ly:25:25: warning: unterminated tie
        c8 ees, bes' c bes 
                           aes~
  </code></pre>
  
  <p>How can I get rid of these warnings and get the desired behavior, as in the following image?</p>
  
  <p><img src="https://i.stack.imgur.com/1lFb9.png" alt="The desired output (ties hand-drawn in GIMP)"></p>