title: How to prevent linebreaks after \subsection or \section
body: <p><a href="https://stackoverflow.com/questions/3203908/">Here</a> I queried how to identify the counters for <code>\subsection</code> and <code>\theorem.</code></p>
  
  <p>The resulting look would be the same (except for the math-specific things, like the content inside a theorem is put in emphasis) if only there is a way to prevent linebreaks after \subsection.</p>
  
  <p>Is there a way to do this? Thanks.</p>