title: pdf via latex cannot render symbols of pi with graphs in matplotlib
body: <p>I want to ask a question about downloading a notebook in Jupyter that uses matplotlib and xticks.</p>
  <p>I produced the following code block as part of a function that plots sine and cosine:</p>
  <pre><code>X = linspace(-pi, pi, 128)
  C = cos(X)
  S = sin(X)
  
  figure(figsize=(10,6))
  
  xlim(-pi*1.1, pi*1.1)
  ylim(-1.1, 1.1)
  
  xticks([-pi, -pi/2, 0, pi/2, pi],
        ['$-\pi$', '$-\pi/2$','$0$', '$+\pi/2', '$+\pi$'])
  yticks([-1, 0, 1],
         ['$-1$', '$0$', '$+1$'])
  plot(X, C, color=&quot;blue&quot;, linewidth = 2.5, linestyle = &quot;-&quot;, label=&quot;cosine&quot;)
  plot(X, S, color=&quot;red&quot;, linestyle = &quot;None&quot;, marker = &quot;o&quot;, label = &quot;sine&quot;)
  
  legend(loc=&quot;upper left&quot;)
  show()
  </code></pre>
  <p>Now, this gives me the following graph:</p>
  <p><a href="https://i.stack.imgur.com/VpoG0.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/VpoG0.png" alt="Graph produced upon execution of code block" /></a></p>
  <p>This is satisfactory.
  However, when I try to download the PDF of the notebook with Latex formatting, I receive the following error:</p>
  <pre><code>[1-22]
  [23]
  Underfull \hbox (badness 10000) in paragraph at lines 2208--2209
  
  [24]
  Underfull \hbox (badness 10000) in paragraph at lines 2252--2253
  
  ! Missing $ inserted.
  &lt;inserted text&gt; 
              $
  l.2265 dollar signs: `\$\pi
                             \$'. For consistency we'll use math rendering for
  ? 
  ! Emergency stop.
  &lt;inserted text&gt; 
                  $
  l.2265 dollar signs: `\$\pi
                             \$'. For consistency we'll use math rendering for
  Output written on notebook.pdf (24 pages).
  Transcript written on notebook.log.
  </code></pre>
  <p>Errors [1-22] were of the same nature, so I omitted them for clarity.</p>
  <p>It appears that the Latex package cannot render the $\pi$ symbol before download, and I don't understand why?</p>
  <p>How can I fix this matter?</p>