Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

Les deux révisions précédentes Révision précédente
Prochaine révision
Révision précédente
Prochaine révision Les deux révisions suivantes
2_programmation:macros:definir_un_caracteres_comme_une_macro [2018/05/25 00:02]
joseph.wright
2_programmation:macros:definir_un_caracteres_comme_une_macro [2018/06/03 16:21]
joseph.wright
Ligne 1: Ligne 1:
 --- ---
-sectionMacro programming +title: Defining characters as macros 
-subsection''​Generic'' ​macros ​and techniques +category: programming 
-permalink: /​FAQ-activechars.html +tags: macros 
-date: 2014-06-10+permalink: /​FAQ-activechars
 --- ---
- 
-# Defining characters as macros 
  
 Single characters can act as macros (defined commands), and both Single characters can act as macros (defined commands), and both
 Plain TeX and LaTeX define the character Plain TeX and LaTeX define the character
-`~` as a ''​non-breakable space''​.  A +`~` as a "non-breakable space".  A 
-character is made definable, or ''​active''​, by setting its+character is made definable, or "active", by setting its
 _category code_ (catcode) to be `\active` (13): _category code_ (catcode) to be `\active` (13):
 ```latex ```latex
Ligne 22: Ligne 20:
 ``` ```
 which could be characterised as an over-simple answer to  which could be characterised as an over-simple answer to 
-[using underscores](FAQ-underscore.md).  However, you must be+[using underscores](FAQ-underscore). ​ However, you must be
 wary: whereas people expect an active tilde, other active characters wary: whereas people expect an active tilde, other active characters
 may be unexpected and interact badly with other macros. ​ Furthermore,​ may be unexpected and interact badly with other macros. ​ Furthermore,​
 by defining an active character, you preclude the character'​s use for by defining an active character, you preclude the character'​s use for
-other purposes, and there are few characters ​''​free'' ​to be subverted+other purposes, and there are few characters ​"free" ​to be subverted
 in this way. in this way.
  
Ligne 38: Ligne 36:
 yawn. This would be an astoundingly bad idea for most documents, but yawn. This would be an astoundingly bad idea for most documents, but
 might have special applications. ​ (Note that, in  might have special applications. ​ (Note that, in 
-`\def``  ​z`, ​+`\def  z`, 
 `z` is no longer interpreted as a letter; the space `z` is no longer interpreted as a letter; the space
 is therefore not necessary&​nbsp;&​mdash;​ `\defz` would do; we choose to is therefore not necessary&​nbsp;&​mdash;​ `\defz` would do; we choose to
Ligne 53: Ligne 51:
 characters will not be interpreted properly when they  appear in the characters will not be interpreted properly when they  appear in the
 argument to another command (as, for example, in argument to another command (as, for example, in
-''​[`\verb` in command arguments](FAQ-verbwithin.md)''​).+"[`\verb` in command arguments](FAQ-verbwithin)").
 An exemplary case is the [`doc`](https://​ctan.org/​pkg/​doc) package, which processes .dtx An exemplary case is the [`doc`](https://​ctan.org/​pkg/​doc) package, which processes .dtx
 files using the [`shortvrb`](https://​ctan.org/​pkg/​shortvrb) package to define files using the [`shortvrb`](https://​ctan.org/​pkg/​shortvrb) package to define
-`|&​hellip;​|` as a shorthand for +`|`&​hellip;​`|` as a shorthand for 
-`\verb``|&​hellip;​|`. But `|` is+`\verb|`&​hellip;​`|`. But `|` is
 also used in the preambles of tabular environments,​ so that tables in also used in the preambles of tabular environments,​ so that tables in
 `dtx` files can only have vertical line separation between `dtx` files can only have vertical line separation between
Ligne 64: Ligne 62:
 Another consequence is that catcode assignments made Another consequence is that catcode assignments made
 in macros often don't work as expected ​ in macros often don't work as expected ​
-(see ''​[Active characters in command arguments](FAQ-actinarg.md)''​).+(see "[Active characters in command arguments](FAQ-actinarg)").
 For example, the definition For example, the definition
 <!-- {% raw %} --> <!-- {% raw %} -->
Ligne 89: Ligne 87:
 ``` ```
 <!-- {% endraw %} --> <!-- {% endraw %} -->
-The alternative (''​tricksy''​) way of creating such an isolated+The alternative ("tricksy") way of creating such an isolated
 definition depends on the curious properties of `\lowercase`,​ which definition depends on the curious properties of `\lowercase`,​ which
 changes characters without altering their catcodes. ​ Since there is changes characters without altering their catcodes. ​ Since there is
-always _one_ active character (`&#x7e;`), we+always _one_ active character (`~`), we
 can fool `\lowercase` into patching up a definition without ever can fool `\lowercase` into patching up a definition without ever
 explicitly changing a catcode: explicitly changing a catcode:
2_programmation/macros/definir_un_caracteres_comme_une_macro.txt · Dernière modification: 2021/10/24 23:05 par jejust
CC Attribution-Share Alike 4.0 International
Driven by DokuWiki Recent changes RSS feed Valid CSS Valid XHTML 1.0