2012-11-01ãã1ã¶æéã®è¨äºä¸è¦§
ããã㯠ãç§ã® TeX ããã°ã©ã å¤æç°å¢ãããããªã宣ä¼ãTeX ï¼ LaTeX Advent Calendar群馬㯠TeX ã«ãªãã¾ãããæ¥æ¬ã¯ TeX ã«ãªãã¾ãããææ¥éå§ãã§ããã°ãããªããï¼è©³ç´°ã¯ ATND ã®ãã¼ã¸ã§ï¼TeX ããã°ã©ã ã§ãããé常ã«é·ãéã®ãã§ãã£ãããâ¦
ããã㯠ãç§ã® TeX ããã°ã©ã å¤æç°å¢ã \tclt@remainder ãä½ããæ±ããããã¨ã«ã¤ãã¦ã¯ããã®ããã°ã§ãä½åº¦ãé¡æã«åãä¸ãã¦ãã¦ãä¾ãã°ããTeX ã§ä½ãé¢æ°ã®ãããªãã®ããã®ã·ãªã¼ãºã§ãæ±ããã¦ãããä»åã®ä½æ¥ã§ã¯ãé¢æ°ããå¤æ° ires ã«æ»ãâ¦
ããã㯠ãç§ã® TeX ããã°ã©ã å¤æç°å¢ã ååã®ç¶ãã 50ã59è¡ç®: æç¶ã eltaso() [BEFORE]function eltaso(_1) max = _1 if max > 9999 then max = 9999 end j = 0 while j < max do j = j + 1 eltaso_name(j) print(sres) end end [AFTER]%%(å ¬é) \eâ¦
ããã㯠ãç§ã® TeX ããã°ã©ã å¤æç°å¢ã ååã¾ã§ã®èª¬æã§ãããããããããããã® Lua ããã°ã©ã ï¼å 㯠(2)ã® eltaso.luaãLua å å¤æå¾ã¯ (9)ã® eltaso4.luaï¼ã TeX ã®ããã°ã©ã ã«å¤æããæºåãæ´ã£ããããããã¯é¨åã«åãã¦ãå ã® Lua ã®ã³ã¼ãâ¦
ããã㯠ãç§ã® TeX ããã°ã©ã å¤æç°å¢ã ããã¶ã¨ã宣ä¼ã TeX ï¼ LaTeX Advent Calendar ããªãã«ããç¥ããªã LaTeX ããã ãã£ã¨ TeX è¸ãããã ï¼è©³ç´°ã¯ ATND ã®ãã¼ã¸ã§ï¼ ç§ã® TeX ã³ã¼ãã£ã³ã°ã¹ã¿ã¤ã« ããã¾ã§ãã³ã¼ãã£ã³ã°ã®æ§å¼ã«ã¤ãã¦ã®â¦
ããã㯠ãç§ã® TeX ããã°ã©ã å¤æç°å¢ã ãããªãã宣ä¼ã TeX ï¼ LaTeX Advent Calendar \textbf ãèªãããæã«ã¯ \futurelet ãèªãã åå¿è ãªäººã TeXnician ãªäººããTeX è¸äººãªäººãã ï¼è©³ç´°ã¯ ATND ã®ãã¼ã¸ã§ï¼ ã¹ããã 5 ï¼ TeX ã³ã¼ãã«ä¸æ°ã«â¦
ããã㯠ãç§ã® TeX ããã°ã©ã å¤æç°å¢ã ããã¤ãã宣ä¼ã TeX ï¼ LaTeX Advent Calendar LaTeX ã TeX ã TeX ã®ãã¡ åå¿è ãããããã£ããããï¼ ï¼è©³ç´°ã¯ ATND ã®ãã¼ã¸ã§ï¼ é åããåååç §ãã«æ¸ãæãã ååã®èå¯ãè¸ã¾ãã¦ãLua ã®ããã°ã©ã â¦
ããã㯠ãç§ã® TeX ããã°ã©ã å¤æç°å¢ã ããªãéã空ããããååã®ç¶ãâ¦â¦ã ãã©ãã®åã«å®£ä¼ã TeX ï¼ LaTeX Advent Calendar TeX ã§é¨ããTeX ã§ç¬ã çããã®ãå¿ãããããã¿ããå¾ ã¡ãã¦ããã¾ãï¼ â»åå¿è 大æè¿ã ãããã¸ã§ã ï¼è©³ç´°ã¯ ATND ã®â¦
ããã¾ãï¼ TeX & LaTeX Advent Calendar (ATND) TeX & LaTeX Advent Calendar TeX ã§é¨ããTeX ã§ç¬ã ã¨ã£ã¦ããã® TeXï¼LaTeX ãã¿ãçã§æã¡å¯ã£ã¦æ¥½ãã ãTeX ï¼ LaTeX Advent Calendarã ã好è©ã«ä»ãä»å¹´ã§ç¬¬ 1 åãè¿ããã«è³ãã¾ããã çããã®ãâ¦
æè¿ãTeX ããã®ããã°ãã¿ä½æç¨è¨èªã¨ãã¦ã®è½åãååã«çºæ®ããäºä¾ãå¢ãã¦ãã¦ãããã¯å¤§å¤åã°ãããã¨ã§ããããããããã¨åæã«é常ã«æ®å¿µãªäºå®ãåå¨ãããããã¯ãTeX ã¨åæã«ã¤ã³ã¹ãã¼ã«ããã BibTeX ãæã£ã¦ããã¯ãã®ãã¿ä½æè½åãã»â¦
ä¾ã® LISP on TeX ãããªã LISP ã«ãªã£ã¦ãã¦ãããã¨ãããã¨ã¯ä½ããã¿ãåºãå¿ è¦æ§ãå¦å¿ç¡ãçããããã§ããããã¡ãã£ã¨æ§åè¦ã¨ãããã¨ã§ãéä¹ã§ãããããããã¦ã¿ããèå¿ã®ãååç°ããããç¾ããªããæ°ã«ããªãã ï¼ãªã¹ããå¤ç¨ããããã°ã©â¦
ã¹ããã 4 ï¼ å¼ã¨å®è¡å¶å¾¡ã®é¢é£ã®å¦ç å ã®ããã°ã©ã ã¯ã·ãªã¼ãº(5)ã®æå¾ã«æ²è¼ãã eltaso2.luaã å¼ãå解ãã æ´æ°ã®ååæ¼ç®ã«ã¤ãã¦ãTeX ã«ã¯åç´ãª + - * / ã¯ç¡ãã¦ãï¼Cè¨èªã®ï¼è¤åä»£å ¥ += -= *= /= ã«ç¸å½ããæ©è½ã ããç¨æããã¦ãããï¼Luâ¦
è£è¶³ï¼ TeX ã«é¢æ°ã¯ãªãã¨ãããªãããªãäºæ ååã®è¨äºã§ã¯ãï¼æ»ãå¤ã®ããï¼é¢æ°ãï¼æ»ãå¤ã®ãªãï¼æç¶ãã«ç½®ãæããã¨ããå¤ææä½ãè¡ã£ããããã¦ãããå¿ è¦ãªçç±ã¨ãã¦TeX ã«ã¯é¢æ°ããªãã¨è¿°ã¹ããã¨ãããããã«ã¤ãã¦éåæãæã¤äººãããããâ¦
ããã㯠ãç§ã® TeX ããã°ã©ã å¤æç°å¢ã ã¹ããã 3 ï¼ é¢æ°ã«é¢é£ããå¦çãè¡ã å ã®ããã°ã©ã ã¯ååã®è¨äºã®æå¾ã«æ²è¼ãã eltaso1.luaã é¢æ°ã追æ¾ãã ããã§ãé¢æ°ãã¨ããã®ã¯ãæ»ãå¤ãè¿ãæç¶ããï¼ã ããå¼ã®ä¸ã§ä½¿ããã¨ãã§ããï¼ã®ãã¨â¦
ãããããããªè§£èª¬ã®éä¸ã§ãããããããããããªããºã«ãã©ããã ï¼åå¿è ã®äººã¯æ°ã«ããªãã§ï¼ï¼ TeX è¸äºº 2 ç´ç¸å½ã plain pTeX ã¾ã㯠pLaTeX ã«ããã¦ã以ä¸ã®ä»æ§ãæºããå®å ¨å±éå¯è½ãªãã¯ã \eltasoname ãå®è£ ããï¼ \eltasoname{<æ£æ´æ°n>} â¦
ããã㯠ãç§ã® TeX ããã°ã©ã å¤æç°å¢ãã¹ããã 2 ï¼ å¤æ°é¢é£ã®å¦çãè¡ãããããã¯ãLua è¨èªã®ç¯çã«ããã¦ãå ã®ããã°ã©ã ããTeX ã«è¿ããå½¢ã«å¤æãã¦ãããå ã®ããã°ã©ã ãåæ²ãã¦ããã[eltaso0.lua] alpha_name = { [0] = "ãã£ã¨", "ãã¼"â¦
ããã㯠ãç§ã® TeX ããã°ã©ã å¤æç°å¢ã ã¹ããã 1 ï¼ ä»æ§ã決ãã æ©éããã°ã©ã ã®å¤æãå§ãããã¨ããã ãããã®åã«ã ããã±ã¼ã¸ã®ååã決ãã ããªãã¡ \eltaso ã®å®è£ ã³ã¼ããæ¸ããã .sty ãã¡ã¤ã«ã®ååã決ãããããã§ã¯ tceltaso ã¨å½åâ¦
ï¼ååã®ç¶ãï¼ è§£èª¬ã®æ¹éã¨ã å½åãããã®ããããã®é ç®ã«ã¤ãã¦è©³ç´°ã説æãããã¨ããæãã§è¨äºãæ¸ãã¦ãããã¨æã£ã¦ããããããããããã¨ã©ããã¦ãéãã解説ãé·ãç¶ããã¨ã«ãªããèªè ã®è² æ ã«ãªãæãããããã¡ããã©ãæ®éã®è¨èªã®ããã°â¦
TeX è¨èªã¯ä»ã®ä¸è¬ã«æ®åãã¦ããããã°ã©ã è¨èªã«æ¯ã¹ãã¨ãç¿å¾ãé£ããã¨è¨ããããã¨ãå¤ãããã®ä¸»å ã®ä¸ã¤ã ã¨æãããã®ããTeX ã®å®è¡ã¢ãã«ãä»ã®è¨èªã¨å¤§ããç°ãªããã¨ã§ãããTeX è¨èªã¯ãã®å®è¡å¶å¾¡ãããã¯ãã®å±éãã¨ããæååï¼æ£ç¢ºã«ã¯â¦
åå ã¬ãã¼ãã ã¨æã£ãï¼ æ®å¿µï¼ï¼ï½ï½ éãå ´ã®æ´»åè¨é²ï¼2012å¹´ åã«ç´åã«ããã°ã«åºãããã¿ãå°å·ããã ãã§ãç¹ã«ãéãéå®æ°ãã¿ãã§ã¯ãªãã£ãã®ã§ãå®å¿ããï¼ä½ãã ï¼