Adding LaTeX formula inside your form

Starting version 2.5.0 eForm supports LaTeX implementation inside your form. It can be integrated to any richtext element or any question element which has options in it (like Single Options, Multiple Options, Sortable etc).

Installing required plugin

To get started you first need to install a plugin that provides LaTeX. You have two options:

In both cases we shall be using shortcodes to put our LaTeX formula. You can use the format code, but we shall focus using the shortcode since it is easier.

Adding LaTeX formula to the options

LaTeX-Formula

Let us start by adding a Single Option element. In the options field we add something like

[text]B: [latex bg="transparent"]] E \Psi(\mathbf{r}) = \left[ \frac{-\hbar^2}{2\mu}\nabla^2 + V(\mathbf{r}) \right] \Psi(\mathbf{r})[[/latex][/text]

This would be parsed by eForm and would be passed to jetpack or WP Latex to make the latex image. The output would be

LaTeX-Output

Supporting Elements

LaTeX is implemented almost everywhere. Although the following elements actually make sense.

  • MCQ > Single Options.
  • MCQ > Multiple Options.
  • MCQ > Sortable.
  • All elements’ description.
  • All design elements where you can add richtext.
  • MCQ > Matrix rows and columns.

Some caveats

  • LaTeX would not work inside report and analysis charts. Starting version 3.0, it would work in the data column of the visualization table, but in google charts we had to strip out any latex code.
  • In the exported PDF, the LaTeX images are not parsed correctly for Jetpack plugin. We are working on this.

 

Swashata has written 257 articles

Hi there, I am the Lead Developer at WPQuark.com. I love to create something beautiful for WordPress and here I write about how to use them. When I am not working, usually I am doing a number of other creative things ;).

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

This site uses Akismet to reduce spam. Learn how your comment data is processed.