ãã㯠TeX ïŒ LaTeX Advent Calendar 2014 ã® 15 æ¥ç®ã®èšäºãšããŠäœæãããã®ã§ãïŒ æšæ¥ïŒ12/14ïŒã¯ hak7a3 ããïŒææ¥ïŒ12/16ïŒã¯ !CardinalXaro ããã§ãïŒ
TeX ãŠãŒã¶ã®éã 2014 ã®äŒæ©äžïŒ 次ã®ããã« pLaTeX ã§èšè¿°ãããšïŒå šè§ã«ã³ããšéãæ¬åŒ§ã®éã«ã¯å šè§ç©ºããæ¿å ¥ãããŠããŸããšããæåã話é¡ã«ãªããŸããïŒ
ããã¯ïŒ\textgt{ãã»ãå
宣èšã}ã®âŠâŠ
ãã®èšäºã§ã¯ïŒäžèšã®æåãïŒè§£æ±ºã®å©ãã«ãªãããšãæåŸ
ããŠå®è£
ãã \lastnodechar
ããªããã£ã
ã«ã€ããŠè§£èª¬ããŸãïŒ
é¢é£ããŒãžãšããŠïŒ
- e-pTeX ã«ã€ããŠã® Wiki
- \pdfshellescape, \lastnodechar ã®å®è£ ïŒTeX Forum äžã®ã¹ã¬ããïŒ ãæããŠãããŸãïŒ
\lastnodechar
ããªããã£ãã¯ïŒ
TeX Live éçºçã®ãœãŒã¹ã« r35619
(2014/11/19) ã«ã³ãããããããã®ãããŸãšãã«äœ¿ããã¯ããã®ãã®ã§ãïŒ
åŸã£ãŠïŒ
- è§è€ããã® W32TeX ã§ã¯ 2014/11/19 以éã®ãã®ã§äœ¿çšã§ããŸãïŒ
- TeX Live 2014 ã§ã¯ãã®ãŸãŸã§ã¯äœ¿ããŸããïŒäžèšã®éçºçã®ãœãŒã¹ããèªåã§ãã«ãããå¿ èŠããããŸãïŒ
- æ¥å¹ŽãªãªãŒã¹ãããäºå®ã® TeX Live 2015ã«ã¯å ¥ãã§ãããïŒ
ãŸãïŒ\lastnodechar
ããªããã£ãã¯ïŒ
e-æ¡åŒµãæå¹ã«ãªã£ãŠãã e-pTeX, e-upTeX ã«ã®ã¿å®è£
ãããŠããŸãïŒ
ã³ãã³ãåã§èšãã°ïŒ
- ptex, uptex ã§ã¯äœ¿ããŸããïŒplain TeX ã§äœ¿ãããå ŽåïŒeptex, euptex ãçšããŠãã ããïŒ
- platex, uplatex ã§ã¯ïŒe-pTeX, e-upTeX ã§åããŠããã®ã§ïŒåé¡ãããŸããïŒ
ããŠïŒpTeX ç³»åïŒASCII pTeX, upTeX, e-pTeX, e-upTeXïŒã§ã¯ïŒåææåéã«å ¥ã空çœã«ã€ããŠïŒæ¬¡ã®ãããªä»æ§ã«ãªã£ãŠããŸãïŒ
- åææå以å€ã®ãã®ã®çŽåŸã«åææå p ãæ¥ãå Žåã¯ïŒp ã®çŽåã«ãæåã¯ã©ã¹ 0 ã®æåãš p ã®éã«å ¥ã空çœããæ¿å ¥ããã
- åææå p ã®çŽåŸãåææåã§ãªãå Žåã¯ïŒp ã®çŽåŸã«ãp ãš æåã¯ã©ã¹ 0 ã®æåã®éã«å ¥ã空çœããè¿œå ããã
- åææå p ã®çŽåŸã«åææå q ãæ¥ãå Žåã¯ïŒäž¡è ã®éã«ãp ãš q ã®éã«å ¥ã空çœããè¿œå ããã
ããããã®åŸåéšã®ããã®éã¯ïŒãã©ã³ãã¡ããªãã¯ã«ãã£ãŠæ±ºããããŠããŸãïŒåæãã©ã³ãã¡ããªãã¯ïŒpTeX å ¬åŒããŒãžå ã®ãã¡ã€ã«ãã©ãŒãããã®è§£èª¬ïŒã§ã¯ïŒåææåãããã€ãã®æåã¯ã©ã¹ã«ã°ã«ãŒãåãïŒæåã¯ã©ã¹ããšã«å¯žæ³ã»ç©ºçœã®æå®ãããããšã«ãªã£ãŠããŸãïŒ
äžèšã®ç©ºçœæ¿å ¥ã®ä»æ§ã¯æ¬§æã«ããããªã¬ãã£ã»ã«ãŒãã³ã°åŠçã«é¡äŒŒããä»æ§ã«ãªã£ãŠããïŒ èª€è§£ãæããã«èšãã°ãåææåã®é£ç¶ããåèªãããªãïŒåèªã®ååŸã«ã¯æåã¯ã©ã¹ 0 ã®åææåãä»®æ³çã«ãããã®ãšã¿ãªãããšãªããŸãïŒ
äžã®èª¬æã§ã¯äœãè¿°ã¹ãŠããããããã¥ãããšæãã®ã§ïŒå ·äœäŸãè¿°ã¹ãŸãïŒ äŸãã°ïŒpLaTeX2e æ°ããã¥ã¡ã³ãã¯ã©ã¹ ãªã©ã§äœ¿ããã JIS ãã©ã³ãã¡ããªãã¯ã§ã¯ïŒæ¬¡ã®ããã«ãªã£ãŠããŸãïŒ
- (a) 挢åãªã©ïŒã»ãšãã©ã®æåã¯æåã¯ã©ã¹ 0
- (b) æåã¯ã©ã¹ 0 ã®æåãšéãæ¬åŒ§ãããã®éã«ã¯åè§ç©ºããå ¥ã
- (c) å šè§ã«ã³ããïŒããšæåã¯ã©ã¹ 0 ã®æåã®éã«ãåè§ç©ºããå ¥ã
- (d) å šè§ã«ã³ããšéãæ¬åŒ§ãããã®éã«ã¯åè§ç©ºããå ¥ã
ãã®ãšãïŒæ¬¡ã®å ¥åãèããŠã¿ãŸãããïŒ
xã
ïŒx
ïŒã
ãããšïŒæ¬¡ã®ããã«ãªããŸãïŒ
- 1è¡ç®ã§ã¯ïŒãããã®çŽåã¯åææåã§ãªãã®ã§ïŒ1. ã®ã±ãŒã¹â (b) ç±æ¥ã®åè§ç©ºããå ¥ã
- 2è¡ç®ã§ã¯ïŒãïŒãã®çŽåŸã¯åææåã§ãªãã®ã§ïŒ2. ã®ã±ãŒã¹â (c) ç±æ¥ã®åè§ç©ºããå ¥ã
- 3è¡ç®ã§ã¯ïŒãïŒãã®çŽåŸã¯åææåããããªã®ã§ïŒ3. ã®ã±ãŒã¹â (d) ç±æ¥ã®åè§ç©ºããå ¥ã
äžã®èª¬æã«ã¯ 2 ç¹è£è¶³ããããŸãïŒ
- ãçŽåŸããšã¯ïŒã§ããã ãå±éãç¶ããçµæïŒæåã®çŽåŸã«ããããŒã¯ã³ãæå³ããïŒ
- ãåææåããšã¯ïŒãœãŒã¹äžã«éœã«çŸããŠããåææåã ãã§ã¯ãªãïŒæ¬¡ã® 2 ã€ãå«ããïŒ
\char`ã
ã®ããã«\char
ããªããã£ãã«åææåã®å éšã³ãŒããæå®ãããã®\chardef
ã«ãã£ãŠåææåã®ãå¥åããšãããå¶åŸ¡ç¶Ž
ç¹ã«ä»ã®å ŽåéèŠã«ãªãã®ã¯åè ã§ïŒäŸãã°æ¬¡ã®1è¡ç®ã®ããã«å ¥åãããšïŒ ãïŒããããã®éã«ã¯åèšã§å šè§ç©ºããæ¿å ¥ãããããšã«ãªããŸãïŒ
ïŒ{}ã
ïŒã% æ¯èŒå¯Ÿè±¡
ãªããªã以äžã®ããã«ïŒãïŒããããããããã«ç±æ¥ããåè§ç©ºããæ¿å ¥ãããããã§ãïŒ
- ãïŒãã®çŽåŸã¯ã°ã«ãŒãéå§ã瀺ãã{ãã§ããïŒåææåã§ã¯ãªãã®ã§ïŒ2. ã®ã±ãŒã¹âåè§ç©ºããå ¥ã
- ãããã®çŽåã¯ã°ã«ãŒãçµäºãè¡šãã}ãã§ããïŒåææåã§ã¯ãªãã®ã§ïŒ1. ã®ã±ãŒã¹âåè§ç©ºããå ¥ã
ãã¯ãã䜿ã£ãäŸãèŒããŠã¿ãŸãïŒ
\def\hoge{ã}
ïŒ\hoge ããããã
äžã®å ŽåïŒãœãŒã¹äžã§ãïŒãã®æ¬¡ã«ããã®ã¯å¶åŸ¡ç¶Ž \hoge
ã§ããïŒ
ããã¯ããããžãšå±éãããŸãïŒçµæãšããŠïŒãïŒãã®çŽåŸã®å±éäžèœããŒã¯ã³ã¯ããããšããããšãšãªãïŒäž¡è
ã®éã«ã¯
åè§ç©ºããå
¥ãããšãšãªããŸãïŒ
pTeX ç³»åã§ã®ã段èœéå§æã®éãæ¬åŒ§ãå šè§äºåäžããã«ãªããã®ãããã§èª¬æãã€ããŸãïŒ
\noindent ããããã
\everypar{}% \everypar ã«ãã段èœé ãžã®æ¿å
¥ãç¡å¹å
ãã»ãå
宣èšã% å
šè§äºåäžãã
æåã®ãããã®çŽåã¯åææåã§ã¯ãªãã®ã§ïŒ
- ã®ã±ãŒã¹ãšãªãïŒãããã®çŽåã«ã¯åè§ç©ºããå ¥ãïŒãšããããã§ãïŒ
以äžãå ã«ïŒæ¬èšäºåé ã®äŸã«ã€ããŠèŠãŠããããšã«ããŸãïŒ
ããã¯ïŒ\textgt{ãã»ãå
宣èšã}ã®âŠâŠ
äŸãã°æ°ããã¥ã¡ã³ãã¯ã©ã¹ãå©çšããŠããå Žåã«ïŒ\textgt
ã®å®çŸ©ã \show\textgt
ã«ãã£ãŠèª¿ã¹ããšæ¬¡ã®ããã«ãªããŸãïŒ
> \textgt=macro:
#1->\relax \ifmmode \hbox \fi {\gtfamily #1}.
èšãæããã°ïŒæ¬èšäºåé ã®äŸã¯ïŒæ¬¡ã®ããã«æžããã®ãšã»ãŒåãããšã«ãªããŸãïŒ
ããã¯ïŒ\relax \ifmmode \hbox \fi {\gtfamily ãã»ãå
宣èšã}ã®âŠâŠ
ãã£ãŠæ¬¡ã®2ç¹ãããããŸãïŒ
- ãïŒãã®çŽåŸã¯
\relax
ãšãããã以äžå±éäžèœãªåœä»€ã§ïŒåææåã§ã¯ãªã - ãããã®çŽåãïŒè©³çŽ°ã¯çç¥ããŸããïŒ
\size@update
ïŒä»å®è¡ããããšãã«ã¯\relax
ãšå矩ïŒãšãªã£ãŠããïŒåææåã§ãªã
çµæãšããŠãïŒãç±æ¥ã®åè§ç©ºãïŒãããç±æ¥ã®åè§ç©ºãã®äž¡æ¹ããïŒããšãããã®éã«æ¿å ¥ãããïŒãšããããã§ãïŒ
pLaTeX æšæºã¯ã©ã¹ jarticle.cls ãªã©ã§ã¯ \textgt
ã®å®çŸ©ãç°ãªããŸããïŒç¶æ³ãšããŠã¯åæ§ã§ïŒ
ãïŒãç±æ¥ã»ãããç±æ¥ã®äž¡æ¹ã®ç©ºãããïŒããšãããã®éã«æ¿å
¥ãããããšã«ãªããŸãïŒ
ãããŸã§ãåæ¯ãã§ãïŒ
ãæãŸãããªãå
šè§ç©ºããå
¥ããåé¡è§£æ¶ã®ããã«èããããæ¹æ³ãšããŠïŒåæéã®ã°ã«ãŒæ¿å
¥ãææ¢ãã \inhibitglue
ãæ¿å
¥ãããšããã®ããããŸãïŒ
äŸãã°ä»¥äžã®ã³ãŒãã§ã¯ïŒãããç±æ¥ã®åè§ç©ºãã»ãïŒãç±æ¥ã®åè§ç©ºãã®æ¿å
¥ãææ¢ããããšã§ïŒäž¡è
ã®éãåè§ç©ºãã«ãªãããã«ããŠããŸãïŒ
ããã¯ïŒ\textgt{\inhibitglue ãã»ãå
宣èšã}ã®âŠâŠ
ããã¯ïŒ\inhibitglue \textgt{ãã»ãå
宣èšã}ã®âŠâŠ
ãããïŒèªåã§äžåŸã« \inhibitglue
ãå
¥ããã®ã¯æãŸãããããŸããïŒ
以äžã®äŸã§ã¯ïŒå
¥ã£ãŠã»ããã¯ãã®åè§ç©ºãããªããªããŸãïŒ
ããã¯\textgt{\inhibitglue ãã»ãå
宣èšã}ã®âŠâŠ
ããã¯ïŒ\inhibitglue \textgt{ã»ãå
宣èš}ãšããæ¬ã®âŠâŠ
ãšããããã§ïŒç©ºããæ£ãããªããããªã\textgt
æ¹ããšã§ãèšãã¹ãåœä»€ãäœãããã«ã¯ïŒ
åœä»€ã®çŽåã®æåãšïŒåœä»€ã®åŒæ°ã®æåã®åææåãèªã¿åãïŒããã«å¿ããŠåŠçãåå²ãããå¿
èŠãåºãŠããŸãïŒ
åŸè
㯠\futurelet
ãªã©ã®å©çšã§ãŸããªããšããªããŸããïŒ
åè
ã®ãåœä»€ã®çŽåã®æåãç¥ããæ¹æ³ãïŒå°ãªããšãç§ã¯ïŒç¥ããŸããïŒãã¶ãäžå¯èœã ã£ãã®ã§ãããïŒ
ãããèšãããã«ã¯ïŒTeX by Topic ã®
第 1.1 ç¯ãªã©ã«èª¬æãããïŒTeX ã® 4 ã€ã®åŠç段éãè¿°ã¹ãå¿
èŠããããŸãïŒ
- ãç®ãïŒ1è¡æ¯ã«èªã¿èŸŒã¿ïŒããŒã¯ã³åãžãšå€æ
- ãå£ãïŒããŒã¯ã³åäžã®ãã¯ãïŒæ¡ä»¶åå²ãªã©ãå±é
- ãèãïŒãã以äžå±éã§ããªãåœä»€ãå®è¡
- ãè žãïŒæ®µèœãè€æ°è¡ã«åå²ããããªã©
éèŠãªã®ã¯ïŒäžæŠãèãã§å®è¡ãããåŸã¯ãå£ãã«ã¯æ»ã£ãŠãããªããšããããšã§ãïŒ
äŸãã°ïŒæ¬èšäºã®æåããåºããŠããäŸã§\textgt
ãå±éãããïŒãšãã段ã«ãªã£ãŠã¿ããšïŒ
ãã®çŽåã®ãïŒãã¯æ¢ã«å®è¡ãçµãã£ãŠãã段éãªã®ã§ïŒ\textgt
ã®äžã§çŽåã®ãïŒããïŒããŒã¯ã³ãšããŠïŒç¥ãããšã¯åºæ¥ãªãïŒ
ãšããããã§ãïŒ
ããã¯ïŒ\textgt{ãã»ãå
宣èšã}ã®âŠâŠ
å¥ã®èšèã§è¿°ã¹ãŸããšïŒTeX ã§ã¯æåã»ç©ºçœïŒçœ«ç·ãªã©ã¯æçµçã«ããŒããšãã圢ã«ãªãïŒ æ®µèœãããŒãžã®äžèº«ã¯ããŒãéã®ãªã³ã¯ãªã¹ããšããŠè¡šçŸãããããšã«ãªããŸãïŒ ç¬¬ 3 段éã®ãèãã¯ããŒã¯ã³ãããŒãã«å€æããéçšã§ããïŒå®è¡ãçµãã£ãŠ äžåºŠããŒãã«å€æããããã®ã¯ããŒã¯ã³ã«æ»ããªãããã§ãïŒ
ãããïŒç§ã \lastnodechar
ããªããã£ããå¿
èŠã ãšèããããã«ãªããŸãïŒ
ãçŽåã®æåããããŒã¯ã³ãšããŠç¥ãããšãåºæ¥ãªãã«ããŠãïŒããŒãã«å€æãããŠããã¯ãã ããïŒ
ãããããçŽåã®æåãã«ã€ããŠã®æ
å ±ãåŸãããšã¯ã§ããã¯ãã ïŒãšããããšã§ãïŒ
äžèšã§èª¬æããã°ïŒæ¬¡ã®ããã«ãªããŸãïŒ
\lastnodechar
ã¯ïŒçŸåšæ§ç¯äžã®ãªã¹ãïŒããã¯ã¹ïŒæ®µèœïŒããŒãžçïŒäžã®ãæåŸã®ããŒãããæåç±æ¥ã§ããã°ãã®æåã³ãŒããïŒ ããã§ãªããã° -1 ãããããå éšæŽæ°ãšããŠè¿ãïŒ
ç°¡åãªãµã³ãã«ã¯ä»¥äžã®éãã§ãïŒ
ããã¯ïŒ\message{\the\lastnodechar}\textgt{ãã»ãå
宣èšã}âŠâŠ% ==> ãïŒãã®å
éšã³ãŒã
This is a pen.\message{\the\lastnodechar} % ==> 46
aiueo\hskip 10pt\message{\the\lastnodechar}% ==> -1
- 1è¡ç®ã§ã¯ïŒ
\lastnodechar
å®è¡æã®ãæåŸã®ããŒããã¯åææåãïŒããªã®ã§ïŒãïŒãã®å éšã³ãŒããçµæã«ãªããŸãïŒ ãã®å€ã¯ e-(u)pTeX ã®å éšæŒ¢åã³ãŒãã§å€ãããŸãïŒ
- äŸãã°çè ã®ç°å¢ã§ã¯ e-pTeX ã®å éšæŒ¢åã³ãŒã㯠EUC ãªã®ã§ïŒ1è¡ç®ãã㯠41380 ïŒ16 é²ã§ã¯ !A1A4ïŒãåŸãããŸãïŒ
- e-upTeX ã§ã¿ã€ãã»ãããããšïŒæšæºã®å éšæŒ¢åã³ãŒã㯠Unicode ãªã®ã§ïŒ1è¡ç®ã®çµæ㯠65290 ïŒ16 é²ã§ã¯ FF0CïŒãšãªããŸãïŒ
- 2è¡ç®ã§ã¯ïŒãæåŸã®ããŒãã欧ææåã.ããªã®ã§ïŒã¯å®è¡çµæã¯ãã®æåã³ãŒã 46 ã§ãïŒ
- 3è¡ç®ã§ã¯ïŒãæåŸã®ããŒããã¯
\hskip
ã«ããã°ã«ãŒãšãªãïŒæåç±æ¥ã§ã¯ãããŸããïŒãã£ãŠçµæ㯠-1 ãšãªããŸãïŒ
äžèšã®èª¬æã§è¿°ã¹ããæåŸã®ããŒããã«ã€ããŠã¯æ³šæããããŸãïŒ ä»¥äžïŒæ¬¡ã® 2 ã€ã®åœä»€ãçšããªãã説æããŠãããŸãïŒ
\showlists
ïŒãçŸåšæ§ç¯äžã®ãªã¹ãã®äžèº«ã衚瀺ãããããªããã£ã\message{...}
ïŒåŒæ°...
ã®äžèº«ã端æ«ãšãã°ãã¡ã€ã«ã«è¡šç€ºããŸãïŒ
ãªãïŒä»¥äžã®äŸã«ãããŠïŒã¯ã©ã¹ãã¡ã€ã«ã¯ jsarticle ã䜿çšããŠããŸãïŒ
\lastnodechar
ã¯ãæåŸã®ããŒããã®æ
å ±ãåŸããã®ãªã®ã§ïŒããŒãçæã«å¯äžããªããã®ïŒäŸãã° \relax
ïŒ
空ã°ã«ãŒã {}
ïŒã¬ãžã¹ã¿ãžã®ä»£å
¥åŠçãªã©ã§çµæãå€ããããšã¯ãããŸããïŒ
äŸãã°ïŒæ¬¡ã®ã³ãŒããã㯠4 è¡ãšããeãã®æåã³ãŒã 101 ãåŸãããŸãïŒ
hoge\message{\the\lastnodechar}
hoge{}\message{\the\lastnodechar}
hoge\relax\message{\the\lastnodechar}
hoge\setcounter{section}{42}\message{\the\lastnodechar}
pTeX ç³»åã§ã¯æ¬§æã®ããŒã¹ã©ã€ã³è£æ£ã \ybaselineshift
ïŒæšªçµïŒïŒ\tbaselineshift
ïŒçžŠçµïŒã§ã§ããããã«ãªã£ãŠããŸãïŒ
ãããã 0 ã§ãªãå ŽåïŒæåŸã®ããŒãã¯ããŒã¹ã©ã€ã³è£æ£çšã®ããŒãã«ãªããŸãïŒ
äŸãã°ïŒæ¬¡ã®ã³ãŒãããã¯ïŒä»¥äžã®å
容ãåŸãããŸãïŒ
foo\showlists
\hbox(0.0+0.0)x9.24687 % \parindent ç±æ¥
\displace 2.0
\OT1/cmr/m/n/10 f
\OT1/cmr/m/n/10 o
\kern0.27779
\OT1/cmr/m/n/10 o
\displace 0.0
\displace x.y
ãšããããŒããããŒã¹ã©ã€ã³è£æ£çšã«äœããã
ããŒã1ã§ãïŒ
ãããããã¯èªåæ¿å
¥ããããã®ãªã®ã§ïŒ\lastnodechar
ã¯ãããé£ã°ãïŒãã¡ããšãoãã®æåã³ãŒã 111 ãè¿ããŸãïŒ
foo\message{\the\lastnodechar}% ==> 111
ãŸãïŒLuaTeX 以å€ã® TeX ã§ã¯æ¬§æã®ååã¯ãŸãšã㊠1 ã€ã®ããŒããšããŠæ±ãããŸãïŒäŸãã°ä»¥äžã®ã³ãŒãããã¯ïŒ ãªã¬ãã£ãffiãã 1 ã€ã®ããŒãã«ãŸãšããããŠããããšãããããŸãïŒ
ffi\showlists
\hbox(0.0+0.0)x9.24687 % \parindent ç±æ¥
\OT1/cmr/m/n/10 ^^N (ligature ffi)
ãã®å ŽåïŒ\lastnodechar
ã¯ïŒãªã¬ãã£ã®æåŸã®æ§æèŠçŽ ã®æåã³ãŒããè¿ãããšã«ããŸããïŒ
ffi\message{\the\lastnodechar}% ==> 105
ããã¯ïŒãªã¬ãã£ã®åšå²ã®å欧æéç©ºçœ (\xkanjiskip
) ã®æ¿å
¥å€å®ãïŒçŽåã®åææåãšãæåã®æ§æèŠçŽ ãã®éïŒ
ãæåŸã®æ§æèŠçŽ ããšçŽåŸã®åææåã®éã§è¡ããšããä»æ§ã«åããããã®ã§ãïŒ
JIS ãã©ã³ãã¡ããªãã¯ã«ãããéãæ¬åŒ§é¡ãèªç¹ã»å¥ç¹çïŒããã®æåãšãæåã¯ã©ã¹ 0 ã®æåããšã®éã«ç©ºçœãå
¥ããããšã
ãã©ã³ãã¡ããªãã¯ã«ãã£ãŠæ±ºãŸã£ãŠããå ŽåããããŸãïŒæ¬èšäºååã®èª¬æããïŒ\lastnodechar
ãçšããŠäœããããçŽåã«
ãã®ãããªæåãæ¥ãå Žåã¯ïŒ\lastnodechar
å®è¡æã«ããããæåŸã®ããŒããã¯
倧æµç©ºçœãè¡šãã°ã«ãŒïŒãŸãã¯ã«ãŒã³ïŒãšãªããŸãïŒ
e-æ¡åŒµã§å®çŸ©ãããŠãããæåŸã®ããŒããã®çš®é¡ãè¿ã \lastnodetype
ãšããããªããã£ãã§ã¯ïŒãã®ç©ºçœãæŸããŸãïŒ
ã\message{\the\lastnodetype}% ==> 11 (glue)
ãããïŒ\lastnodechar
ã¯å®è£
ç®çããããŠãã®ãããªåäœã¯æãŸãããªãã®ã§ïŒ
ãã®ãããª*'ã¡ããªãã¯ç±æ¥ã®ç©ºçœã \lastnodechar
ã¯ç¡èŠ*'ããŸãïŒèšãæããã°ïŒ
以äžã®ãœãŒã¹ã¯æåŸ
ããããšããã«ãããã®å
éšã³ãŒããè¿ãïŒãšããããã§ãïŒ
ã\message{\the\lastnodechar}% ==> 41431 (EUC), 12301 (e-upTeX)
åæ§ã«ïŒ\lastnodechar
çŽåãåææåã§ïŒãã€ãã®åææåã«ããã \postbreakpenalty
ã®å€ã 0 ã§ãªãå Žåã¯ïŒ
ããã«ãã£ãæåŸã®ããŒãã«ãªããŸãïŒ
\postbreakpenalty`ã£=500
ãã£\showlists
\hbox(0.0+0.0)x9.24687
\JY1/mc/m/n/10 ã
\JY1/mc/m/n/10 ã£
\penalty 500(for kinsoku)
å Žåã«ãã£ãŠã¯ïŒã¡ããªãã¯ç±æ¥ã®ç©ºçœãåæã«æ¿å ¥ãããããšãããããŸããïŒ ãã®å Žåã¯ç©ºçœã®æ¹ãåŸã«æ¥ãããšã«ãªããŸãïŒ
\postbreakpenalty`ïŒ=-1% 説æçšïŒ
äŸïŒ\showlists
\hbox(0.0+0.0)x9.24687
\JY1/mc/m/n/10 äŸ
\JY1/mc/m/n/10 ïŒ
\penalty -1(for kinsoku)
\glue(refer from jfm) 4.62343 minus 4.62343
çŠåçšããã«ãã£ã«ã€ããŠãïŒ\lastnodechar
ã¯çŠåçšããã«ãã£ãç¡èŠããããã«ãªã£ãŠããŸãïŒ
\postbreakpenalty`ïŒ=-1
\postbreakpenalty`ã£=500
ãã£\message{\the\lastnodechar}% ==> 42179 (EUC)
äŸïŒ\message{\the\lastnodechar}% ==> 41419 (EUC)
äŸãšããŠïŒæ¬¡ã§å®çŸ©ããã \fixjfmspacing
, \mytextgt
åœä»€ãèããŠã¿ãŸãïŒ
\makeatletter
\let\fjs@kanji=挢% kanji
\let\fjs@kana=ã% kana
\let\fjs@other=ïŒ% other
\def\fixjfmspacing{%
> % \@temp 㯠\fixjfmspacing çŽåŸã®ããŒã¯ã³ãšãªã
> \futurelet\@temp\fixjfmspacing@
}
\def\fixjfmspacing@{{%
> \@tempcnta=\lastnodechar
> % \@temp ã®äžèº«ãå±éãç¶ããçµæã®æåã¯åææåãïŒ
> \edef\@@temp{\@temp}\expandafter\fixjfmspacing@@\@@temp\relax\@nil%
> %
> \ifnum\@tempcnta>\m@ne
> \setbox0\hbox{\inhibitglue\char\@tempcnta
> \relax\@temp\inhibitglue}%
> \setbox2\hbox{\inhibitglue\char\@tempcnta
> \@temp\inhibitglue}%
> \hskip\dimexpr\wd2-\wd0\relax
> \fi
}}
% #1 ã¯ãããã以äžå±éäžå¯èœãªã¯ã
\def\fixjfmspacing@@#1#2\@nil{%
> \ifcat\fjs@kanji#1\else
> \ifcat\fjs@kana#1\else
> \ifcat\fjs@other#1\else
> \@tempcnta=\m@ne
> \fi
> \fi
> \fi
}
\DeclareRobustCommand\mytextgt[1]{%
> \relax\ifmmode\hbox\fi{%
> \gtfamily\fixjfmspacing #1%
> }\fixjfmspacing%
}
\makeatother
ãã® \fixjfmspacing
åœä»€ã䜿ããšïŒæ¬¡ã®ããã«æžäœå€æŽåœä»€ãéã«å
¥ããŠãïŒæåéã«ã¯æ£ããåè§ç©ºããå
¥ãããã«ãªããŸãïŒ
ã \gtfamily \fixjfmspacing ïŒ
ãããå
éšã«äœ¿ã£ãŠãã \mytextgt
åœä»€ã \textgt
ã®ä»£ããã«çšãããšïŒ
ã²ãšãŸãåææåéã®ç©ºçœãããŸããã£ãŠããâŠâŠããã«èŠããŸãïŒ
\parindent=0pt
\def\TEST{ãã»}
ãäŸ1ã\\
ããã¯ïŒãã»ãå
宣èšãïŒãã²ã»ãã¬èïŒ\\
ããã¯ïŒ\mytextgt{ãã»ãå
宣èšã}ïŒãã²ã»ãã¬èïŒ\\% OK
ããã¯ïŒ{}\mytextgt{ãã»ãå
宣èšã{}}ïŒãã²ã»ãã¬èïŒ\\% OK
ããã¯ïŒ\relax\mytextgt{ãã»ãå
宣èšã\relax}ïŒãã²ã»ãã¬èïŒ\\% OK
ããã¯ïŒ\mytextgt{\TEST ãå
宣èšã\relax}ïŒãã²ã»ãã¬èïŒ\\% OK
ããã¯ïŒ\textgt{ãã»ãå
宣èšã}ïŒãã²ã»ãã¬èïŒ% NG
ãäŸ2ã\\
ããã¯ãã»ãå
宣èšããšããæ¬ã®âŠâŠ\\
ããã¯\mytextgt{ãã»ãå
宣èšã}ãšããæ¬ã®âŠâŠ\\% OK
ããã¯\textgt{ãã»ãå
宣èšã}ãšããæ¬ã®âŠâŠ% OK
ãªãïŒããã§äœæãã \fixjfmspacing
, \mytextgt
åœä»€ã¯èª¬æã®ããã«ããçšåºŠåçŽåããŠäœã£ããã®ã§ïŒ
以äžã®ãããªæ³šæäºé
ãæããããŸãïŒãããã解決ãããã®ã¯å®éã®å©çšè
éã«ä»»ããããšã«ããŸã!^!^;
\fixjfmspacing
ã®çŽåŸã®ããŒã¯ã³ãæåããŒã¯ã³ã§ãªãå Žåã¯åäœããŸããïŒ- äŸãã°ïŒ
ã\fixjfmspacing {}ã
ãã\fixjfmspacing \relaxã
ãšããäŸããããŸãïŒ \fixjfmspacing
ã®çŽåŸã\char
ããªããã£ããïŒ\chardef
ããªããã£ãã§å®çŸ©ãããå¶åŸ¡ç¶Žã®å Žåã äžèšã®ã³ãŒãã§ã¯å¯Ÿå¿ã§ããŠããŸããïŒ
- äŸãã°ïŒ
- éã«ãµã€ãºå€æŽåœä»€ãæãã
ïŒ\Large \fixjfmspacing ã
ãšãã£ãå ¥åã¯äºæããªã çµæ2ã«ãªããŸãïŒ
- ããã¯
\fixjfmspacing
å®è¡æã®ã«ã¬ã³ããã©ã³ããçšããŠè£æ£éãèšç®ãã3ããã§ãïŒ
- åæ§ã«ïŒ
\fixjfmspacing
ã®ååŸã§ãæ¬è³ªçã«ç°ãªãããã©ã³ãã¡ããªãã¯ã䜿ã£ãŠããå Žåã«ãçµæãä¹±ããã§ãããïŒ - å®éã«ã¯ãã©ã³ãã¡ããªãã¯ç±æ¥ã®ã°ã«ãŒã«ã¯èªç¶é·ä»¥å€ã«äŒžã³éã»çž®ã¿éããããŸãïŒ ãããïŒãã®æ¹æ³ã§ã¯äžæŠããã¯ã¹ã«æ ŒçŽãïŒããã¯ã¹ã®å¹ ã®å·®ãèŠãŠããé¢ä¿ããïŒäŒžã³éã»çž®ã¿éã®è£æ£ãã§ããŸããïŒ
LuaTeX ãïŒãã®äžã§åã LuaTeX-ja ã®å Žåã«ã¯ïŒç¶æ³ãç°ãªããŸãïŒ
LuaTeX ã§ã¯ïŒãªã¬ãã£ãã«ãŒãã³ã°ã®åŠçã¯æ®µèœã»ããã¯ã¹çµäºæã«äžæ¬ããŠããŒãããŒã¹ã§è¡ãããšã«ãªã£ãŠããŸãïŒ äŸãã°ïŒæ®µèœéäžã§ããŒãã®äžŠã³ã衚瀺ãããŠã¿ããš
ffi\showlists
\whatsit
.\localinterlinepenalty=0
.\localbrokenpenalty=0
.\localleftbox=null
.\localrightbox=null
\hbox(0.0+0.0)x9.24866, direction TLT
\OT1/cmr/m/n/10 f
\OT1/cmr/m/n/10 f
\OT1/cmr/m/n/10 i
ãšãªã£ãŠããïŒ\par
ãªã©ã«ãã£ãŠæ®µèœãçµäºãããšãã«åããŠïŒãã® f, f, i ã® 3 ããŒãããªã¬ãã£ã«ãªããªãã§ãïŒ
ãã®ããïŒåŸæ¥ãªã¬ãã£ã®ææ¢ãšããŠçšãããã ff{}i
ã®ãããªæ¹æ³ã¯ãã¯ã䜿ããŸããïŒç©ºã°ã«ãŒã {} ã¯ããŒããçæããªãããã§ãïŒ
以äžã®ããšã¯ã«ãŒãã³ã°ã«å¯ŸããŠãããŠã¯ãŸããŸãïŒ
pTeX ç³»åã§ã¯ïŒãç°ãªãåæãã©ã³ãã䜿ããããšã¯ïŒç°ãªããã©ã³ãã¡ããªãã¯ãçšããããšãæå³ããŠããŸããïŒ äŸãã°ïŒJIS ãã©ã³ãã¡ããªãã¯äžã«ãã暪çµææçšã® jis.tfm ãšæšªçµãŽã·ãã¯çšã® jisg.tfm ã¯ïŒå 容ã¯åãã§ãã ç°ãªããã©ã³ãã¡ããªãã¯ã§ãïŒ
äžæ¹ïŒLuaTeX-ja ã§ã¯ïŒç°ãªãåæãã©ã³ãã«å¯ŸããŠãïŒåããã©ã³ãã¡ããªãã¯ãå
±çšããããšãèš±ããŠããŸãïŒ
以äžã®äŸã§ã¯ïŒIPAexææ (\MC
) ãš IPAexãŽã·ã㯠(\GT
) ã«ã€ããŠïŒåãã¡ããªãã¯ãå
±çšããŠããŸãïŒ
ããŒãçã«èšãã°ïŒ\MC
ã®ãïŒãã®çŽåŸã« \GT
ã®ããããç¶ããŠãã4ããã§ããïŒäž¡è
ã¯åãã¡ããªãã¯ãªã®ã§ïŒ
äž¡è
ã®éã«ã¯ïŒãïŒããšãããã®éã«å
¥ãã¹ãïŒåè§ç©ºããå
¥ãããã«ãªã£ãŠããŸãïŒ
% plain LuaTeX
\input luatexja.sty % LuaTeX-ja ã®èªã¿èŸŒã¿
\jfont\MC=IPAexMincho:jfm=ujis at 9.62216pt
\jfont\GT=IPAexGothic:jfm=ujis at 9.62216pt
\MC
ããã¯ïŒ{\GT ãã»ãå
宣èšã}ïŒãã²ã»ãã¬èïŒã®âŠâŠ
\end
LuaTeX 㧠\lastnodechar
代æ¿ç©ãäœãããšã¯æ¯èŒçç°¡åã§ãïŒ
% LuaTeX
\def\lastnodechar{%
\directlua{%
local n = tex.nest[tex.nest.ptr].tail
if n and n.id==node.id('glyph') then
tex.write(tostring(n.char))
else
tex.write('-1')
end
}%
}
æ¬æ¥ã® e-pTeX ã® \lastnodechar
ãšç°ãªãç¹ãšããŠïŒããã¯è¿ãå€ãæååã§è¿ãããšãæããããŸãïŒ
ãŸãïŒLuaTeX-ja ã§ã¯ïŒå éšåŠççšã«æ§ã ãªïŒwhatsit ãšåŒã°ããïŒããŒãéã䜿ã£ãŠããã®ã§ïŒäžã®ãããªåçŽãªå®çŸ©ã§ã¯ 次ã®ãããªå Žåã«å¯Ÿå¿ã§ããŸããïŒ
ããããã\Large\message{\lastnodechar}% ==> -1 (NG)
Footnotes
-
以éã®ããŒã¹ã©ã€ã³ã
x.y
ptã ãäžã«ããã圹å²ãæã¡ãŸãïŒ â© -
ãããããã®å Žåã®ãæ£ããçµæãã£ãŠäœãªãã§ãããïŒ â©
-
æåã³ãŒããšåæ§ã«ïŒãæåŸã®åææåã®ãã©ã³ãããç¥ãæ¹æ³ã¯çŸæç¹ã§ã¯ãªãïŒæ°ãã«
\lastnodefont
ãšã§ãããåœä»€ãäœã以å€ã«ãªãã§ãããïŒååãè¯ããªãâŠâŠïŒïŒ â© -
\showlists
ã§èŠããšïŒ\tenrm ïŒ
ãš\tenrm ã
ã®ããã«ïŒæ¬§æãã©ã³ããçšããŠããããã«èŠããŸãïŒãããïŒå®éã«ã¯\showlists
ã§ã¯èŠããªããšããã«äœ¿ã£ãŠããåæãã©ã³ãã®æ å ±ãæ ŒçŽããŠããïŒåé¡ãããŸããïŒ â©