KTUGFaq

KTUG FAQ

로그인:
비밀번호:
가입
The time is right to make new friends.
FrontPage › hoze/webtex
텍이 설치된 웹에서 PDF 만들기

목차

1 webtex.html
2 webtex.php

1 webtex.html

<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>Topfeild WebTeX</title>
<style type=text/css>
<!--
BODY,TD {font-size:12px;font-family:굴림체;color:#111111;line-height:15pt}
A:LINK, A:VISITED, A:ACTIVE {text-decoration:none; color:#555555}
A:hover {text-decoration:underline; color:#555555}
INPUT {text-align:left; border:1x solid #555555;background-Color:;font-size:12px;font-family:굴림체;color:}

-->
</style>
</head>

<body>
<form name=inputtex method=post action=webtex.php>
	파일 이름<input type=text name=filename size=20 value=test>(.tex) <input type=submit value=완료><br>
	<textarea name=tex wrap=virtual rows=40 cols=120>
\documentclass[a4paper,article]{memoir}
\usepackage{dhucs}

\begin{document}
	
% 여기에 내용을 쓰세요.
	
\end{document}
	</textarea>
</form>
</body>
</html>

2 webtex.php

<?
$tex= str_replace("\\\\", "\\", $tex);
$tex= str_replace("\"", "''", $tex);
$tex= str_replace("\'", "'", $tex);

if($filename=='') $filename="test";
if(file_exists("$filename.tex"))unlink("$filename.tex");
$fp = fopen("$filename.tex", "w+");
fwrite($fp, $tex, 65535);
fclose($fp);

if(file_exists("$filename.pru"))unlink("$filename.pru");
if(file_exists("$filename.log"))unlink("$filename.log");
if(file_exists("$filename.dvi"))unlink("$filename.dvi");
if(file_exists("$filename.pdf"))unlink("$filename.pdf");
if(file_exists("$filename.aux"))unlink("$filename.aux");
echo("1");
if(file_exists("$filename.tex"))exec("latex $filename");
echo("2");
if(file_exists("$filename.dvi"))exec("dvipdfmx $filename");
echo("3");
echo("
<html>
<head>
<meta http-equiv='content-type' content='text/html; charset=utf-8'>
<title>Topfield WebTeX</title>
<style type=text/css>
<!--
BODY,TD {font-size:12px;font-family:굴림체;color:#111111;line-height:15pt}
A:LINK, A:VISITED, A:ACTIVE {text-decoration:none; color:#555555}
A:hover {text-decoration:underline; color:#555555}
INPUT {text-align:left; border:1x solid #555555;background-Color:;font-size:12px;font-family:굴림체;color:}

-->
</style>
</head>

<body>
");
if(file_exists("$filename.pdf")){
	echo("<a href=$filename.tex>$filename.tex</a>
	<a href=$filename.pdf>$filename.pdf</a>");
}else{
	echo("<a href=$filename.log>$filename.log</a>");
}
echo("
<form name=inputtex method=post action=webtex.php>
	파일 이름<input type=text name=filename size=20 value=$filename>(.tex) <input type=submit value=완료><br>
	<textarea name=tex wrap=virtual rows=40 cols=120>
$tex
</textarea>
</form>
</body>
</html>
");
?>

^
Valid XHTML 1.0! Valid CSS! powered by MoniWiki
last modified 2010-02-10 10:32:22
Processing time 0.0269 sec