title: How can I use the only directive inline by using role in python-sphinx?
body: <p>In python-sphinx there is the <a href="http://sphinx.pocoo.org/markup/misc.html?highlight=only#including-content-based-on-tags">only directive</a>, which can be used to conditionally influence the document according to its output. For instance text appears in html or latex only.</p>
  
  <p>It is use like this:</p>
  
  <pre>
  .. only:: not latex
  
     Here there is some Text, that does not appear in latex output.
  
  .. only:: html
  
     Here there is some Text, that only appears in html output.
  </pre>
  
  <p>How can I use the role directive in the right way to use the only-class inline, let's say like this:</p>
  
  <pre>
  Here there is some Text, that :only-notlatex:`does not appear in latex`<br>:only-html:`only appears in html`.
  </pre>
  
  <p>I saw something similar for the raw directive. Is this also possible for the only directive? I tried:</p>
  
  <pre>
  
  .. role:: only-html(only)
     :format: html
  
  .. role:: only-notlatex(only)
     :format: not latex 
  
  </pre>
  
  <p>But this does not work.</p>