Help:Comments

From QED

Jump to: navigation, search

This page is for QED editors. It explains how one can specify a block of text which is not to be displayed. If you have a comment to make about QED please send mail to qed@princeton.edu.

Contents

Comments in Wikitext

HTML comments, which take the form <!-- This is an HTML comment -->, may be used in wikitext to indicate segments of text that are not to be rendered. This is the normal way to include comments in MediaWiki markup.

Using Comments to Specify Keywords

The QED search facility indexes raw text and so HTML-style comments can be used to specify keywords for a page. However, Google indexes rendered text and therefore such keywords will in effect be invisible to Google.

Subtleties

HTML comments are begun by "<--" but not by variants such as "< --".

HTML comments are ended by "-->" but not by variants such as "-- >".

In wikitext, HTML-style comments are removed recursively, so that:

  • <<!---->!----> becomes

If you want to use the string "<--" without it being interpreted as beginning an HTML comment, then you can use the so-called "character entity reference" &lt; instead of the initial <. Similarly, if you want to include the sequence "-->" within an HTML comment, use the character entity &gt; instead of the final >.

Comments within MediaWiki templates and tables

HTML-style comments can be used within template invocations and tables, whether specified by HTML or wikimarkup. For example:

  • {{information|INFORMATION<!--COMMENT-->}} produces


Image:Imbox notice.png
INFORMATION


HTML-style comments are stripped out early in the parsing process and thus, in general, one does not need to be worried about potential ambiguities.

Comments in <math> Markup

Within a <math> block, one can use "%" for single-line comments.

For multi-line comments or if you do not wish to use %, consider using newcommand as follows to define comment:

\newcommand{\comment}[1]{}

This can then be used in the current and subsequent <math> blocks to specify comments, e.g.

\comment{This comment would not appear if it was placed within a <math> block}
Personal tools