Initial system

This manual is built up for XenForo 1.5.9. You can buy and download the current version on the official XenForo website and install it on your local system. We used a XAMPP installation with Apache Server and MySQL Enviroment. You can use the LaTeX4technics editor in combination with MathJax and also with native LaTeX enviroments. If you want to know how to integrate MathJax into your XenForo-Forum read another article.

Integrate LaTeX4technics in XenForo

  • 1

    Generate buttons

    You need to assign specific classes to input fields in order to connect these buttons with the LaTeX4technics library
    copy
    
    <!-- LaTeX4technics Button for inline equation -->
    <input type="button" class="button L4tinlinebtn" value="Insert inline equation"/>
    <!-- LaTeX4technics Button for display equation -->
    <input type="button" class="button L4tdisplaybtn" value="Insert display equation"/>
    
    Insert this code into every template you want to include the LaTeX4technics technology. For example you can implement this code into thread_create, thread_reply, conversation_reply and quick_reply. If you open a new topic or reply to an existing topic you will see two additional buttons. You can change the text of the buttons and style with additional classes (like button does), but the LaTeX4technics default-classnames need to be included!
  • 2

    Connect LaTeX4technics to input fields

    Right now the buttons are created but there is no action linked to them. Therefore you go to the PAGE_CONTAINER template and add this code at the end of the template. Be aware of changing the application_id. If you don't have an app-id you can use the connection between LaTeX4technics and your site with all features available. If you want a customized version of the equation editor you have to go to your LaTeX4technics dashboard and create an customized application.
    copy
    <!-- LaTeX4technics configuration and library -->
    <script type="text/javascript" >
    var L4tconfig ={
    application_id : "your_app_id",
    receiver_field_id : "redactor_MessageEditor",
    displayMath_delimiter_start : "$$",
    displayMath_delimiter_end : "$$",
    inlineMath_delimiter_start : "$",
    inlineMath_delimiter_end : "$",
    x_ratio : "0.6",
    y_ratio : "0.8"
    }
    </script>
    <script type="text/javascript"  src="https://www.latex4technics.com/lib/l4t_xenforo_latest.js"></script>
    
    If you don't use the redactor editor you can check your receiver_field_id by using common inspector tools like the chrome developer tools. Now you can use all the power of LaTeX4technics in your forum. Both buttons are connected to an customized LaTeX4technics instance, which is able to write equations directly to the editor field.