Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

This article explains about how to resolve the issue of Latex Math anchor/numbering not working in Confluence Server after an upgrade.

If you're experiencing issues with Latex Math in Confluence Server after upgrading to a new version, such as anchors or numbering not working, there may be an issue with the velocity templates for the Latex Math add-on. This knowledge base article provides a step-by-step guide on how to resolve this issue and includes some general best practices for add-on management in Confluence. To resolve the issue

...

you need to update the velocity templates(Math Block velocity template and Math Block Reference velocity template) for the Latex Math add-on.

...

Step 1: Go to the Latex Math configuration page in Confluence.

...

Step 2: Compare the velocity templates in your installation with those in a freshly installed add-on.

...

Step 3: Copy the new install text to your installation, replacing the old velocity templates.

...

Step 4: Save the changes and refresh the page to check if the issue has been resolved.

update the Math Block velocity template and Math Block Reference velocity template present in the latex math configuration like in the attached files in your test environment and let us know the result

Instructions

  1. Login to Jira and click on the gear wheel icon in the top right corner of the screen.

  2. Select "Manage Apps" from the dropdown menu.

  3. Scroll down until you see "Latex Math" and click on it.

  4. Select "Latex Math Configuration".

  5. Scroll down until you see "Math Block velocity template" and "Math Block Reference velocity template" as shown below.

    Image Added
  6. Click on "Edit" for each template.

  7. Compare the existing template with the one provided below.

  8. If the existing template is different, replace it with the template provided below.

Refresh the Confluence page containing the mathline macro.

Math Block velocity template:

Code Block
#*
Copyright (c) 2022 Appfire Technologies, LLC.
All rights reserved.

This software is licensed under the provisions of the "Appfire EULA"
(https://appfire.com/eula/) as well as under the provisions of
the "Standard EULA" from the "Atlassian Marketplace Terms of Use" as a "Marketplace Product"
(http://www.atlassian.com/licensing/marketplace/termsofuse).
See the LICENSE file for more details.
*#
#htmlSafe()
## Put parenthesis around equation number:
#if ($!captionHtml && ($!captionHtml.length()>0))
  #set ($captionHtml = "($captionHtml)")
#end
##
## Write block equation:
<table border=0 cellspacing=0 cellpadding=0 width=100% align="center" class="latexmath-mathblock" style="width: 100% !important;">
  <tbody><tr>
	<td nowrap class="latexmath-numbering">$!captionHtml</td>
	<td nowrap class="latexmath-$halign">$!latexHtml</td>
  </tr></tbody>
</table>

Math Block Reference velocity template:

Code Block
#*
Copyright (c) 2022 Appfire Technologies, LLC.
All rights reserved.

This software is licensed under the provisions of the "Appfire EULA"
(https://appfire.com/eula/) as well as under the provisions of
the "Standard EULA" from the "Atlassian Marketplace Terms of Use" as a "Marketplace Product"
(http://www.atlassian.com/licensing/marketplace/termsofuse).
See the LICENSE file for more details.
*#
#htmlSafe()
#macro(doNothing)#end
## Add colon to page name:
#if ($pageNameHtml && ($pageNameHtml.length()>0))
  #set ($pageNameHtml = $pageNameHtml+'<span class="latexmath-refpagejoiner">:</span>')
#end
##
<a href="$!{anchorURLHtml}" class="latexmath-mathblock-ref"$!{dataParamsHtml}>($!{pageNameHtml}$!{captionHtml})</a>#doNothing()

9. Make sure to save your changes after replacing the templates.

10. Refresh the Confluence page containing the Latex math macros.

Info

Perform the above steps in a staging environment before implementing them in production.