ãã¡ãªã¿ã«ðã
— æZRï¼ããããðï¼ (@zr_tex8r) 2023å¹´9æ26æ¥
TeXè¨èªð¤®ã®ã³ã¼ããè±åãªãðã§æ¸ãé£ããï¼
ã»è¨å·ã¨æ°åã ãã§æ¸ã â ããã¨ã«ã³ã¿ã³ð
ã»è¨å·ã ãã§æ¸ã â ã¨ã¦ãã ãºã«ã·ã¤ð
å®ã¯ãæ°åã使ããããã§å¤§ããå¤ãã£ã¦ããã#TeX #TeXè¨èª
ã¨ããããã§ãæ¬è¨äºã§ã¯ãTeXè¨èªã®ã³ã¼ãï¼LaTeXææ¸ã®ã½ã¼ã¹ãå«ãï¼ãè¨å·ã¨æ°åã®ã¿ãå«ãï¼ãã§ããèªã¿ã«ããðï¼ã³ã¼ãã«å¤æãããããã®å ·ä½çãªæé ã«ã¤ãã¦è§£èª¬ãã¾ãã
â»å¯¾è±¡ã¨ããã³ã¼ãã¯ASCIIæåã®ã¿ãå«ããã®ã«éãã¾ããTeXã¨ã³ã¸ã³ã®ç¨®é¡ã«ã¯ä¾åãã¾ããã
ããã³çç¥è
ãªãã¨ãã¤ã³ã¿ã¡ã¼ãããã«ã¯ããã§ããèªã¿ã«ããTeXè¨èªã®ããã³ãã解説ããã¹ãã©ã·ã¤è¨äºãããã¾ãããã§ããèªã¿ã«ããTeXè¨èªåå¿è ã¯ã¾ããããèªã¿ã¾ãããã
- TeX ã®é£èªå â ã©ã³ã°ã»ã©ã°ã¼
ããã§ç´¹ä»ããæé ã§ã¯ä¸è¨è¨äºã®ããµã¼ã«ã ãã¬ãã¯ã¹ã¡ã½ãããï¼ã½ã¼ã¹ä¸ã®æåã代ç¨ãã^^ab
å½¢å¼ã®æåã³ã¼ã表è¨ï¼ãå©ç¨ãã¾ãã
â»æ¬è¨äºã§ã¯ããµã¼ã«ã ãã¬ãã¯ã¹ã¡ã½ãããã®ãã¨ãï¼ä¾ã«ãã£ã¦1ï¼ãTeXã¨ã¹ã±ã¼ããã¨å¼ã³ã¾ãã
è±åãã°ããã¤ããæé
ASCIIæåãããªãã³ã¼ãããè¨å·ã¨æ°åã ããã«ããã«ã¯è±åï¼Aï½Zãaï½zï¼ãé¤å»ããå¿ è¦ãããã¾ãããã®ãããè±å¤§æåãé¤å»ããããè±å°æåãé¤å»ãããã¨ãã2ã¤ã®ã¹ããããé ã«å®è¡ãããã¨ã§å®ç¾ãã¾ãã
è±å¤§æåãã°ããã¤ãã話
æåã®ã¹ãããã¨ãã¦ASCIIæåã®ã³ã¼ãããè±å¤§æåãå«ã¾ãªããã®2ãã«å¤æãã¾ããããã¯æ©æ¢°çã«å¦çã§ããåå¥ã«å¯¾å¦ããå¿ è¦ãããã¾ãããããã»ã©é£ããä½æ¥ã§ã¯ããã¾ãããå ã ãTeXè¨èªã®ãããã°ã©ã ã£ã½ãã³ã¼ããã§ã¯å¤§æåã¯ã»ã¨ãã©ä½¿ããã¾ãããTeXã®ããªããã£ãåããã¼ã¯ã¼ãã¯å ¨ã¦å°æåã§ããããã©ã¼ããããæä¾ããå¶å¾¡ç¶´åã大é¨åãå°æåã®ã¿ãããªãããã§ãã
ãã®ãããè±å¤§æåãåºç¾ããç®æã®å¤ãã¯ãæåãåºåããé¨åãã«ãªããããã«ã¤ãã¦ã¯\uppercase
ã使ãã¨å¯¾å¦ã§ãã¾ãã次ã®ãããªã³ã¼ããèãã¦ã¿ã¾ãããã
\documentclass{article} \begin{document} Hello, ZR world! \end{document}
\uppercase
ãå©ç¨ãããã¨ã§å¤§æåãæ¶ããã¨ãã§ãã¾ãã
\documentclass{article} \begin{document} \uppercase{h}ello, \uppercase{zr} world! \end{document}
ãã¡ãããæã«ã¯å¤§æåãå«ãååã®å¶å¾¡ç¶´ã使ããããã¨ããããããã®å¯¾å¦ã¯åä»ã§ãã
\documentclass{article} \begin{document} Hello, {\TeX} world! \end{document}
ãã®å ´åã¯\csnameï½\endcsname
ã¨\uppercase
ãé§ä½¿ãã¦å¯¾å¦ãããã¨ã«ãªãã¾ãã
\documentclass{article} \begin{document} \def\smalle{e} \uppercase{h}ello, \uppercase{\csname t\smalle x\endcsname} world! \end{document}
å°ãæå·§çãªã®ã§è£è¶³ãã¦ããã¾ãã\uppercase
ã¯æåãã¼ã¯ã³ã ãã«ä½ç¨ãã¦å¶å¾¡ç¶´ã¯å¤åãããªãã®ã§ã
\uppercase{\csname t\smalle x\endcsname} âå®è¡ \csname T\smalle X\endcsname âå±é(ãã㧠\smalle ãå±é) \TeX
ã¨ãªãçµæçã«\TeX
ãå®è¡ããã¾ãã注æãã¹ããªã®ã¯ã\uppercase
ã¯å±éå¯è½ã§ãªããï¼ããã¦\csnameï½\endcsname
ã®ä¸ã¯å±éã§å¦çãããï¼ã¨ãããã¨ã§ããã®ãã\csname\uppercase{t}e\uppercase{x}\endcsname
ã¨ã¯æ¸ãã¾ããã
ããå°ãâæ©æ¢°çã«å¦çâãããã¨ããå ´åã¯ã大æåã«å¤æããå®å
¨å±éå¯è½ãªãã¯ãï¼\upcase
ï¼ãä½æ3ãããã¨ããææ³ãæå¹ã§ãããã
\documentclass{article} \makeatletter \def\upcase#1{\@nameuse{my@uc/#1}} \def\my@uc@a#1{\uppercase{\my@uc@b#1}} \def\my@uc@b#1#2{\@namedef{my@uc/#2}{#1}} \@tfor\my@x:=abcdefghijklmnopqrstuvwxyz\do{% \expandafter\my@uc@a\my@x\my@x} \makeatother \begin{document} \upcase{h}ello, {\csname\upcase{t}e\upcase{x}\endcsname} world! \end{document}
ãã®\upcase
ã使ããã¨ã§å¤æãããªã楽ã«ãªãã¾ãã
è±å°æåãã°ããã¤ãã話
å
ã®ã¹ãããã§è±å¤§æåãé¤å»ããã®ã§æ®ã£ã¦ããè±åã¯å°æåã ãã«ãªãã¾ããããã¯ãè±å°æåãTeXã¨ã¹ã±ã¼ãå½¢å¼ã«å¤æããããã¨ã§æ©æ¢°çã«é¤å»ã§ãã¾ããè±å°æåï¼aï½zï¼ã®ASCIIã³ã¼ãã¯0x61ï½7Aã§ãããããåæåï¼^^X
ï¼ã®TeXã¨ã¹ã±ã¼ãå½¢å¼ã«ç´ããå ´åã®X
ã®é¨åã®æåã³ã¼ãã¯0x21ï½3Aã¨ãªãããã®ç¯å²ã®æåã¯å
¨ã¦è¨å·ã¨æ°åã«ãªãããã§ãã
å¤æå: abcdefghijklmnopqrstuvwxyz å¤æå¾: !"#$%&'()*+,-./0123456789:
ãã ããã®ä¸ã®ãpï½yãã®ç¯å²ã«ã¤ãã¦ã¯å°ã注æãå¿
è¦ã§ããä¾ãã°ãw3
ãã¨ããæååã®è±å°æåé¨åãä¸è¨ã®è¦åã«å¾ã£ã¦TeXã¨ã¹ã±ã¼ãã«å¤æããã¨^^73
ã¨ãªãã¾ãããããã¯16é²æ³ã®TeXã¨ã¹ã±ã¼ãã®å½¢å¼ã«åè´ãã¦ããããs
ã¨ããç°ãªãæååã«è§£éããã¦ãã¾ãã¾ãã
ãã®åé¡ãåé¿ããããããpï½yãã®ç¯å²ã®æåã¯åæåã®TeXã¨ã¹ã±ã¼ãï¼^^0ï½^^7
ï¼ã®ä»£ããã«16é²æ³ã®TeXã¨ã¹ã±ã¼ãï¼^^70ï½^^79
ï¼ã«å¤æãããã¨ã«ãã¾ããããã¨w3
ã®å¤æçµæã¯^^773
ã¨ãªããå¥ã®æååã«è§£éããããã¨ã¯ãªããªãã¾ã4ã
ã¾ã¨ããã¨ã以ä¸ã®æé ã«ããè±å°æåãé¤å»ã§ãã¾ãã
- ã¾ããpï½yãã16é²æ³TeXã¨ã¹ã±ã¼ãï¼
^^70ï½^^79
ï¼ã«å¤æããã - æ®ãã®è±å°æåï¼aï½zï¼ãåæåTeXã¨ã¹ã±ã¼ãï¼
^^!ï½^^:
ï¼ã«å¤æããã
次ã®ãããªï¼è±å¤§æåãå«ã¾ãªãï¼ã³ã¼ããèãã¦ã¿ã¾ãããã
\catcode`\@=11 \newcount\my@n \my@n=42
å ã®æé ã«å¾ã£ã¦å¤æããã¨è±å°æåãå«ã¾ãªãã³ã¼ããå¾ããã¾ãã
\^^#^^!^^74^^#^^/^^$^^%`\@=11 \^^.^^%^^77^^#^^/^^75^^.^^74\^^-^^79@^^. \^^-^^79@^^.=42
ãã®example-3a.texã¯TeXã®åå¥è§£æã®è¦åã®ä¸ã§ã¯example-3.texã¨å ¨ãåä¸ã®ã³ã¼ãã¨è§£éãããããã§ãã
è¨å·ã¨æ°åã ãã§âhello worldâããã£ã¦ã¿ã話
ããã¾ã§èª¬æãã2ã¤ã®ã¹ããããé ã«å®è¡ãããã¨ã§ãã©ããªTeXè¨èªã³ã¼ãã§ããè¨å·ã¨æ°åã ãã®ã³ã¼ããã«å¤æã§ãã¾ããä¾ã¨ãã¦ãâhello worldâã®LaTeXææ¸ããè¨å·ã¨æ°åã ãã®ã³ã¼ããã«å¤æãã¦ã¿ã¾ãããã
\documentclass{article} \begin{document} Hello, {\TeX} world! \end{document}
ããã¯åç¯ã§ä¾ã«ãããexample-2.texã¨åããã®ã§ããå¾ã£ã¦ãããããè±å¤§æåãé¤å»ãããçµæã®ã³ã¼ãï¼ã®ä¸ä¾ï¼ãexample-2a.texã¨ãªãã¾ãããã ãå¤æå¾ã®ã³ã¼ãã¯æ¨ªã«é·ããªãã®ã§ãæ¹è¡ãå¤ãã«å ¥ãã¦ãããã¨ã«ãã¾ãã
\documentclass{article} \begin{document} \def\smalle{e} \uppercase{h}ello, \uppercase{\csname t\smalle x\endcsname} world! \end{document}
ãã¨ã¯ãã®ã³ã¼ããâTeXã¨ã¹ã±ã¼ãå¤æâãã¦ãè±å°æåãé¤å»ãããã°ãæ°åã¨è¨å·ã ãã®ã³ã¼ãããå®æãã¾ãã
\^^$^^/^^#^^75^^-^^%^^.^^74^^#^^,^^!^^73^^73{^^!^^72^^74^^)^^#^^,^^%} \^^"^^%^^'^^)^^.{^^$^^/^^#^^75^^-^^%^^.^^74} \^^$^^%^^&\^^73^^-^^!^^,^^,^^%{^^%} \^^75^^70^^70^^%^^72^^#^^!^^73^^%{^^(}^^%^^,^^,^^/, \^^75^^70^^70^^%^^72^^#^^!^^73^^%{\^^#^^73^^.^^!^^-^^% ^^74\^^73^^-^^!^^,^^,^^% ^^78\^^%^^.^^$^^#^^73^^.^^!^^-^^%} ^^77^^/^^72^^,^^$! \^^%^^.^^${^^$^^/^^#^^75^^-^^%^^.^^74}
ã¾ãã§è§£èªä¸è½ãªã®ã§ãããã¢ç´ æµð
å®éã«LaTeXã§å¦çãã¦ã¿ã¾ãããã
å ã®ã³ã¼ãã¨åãåºåãå¾ããã¾ããð
ã¾ã¨ã
ã¨ããããã§ããTeXè¨èªð¤®ã¯ã«ã³ã¿ã³ã ããããã©ãã¤ðãã¨ãã人ã¯ãã²ã使ãæåãå¶éããðãã¨ã«ææ¦ãã¦ã¿ã¾ãããï¼ðï¼ãã£ï¼
- çè ã常ç¨ãã¦ããç¨èªããTeXã¨ã¹ã±ã¼ããã§ããã¡ãªã¿ã«ãã®è¡¨è¨ã«å¯¾ããâæ£å¼å称âã¯åå¨ããªãããã§ããï¼tex.webã®ä¸ã§ã¯âexpanded charactersâã®ãããªè¡¨ç¾ã使ããã¦ãã¾ããï¼↩
-
ãã ãããAï½Iã»Pï½Yãã®ç¯å²ã®æåã¯TeXã¨ã¹ã±ã¼ãã§è¨å·ã¨æ°åã®ã¿ã®è¡¨è¨ï¼
^^41
ï½^^49
ã»^^51
ï½^^59
ï¼ã«å¤æã§ããã®ã§ãå®éã«åé¡ã«ãªãã®ã¯ãJï½Oã»Zãã ãã«ãªãã¾ãã↩ - ãå®å ¨å±éå¯è½ã§ãªããã®å®å ¨å±éå¯è½ã«ãããããã®å¸¸å¥æ段ã§ãããäºåã«è¨ç®ãã¦ãã®çµæãï¼æ¬ä¼¼ï¼é åã«ä¿åãããã¨ããææ³ã使ã£ã¦ãã¾ãã↩
-
^^
ã§å§ã¾ã16é²æ³ã®TeXã¨ã¹ã±ã¼ãã®16é²æ°å¤ã¯å¸¸ã«ä¸åº¦2æ¡ã§è¡¨ããã¾ããUnicode対å¿ã®XeTeXãLuaTeXã§ã¯0x100以ä¸ã®æåã³ã¼ãã使ããã¾ããããã®å ´åã®TeXã¨ã¹ã±ã¼ã表è¨ã¯^^^^2603
ã^^^^^^01f986
ã®ããã«^
ã®åæ°ãå¢ãããå½¢ã«ãªãã¾ãã↩