Template talk:LaTeX/Example

Problem with multi-line examples appear to be solved
Until recently the Example template rendered multi-line examples poorly. Line breaks in the source would not show up in the rendered example, making them hard to read. For example, the LaTeX code would be rendered as Note how the meaning of the sample becomes different because newlines have meaning in the syntax of LaTeX. In the badly rendered version of the sample everything after the first '%' is just comment, effectively leaving only , which has a different meaning from the original example.

The change shows that the solution lay in removing the enclose=none command. This sounds rather obscure. Some heavy-duty digging in the Wikimedia documentation gives us the mw:Extension:SyntaxHighlight page, which tells us:
 * The  attribute indicates that the source code should be inline as part of a paragraph (as opposed to being its own block). ... For backwards-compatibility, an   attribute results in the same behaviour.

This reveals that  has the same meaning as , and explains what it does.

I wholeheartedly approve of this change to the template and thank User:Johannes Bo for making it.

--Hops Splurt (discuss • contribs) 12:13, 12 August 2015 (UTC)


 * User:Hops Splurt All the effort in investigating goes to User:ChrisHodgesUK, i just followed his lead. All thanks should be directed to him :-). Please see https://en.wikibooks.org/wiki/Template_talk:LaTeX/Usage --Johannes Bo (discuss • contribs)


 * Ah, that was the page that I couldn't find again while looking for the discussion page about broken examples. So there is Template:LaTeX/Example and Template:LaTeX/Usage. I'll try to add a note and a link in the documentation of both to make editors aware of the other template. Ideally there would only be one template (only LaTeX/Example) which creates the "Usage" form if the  parameter is omitted. --Hops Splurt (discuss • contribs) 18:53, 12 August 2015 (UTC)