Magic characters Contents Index

## Magic characters

Hyperlatex makes extensive use of "meta" characters, also called "magic" characters in its passes.2 The meta characters are the regular character, plus hyperlatex-meta-offset. Broadly, the meta characters have two uses, protecting characters from being interpreted, and as single-character document processing commands.

### Protecting characters

Most magic characters are used to protect characters from final substitution. After Hyperlatex conversion, all &, <, and > characters in the file are converted to XML symbols (i.e. &amp; &lt; and &gt;), while the meta-&, meta-< and meta-> are converted to the normal &, <, > characters.

In addition to the space, these are the characters converted for this reason:

&  <  >  %  {  }  "  ~  -  '


For example, the < and > characters are meaningless to LaTeX, but meaningful as HTML. So as LaTeX macros are turned into HTML directives, they are bracketed with these meta brackets for the duration of the processing. The last processing step (in hyperlatex-final-substitutions) puts them all back.

### Indicating text layout

Meta characters are used a single-character marks for various kinds of text layout directives. These are outlined below.

meta-C
is used (with the meta versions of { and }) to escape the magic characters, if they appear in the input file, like this: C{}.
meta-|
is used in parsing arguments to macros. It is placed in the text to delimit an argument from the text following the command. After the command is interpreted, the character is removed.
meta-l
is used to mark the spot after something that has been labeled. For instance, saying
\section{abc}

will generate an automatic label, an <h> tag, and then a meta-l marker. If now a \label command follows, Hyperlatex checks the presence of meta-l to make sure that the label before the section heading is used.
meta-X
marks locations where Hyperlatex doesn't yet know what text to mark as the anchor of a label (i.e. the contents of an <a name="xxx">xxx</a> tag). This is then done in the final substitution stage.
meta-p
marks where a paragraph break should happen.
meta-n
indicates places where no paragraph break should occur.
meta-P
is for marking paragraph endings.

### Paragraph tags

Paragraph tags are controlled by two flags:

hyperlatex-in-paragraph
This is set to t at the beginning of a paragraph, and to nil when a paragraph ends. A paragraph should begin when printable material is ready to be placed on the "page," and when it's appropriate to put it into a paragraph.
hyperlatex-in-body
This is set to t when it's worth considering whether a paragraph is even appropriate here. For example, it's set to nil during the creation of a html node (file) header, during the formatting of a section head, and during the formatting of the example environment. You can unset and set this variable with \suspendpars and \resumepars`.

July 13, 2005

 Magic characters Contents Index
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.822521448135376, "perplexity": 4304.846030412836}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.3, "absolute_threshold": 10, "end_threshold": 15, "enable": false}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2015-32/segments/1438042988962.66/warc/CC-MAIN-20150728002308-00046-ip-10-236-191-2.ec2.internal.warc.gz"}