Passing an equal sign ('=') to a parameter in a MediaWiki template

I'm surprised no one has mentioned this, but what about escaping the character?

Using = will work. If you can't be bothered to remember the code, you can create the template Template:= with = as the only contents and then include it as {{=}}


If a MediaWiki template parameter string contains an equals sign, everything before the sign is taken to be the name of the parameter. If it does not contain an equals sign, the parameter string is assigned to the next available numeric parameter.

Thus, the simplest workaround, if you actually want a numbered parameter value to contain an equals sign, is to explicitly number it, like this:

{{ Test | 1 = R = 3/(2-(1+1)) }}

This will cause {{{1}}} inside the template to expand to the string R = 3/(2-(1+1)), just as:

{{ Test | equation = R = 3/(2-(1+1)) }}

will cause {{{equation}}} to expand to that same string.


You can create a {{=}} template whose value is =. Then use that template in place of the bare equal sign in your templates, like so:

{{ Test | R {{=}} 3/(2-(1+1)) }}