KTUGFaq
KTUG FAQ
Generosity and perfection are your everlasting goals.
¸ñÂ÷
- 1 CategoryCode
- 1.1 \catcode ¸í·É
- 2 CategoryCodeÀÇ »ç¿ë
- 2.1 \makeatletter, \makeatother
- 2.2 CategoryCode ¿¹Á¦
[ÆíÁý]
1 CategoryCode ¶
TeX ¼³°è»óÀÇ Æ¯Â¡ ÁßÀÇ Çϳª·Î¼, ÀԷµǴ ¸ðµç ¹ÙÀÌÆ®¸¦ 16°¡ÁöÀÇ Category·Î ±¸ºÐÇÏ¿© ó¸®ÇÏ´Â °ÍÀÌ´Ù. default´Â ´ÙÀ½°ú °°´Ù.
Category | ¼³¸í | ±âÁ¤°ª |
0 | escape character | \ |
1 | ±×·ì ¿±â | { |
2 | ±×·ì ´Ý±â | } |
3 | ¼öÇиðµå Àüȯ | $ |
4 | Á¤·Ä ÅÇ | & |
5 | Çೡ | <Return>, ^^M(ASCII return) |
6 | parameter | # |
7 | À÷ÀÚ | ^, ^^K |
8 | ¾Æ·§Ã·ÀÚ | _, ^^A |
9 | ignored character | NUL, ^^@ (ASCII null) |
10 | ½ºÆäÀ̽º | , ^^I(ASCII horizontal tab) |
11 | ±ÛÀÚ(letter) | A..Z, a..z |
12 | ±âŸ¹®ÀÚ | ³ª¸ÓÁö ¸ðµÎ |
13 | active character | ~, ^^L(ASCII form feed) |
14 | Ä¿¸àÆ® ¹®ÀÚ | % |
15 | invalid character | DEL, ^^J(ASCII delete) |
- letter¸¦ ±ÛÀÚ, character¸¦ ¹®ÀÚ¶ó°í ¹ø¿ª
[ÆíÁý]
1.1 \catcode ¸í·É ¶
ƯÁ¤ÇÑ ¹®ÀÚÀÇ CategoryCode¸¦ º¯°æÇÏ·Á¸é \catcode¸¦ ¾´´Ù. ¿¹ÄÁ´ë
\catcode`\[=1 \catcode`\]=2
[ÆíÁý]
2.1 \makeatletter, \makeatother ¶
LaTeX¿¡¼ ÈçÈ÷ ¾²ÀÌ´Â ¸í·ÉÀ¸·Î \makeatletter¿Í \makeatother°¡ ÀÖ´Ù.
TeXÀº ±× ¼³°è»ó ¸ðµç ControlSequences°¡ ¿øÄ¢ÀûÀ¸·Î ¹®ÀÚ(letter = catcode 11)·Î ÀÌ·ç¾îÁöµµ·Ï ¾à¼ÓµÇ¾î ÀÖ´Ù. ±×·±µ¥ LaTeXÀÇ ¼³°èÀÚµéÀº @¹®ÀÚ(at-¹®ÀÚ)µµ ControlSequences¿¡¼ »ç¿ëÇÏ°í ½Í¾îÇß´Ù.
@¹®ÀÚ´Â ¿ø·¡ ±âŸ¹®ÀÚ(other characters = catcode 12)¿¡ ÇØ´çÇÏ´Â °ÍÀÌ´Ù. ±×·¯¹Ç·Î ±× ÀÚü·Î´Â ControlSequences¿¡ »ç¿ëµÉ ¼ö ¾ø´Ù. ÀÌ ¹®ÀÚ¿¡ CategoryCode 11À» ÇÒ´çÇÏ¿© ¸¶Ä¡ ¹®ÀÚ(letter)ÀÎ °Íó·³ Ãë±ÞÇ϶ó´Â ¸í·ÉÀÌ \makeatletterÀÌ´Ù. \makeatletter ¸í·ÉÀ» Áö½ÃÇÑ ÀÌÈķδ @¹®ÀÚÀÇ catcode´Â 11ÀÌ µÇ¾î ´Ù¸¥ ¹®ÀÚµé°ú ÇÔ²² ¸í·É(ControlSequences)ÀÇ ÀϺηΠ¾²ÀÏ ¼ö ÀÖ´Ù.
¹Ý¸é, @¹®ÀÚ¸¦ ¿ø·¡ÀÇ »ç¿ë¹ýÀ¸·Î µÇµ¹·ÁÁÖ·Á¸é CategoryCode¸¦ 12·Î ¼³Á¤ÇØ¾ß ÇÑ´Ù. ÀÌ°ÍÀÌ \makeatotherÀÌ´Ù. letter³ª other´Â catcode 11, 12¸¦ °¢°¢ ÁöĪÇÏ´Â ¸»ÀÌ´Ù.
\def\makeatletter{\catcode`\@11\relax} \def\makeatother{\catcode`\@12\relax}@¹®ÀÚ¸¦ Æ÷ÇÔÇÏ´Â ControlSequences´Â LaTeX ¹®¼ÀÇ º»¹®¿¡¼ ¾²·Á¸é \makeatletter, \makeatother¸¦ ÁöÁ¤Çؾ߸¸ ÇÑ´Ù. ÀÌ Á¡À» ÀÌ¿ëÇÏ¸é »ç¿ëÀÚ¿Í Á÷Á¢ ÀÎÅÍÆäÀ̽ºÇÏ´Â ¸í·ÉÀÌ ¾Æ´Ñ, ¾î¶² ÇÔ¼öÀÇ ³»ºÎ ¸í·ÉÀ¸·Î »ç¿ëµÇ´Â °ÍÀÓÀ» º¸´Ù ºÐ¸íÇÏ°Ô (½Ã°¢ÀûÀ¸·Î) º¸¿©ÁÙ ¼ö ÀÖ´Ù´Â ÀåÁ¡ÀÌ ÀÖ´Ù. Áï, @¹®ÀÚ°¡ »ç¿ëµÈ ¸í·ÉÀº ´ëºÎºÐ ½ºÅ¸ÀÏÀ̳ª Ŭ·¡½ºÀÇ ³»ºÎ¸í·ÉµéÀÌ´Ù. È®Àå¸íÀÌ .styÀÎ ½ºÅ¸ÀÏ°ú .clsÀΠŬ·¡½º ÆÄÀÏÀº º°µµ·Î \makeatletter¸¦ Áö½ÃÇÏÁö ¾Ê¾Æµµ ±× ÆÄÀÏÀÇ ¹üÀ§ ¾È¿¡¼ @ ¹®ÀÚ¸¦ ControlSequencesÀÇ ÀϺηΠÀνÄÇÑ´Ù.
[ÆíÁý]
2.2 CategoryCode ¿¹Á¦ ¶
CTAN¿¡µµ ÀÖ´Â °ÍÀ¸·Î, ¿¹Àü¿¡ comp.text.tex¿¡ ¿Ã¶ó¿Ô´ø Àç¹ÌÀÖ´Â ¿¹Á¦.
\let~\catcode~`76~`A13~`F1~`j00~`P2jdefA71F~`7113jdefPALLF PA''FwPA;;FPAZZFLaLPA//71F71iPAHHFLPAzzFenPASSFthP;A$$FevP A@@FfPARR717273F737271P;ADDFRgniPAWW71FPATTFvePA**FstRsamP AGGFRruoPAqq71.72.F717271PAYY7172F727171PA??Fi*LmPA&&71jfi Fjfi71PAVVFjbigskipRPWGAUU71727374 75,76Fjpar71727375Djifx :76jelse&U76jfiPLAKK7172F71l7271PAXX71FVLnOSeL71SLRyadR@oL RrhC?yLRurtKFeLPFovPgaTLtReRomL;PABB71 72,73:Fjif.73.jelse B73:jfiXF71PU71 72,73:PWs;AMM71F71diPAJJFRdriPAQQFRsreLPAI I71Fo71dPA!!FRgiePBt'el@ lTLqdrYmu.Q.,Ke;vz vzLqpip.Q.,tz; ;Lql.IrsZ.eap,qn.i. i.eLlMaesLdRcna,;!;h htLqm.MRasZ.ilk,% s$;z zLqs'.ansZ.Ymi,/sx ;LYegseZRyal,@i;@ TLRlogdLrDsW,@;G LcYlaDLbJsW,SWXJW ree @rzchLhzsW,;WERcesInW qt.'oL.Rtrul;e doTsW,Wk;Rri@stW aHAHHFndZPpqar.tridgeLinZpe.LtYer.W,:jbye
latexÀÌ ¾Æ´Ï¶ó texÀ» ½ÇÇàÇØ¾ß ÇÕ´Ï´Ù.