Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

LaTeX User Macro stopped working

Adam Procházka February 21, 2023

Hello,

we have a custom user macro for rendering LaTeX math expressions. Up until certain point, equations put into the body of the macro as normal text, would be rendered as a proper LaTeX expression.

However from certain point (first reported on 27.10.2022), existing pages with math macro do not display the proper LaTeX expression but the original plain text.

Additionally any existing page with the macro was blank, when opened in editing mode and saving would clear any content in the updated page - this was solved with help from Atlassian support by commenting out certain part of the macro Template.

## Macro title: math-formula
## @param size:title=Font size|type=int|default=150|desc=Size of the text in percent

## Size
#if (!$paramsize)
#set ($paramsize="150")
#end

##Unique ID
#if ($req.getAttribute('lastUniqueId'))
#set($uniqueId = $req.getAttribute('lastUniqueId') +1)
#else
#set($uniqueId = 0)
#end
$!req.setAttribute('lastUniqueId', $uniqueId)

<style>
#math${uniqueId}.typeset {
color: black
}
#math${uniqueId} {
font-size: $paramsize%;
margin: 1em 0px;
}
#jsMath_button, #jsMath_message, #jsMath_Warning {
display: none;
}
</style>

<script src="/includes/js/jsMath/plugins/noImageFonts.js" type="text/javascript">
</script>
<script src="/includes/js/jsMath/jsMath.js" type="text/javascript">
</script>

<span id="math${uniqueId}" class="math">
${body}
</span>

<script type="text/javascript">
//check for use of this macro elsewhere on the page so that we only call jsMath once
// if (typeof mathFormulaDetected == 'undefined') {
// var mathFormulaDetected = false;
//}
//jQuery(document).ready(function() {
// if (!mathFormulaDetected) {
// jsMath.ProcessBeforeShowing();
// mathFormulaDetected = true;
// }
//});
</script>

The macro was most likely copied from here (with other reference here).

  1. Is anybody else using this user macro?
  2. Would anybody know, what can cause this change in behavior and what can we do to fix it?

Thanks in advance to anybody who leaves a comment or provides an insight.

With Regards,
Adam

0 answers

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
TAGS
AUG Leaders

Atlassian Community Events