ä¿®è«ãçµãã£ã¦ããlatexmkã®åå¨ã«æ°ãã¤ãã
ãããªããã§ä¿®è«Done!!
ä¹
ã
ã«ã¯ã¦ããããã®ãæ¸ãã¦ã¿ãï¼
latexmkã¨ããlatexã®ã³ã³ãã¤ã«ã«ä¾¿å©ãªãã¼ã«ããããããï¼
ã§ï¼ã°ã°ãã¨å¾®å¦ã«æ
å ±ãå¤ããµã¤ããå¤ãï¼ã£ã½ãé°å²æ°ãªã®ã§ã¡ã¢ä»£ããã«ã¯ã¦ã¶ï¼
ä¿®è«ã¯ãã£ã¨TeXã§æ¸ãã¦ã¦ï¼ãã£ã¦ãã¨ãã¯Makefileãæ¸ãã¦makeããããã¦ããã ãã©ï¼ã³ã¿ãã¼ã«ãã¾ããããªãï¼
åã«ãã¡ã®Makefileãæªãã£ãï¼ã¨ãã話ã§ã¯ãããã ãã©ï¼TeXã®ã³ã³ãã¤ã«ã£ã¦ï¼å¾®å¦ã«ããã©ãï¼
.tex ãã latex 㧠.aux ä½ã£ã¦ï¼ .aux 㨠hoge.bib ãã bibtexã㧠.bbl ã¤ãã£ã¦ï¼ããã§ãã£ã¦ããã£ã¡ãlatex㧠.dvi ãä½ãç´ãã¦ï¼ãã㧠dvipdf 㧠.pdfï¼ãï¼ä¸ålatexã³ãã³ã足ãã¦ãªãï¼æ°ã®ãããï¼
ãããªãããªã§ï¼Makefileã®ããã©ã«ãã®ãµãã£ãã¯ã¹ã«ã¼ã«ãéªéãã¦ããããï¼åæã«ããããçæãããã®ã ããã¿ã¤ã ã¹ã¿ã³ããããããããªããªã£ããâ¦â¦
ã§ï¼ã©ãã«ãããã«ãåãMakefileãã§ãã¦ï¼ããã§ä¿®è«ãçµãã£ã¦ããï¼ã©ãããlatexmkã¨ããã³ãã³ããå
¨é¨ãã£ã¦ããããããï¼ã¨ç¥ã£ãï¼
latexmkã³ãã³ãã¯ãã¡ã®ç°å¢(Mac Lion)ã§ã¯ãªãããããã /use/texbin/ ã«æ¢ã«å
¥ã£ã¦ãï¼
ãªã«ã§latexãã¤ã³ã¹ãã¼ã«ããããããã£ããå¿ãã¦ããã©ï¼texliveã ããªãã ãã§å
¥ããæ°ãããï¼
ã ãããã®ã¤ã³ã¹ãã¼ã©ããã¯å
¥ãã¦ããããããã¾ããã¨äºæ³ï¼
ã§ï¼æ©éãããã¦ã¿ããããªãã ãã©ï¼ã¨ããããlatexmkãä½ã使ããã確èª
$ latexmk -commands Commands used by latexmk: To run latex, I use "latex %O %S" To run pdflatex, I use "pdflatex %O %S" To run biber, I use "biber %O %B" To run bibtex, I use "bibtex %O %B" To run makeindex, I use "makeindex %O -o %D %S" To make a ps file from a dvi file, I use "dvips %O -o %D %S" To make a ps file from a dvi file with landscape format, I use "dvips -tlandscape %O -o %D %S" To make a pdf file from a dvi file, I use "dvipdf %O %S %D" To make a pdf file from a ps file, I use "ps2pdf %O %S %D" To view a pdf file, I use "start acroread %O %S" To view a ps file, I use "start gv %O %S" To view a ps file in landscape format, I use "start gv -swap %O %S" To view a dvi file, I use "start xdvi %O %S" To view a dvi file in landscape format, I use "start xdvi -paper usr %O %S" To print a ps file, I use "lpr %O %S" To print a dvi file, I use "NONE $lpr_dvi variable is not configured to allow printing of dvi files" To print a pdf file, I use "lpr %O %S" To find running processes, I use "ps -ww -u takei", and the process number is at position 1 Notes: Command starting with "start" is run detached Command that is just "start" without any other command, is used under MS-Windows to run the command the operating system has associated with the relevant file. Command starting with "NONE" is not used at all
-commands ãªãã·ã§ã³ãã¤ããã¨latexmkãä½ã使ããåããï¼
æ¨æºã ã¨latexã¨bibitexã¨dvipdfã¨â¦â¦ã¨ããããã¬ã¼ã³ï¼
ãã¡ã¯platexããpbibtexã使ããããããï¼
ã¨ãªãã·ã§ã³ãè¦ã¦ã㨠-latex=HOGE ã§latexã®ä»£ããã«HOGEã使ããï¼çãªãã¨ãæ¸ããã¦ããã®ã ãã©ï¼ãããbibtexã¯ï¼
ã§ï¼ã°ã°ã£ã¦ã¿ãã¨latexmkã¯perlã¹ã¯ãªããã§æ¸ããã¦ããããæ¸ãæããï¼ã¨ããããµã¤ãããã£ã¦ï¼ã¾ãã£ããï¼ã¨ãæãã¤ã¤ã³ãã¼ãã¦æ¸ãæãã¦â¦â¦ããã£ã¦ãã®ã ãã©ï¼ã©ããã ~/.latexmkrc ãæ¸ãã®ä¸çªã¹ãã¼ãã£ã½ãï¼
ãã¡ãã°ã°ã£ãç¯å²ã ã¨å¾®å¦ã«latexmkrcã®æ¸ãæ¹ãå¤ããµã¤ããå¤ãã£ã½ãã®ã ãã©ï¼ãããªãã¨ããã¡ã使ã£ã¦ãLatexmk 4.24ã§ã¯ãããªæãï¼
#!/usr/bin/perl $latex = 'platex %O %S'; $bibtex = 'pbibtex %O %B'; $dvipdf = 'dvipdfmx %O %S'; $pdf_mode = 3; # use dvipdf
å¥ã«ã·ãã³(#!)ã¯ãããªãã£ã½ãã®ã ãã©ï¼vimã®syntaxãã¤ã©ã¤ããããããï¼ã©ããperlãããã®ã¾ã¾doããã¦ãã ãã£ã½ãã®ã§ï¼å®³ã¯ãªããã¨ï¼
å¤ããµã¤ãã ã¨ã³ãã³ãã ãããæ¸ãã¦ãªããã¨ããããã ãã©ï¼ä»ã®ã´ã¡ã¼ã¸ã§ã³ãªã"%O"ã§ãªãã·ã§ã³ï¼"%S"ã§ã½ã¼ã¹ãã¡ã¤ã«ï¼"%B"ã§bibãã¡ã¤ã«ãªã©ãæå®ã§ãã模æ§ï¼
ç¹ã«dvipdfmxã¯dvipdfã¨å¾®å¦ã«å¼æ°ãäºæãããªãã®ãããããããããï¼
$pdf_mode ã¯pdfãä½ãæ¹æ³ï¼
0(default)ã ã¨pdfãä½ããªãï¼1ã§pdflatexï¼2ã§psçµç±ps2pdfï¼3ã§dviçµç±dvipdfã«ãªãï¼
ãã®ã»ãã®ãªãã·ã§ã³ã¯ /usr/texbin/latexmk ãèªãã°åãããã¨ï¼
ãã¡ã¯ã©ããopenã³ãã³ãã§Preview.appãèµ·åãã¦ããã®ã§ä½¿ããªããã©ï¼viewerãããã«openã¨ã{kde,gnome}-openããã好ã¿ã®ãã¥ã¼ã¯ã¼ãè¨å®ããã¨åï¼
ãã¨latexmkrcã¯ã·ã¹ãã ï¼ãã¼ã ï¼ã«ã¬ã³ããã£ã¬ã¯ããªãããããèªãã®ã§ï¼è«ææ¯ã«å¾®å¦ã«è¨å®å¤ãããå ´åã¯ã«ã¬ã³ããã£ã¬ã¯ããªã«.latexmkrcãç½®ãã¦ããã¨åããï¼
ãããªãã㧠.latexmkrc ãèªã¾ãã¦ããã確èª
$ latexmk -commands Commands used by latexmk: To run latex, I use "platex %O %S" To run pdflatex, I use "pdflatex %O %S" To run biber, I use "biber %O %B" To run bibtex, I use "pbibtex %O %B" To run makeindex, I use "makeindex %O -o %D %S" To make a ps file from a dvi file, I use "dvips %O -o %D %S" To make a ps file from a dvi file with landscape format, I use "dvips -tlandscape %O -o %D %S" To make a pdf file from a dvi file, I use "dvipdfmx %O %S" To make a pdf file from a ps file, I use "ps2pdf %O %S %D" To view a pdf file, I use "start acroread %O %S" To view a ps file, I use "start gv %O %S" To view a ps file in landscape format, I use "start gv -swap %O %S" To view a dvi file, I use "start xdvi %O %S" To view a dvi file in landscape format, I use "start xdvi -paper usr %O %S" To print a ps file, I use "lpr %O %S" To print a dvi file, I use "NONE $lpr_dvi variable is not configured to allow printing of dvi files" To print a pdf file, I use "lpr %O %S" To find running processes, I use "ps -ww -u takei", and the process number is at position 1 Notes: Command starting with "start" is run detached Command that is just "start" without any other command, is used under MS-Windows to run the command the operating system has associated with the relevant file. Command starting with "NONE" is not used at all
大ä¸å¤«ã£ã½ãã®ã§ãã¨ã¯ latexmk hoge.tex 㧠hoge.pdf ãä½ãã¡ããã¾ãï¼
latexmk -c ã§çæç©ä»¥å¤ã®ã¯ãªã¼ã³ï¼ -C ã§çæç©ãå«ããã¯ãªã¼ã³ãã§ãã¾ãï¼
便å©ä¾¿å©âª
ãã¨ã¯--helpãªãã³ã¼ããèªãã§ãã ããï¼
ã¾ãï¼ãªããomake使ã£ãæ¹ã楽ã¨ãï¼ãããªåããããã§ããã©ãâ¦â¦ï¼