2009년 09월 24일
파워포인트에 tex 수식 집어넣기 2
이전글 : 파워포인트에 tex equation 집어넣기
업데이트 버전
이번에는 cygwin용 bash 스크립트다.
eps가 파워포인트에서 렌더링이 하도 구리게 되서 다시 이미지 파일로 쓰기로 변경했다.
최종은 equation.png 파일로 저장되는데, 이미지 크기와 함께 dpi를 높게 설정해서 파워포인트에 붙일 때 적절한 크기로 붙으면서 어느 크기에서든 잘 보이게 업데이트했다.
아직 해결 못 한 문제가 하나 있는데 이놈들을 이용하려면 cygwin 아래에서만 이용 가능하다는 점이다. 흐음...;;
.vimrc
=====================================================
function! TexEq_CurrentLine()
let l = getline('.')
let list = [l]
call writefile(list, '.texeq_temp.eq')
call system("bash -c /usr/bin/texeq.sh")
endfunction
=====================================================
texeq.sh
=====================================================
#!/bin/bash
echo "\\documentclass[48pt]{article}" > .texeq_temp.tex
echo "\\pagestyle{empty}" >> .texeq_temp.tex
echo "\\begin{document}" >> .texeq_temp.tex
echo "\\begin{displaymath}" >> .texeq_temp.tex
cat .texeq_temp.eq >> .texeq_temp.tex
echo "\\end{displaymath}" >> .texeq_temp.tex
echo "\\end{document}" >> .texeq_temp.tex
latex .texeq_temp.tex
dvips -f -E -o .texeq_temp.eps .texeq_temp.dvi
epstool -t6p --gs-args "-dTextAlphaBits=4 -dGraphicsAlphaBits=4" --dpi 300 .texeq_temp.eps equation.eps
convert -density 2400 equation.eps .texeq_temp.bmp
convert .texeq_temp.bmp equation.png
cygstart .
rm .texeq_temp.*
=====================================================
# by | 2009/09/24 04:02 | 트랙백 | 덧글(0)





☞ 내 이글루에 이 글과 관련된 글 쓰기 (트랙백 보내기) [도움말]