## Ignore generated numbered headings/figures/tables
#set ($class = $latex.block.getParameter('class'))
## TODO: Introduce an extension point to move this to the Numbered Reference Extension, the LaTeX extension shouldn't
## know about this
#if ($class.contains('wikigeneratedfigurenumber') || $class.contains('wikigeneratedtablenumber') || $class.contains('wikigeneratedheadingnumber'))
  #break
#end
## Support specifying some text to be displayed in a smaller font
## Example: Hello (% class=small %)small(%%) world
#if ($class.equals('small'))
  {\small ##
#end
#set ($format = $latex.block.getFormat().toString())
#if ($format == 'BOLD')
  \textbf{${latex.processor.process($latex.block.getChildren())}}##
#elseif ($format == 'ITALIC')
  \textit{${latex.processor.process($latex.block.getChildren())}}##
#elseif ($format == 'MONOSPACE')
  \texttt{${latex.processor.process($latex.block.getChildren())}}##
#elseif ($format == 'UNDERLINED')
  \underline{${latex.processor.process($latex.block.getChildren())}}##
#elseif ($format == 'STRIKEDOUT')
  \sout{${latex.processor.process($latex.block.getChildren())}}##
#elseif ($format == 'SUBSCRIPT')
  \textsubscript{${latex.processor.process($latex.block.getChildren())}}##
#elseif ($format == 'SUPERSCRIPT')
  \textsuperscript{${latex.processor.process($latex.block.getChildren())}}##
## Note: sr-only is a bootstrap class used by XWiki to indicate that the content should be hidden
#elseif (!$class.contains('sr-only'))
  $latex.processor.process($latex.block.getChildren())##
#end
#if ($class.equals('small'))
  }##
#end