--- plain2-2.54p1.orig/doc/Beginning.tex +++ plain2-2.54p1/doc/Beginning.tex @@ -9,7 +9,7 @@ } \medskip -{\large \dg\bf\addtocounter{sectionx}{1}\setcounter{subsectionx}{0}{\thesectionx} ようこそ plain2 の世界へ} +{\large \bf\addtocounter{sectionx}{1}\setcounter{subsectionx}{0}{\thesectionx} ようこそ plain2 の世界へ} \medskip \par TeXなんて書けない,読めない.そんなユーザの声に応える @@ -24,10 +24,10 @@ \ \ \ \ \ \ \ \ ...\\ \%~xdvi~example.dvi\\ } -\endlist} +\mbox{}\endlist} \medskip -{\normalsize \dg\bf\addtocounter{subsectionx}{1}\setcounter{subsubsectionx}{0}{\thesectionx}.{\thesubsectionx} 多様なリスト} +{\normalsize \bf\addtocounter{subsectionx}{1}\setcounter{subsubsectionx}{0}{\thesectionx}.{\thesubsectionx} 多様なリスト} \medskip \par いろいろなリストが書けます.ネストもできます. @@ -45,12 +45,12 @@ \medskip \end{itemize} -{\normalsize \dg\bf\addtocounter{subsectionx}{1}\setcounter{subsubsectionx}{0}{\thesectionx}.{\thesubsectionx} テーブルと線画の機能} +{\normalsize \bf\addtocounter{subsectionx}{1}\setcounter{subsubsectionx}{0}{\thesectionx}.{\thesubsectionx} テーブルと線画の機能} \medskip \par plain2ならテーブルも簡単に書けます ~\\ -\begin{center} +\mbox{}\begin{center} \begin{tabular}{|c|c|c|c|} \hline & べた書き & マークアップ & ワープロ\\ @@ -63,7 +63,7 @@ \end{center} \medskip ~\\ -\begin{center} +\mbox{}\begin{center} \begin{picture}(288,120)(0,0) \put(3,97){簡単な絵くらいは書けます.} \thinlines --- plain2-2.54p1.orig/doc/Example_adjust2.tex +++ plain2-2.54p1/doc/Example_adjust2.tex @@ -19,5 +19,5 @@ cc $-$DKANJI $-$DPICTURE $-$DBSD $-$DDEBUG $-$target sun4 $-$c hint.c\\ cc $-$DKANJI $-$DPICTURE $-$DBSD $-$DDEBUG $-$target sun4 $-$c justify.c\\ cc $-$DKANJI $-$DPICTURE $-$DBSD $-$DDEBUG $-$target sun4 $-$c texout.c\\ -\endlist} +\mbox{}\endlist} }\end{minipage}}\\ --- plain2-2.54p1.orig/doc/Makefile +++ plain2-2.54p1/doc/Makefile @@ -46,7 +46,7 @@ Example_adjust2.tex PRTGIF=prtgif+ -PLAIN2=../src/plain2 +PLAIN2=../src/plain2 -tstyle=a4j -jverb VERBTEXFILES= plain2.ps: plain2.dvi @@ -63,7 +63,10 @@ rm -f ${SAMPLES} ${OTHERFILES} plain2.tex plain2.dvi plain2.ps \ plain2.toc plain2.aux plain2.log -title_a47.tex title_shounin.tex: +title_a47.tex: title_a47.raw + $(PLAIN2) -tex -fexampl_left $< > $@ + +title_shounin.tex: title_shounin.raw $(PLAIN2) -tex -fexampl_left $< > $@ table_kanji.tex: table_kanji.pln --- plain2-2.54p1.orig/doc/Tgif_doc.tex +++ plain2-2.54p1/doc/Tgif_doc.tex @@ -2,11 +2,11 @@ \hspace*{2cm}\framebox[13.5cm][l]{~~\begin{minipage}{12cm} \setcounter{sectionx}{0}{\small\baselineskip=10pt -{\large \dg\bf\addtocounter{sectionx}{1}\setcounter{subsectionx}{0}{\thesectionx} tgif+ の利用} +{\large \bf\addtocounter{sectionx}{1}\setcounter{subsectionx}{0}{\thesectionx} tgif+ の利用} \medskip \par tgif+ で書いた絵を次のようにして -べた書き文書に取り込みます.\\ +べた書き文書に取り込みます.\\\mbox{} \medskip --- plain2-2.54p1.orig/doc/exampl.p2 +++ plain2-2.54p1/doc/exampl.p2 @@ -7,6 +7,8 @@ EXAM_BEGIN "{\\baselineskip=#1pt\n\\tt\\obeylines\\catcode` =11\n" EXAM_END "}\n", +JEXAM_BEGIN "{\\baselineskip=#1pt\n\\tt\\obeylines\\catcode` =11\n" +JEXAM_END "}\n", BOLD_BEGIN, "{\\bf " SECTION_1 "\n{\\normalsize \\bf\\addtocounter{sectionx}{1}\ --- plain2-2.54p1.orig/doc/exampl_star.p2 +++ plain2-2.54p1/doc/exampl_star.p2 @@ -7,6 +7,8 @@ EXAM_BEGIN "{\\baselineskip=#1pt\n\\tt\\obeylines\\catcode` =11\n" EXAM_END "}\n", +JEXAM_BEGIN "{\\baselineskip=#1pt\n\\tt\\obeylines\\catcode` =11\n" +JEXAM_END "}\n", SECTION_1 "\n\\section*{@1}\n" SECTION_2 "\n\\subsection*{@1}\n" --- plain2-2.54p1.orig/doc/guide.p2 +++ plain2-2.54p1/doc/guide.p2 @@ -1,4 +1,10 @@ -DOC_BEGIN "\\documentstyle[epsf]{jarticle}\n\ +DOC_BEGIN "\ + \\newif\\ifNTT\\NTTfalse\n\ + \\ifx\\gtfam\\undefined\\ifx\\gtfamily\\undefined\\NTTtrue\\fi\\fi\n\ + \\ifNTT\\documentstyle[$2,epsf]{j-article}\n\ + \\else\\documentstyle[$3,epsf]{jarticle}\\fi\n\ + \\advance\\textwidth1.4cm \\advance\\oddsidemargin-.7cm\n\ + \\advance\\textheight2cm \\advance\\topmargin-1cm\n\ \\setcounter{secnumdepth}{6}\n\ \\setcounter{tocdepth}{6}\n\ \\topsep=0.1cm\n\ @@ -15,12 +21,12 @@ \\let\\@mkboth=\\@gobbletwo\n\ \\def\\@evenhead{}\\def\\@evenfoot{}%\n\ \\def\\@oddhead{\\makebox[\\textwidth]%\n\ - {\\ plain2ユーザガイド(r2.5)\\hfill\\thesection\\ 章}}%\n\ + {plain2ユーザガイド(r2.5)\\hfill\\thesection\\ 章}}%\n\ \\def\\@oddfoot{\\makebox[\\textwidth]%\n\ - {\\rightmark\\leaders\\hbox{\\tiny ~plain2}\\hfill}\\ \\thepage}}\n\ - \\@ifundefined{jintercharskip}{%\n\ - \\def\\p2zerointerskip{\\kanjiskip=0cm}}{%\n\ - \\def\\p2zerointerskip{\\jintercharskip=0cm}}\n\ + {\\rightmark\\leaders\\hbox{\\tiny ~plain2}\\hfill\\ \\thepage}}}\n\ + %\\@ifundefined{jintercharskip}{%\n\ + % \\def\\p2zerointerskip{\\kanjiskip=0cm}}{%\n\ + % \\def\\p2zerointerskip{\\jintercharskip=0cm}}\n\ \\makeatother\n" SECTION_1 "\n\ \\section{@1}\ --- plain2-2.54p1.orig/doc/plain2.pln +++ plain2-2.54p1/doc/plain2.pln @@ -377,6 +377,7 @@ [[R \input{picture_intro.tex} +\mbox{} % to avoid `Underfull \hbox (badness 10000)' ]]R 3. plain2 コマンド @@ -2270,7 +2271,7 @@ "tgif_fig.eps"とします. [[R ~\\ -\begin{center} +\mbox{}\begin{center} \epsfile{file=tgif_win.eps}\\ \end{center} ]]R --- plain2-2.54p1.orig/doc/pln2raw +++ plain2-2.54p1/doc/pln2raw @@ -9,22 +9,25 @@ LNUM= while getopts n c do - case $c in + case "$c" in n) LNUM="on" shift ;; esac done -echo '{\list{}{\leftmargin=0.5in}\item[]' -echo '{\baselineskip=10pt' -echo '\p2zerointerskip' -echo '\begin{verbatim}' +cat <<'EOF' +{\list{}{\leftmargin=0.5in}\item[] +{\par\baselineskip=10pt +\begin{jverbatim} +EOF if [ "$LNUM" = "on" ] then - awk '{printf "%3d: %s\n",NR,$0}' $1 + awk '{printf "%3d: %s\n",NR,$0}' ${1+"$@"} else - cat $1 + cat ${1+"$@"} fi | expand -echo '\end{verbatim}}' -echo '\endlist}' +cat <<'EOF' +\end{jverbatim}\par} +\endlist} +EOF --- plain2-2.54p1.orig/doc/table_adjust.texv +++ plain2-2.54p1/doc/table_adjust.texv @@ -1,7 +1,7 @@ {\list{}{\leftmargin=0.5in}\item[] {\baselineskip=10pt -\jintercharskip=0cm -\begin{verbatim} +\par +\begin{jverbatim} % plain2 -tex -nopre table_adjust.pln \par 次のように枠のないテーブルは, @@ -12,5 +12,5 @@ 明示的に指定する "[[T"と"]]T" そのまま我慢する 多分例示になる \endlist} -\end{verbatim}} +\end{jverbatim}\par} \endlist} --- plain2-2.54p1.orig/lib/jbook.p2 +++ plain2-2.54p1/lib/jbook.p2 @@ -1,9 +1,13 @@ # # jbookスタイルを使う # -# $Id: jbook.p2,v 1.1 1993/02/25 19:40:32 uchida Exp $ +# # -DOC_BEGIN "\\documentstyle[]{jbook}\n\ +DOC_BEGIN "\ +\\newif\\ifNTT\\NTTfalse\n\ +\\ifx\\gtfam\\undefined\\ifx\\gtfamily\\undefined\\NTTtrue\\fi\\fi\n\ +\\ifNTT\\documentstyle[$2]{j-book}\n\ +\\else\\documentstyle[$3]{jbook}\\fi\n\ \\setcounter{secnumdepth}{6}\n\ \\setcounter{tocdepth}{6}\n\ \\topsep=0.1cm\n\ --- plain2-2.54p1.orig/src/Makefile +++ plain2-2.54p1/src/Makefile @@ -10,23 +10,23 @@ SHELL=/bin/sh -DEFINES=-DKANJI -DPICTURE +DEFINES=-DKANJI -DPICTURE -DHTML -#CC=gcc -#CFLAGS= -fwritable-strings ${DEFINES} -DBSD -DDEBUG +CC=gcc +CFLAGS= -fwritable-strings ${DEFINES} -DBSD -DDEBUG -O2 -s -CC=cc -CFLAGS= -O ${DEFINES} -DBSD -DDEBUG +#CC=cc +#CFLAGS= -O -fwritable-strings ${DEFINES} -DBSD -DDEBUG #CFLAGS= -g ${DEFINES} -DDEBUG SRCS=plain2.c readfile.c analyze.c miscutil.c\ section.c example.c list.c plaintxt.c table.c spacing.c\ headfoot.c hint.c picture.c justify.c ftitle.c\ - roffout.c texout.c title.c output.c renumout.c macro.c + roffout.c texout.c title.c output.c renumout.c macro.c htmlout.c OBJS_NOKANJI=plain2.o readfile.o miscutil.o\ section.o example.o list.o plaintxt.o spacing.o\ headfoot.o hint.o justify.o\ - texout.o output.o renumout.o macro.o + texout.o output.o renumout.o macro.o htmlout.o # # Following files contain Kanji characters(8bit) in EUC code. # @@ -96,3 +96,4 @@ output.o: plain2.h picture.h macro.h renumout.o: plain2.h macro.o: plain2.h macro.h +htmlout.o: plain2.h macro.h --- plain2-2.54p1.orig/src/headfoot.c +++ plain2-2.54p1/src/headfoot.c @@ -282,6 +282,8 @@ } /* * Build and print Header/Footer string for troff output + * (Note: This function returns a pointer to a static buffer which will be + * re-written at next call) */ extern struct transTable roffTransQ[]; char * @@ -290,7 +292,7 @@ { char left[HF_MAXLEN]; char right[HF_MAXLEN]; - char ret[64]; + static char ret[64]; if (build(pat1, pat2, left, right)) { (void)strcpy(ret, codeCvt(textQuote(left, roffTransQ))); (void)strcat(ret, "\\\\\\\\nP"); --- plain2-2.54p1.orig/src/hint.c +++ plain2-2.54p1/src/hint.c @@ -47,7 +47,7 @@ } hp++; } - return NULL; + return 0; } hint(begin, end) int begin; --- plain2-2.54p1.orig/src/macro.c +++ plain2-2.54p1/src/macro.c @@ -15,12 +15,14 @@ #define MACRO_SUFFIX ".p2" struct macNames macNames[] = { - "DOC_BEGIN", M_DOC_BEGIN, "#$", + "DOC_BEGIN", M_DOC_BEGIN, "#$$", "DOC_END", M_DOC_END, "", "PLAIN_BEGIN", M_PLAIN_BEGIN, "", "PLAIN_END", M_PLAIN_END, "", "EXAM_BEGIN", M_EXAM_BEGIN, "#", "EXAM_END", M_EXAM_END, "", + "JEXAM_BEGIN", M_JEXAM_BEGIN, "#", + "JEXAM_END", M_JEXAM_END, "", "SET_SEC", M_SET_SEC, "#$", "APPENDIX", M_APPENDIX, "$", "APDX_BEGIN", M_APDX_BEGIN, "", @@ -86,12 +88,18 @@ struct cmpMac *mip, *new_mip; int def_type; mip = (struct cmpMac *)malloc(sizeof(struct cmpMac)); + if(mip == NULL){ /* Add Nide */ + malloc_error: + fprintf(stderr, "PANIC(malloc in macroParse)\n"); + exit (2); + } mip->cmac_next = NULL; mip->cmac_argnum = -1; mip->cmac_str = s; while (*s) { if (isdigit(*(s+1)) && (def_type = atype(*s)) != ATYPE_VOID) { new_mip=(struct cmpMac *)malloc(sizeof(struct cmpMac)); + if(new_mip == NULL) goto malloc_error; /* Add Nide */ mip->cmac_next = new_mip; new_mip->cmac_next = NULL; new_mip->cmac_argtype = *s; @@ -369,8 +377,7 @@ } if (ret == -1) continue; - s = (char *)malloc(strlen(defstr)); - strcpy(s, defstr); + s = strsave(defstr); /* Changed Nide (but don't we need free?)*/ outMacro[macroNum] = macroParse(s, macroNum, s); } fclose(fd); --- plain2-2.54p1.orig/src/macro.h +++ plain2-2.54p1/src/macro.h @@ -10,29 +10,31 @@ #define M_PLAIN_END 3 #define M_EXAM_BEGIN 4 #define M_EXAM_END 5 -#define M_SET_SEC 6 -#define M_APPENDIX 7 -#define M_APDX_BEGIN 8 -#define M_BLANK 9 -#define M_PAGE 10 -#define M_NEWLINE 11 -#define M_CENTER_BEGIN 12 -#define M_CENTER_END 13 -#define M_RIGHT_BEGIN 14 -#define M_RIGHT_END 15 -#define M_INDENT 16 -#define M_INDENT0 17 -#define M_TITLE 18 -#define M_FOOTN_BEGIN 19 -#define M_FOOTN_END 20 -#define M_REFER_BEGIN 21 -#define M_REFER_END 22 -#define M_BOLD_BEGIN 23 -#define M_BOLD_END 24 -#define M_INDEX_BEGIN 25 -#define M_INDEX_END 26 -#define M_SECTION_END 27 -#define M_SECTION_1 28 +#define M_JEXAM_BEGIN 6 /* Inserted by Nide */ +#define M_JEXAM_END 7 /* Inserted by Nide */ +#define M_SET_SEC 8 +#define M_APPENDIX 9 +#define M_APDX_BEGIN 10 +#define M_BLANK 11 +#define M_PAGE 12 +#define M_NEWLINE 13 +#define M_CENTER_BEGIN 14 +#define M_CENTER_END 15 +#define M_RIGHT_BEGIN 16 +#define M_RIGHT_END 17 +#define M_INDENT 18 +#define M_INDENT0 19 +#define M_TITLE 20 +#define M_FOOTN_BEGIN 21 +#define M_FOOTN_END 22 +#define M_REFER_BEGIN 23 +#define M_REFER_END 24 +#define M_BOLD_BEGIN 25 +#define M_BOLD_END 26 +#define M_INDEX_BEGIN 27 +#define M_INDEX_END 28 +#define M_SECTION_END 29 +#define M_SECTION_1 30 #define M_SECTION_2 (M_SECTION_1 + 1) #define M_SECTION_3 (M_SECTION_1 + 2) #define M_SECTION_4 (M_SECTION_1 + 3) --- plain2-2.54p1.orig/src/output.c +++ plain2-2.54p1/src/output.c @@ -1,9 +1,12 @@ /* * Copyright (C) 1991,1992,1993 NEC Corporation. */ +/* + * modify by k-chinen@is.aist-nara.ac.jp, 1994 + */ #ifndef lint -static char rcsid[] = - "$Id: output.c,v 2.17 1994/04/19 10:16:51 uchida Exp $ (NEC)"; + + #endif #include <stdio.h> @@ -19,9 +22,11 @@ ?(textp)->body\ :(textp)->body+(textp)->indent) #endif + /* * Definition of Output driver routines. */ +/***** roff *****/ int roffPlain(), roffExample(), roffListBlock(), roffDlistItem(), roffListItem(), roffRawText(), roffSpace(), @@ -33,6 +38,8 @@ roffTable(), roffFTitle(), roffTitle(); char *roffQuote1(), *roffQuote2(); + +/***** TeX *****/ int texPlain(), texExample(), texListBlock(), texDlistItem(), texListItem(), texRawText(), texSpace(), @@ -44,6 +51,20 @@ texTable(), texFTitle(), texTitle(); char *texQuote1(), *texQuote2(); +#ifdef HTML +/***** HTML *****/ +int htmlPlain(), htmlExample(), + htmlListBlock(), htmlDlistItem(), + htmlListItem(), htmlRawText(), htmlSpace(), + htmlCapsule(), htmlComment(), +#ifdef PICTURE + htmlPictureBlock(), htmlPicLine(), htmlPicArc(), + htmlPicText(), htmlLineWidth(), +#endif + htmlTable(), htmlFTitle(), htmlTitle(); +char *htmlQuote1(), *htmlQuote2(); +#endif + struct outDev roffPut = { roffPlain, roffExample, roffListBlock, roffDlistItem, @@ -69,9 +90,32 @@ texTable, texFTitle, texTitle, texQuote1, texQuote2, }; + +#ifdef HTML +struct outDev htmlPut = { + htmlPlain, htmlExample, + htmlListBlock, htmlDlistItem, + htmlListItem, htmlRawText, htmlSpace, + htmlCapsule, htmlComment, +#ifdef PICTURE + htmlPictureBlock, htmlPicLine, htmlPicArc, + htmlPicText, htmlLineWidth, +#endif + htmlTable, htmlFTitle, htmlTitle, + htmlQuote1, htmlQuote2, +}; +#endif + + +#ifdef HTML +/* + * Output text in (roff, TeX or HTML) format. + */ +#else /* * Output text in (roff or TeX) format. */ +#endif struct inline_mark { char il_mark; @@ -408,12 +452,19 @@ + texts[begin]->indent + texts[begin]->headLen, capsule); PRINTED(begin); - if (!capsule) + if (!capsule){ + if(texts[begin]->indent && put == &texPut){ + /* この場合、texFTitle()の出力が「\\」で終わっており、 + 次のputIndent()が「\endlist」を出力する直前に + 「\mbox{}」を入れてunderfull hboxの警告を抑える */ + printf("\\mbox{}"); + } putIndent(IND_RESUME, 0); + } break; case TB_QUOTE: case TB_EXAMPLE: - putMacro(M_EXAM_BEGIN, fontSize); + putMacro(useJverb ? M_JEXAM_BEGIN : M_EXAM_BEGIN, fontSize); for (i = begin; i < end; i++) { PRINTED(i); if (texts[i]->blank) @@ -421,7 +472,7 @@ else (*put->example)(texts[i]->body + listIndent); } - putMacro(M_EXAM_END); + putMacro(useJverb ? M_JEXAM_END : M_EXAM_END); break; case TB_LISTHD: printf("ERROR(List Output%d)%s\n", begin, texts[begin]->body); @@ -452,17 +503,40 @@ case TB_TABLE: { int center; + int indent_amount = 0; + if (!capsule) { center = isCenter(begin, end); (*put->capsule)(BEGIN, FT_TABLE, center); - if (!center) - putIndent(IND_INDENT, - texts[begin]->indent / 2); + if (!center){ + indent_amount = + texts[begin]->indent / 2; + + if(!crossRefer && put == &texPut && + indent_amount){ + /* この場合、texCapsule()の出力が + 「\\」で終わっており、次の + putIndent()が「{\list{}…」を出力 + する直前に「\mbox{}」を入れて + underfull hboxの警告を抑える */ + printf("\\mbox{}"); + } + putIndent(IND_INDENT, indent_amount); + } } tblOutput(begin, end); if (!capsule) { - if (!center) + if (!center){ + if(put == &texPut && indent_amount){ + /* この場合、直前のputIndent()の出力 + が「\\」で終わっており、次の + putIndent()が「\endlist」を出力 + する直前に「\mbox{}」を入れて + underfull hboxの警告を抑える */ + printf("\\mbox{}"); + } putIndent(IND_RESUME, 0); + } (*put->capsule)(END, FT_TABLE, center); } } --- plain2-2.54p1.orig/src/picture.c +++ plain2-2.54p1/src/picture.c @@ -1,9 +1,13 @@ /* * Copyright (C) 1991,1992 NEC Corporation. */ +/* + * modify by k-chinen@is.aist-nara.ac.jp, 1994 + */ + #ifndef lint -static char rcsid[]= - "$Id: picture.c,v 2.11 1994/04/19 10:16:53 uchida Exp $ (NEC)"; + + #endif #ifdef PICTURE @@ -627,6 +631,39 @@ int l; int maxLen; int minInd; + +#ifdef HTML + static int pic_count=0; + if(put == &htmlPut) { + if(htmlOnce) { + if(rawOutput) { + printf("<PRE>\n"); + for( l = begin; l < end; l++) { + htmlRawText(texts[l]->body); + } + printf("</PRE>\n"); + } + else { + printf("<!-- PICTURE -->\n"); + } + return ; + } + else { + printf("<!-- plain2:PICTURE %05d %d %d -->\n", + pic_count, begin, end); + if(htmlHere) { + printf("<P><IMG SRC=\"PIC%05d.gif\">\n", pic_count); + } + else { + printf("<P><B><A HREF=\"PIC%05d.gif\">Picture here</A></B></P>\n", + pic_count); + } + pic_count++; + return ; + } + } +#endif /* HTML */ + minInd = minIndent(begin, end); maxLen = maxLength(begin, end); if ((maxLen - minInd) * fontSize > pageWidth) --- plain2-2.54p1.orig/src/plain2.c +++ plain2-2.54p1/src/plain2.c @@ -1,9 +1,13 @@ /* * Copyright (C) 1991,1992,1994 NEC Corporation. */ +/* + * modify by k-chinen@is.aist-nara.ac.jp, 1994 + */ + #ifndef lint -static char rcsid[] = - "$Id: plain2.c,v 2.29 1994/04/19 10:40:29 uchida Exp $ (NEC)"; + + #endif #include <stdio.h> @@ -12,6 +16,30 @@ #include "plain2.h" #include "macro.h" +#ifdef HTML +#define PLAIN2_USAGE_1 "\ +usage: plain2 [options] [files ...]\n\n\ + ---- parser options ---- ---- output options ----(default)\n\ +-table=dd: table factor [0-100](def=50) -roff: troff output\n\ +-exam=dd: example factor[0-100](def=50) -ms/-mm: troff macro (mm)\n\ +-indsec: sections can be indented -tex: tex output\n\ +-ktable:enable JIS keisen table -tstyle=ss:tex style\n\ +-ref: figure/picture reference -html: HTML output\n\ + -htmlonce: HTML (one path) output\n\ + -here: HTML table/picture ref.\n\ + -renum: renumbering only\n\ + -[no]listd:list decoration (on)\n\ + ---- Others ---- -[no]space:spacing (on)\n\ +-v: verbose output -[no]pre: preamble block (on)\n\ +-dLevel: debug level -[no]acursec: section numbers (off)\n\ + ----- experimental ---- -raw: quote special chars(off)\n\ +-pt=Size: font size -jis: JIS code output\n\ + -sjis: Shift-JIS code input/output\n\ + -f file: output customization\n\n" +#define VERSION "plain2 r2.54 1994/04 by A.Uchida NEC Corporation\n\ +\t(HTML output) by k-chinen@is.aist-nara.ac.jp, NAIST\n\ +\t(unofficial patch 98/08/13 by N.Nide)" +#else #define PLAIN2_USAGE_1 "\ usage: plain2 [options] [files ...]\n\ ---- parser options ---- ---- output options ----(default)\n\ @@ -28,13 +56,19 @@ -pt=Size: font size -jis: JIS code output\n\ -sjis: Shift-JIS code input/output\n\ -f file: output customization\n" -#define VERSION "plain2 r2.54 1994/04 by A.Uchida NEC Corporation" +#define VERSION "plain2 r2.54 1994/04 by A.Uchida NEC Corporation\n\ +\t(HTML output) by k-chinen@is.aist-nara.ac.jp, NAIST" +#endif -extern char *getenv(); +extern char *getenv(); extern char *optarg; extern int optind; extern struct macDefs roffMacros[], roffMsMacros[]; extern struct macDefs texMacros[]; +#ifdef HTML +extern struct macDefs htmlMacros[]; +#endif + /* * Default parameters for Parsing */ @@ -64,10 +98,15 @@ int fontSize = 10; int fontSpecified = 0; int verbose = 0; +#ifdef HTML +int htmlOnce = 0; +int htmlHere = 0; +#endif char *plain2Lib = NULL; char *macroName = NULL; -char *texStyle = NULL; +char *texStyle = DEFAULT_STY; /* Nide */ struct outDev *put = &roffPut; +int useJverb = 0; /* Nide */ FILE *inFile; struct text **texts; @@ -89,6 +128,8 @@ extern unsigned _stklen = 32768U; #endif +int stflag = 1; + main(argc, argv) int argc; char **argv; @@ -112,6 +153,7 @@ (void)fprintf(stderr, "%s\n", VERSION); exit (2); } + if (put != &texPut) useJverb = 0; if (macroName) macroFile(macroName); saveParseDefaults(); @@ -146,6 +188,46 @@ putMacro(M_DOC_END); exit(0); } + + /* "a4j,12pt" -> "a4,12pt" etc. Return value can be free'ed afterward */ +char *styleConv(s, nttflag) +char *s; +int nttflag; +{ + char *buf, *p; + int sty_appeared = 0; + + if(NULL == (p = buf = malloc(strlen(s)*3/2+6+1))){ /* 6 for ",jverb" */ + fprintf(stderr, "PANIC(malloc in styleConv)\n"); + exit(2); + } + while(*s){ + while(isspace(*s)) *p++ = *s++; + if(*s) sty_appeared = 1; + if((*s == 'a' || *s == 'b') && (s[1] == '4' || s[1] == '5')){ + if(nttflag){ + if(s[2] == 'j' && (!s[3] || s[3] == ',')){ + strncpy(p, s, 2), p += 2, s += 3; + } + } else { + if(!s[2] || s[2] == ','){ + strncpy(p, s, 2), p += 2, s += 2; + *p++ = 'j'; + } + } + } + while(*s) if(',' == (*p++ = *s++)) break; + } + if(useJverb){ + if(sty_appeared) *p++ = ','; + strcpy(p, "jverb"), p += 5; + } + *p = '\0'; + return buf; +} +#define nttSty(s) styleConv(s, 1) +#define asciiSty(s) styleConv(s, 0) + /* * Do parse & output */ @@ -163,14 +245,26 @@ if (firstTime) { firstTime = 0; +#ifdef HTML + if (put == &htmlPut) { + initMacroDefs(htmlMacros); + /* sorry, nothing is change this "if" */ + if (halfCooked) { + htmlSetTrans(0); + } + else { + htmlSetTrans(1); + } + } + else +#endif if (put == &roffPut) { if (roffMacro == MS_MACRO) initMacroDefs(roffMsMacros); initMacroDefs(roffMacros); } - else if (put == &texPut) + else if (put == &texPut) { initMacroDefs(texMacros); - if (put == &texPut) { if (halfCooked) { texSetTrans(0); } @@ -179,10 +273,18 @@ } } if (preamble) { - if (texStyle) - putMacro(M_DOC_BEGIN, (long)fontSize, texStyle); - else - putMacro(M_DOC_BEGIN, (long)fontSize, ""); + if (stflag) { + char *p = nttSty(texStyle), *q = asciiSty(texStyle); + + putMacro(M_DOC_BEGIN, (long)fontSize, p, q); + free(p), free(q); + } + else { + char *p = asciiSty(texStyle), *q = asciiSty(texStyle); + + putMacro(M_DOC_BEGIN, (long)fontSize, p, q); + free(p), free(q); + } } } @@ -285,6 +387,13 @@ } else #endif + /* Add Nide (need jverb,sty to use this option) */ + if (strcmp(optarg, "verb") == 0) { + OUTPUT_OPTION("-jverb"); + useJverb = 1; + } + else + /* Add Nide end */ goto usage; break; case 'l': @@ -300,12 +409,17 @@ outputCode = CODE_SJIS; inputCode = CODE_SJIS; } - else + else if (strcmp(optarg, "trict") == 0) { + stflag = 0; + } #endif if (strcmp(optarg, "pace") == 0) { OUTPUT_OPTION("-space"); reflectSpace = 1; } + else if (strcmp(optarg, "trict") == 0) { + stflag = 0; + } else goto usage; break; case 'e': @@ -407,6 +521,22 @@ OUTPUT_OPTION("-alfraw"); halfCooked = 1; } +#ifdef HTML + else if (strcmp(optarg, "tmlonce") == 0) { + OUTPUT_OPTION("-htmlonce"); + htmlOnce = 1; + put = &htmlPut; + } + else if (strcmp(optarg, "tml") == 0) { + OUTPUT_OPTION("-html"); + htmlOnce = 0; + put = &htmlPut; + } + else if (strcmp(optarg, "ere") == 0) { + OUTPUT_OPTION("-here"); + htmlHere = 1; + } +#endif else goto usage; break; case 't': --- plain2-2.54p1.orig/src/plain2.h +++ plain2-2.54p1/src/plain2.h @@ -19,16 +19,23 @@ * 2.4: 28/04/92 * 2.5: 06/08/93 */ -#define NEC_CCS /* NEC C&C Common Software Lab. dependent */ +/* + * modify by k-chinen@is.aist-nara.ac.jp, 1994 + */ + +/* #define NEC_CCS /* NEC C&C Common Software Lab. dependent */ -#define NTT_TEX /* NTT jlatex */ +/* #undef NTT_TEX /* NTT jlatex */ /* no longer needed */ #define TITLE_SPECIAL #define PLAIN2_ENV "PLAIN2_INIT" #define PLAIN2_LIB "PLAIN2_LIB" -#define MACRO_LIB "/usr/local/lib/plain2" +#define MACRO_LIB "/usr/lib/plain2" + +#define DEFAULT_STY "" /* default style in TeX output */ +/*#define DEFAULT_STY "a4" */ #define MIN_INDENT 4 /* minimum indentation to be indented region */ #define MIN_SPACING 4 /* minimum number of lines to be space region*/ @@ -203,9 +210,14 @@ extern int listDecor; /* List decoration */ extern int reflectSpace; /* reflect space lines */ extern int texQuote; /* Use \verb| | for tex output */ +#ifdef HTML +extern int htmlOnce; /* One/Multi-path flag for HTML */ +extern int htmlHere; /* flag of pic/tbl here or not */ +#endif extern int indexEnabled; /* Enables Indexing */ extern int fontSize; /* font size */ extern int fontSpecified; /* font size specified */ +extern int useJverb; /* use jverbatim (Nide) */ /* */ extern FILE *inFile; /* intput File */ extern struct text **texts; /* texts[lineNum] array of text @@ -268,6 +280,8 @@ int markAsPlain(); int markIfQuote(); int markIfTable(); +struct picLineElm *picLineMatch(); +struct picMiscLines *picMiscMatch(); /* * Output driver @@ -309,6 +323,9 @@ }; extern struct outDev roffPut; extern struct outDev texPut; +#ifdef HTML +extern struct outDev htmlPut; +#endif extern struct outDev *put; #define INLINE_BEGIN "((" --- plain2-2.54p1.orig/src/readfile.c +++ plain2-2.54p1/src/readfile.c @@ -201,6 +201,7 @@ while (fgets(buf, MAX_LINE_LEN, inFile) != NULL) { textp->next = (struct text *)malloc(sizeof(struct text)); if (textp->next == NULL){ + malloc_error: fprintf(stderr, "PANIC(malloc in readAndStore)\n"); exit (2); } @@ -222,8 +223,10 @@ */ texts = (struct text **) malloc(sizeof(struct text *) * (textLines + 1)); + if(texts == NULL) goto malloc_error; /* Add Nide */ for (textp = textTop, i=1; i < textLines; textp = textp->next, i++) texts[i] = textp; texts[textLines] = (struct text *)malloc(sizeof(struct text)); + if(texts[textLines] == NULL) goto malloc_error; /* Add Nide */ bzero((char *)texts[textLines], sizeof(struct text)); } --- plain2-2.54p1.orig/src/table.c +++ plain2-2.54p1/src/table.c @@ -464,7 +464,7 @@ if (colVline[col] == COLV_ASC && tblAsciAttr[(unsigned char)*s] == 0 && tblKanjiByte[(unsigned char)*s] - && tblKwakuAttr(s) == NULL) + && tblKwakuAttr(s) == 0) nilg++; #ifdef KANJI if (isZenkaku(s)) { --- plain2-2.54p1.orig/src/roffout.c +++ plain2-2.54p1/src/roffout.c @@ -19,6 +19,10 @@ M_PLAIN_END, "", M_EXAM_BEGIN, ".ft CW\n.vs -2\n.nf\n", M_EXAM_END, ".fi\n.vs +2\n.ft\n", + M_JEXAM_BEGIN, "", + M_JEXAM_END, "", /* These two are not actually used, because when + roff output is selected, the flag useJverb + is always 0 */ M_APPENDIX, "\\fBAppendix $1\\fP\n", M_BLANK, "\n", M_PAGE, ".bp\n", --- plain2-2.54p1.orig/src/texout.c +++ plain2-2.54p1/src/texout.c @@ -12,32 +12,30 @@ #include "table.h" #include "macro.h" -#ifdef NTT_TEX -#define STR_DOC_BEGIN "\\documentstyle[$2]{jarticle}\n\ +#define STR_DOC_BEGIN "\ +\\newif\\ifNTT\\NTTfalse\n\ +\\ifx\\gtfam\\undefined\\ifx\\gtfamily\\undefined\\NTTtrue\\fi\\fi\n\ +\\ifNTT\\documentstyle[$2]{j-article}\n\ +\\else\\documentstyle[$3]{jarticle}\\fi\n\ \\setcounter{secnumdepth}{6}\n\ \\setcounter{tocdepth}{6}\n\ \\topsep=0.1cm\n\ \\parsep=0.1cm\n\ \\itemsep=0.0cm\n\ -\\renewcommand{\\bf}{\\protect\\pbf\\protect\\pdg}\n\ +%\\renewcommand{\\bf}{\\protect\\pbf\\protect\\pdg}\n\ \\begin{document}\n" -#else /* ASCII_TEX */ -#define STR_DOC_BEGIN "\\documentstyle[$2]{jarticle}\n\ -\\setcounter{secnumdepth}{6}\n\ -\\setcounter{tocdepth}{6}\n\ -\\topsep=0.1cm\n\ -\\parsep=0.1cm\n\ -\\itemsep=0.0cm\n\ -\\begin{document}\n" -#endif struct macDefs texMacros[] = { M_DOC_BEGIN, STR_DOC_BEGIN, M_DOC_END, "\\end{document}\n", M_PLAIN_BEGIN, "\\par\n", M_PLAIN_END, "", - M_EXAM_BEGIN, "{\\baselineskip=#1pt\n\\begin{verbatim}\n", + M_EXAM_BEGIN, "{\\par\\baselineskip=#1pt\n\\begin{verbatim}\n", + /* 直前の行間まで狭まってしまうのを防ぐため\parを置いた */ M_EXAM_END, "\\end{verbatim}}\n", + M_JEXAM_BEGIN, "{\\par\\baselineskip=#1pt\n\\begin{jverbatim}\n", + M_JEXAM_END, "\\end{jverbatim}\\par}\n", + /* jverbatimの前後には\par必要。jverb.styのドキュメント参照 */ M_APDX_BEGIN, "\\appendix\n", M_APPENDIX, "\\section{@1}\n", M_BLANK, "\\medskip\n", @@ -180,8 +178,9 @@ s = buf; while(*str) { if (len = alpha(str)) { - (void)strcpy(s, "\\verb|"); - s += strlen("\\verb|"); + char *p = useJverb ? "\\jverb|" : "\\verb|"; + (void)strcpy(s, p); + s += strlen(p); (void)strncpy(s, str, len); s += len; str += len; @@ -805,7 +804,9 @@ if (begin) { printf("~\\\\\n"); if (center) { - printf("\\begin{center}\n"); + /* 「\begin{center}」の直前が「\\」となるため + 「\mbox{}」を入れてunderfill hboxの警告を抑える */ + printf("\\mbox{}\\begin{center}\n"); } } else { --- plain2-2.54p1.orig/src/title.c +++ plain2-2.54p1/src/title.c @@ -101,6 +101,12 @@ "事業部", TENT_SHOZOKU, S_ALL, 0, W_ANYWHERE, "研究所", TENT_SHOZOKU, S_ALL, 0, W_ANYWHERE, "研究部", TENT_SHOZOKU, S_ALL, 0, W_ANYWHERE, +/* Add Nide */ + "大学", TENT_SHOZOKU, S_ALL, 0, W_ANYWHERE, + "学部", TENT_SHOZOKU, S_ALL, 0, W_ANYWHERE, + "学科", TENT_SHOZOKU, S_ALL, 0, W_ANYWHERE, + "研究室", TENT_SHOZOKU, S_ALL, 0, W_ANYWHERE, +/* Add Nide end */ "文書番号", TENT_NUMBER, S_FROMRIGHT, 0, W_ANYWHERE, "日付", TENT_DATE, S_FROMRIGHT, 0, W_ANYWHERE, "月", TENT_DATE, S_ALL, 0, W_ANYWHERE, @@ -132,6 +138,18 @@ "/97", TENT_DATE, S_ALL, 0, W_ANYWHERE, "/98", TENT_DATE, S_ALL, 0, W_ANYWHERE, "/99", TENT_DATE, S_ALL, 0, W_ANYWHERE, +/* Add Nide */ + "2000/", TENT_DATE, S_ALL, 0, W_ANYWHERE, + "2001/", TENT_DATE, S_ALL, 0, W_ANYWHERE, + "2002/", TENT_DATE, S_ALL, 0, W_ANYWHERE, + "2003/", TENT_DATE, S_ALL, 0, W_ANYWHERE, + "2004/", TENT_DATE, S_ALL, 0, W_ANYWHERE, + "/2000", TENT_DATE, S_ALL, 0, W_ANYWHERE, + "/2001", TENT_DATE, S_ALL, 0, W_ANYWHERE, + "/2002", TENT_DATE, S_ALL, 0, W_ANYWHERE, + "/2003", TENT_DATE, S_ALL, 0, W_ANYWHERE, + "/2004", TENT_DATE, S_ALL, 0, W_ANYWHERE, +/* Add Nide end */ #ifdef NEC_CCS "開本", TENT_SHOZOKU, S_ALL, 0, W_ANYWHERE, "開研", TENT_SHOZOKU, S_ALL, 0, W_ANYWHERE, --- plain2-2.54p1.orig/src/README.HTML +++ plain2-2.54p1/src/README.HTML @@ -0,0 +1,176 @@ +by k-chinen@is.aist-nara.ac.jp + +1. Prologue + + +This packege is patched HTML support plain2. +HTML support routines separated by Macro HTML. + + #ifdef HTML + +If you found bugs, please send mail k-chinen@is.aist-nara.ac.jp. + + + + +2. What is HTML ? + +HTML was acronym for Hyper Text Markup Language, which is used in World +Wide Web. +World Wide Web is famous service for Mosaic. World Wide Web makes hypertext +over Network. + + + +3. How to use ? + +3.1. Basic + +3.1.1. convert plain text to HTML + + + % plain2 -html foo.txt > bar.html + +plain2 convert foo.txt (plain text) to bar.html (HTML). + + + +3.1.2. convert plain text to HTML with pictures and tables + +use -here option, plain2 made HTML which include pictures and tables. +But HTML not support picture and table. plain2 only express anchor for link +to picture and table + + % plain2 -html -here foo.txt > junk.html + + +3.1.3. convert plain text to HTML with erasing pictures and tables + +If you want to erase picture or table, use -htmlonce option (don't use -html). + + + +3.1.4. convert plain2 text to HTML with raw pictures and tables + +If you want to convert plain2 text with raw pictures and tables, +use -htmlonce and -raw. + + + +3.2. Extended (plain2html) + +3.2.1. require + +HTML is not support picture and table, you know. but plain2 generate +image and table via roff or TeX. +Then you need roff or TeX and image processing programs. + +For example, this packege include c-shell script which named plain2html. +This script ganerate HTML and picture and table files. +(pictures and tables are GIF format file). +and plain2html require follow programs. + + (1) plain2 + + (2) typesetting program + - TeX + * latex and dvi2ps + ('jlatex' is japanelized latex. please subsitute + 'jlatex' to 'latex' in script) + - roff + * groff + + (3) image processing program + - convert ( which included ImageMagick) + - pnmcrop ( which included pbmplus) + + (4) other + - csh or tcsh + - awk + - ghostscript ( convert calle it) + - pt2htcol.awk ( inclued this packege ) + +3.2.2. How to use + +For eample, convert plain text file foo.txt to HTML. + + (1) Make working direcory, because plain2 generate many files. + + % mkdir foo.work + % cp foo.txt foo.work + % cd foo.work + + (2) run plain2html + + % plain2html foo.txt + + plain2html gerate HTML file foo.html, PIC*.gif (for picture) and + TBL*.gif (for table). + +So, you get HTML file. Please check result via Mosaic or Chimera. + + % Mosaic foo.html + +or + + % chimera foo.html + + + +4. Changes for plain2 + +* add -html option + +* add -here option + Document size is important in WWW. switch include images or not. + +* new make htmlout.c (like texout.c) + +* Cannot found pictures begin and end, I modify picture.c + +* add plain2html and pt2htcol.awk + + 1. Genate HTML with -html + 2. Convert pictures and tables. + + a) groff + - conver to PS via groff + + b) latex + - convert to DVI via latex + - convert to PS via dvi2ps + + 3. cut improtant part in picures and convert to GIF. + - convet to PNM via 'convert' + - cut via 'pnmcrop' + - convet to GIF via 'convert' + + + +5. Bugs. + +* It is multi path + plain2 is beauty, because plain2 is one path... + but plain2html is multi path. + +* I think to hard to install. because it require many programs. + +* on groff + - groff not support japanaes + + +6. Acknowledgment + +Special thank for Mr. Uchida (uchida@ccs.mt.nec.co.jp). he release +plain2 r2.5 for this program. And he give important advice and +suggestion. + + +7. Epilogue + +This packege is only patch for plain2. It is not new revision of plain2. +Then, If you have questions, advices and requiremnts. please mail +k-chinen@is.aist-nara.ac.jp + +Own your risk. +Enjoy !!! --- plain2-2.54p1.orig/src/README.HTML.JPN +++ plain2-2.54p1/src/README.HTML.JPN @@ -0,0 +1,197 @@ +$BBjL>(B plain2 $B$N(B HTML $BBP1~(B +by k-chinen@is.aist-nara.ac.jp + +1. $B$O$8$a$K(B + +$B$3$N%G%#%l%/%H%j$N%=!<%9%U%!%$%k$NCf$G!"(B + + #ifdef HTML + +$B$H$7$F$"$k$N$O!"%*%j%8%J%k$N(B plain2 $B$rF`NI@hC<2J3X5;=QBg3X1!Bg3X$N(B +$BCNG0(B (k-chinen@is.aist-nara.ac.jp) $B$,(B HTML $BBP1~$N$?$a2~B$$7$?$H$3$m(B +$B$G$9!#(B +$B$=$NItJ,$G%P%0$,5/$-$?$H;W$o$l$k:]$K$O(B k-chinen@is.aist-nara.ac.jp +$B$X(B E-mail $B$G$*CN$i$;$/$@$5$$!#<!$N%j%j!<%9$N:]$N;29M$K$7$^$9!#(B + + + +2. HTML $B$H$O(B ? + +HTML $B$H$O(B Hyper Text Markup Language $B$NN,$G!"(BWorld Wide Web $B$H$$$&(B +$B%5!<%S%9$GJ8>O$r:n@.$9$k0Y$N8@8l$G$9!#(BWorld Wide Web $B$O(B Mosaic $B$H(B +$B$$$&%W%m%0%i%`$GM-L>$J!"%M%C%H%o!<%/>e$K%O%$%Q!<%F%-%9%H$r:n$k%5!<(B +$B%S%9$G$9!#(B + + +3. $B;H$$J}(B + +3.1. $B4pK\(B + +3.1.1. plain text $B$r(B HTML $B$K(B + +$B4pK\E*$J%*%j%8%J%k$N(B plain2 $B$H$[$H$s$IF1$8$G!"(B + + % plain2 -html -jis foo.txt > bar.html + +$B$H$$$&$h$&$K;H$$$^$9!#(B +$B$3$&$9$k$H!"(Bfoo.txt $B$H$$$&(B plain text $B$r(B bar.html $B$H$$$&(B HTML $B$N=q(B +$B<0$G$+$+$l$?%U%!%$%k$,$G$-$^$9!#(B + +3.1.2. plain text $B$r?^$dI=$,F~$C$?(B HTML $B$K(B + +plain2 $B$K(B -here $B%*%W%7%g%s$r$D$1$k$H!"?^$dI=$rD>@\4^$a$k$h$&$K=q$+(B +$B$l$?(B HTML $B$N=q<0$N%U%!%$%k$,$G$-$^$9!#(B +($B$?$@$7!";DG0$J$,$i(B plain2 $B$G?^$dI=$r(B HTML $B$K$9$k;v$O=PMh$^$;$s!#(B) + + % plain2 -html -here -jis foo.txt > junk.html + +$B$H$7$F;H$C$F$_$^$7$g$&!#(B +$B$3$N(B junk.html $B$G$O!"(B bar.html $B$G(B "Picture here" $B$H$+(B "Table here" +$B$H=q$$$F$"$C$?>l=j$K2?$+?^$,=P$k$H$*$b$$$^$9!#(B + +3.1.3. plain text $B$N?^$dI=$rL5;k$7$F(B HTML $B$K(B + +$B?^$dI=$rL5;k$7$F(B HTML $B$K$7$?$$;~$K$O!"(B-html $B$G$O$J$/(B -htmlonce $B$r(B +$B;H$C$F$/$@$5$$!#(B + +3.1.4. plain text $B$N?^$dI=$O$=$N$^$^$G(B HTML $B$K(B + +$B?^$dI=$r$=$N$^$^(B HTML $B$K4^$a$?$$;~$K$O!"(B-htmlonce $B$H(B -raw $B$r0l=o(B +$B$K;H$C$F$/$@$5$$!#(B + + + +3.2. $B1~MQ(B (plain2html) + +3.2.1. $BI,MW$JJ*(B + +plain2 $B$N(B HTML $B$r:n$k5!G=$G$O?^$dI=$O:n$l$^$;$s$,!"(Broff $B$d(B TeX $B$r(B +$B;H$C$F?^$dI=$r:n$k;v$,=PMh$^$9!#$3$N$?$a$K$O(B roff $B$d(B TeX $B$N7A<0$N(B +$B%U%!%$%k$r(B gif $BEy$N%$%a!<%8%G!<%?$K$9$k%W%m%0%i%`$,I,MW$G$9!#(B + +$B%5%s%W%k$H$7$F!"$3$N%Q%C%A$G$O(B plain2html $B$H$$$&(B csh script $B$r$D(B +$B$1$F$"$j$^$9!#$3$N%9%/%j%W%H$G$O(B HTML $B$N%U%!%$%k$H$=$l$KI,MW$J?^(B +$B$dI=$N$?$a$N%$%a!<%8%G!<%?$r:n$j$^$9!#(B + +$B$3$N%9%/%j%W%H$r;H$&$K$O0J2<$N$h$&$J%W%m%0%i%`$,I,MW$G$9!#(B + + (1) plain2 + + (2) $BAHHG%W%m%0%i%`(B + - TeX $B$r$D$+$&>l9g(B + * jlatex $B$H(B dvi2ps + - roff $B$r;H$&>l9g(B + * groff + + (3) $B%$%a!<%8%G!<%?JQ49%W%m%0%i%`(B + - convert ( ImageMagick $B$K4^$^$l$F$$$^$9(B ) + - pnmcrop ( pbmplus $B$K4^$^$l$F$$$^$9(B ) + + (4) $B$=$NB>(B + - csh $B$+(B tcsh + - awk + - ghostscript ( convert $B$,8F$S=P$7$^$9(B ) + - pt2htcol.awk ( $B$3$N%Q%C%A$K4^$^$l$F$$$^$9(B ) + +3.2.2. $B;H$$J}(B + +foo.txt $B$r(B HTML $B$N%U%!%$%k$K$9$kNc$r>R2p$7$^$9!#(B + + (1) $B?^$dI=$N%$%a!<%8%G!<%?$,$G$-$k$N$GJL$N%G%#%l%/%H%j$r$D$/(B + $B$C$F$=$3$G:n6H$7$^$7$g$&!#(B + + % mkdir foo.work + % cp foo.txt foo.work + % cd foo.work + + (2) plain2html $B$r<B9T$7$^$9(B + + % plain2html foo.txt + + $B<B9T$,=*N;$9$k$H(B($B$$$m$$$m$J=hM}$r$9$k$N$G7k9=;~4V$+$+$j(B + $B$^$9(B)$B!"(Bfoo.html $B$H$$$&(B HTML $B$N=q<0$G$-$?%U%!%$%k$H!"?^(B + $B$dI=$N$?$a$N(B PIC*.gif $B$d(B TBL*.gif $B$G$-$^$9!#(B + +$B$H$$$&$o$1$G(B HTML $B$N=q<0$G$G$-$?%U%!%$%k$,$G$-$^$9!#(BMosaic $B$d(B +chimera $B$G7k2L$r3NG'$7$F$/$@$5$$!#(B + + % Mosaic foo.html + +$B$^$?$O!"(B + + % chimera foo.html + +$B$H$7$F$/$@$5$$!#(B + + +4. $BJQ99E@(B + +* -html $B%*%W%7%g%s$r$D$1$?!#(B + $B$3$l$G!"(BHTML $B$N=PNO$r$9$k!#(B + +* -here $B%*%W%7%g%s$r$D$1$?!#(B + WWW $B$G$OJ8=q$NBg$-$5$O=EMW(B(64kbps $B$N%5%$%H$b$"$k(B)$B$J$N$G!"(BHTML + $B$NCf$KI=$d?^$r(B + + - $B$=$N$^$^F~$l$k(B + - $B%j%s%/$H$9$k(B + + $B$K@ZBX$($k!#(B + +* texout.c $B$r$^$M$F!"(Bhtmlout.c $B$r:n$C$?!#(B + html $B$G;O$^$k4X?t$r:n$C$F(B HMTL $BBP1~$7$?!#(B + +* $B$J$<$+!"?^$@$1$O(B *out.c $B$N4X?t$GNN0h(B($B;O$a$H=*$j$N9T(B) $B$rCN$k;v(B + $B$,$G$-$J$$$h$&$J$N$G!"(Bpicture.c $B$NCf$rJQ99$7$?!#(B + +* $B%9%/%j%W%H(B plain2html , pt2htcol.awk $B$rDI2C!#(B + mulit path $B$H$7$F2?2s$b<B9T$7$F!"A4BN$rJQ49$9$k;v$K$7$?!#(B + + 1. $BA4BN$r(B -html $B$GJQ49!#(B + 2. $BI=$d?^$NItJ,$r(B ps $B$KJQ49!#(B + + a) groff + - groff $B$G(B ps $B$K(B + + b) latex + - jlatex $B$G(B dvi $B$K(B + - dvi2ps $B$G(B ps $B$K(B + + 3. $BI=$d?^$NI,MW$J=j$r@Z$j=P$7$F!"(Bgif $B$KJQ49!#(B + - convert $B$G(B pnm $B$K(B + - pnmcrop $B$G@Z$j=P$9(B + - convert $B$G(B gif $B$K(B + + $B?^$N@Z$j=P$7$O!"(BTeX $B$G$O(B \thispagestyle{empty} $B$r=q(B + $B$$$?%9%?%$%k%U%!%$%k$rMQ0U$7$F2r7h!#(B + groff $B$G$O(B -me $B$G2r7h$7$?$h$&$@!#(B(roff $B$O>\$7$/$J$$(B + $B$N$G<+?.$,$J$$(B) + + +5. $BLdBjE@(B + +* multi path $B$J$C$F$7$^$C$?!#(B + plain2 $B$O(B one path $B$@$+$iH~$7$$$N$K(B... + +* $B$$$m$$$m$J%D!<%k$r;H$&$N$G!"(Binstall $B$9$k;~$OBgJQ$+$bCN$l$J$$!#(B + +* groff $B$K4X$7$F(B + - $BF|K\8l$,DL$8$J$$(B + + +6. $B<U<-(B + +plain2 $B$N:n<T$NFbED$5$s(B(uchida@ccs.mt.nec.co.jp)$B$K$O$*K;$7$$$N$K(B +plain2 r2.5 $B$N%j%j!<%9$r$7$F$b$i$$$^$7$?!#$^$?!"$$$m$$$m$H%3%a%s(B +$B%H$rD:$-$^$7$?!#$"$j$,$H$&$4$6$$$^$7$?!#(B + + + +7. $B$*$o$j$K(B + +$B$3$N%Q%C%A$O(B plain2 $B$KBP$9$k$b$N$G!"(Bplain2 $B$N?7$7$$(B revison $B$G$O(B +$B$"$j$^$;$s!#$7$?$,$C$F!"$3$N%Q%C%A$K4X$9$k46A[!"MWK>!"<ALd$J$I$O(B +k-chinen@is.aist-nara.ac.jp $B08$G$*4j$$$7$^$9!#(B + +$B$J$*!"$3$N%Q%C%A$K$K$h$C$F@8$8$?$$$+$J$kB;32!"Mx1W$K$D$$$F:n<T$O(B +$B@UG$$rIi$$$^$;$s!#(B --- plain2-2.54p1.orig/src/htmlout.c +++ plain2-2.54p1/src/htmlout.c @@ -0,0 +1,469 @@ +/* + * Copyright (C) 1991,1992 NEC Corporation. + */ +/* + modify from texout.c, by k-chinen@is.aist-nara.ac.jp, 1994 + + NOTE: + * This module is prototype of HTML ouputting. + * HTML can markup. but HTML cannot layout. + Therfore this module cannot handle CENTER, RIGHT and SPACE. + * HTML cannout handle table and picture directly. + Therfore this module cannot handle table and picture with + TeX and TROFF outoputting's approach. + Then I could not implement it. +*/ + + + + +#ifndef lint + + +#endif + +#include <stdio.h> +#include "plain2.h" +#include "picture.h" +#include "table.h" +#include "macro.h" + + +struct macDefs htmlMacros[] = { + M_DOC_BEGIN, "<HTML>\n", + M_DOC_END, "</HTML>\n", + M_PLAIN_BEGIN, "<P>\n", + M_PLAIN_END, "</P>\n", + M_EXAM_BEGIN, "<PRE><TT>\n", + M_EXAM_END, "</TT></PRE>\n", + M_APDX_BEGIN, "<!-- appendix -->\n", + M_APPENDIX, "<!-- appendix section -->\n", + M_BLANK, "\n", + M_PAGE, "\n<!-- PAGE -->\n", + M_NEWLINE, "\n<!-- NEWLINE -->\n", + M_CENTER_BEGIN, "<!-- CENTER -->\n", + M_CENTER_END, "<!-- end of CENTER -->\n", + M_RIGHT_BEGIN, "<!-- RIGHT -->\n", + M_RIGHT_END, "<!-- end of RIGHT -->\n", + M_INDENT, "<BLOCKQUOTE>\n", + M_INDENT0, "</BLOCKQUOTE>\n", + M_FOOTN_BEGIN, "", + M_FOOTN_END, "", + M_REFER_BEGIN, "<A HREF=\"#", + M_REFER_END, "\">GO</A>", + M_BOLD_BEGIN, "<B>", + M_BOLD_END, "</B>", + M_INDEX_BEGIN, "", + M_INDEX_END, "", + M_SECTION_1, "\n<H1>@1</H1>\n", + M_SECTION_2, "\n<H2>@1</H2>\n", + M_SECTION_3, "\n<H3>@1</H3>\n", + M_SECTION_4, "\n<H4>@1</H4>\n", + M_SECTION_5, "\n<H5>@1</H5>\n", + M_SECTION, "", + M_SETSEC_1, "", + M_SETSEC_2, "", + M_SETSEC_3, "", + M_SETSEC_4, "", + M_SETSEC_5, "", + M_TITLE, "<TITLE>&1</TITLE>\n<H1>&1</H1>\n<EM>&6</EM>\n<PRE>&4\n&3</PRE>\n<HR>", + -1, "", + }; + + +/* + * HTML text output routines + */ + +struct transTable *htmlTrans; +struct transTable *htmlTransM; + +static struct transTable htmlFullTrans[] = { + {'<', "<" }, + {'>', ">" }, + {'&', "&" }, + {0,0} }; +static struct transTable htmlFullTransM[] = { + {'<', "<" }, + {'>', ">" }, + {'&', "&" }, + {0,0} }; + +static struct transTable htmlHalfTrans[] = { + {'<', "<" }, + {'>', ">" }, + {'&', "&" }, + {0,0} }; + +static struct transTable htmlHalfTransM[] = { + {'<', "<" }, + {'>', ">" }, + {'&', "&" }, + {0,0} }; + +htmlSetTrans(full) +int full; +{ + if (full) { + htmlTrans = htmlFullTrans; + htmlTransM = htmlFullTransM; + } + else { + htmlTrans = htmlHalfTrans; + htmlTransM = htmlHalfTransM; + } +} + + +char * +htmlTextQuote(str, quotable) +char *str; +int quotable; +{ + char *s; + int len; + static char buf[MAX_LINE_LEN]; + + if (rawOutput) + return str; + + if (!quotable) + return textQuote(str, htmlTransM); + + return textQuote(str, htmlTrans); +} + +char *htmlQuote1(str) +char *str; +{ + return htmlTextQuote(str, 1); +} + +char *htmlQuote2(str) +char *str; +{ + return htmlTextQuote(str, 0); +} + + +htmlPutLabel(str) +char *str; +{ + printf("<A NAME=\"%s\"> <EM>(here)</EM> </A>", codeCvt(str)); +} + +htmlPlain(str, attr, newline) +char *str; +int attr; +int newline; +{ + if (attr == IL_RAW || attr == IL_REFERENCE) + printf("%s", codeCvt(str)); + else + printf("%s", codeCvt(htmlTextQuote(str, 1))); + if (newline) + printf("\n"); +} + +htmlExample(str) +char *str; +{ + printf("%s\n",textQuote(str, htmlTrans)); +} + +static int enumLevel = 0; +htmlListBlock(begin, level, ltype, hint) +int begin; +int level; +int ltype; +char hint; +{ + char *lstr; + if (begin) { + switch (ltype) { + case L_BULLET: + case L_DASH: + printf("<UL>\n"); + break; + case L_DLIST: + printf("<DL>\n"); + break; + case L_LROMAN: + case L_SROMAN: + case L_NUMBER: + case L_LALPHA: + case L_SALPHA: + enumLevel++; + printf("<OL>\n"); + break; + default: + break; + } + } + else { + switch (ltype) { + case L_BULLET: + case L_DASH: + printf("</UL>\n"); + break; + case L_LROMAN: + case L_SROMAN: + case L_NUMBER: + case L_LALPHA: + case L_SALPHA: + enumLevel--; + printf("</OL>\n"); + break; + case L_DLIST: + printf("</DL>\n"); + break; + default: + break; + } + } +} + +htmlDlistItem(level, dscr, cont) +int level; +char *dscr; +int cont; +{ + printf("<DT><B>%s</B>\n", codeCvt(htmlTextQuote(dscr, 1))); +} + +htmlListItem(level) +int level; +{ + printf("<LI> "); +} + +htmlRawText(str) +char *str; +{ + printf("%s\n",codeCvt(str)); +} + +htmlSpace(length) +int length; +{ + /* EMPTY --- I don't know what do here */ +} + +htmlFTitle(ft, str, capsule) +int ft; +char *str; /* if (str!=NULL) output title */ +int capsule; +{ + static int figNumber = 1; + static int tblNumber = 1; + if (crossRefer && capsule) { + printf("<B>%s</B>\n", codeCvt(htmlTextQuote(str, 1))); + htmlPutLabel(str); + } + else { + printf ("<P>"); +#ifdef KANJI + if (japaneseText) { + if (ft == FT_FIGURE) + printf ("<B> %s %d.</B>", codeCvt("$B?^(B"), figNumber++); + + else if (ft == FT_TABLE) + printf ("<B> %s %d.</B>", codeCvt("$BI=(B"), tblNumber++); + } + else { +#endif + if (ft == FT_FIGURE) + printf ("<B> Figure %d.</B>", figNumber++); + else if (ft == FT_TABLE) + printf ("<B> Table %d.</B>", tblNumber++); +#ifdef KANJI + } +#endif + printf ("%s\n", codeCvt(htmlTextQuote(str, 1))); + } +} + +#ifdef PICTURE +/* + * Driver for HTML(picture) output + */ +static int picLines; /* Number of lines in the block */ +static int picMinInd; /* Indentation of the region */ + +static int htmlVsize; +static int htmlUnit; + +htmlPictureBlock(begin, lines, indent, maxLen) +int begin; +int lines; +int indent; +int maxLen; +{ + if(htmlOnce) { + if(begin) + printf("<!-- PICTURE -->\n"); + } + else { + if(begin) + printf("<!-- PICTURE -->\n"); + } +} + +/* set line width */ +htmlLineWidth(style) +int style; +{ + /* */ +} + +htmlEllipse(x0, y0, x1, y1, style) +int x0, x1, y0, y1; +int style; +{ + /* */ +} + +/* + * Draw line + * Only ({-1,0,1},{-1,0,1}) direction. + */ +htmlPicLine(x0, y0, x1, y1, style, vector) +int x0, x1, y0, y1; +int style; +int vector; +{ + /* */ +} + +htmlPicArc(x, y, r, dir, style) +int x, y, r; +enum direction dir; +int style; +{ + /* */ +} + +htmlPicText(s, xpos, vpos, factor) +char *s; +int xpos; +int vpos; +int factor; +{ + /* */ +} +#endif + + + +htmlTitle(style, haifu, title, shozoku, number, date, name, renraku +#ifdef TITLE_SPECIAL + ,special8, special9 +#endif + ) +int style; +char **haifu; +char **title; +char **shozoku; +char **number; +char **date; +char **name; +char **renraku; +#ifdef TITLE_SPECIAL +char **special8, **special9; +#endif +{ + char **s; + if (style == 0) { + putMacro(M_TITLE, + title, number, date, shozoku, haifu, name, renraku +#ifdef TITLE_SPECIAL + ,special8, special9 +#endif + ); + return; + } +} + +htmlTable(begin, end, tblp) +int begin; +int end; +struct table *tblp; +{ + if(htmlOnce) { + if(rawOutput) { + int l; + + printf("<PRE>\n"); + for (l = begin; l < end; l++) { + htmlRawText(texts[l]->body); + } + printf("</PRE>\n"); + } + else { + printf("<!-- TABLE -->\n"); + } + + } + else { + static int tbl_count=0; + printf("\n<!-- plain2:TABLE %05d %d %d -->\n",tbl_count,begin,end); + + if(htmlHere) { + printf("<P><IMG SRC=\"TBL%05d.gif\">\n", tbl_count); + } + else { + printf("<P><B><A HREF=\"TBL%05d.gif\">Table here</A></B></P>\n", + tbl_count); + } + tbl_count++; + } +} + +htmlCapsule(begin, type, center) +int begin; +int type; +int center; +{ + static int count=0; + char *typeStr; + + if (crossRefer) { + switch (type) { + case FT_FIGURE: + typeStr = "figure"; + break; + case FT_TABLE: + typeStr = "table"; + break; + default: + fprintf(stderr, "PANIC(unknown capsule type)\n"); + exit(2); + break; + } + if (begin) { + count++; + printf("\n<!-- Start of #%d -->\n",count); + } + else { + printf("\n<!-- End of #%d -->\n",count); + } + } + else /* short paper */ { + if (begin) { + printf("\n<!-- Start of #%d -->\n",count); + } + else { + printf("\n<!-- End of #%d -->\n",count); + } + } +} + +htmlComment(begin, end) +int begin; +int end; +{ + int l; + for (l = begin; l < end; l++) { + printf ("<!-- %s -->\n", codeCvt(texts[l]->body)); + } +} --- plain2-2.54p1.orig/src/plain2html +++ plain2-2.54p1/src/plain2html @@ -0,0 +1,159 @@ +#!/usr/local/bin/tcsh +# +# plain2html: plain text to HTML file +# by k-chinen@is.aist-nara.ac.jp , 1994 +# +# NOTE: +# * This script will be running under csh or tcsh. +# * Handle with care for directory, because this script make +# a lot of temporary file and output file. +# + + +# +# require: +# +# program: +# csh or tcsh +# plain2 ( have -html option verison ) +# awk +# groff ( gtbl, gpic ) +# latex or jlatex +# dvi2ps +# convert ( convertable PS to Any-format version ) +# pnmcrop ( included PBMPLUS ) +# ghostscript ( called by convert when convert PS format ) +# +# script: +# pt2htcol.awk ( included this packeage ) +# +# +# input: +# $1 (plain text file name. e.g., README.j) +# +# output: +# $1:r.html (e.g., README.html) +# +# temporary file: +# _src, _cut.sh , _out.html , pt2empty.sty, _tmp.pnm +# TBL*.p TBL*.ps TBL*.src TBL*.tex TBL*.dvi TBL*.pnm +# PIC*.p PIC*.ps PIC*.src PIC*.tex PIC*.dvi PIC*.pnm +# + + +# +# Default values +# +set tex=1 +set roff=0 +set lib=/usr/local/lib/plain2 + + +# +# Check args. +# +if ( $#argv > 0 ) then + switch ($1) + case -tex: + set tex=1 + set roff=0 + shift + breaksw + case -roff: + set tex=0 + set roff=1 + shift + breaksw + default: + breaksw + endsw +endif + +if ( $#argv > 0 ) then + set target=$1 +else + cat << END_USAGE +plain2html: plain text to HTML file + by k-chinen@is.aist-nara.ac.jp NAIST , 1994 + +usage: plain2html [option] input-filename + +option: -tex TeX mode (use latex, dvi2ps) [defauts] + -roff roff mode (use groff) + +END_USAGE + exit +endif + + + +# +# Start +# convert document's main body. +# collect table/picture location and cut these. +# + +echo "Copy Target $target ." +cp $target _src + +echo "Process document main body" +plain2 -html -jis -here _src > _out.html + +echo "Collect Table/Picutre" +awk -f $lib/pt2htcol.awk _out.html > _cut.sh + + + +# +# Convert parts(table/picture) via LaTeX +# If you don't have jlatex substitute to "latex". +# ( jlatex is Japanese LaTeX ) +# +if ( $tex ) then +cat << END_STYLEFILE > pt2empty.sty +\\thispagestyle{empty} +\\pagestyle{empty} +END_STYLEFILE +cat << END_TEX_CUT >> _cut.sh +foreach i ( TBL*.p PIC*.p ) + echo "Part \$i process" + plain2 -tex -jis -tstyle=pt2empty \$i > \$i:r.tex + jlatex \$i:r.tex + dvi2ps \$i:r.dvi > \$i:r.ps + convert -density 144x144 \$i:r.ps \$i:r.pnm + pnmcrop -white \$i:r.pnm > _tmp.pnm + convert _tmp.pnm \$i:r.gif + rm -f \$i:r.ps \$i:r.dvi \$i:r.aux \$i:r.log \$i:r.tex \$i:r.p \$i:r.pnm +end +END_TEX_CUT +endif + +# +# Convert parts(table/picture) via GROFF +# If you don't have gorff substitute to ROFF-like program. +# +if ( $roff ) then +cat << END_ROFF_CUT >> _cut.sh +foreach i ( TBL*.p PIC*.p ) + echo "Part \$i process" + plain2 -roff -euc \$i > \$i:r.src + groff -me -t -p \$i:r.src > \$i:r.ps + convert -density 144x144 \$i:r.ps \$i:r.pnm + pnmcrop -white \$i:r.pnm > _tmp.pnm + convert _tmp.pnm \$i:r.gif + rm -f \$i:r.ps \$i:r.src \$i:r.p \$i:r.pnm +end +END_ROFF_CUT +endif + +# +# Run parts conversion script +# +echo "Cut Table/Picture" +$shell _cut.sh + +rm -f $target:r.html +mv _out.html $target:r.html +rm -f _cut.sh pt2empty.sty _src _tmp.pnm + +echo "Complete" --- plain2-2.54p1.orig/src/pt2htcol.awk +++ plain2-2.54p1/src/pt2htcol.awk @@ -0,0 +1,20 @@ +# +# pt2htcol.awk: plain2html's parts collection awk-script. +# by k-chinen@is.aist-nara.ac.jp , 1994 +# +# plain2's (with -html) output have "plain2:TABLE" and "plain2:PICTURE" +# sentence. It is mean that output have link to TABLE and PICTURE. +# Therefore, this script collect such sentence and make cutting script. +# +BEGIN{ +} +/^<!-- plain2:TABLE/{ + # print "# " $0 + printf "# table %d th, start %d, end %d\n", $3, $4, $5 + printf "head -%d _src| tail -%d > TBL%05d.p\n",$5, $5-$4+1, $3 +} +/^<!-- plain2:PICTURE/{ + # print "# " $0 + printf "# picture %d th, start %d, end %d\n", $3, $4, $5 + printf "head -%d _src| tail -%d > PIC%05d.p\n",$5, $5-$4+1, $3 +} --- plain2-2.54p1.orig/patch-stamp +++ plain2-2.54p1/patch-stamp @@ -0,0 +1 @@ +HTML and nide patches are applied --- plain2-2.54p1.orig/debian/control +++ plain2-2.54p1/debian/control @@ -0,0 +1,17 @@ +Source: plain2 +Section: text +Priority: optional +Maintainer: Yasuhiro Take <take@debian.or.jp> +Origin: debian-jp +Bugs: debbugs://bugs.debian.or.jp +Build-Depends: debhelper (>> 3.0.0) +Standards-Version: 3.5.2 + +Package: plain2 +Architecture: any +Depends: ${shlibs:Depends} +Suggests: ptex-bin | jtex-bin, groff +Description: Converts plain text into roff, TeX or HTML format. + In TeX format, this converts into ASCII or NTT TeX format. + HTML format is not in original but by a patch and NTT TeX format is also + not in original but by another patch. --- plain2-2.54p1.orig/debian/README.Debian +++ plain2-2.54p1/debian/README.Debian @@ -0,0 +1,30 @@ +plain2 for DEBIAN +---------------------- + +1. By the new extension patch of Mr. Nide, plain2 can now output for both + ASCII and NTT japanese LaTeX. cf. README.nide + We apply a patch which can pass option "a4j" to NTT japanese LaTeX when + use with "-strict" option. + (The option "-strict" does not mean really strict, but only set a4j instead + of a4 for NTT LaTeX also.) + +2. We apply HTML patch of Mr. Chinen but the patch is for plain2-2.53 + so we slightly modify it. cf. README.HTML(.JPN.gz) + +3. Remark that two pathes at the same time may cause some troubles. + +4. examples.tar.gz contains manuals in Japanese. It may be useful to + copy it to somewhere your working directory and do + 'tar zxvf examples.tar.gz' and do not forget to remove examplex.tar.gz + Then in examples directory do 'make plain2.dvi'. + We use platex(ASCII japanese LaTeX) by default but if you want to use other + japanese LaTeX such as jlatex(NTT japanese LaTeX), please edit lines + 56 and 57 of Makefile like "jlatex plain2.tex". + + It is necessary to copy jverb.sty to somewhere in /usr/lib/texmf/tex/ + if you want to use "-jverb" option generally. cf. jverbsty.doc + +5. We modify plain2html script so that it works better in Debian. + We thanks to Debian JP members whose advices make this possible. + +Yasuhiro Take <take@debian.or.jp>, Sat, 25 Mar 2000 20:51:00 +0900 --- plain2-2.54p1.orig/debian/README.ja +++ plain2-2.54p1/debian/README.ja @@ -0,0 +1,24 @@ + +1. 新しい新出さんの機能拡張のパッチにより日本語 LaTeX の場合 ASCII 版でも + NTT 版でも使えます。README.nide 参照。 + NTT 版で a4.sty より a4j.sty が使いたいときのために -strict オプション + を指定できるようにパッチを作って当てています。 + (ただし -strict オプションは単に NTT LaTeX に対しても a4 でなく a4j を + 指定できるだけで、本当の意味で strict ではありません。) + +2. HTML に変換できる知念さんのパッチを当てていますが HTML のパッチは + plain2-2.53用だったので少し修正してあります。README.HTML(.JPN.gz) 参照。 + +3. また二つのパッチは同時に当てられる保障はありませんので不具合があるかも + わかりません。 + +4. examples.tar.gz がドキュメントを含んでいます。適当な作業用のディレクトリ + で展開して "make plain2.dvi" してみてください。 + デフォルトでは platex が使われますがもし他の jlatex などを使いたい場合は + Makefile の 56, 57 行目を jlatex plain2.tex のように修正してください。 + + もし -jverb オプションを使う予定なら jverb.sty は /usr/lib/texmf/tex/ の + 適当なディレクトリにコピーしてください。jverbsty.doc 参照。 + +5. スクリプト plain2html は Debian 用にかなり修正してあります。 + この修正は Debian JP のメンバーの方々のご助言によるものです。 --- plain2-2.54p1.orig/debian/changelog +++ plain2-2.54p1/debian/changelog @@ -0,0 +1,97 @@ +plain2 (2.54p1-4.2) unstable; urgency=low + + * NMU. + * Added Origin: debian-jp, Bugs: debbugs://bugs.debian.or.jp to control. + + -- Atsuhito KOHDA <kohda@pm.tokushima-u.ac.jp> Thu, 22 Aug 2002 12:53:19 +0900 + +plain2 (2.54p1-4.1) unstable; urgency=low + + * NMU. + * Added Build-Depends. + * Fixed obsolete Suggests. + * Bumped up to Standards-Version: 3.5.2. + + -- Masayuki Hatta <mhatta@debian.org> Thu, 4 Oct 2001 09:52:42 +0900 + +plain2 (2.54p1-4) unstable; urgency=low + + * New Maintainer. + * Update to Version: 3.0.1 + + -- Yasuhiro Take <take@debian.or.jp> Sat, 25 Mar 2000 21:00:32 +0900 + +plain2 (2.54p1-3.3) unstable; urgency=low + + * Change examples to examples.tar.gz for disk space. + * Rearrange and update documents a bit and provide a brief english copyright. + + -- Atsuhito Kohda <kohda@pm.tokushima-u.ac.jp> Fri, 19 Nov 1999 17:31:22 +0900 + +plain2 (2.54p1-3.2) unstable; urgency=low + + * Upgrade jverb.sty from v1.04 to v1.06 + * Move /usr/doc/ to /usr/share/doc/ as per the FHS + also /usr/man to /usr/share/man + * Fix some files in example directory so that new tgif can work for them. + Especially we add jmodules.obj in place of original modules.obj + + -- Atsuhito Kohda <kohda@pm.tokushima-u.ac.jp> Thu, 30 Sep 1999 16:55:08 +0900 + +plain2 (2.54p1-3.1) unstable; urgency=low + + * Fix depending on non-free packages, platex | ptex-jtex, and now suggest + these. + + -- Atsuhito Kohda <kohda@pm.tokushima-u.ac.jp> Mon, 12 Apr 1999 12:37:45 +0900 + +plain2 (2.54p1-3) unstable; urgency=low + + * Apply patch of nide@ics.nara-wu.ac.jp + * Include jverb.sty + + -- Atsuhito Kohda <kohda@pm.tokushima-u.ac.jp> Sat, 6 Feb 1999 08:49:29 +0900 + +plain2 (2.54p1-2) frozen-jp unstable-jp; urgency=low + + * Remove eclepsf.sty whose copyright may conflict with DFSG. + * Adopt CVS + + -- Atsuhito Kohda <kohda@pm.tokushima-u.ac.jp> Sat, 6 Feb 1999 08:49:29 +0900 + +plain2 (2.54p1-1) unstable; urgency=low + + * Apply HTML patch of k-chinen@is.aist.nara.ac.jp but slightly modify it + so that it can apply to version 2.54(debian/patch/patch-1) + * Set -DBSD -DDEBUG in CFLAGS (it might cause trouble). + + -- Atsuhito Kohda <kohda@pm.tokushima-u.ac.jp> Tue, 20 Oct 1998 15:11:19 +0900 + +plain2 (2.54-4) frozen-jp unstable-jp; urgency=low + + * move manual from /usr/man/ja_JP.ujis into /usr/man/ja + * change from unstable to frozen-jp unstable-jp + + -- Atsuhito Kohda <kohda@pm.tokushima-u.ac.jp> Sun, 21 Jun 1998 09:39:50 +0900 + +plain2 (2.54-3) unstable; urgency=low + + * compress changelog.Debian in usr/doc/plain2 (suggested by linitian). + + -- Atsuhito Kohda <kohda@pm.tokushima-u.ac.jp> Thu, 4 Jun 1998 15:01:19 +0900 + +plain2 (2.54-2) unstable; urgency=low + + * New copyright by the author, so changes from non-free to main + + -- Atsuhito Kohda <kohda@pm.tokushima-u.ac.jp> Sun, 24 May 1998 09:51:52 +0900 + +plain2 (2.54-1) unstable; urgency=low + + * Initial Release. + + -- Atsuhito Kohda <kohda@pm.tokushima-u.ac.jp> Fri, 8 May 1998 08:10:00 +0900 + +Local variables: +mode: debian-changelog +End: --- plain2-2.54p1.orig/debian/README.nide +++ plain2-2.54p1/debian/README.nide @@ -0,0 +1,102 @@ + 奈良女子大学の新出と申します。 + べた書きテキストをroffやLaTeXの原稿ファイルに変換するソフト「plain2」 +(の最新版、v2.54)に対する、若干のバグ修正&拡張を行うパッチを作りましたの +で、大したものではありませんが流します。 + このパッチは公式なものではありません。バグ修正については、オリジナルに +吸収したい旨(plain2の作者の)内田さんから連絡頂きましたが、機能拡張につい +てはオリジナルには取り込まれないかも知れません。 + このパッチには次のような機能があります。 + + +[A] ソースのバグ修正 + + (1) 一部の関数がauto配列へのポインタを戻り値として返していた。 + (2) malloc()の戻り値チェックが抜けているところがあった。 + + +[B] TeX出力の不具合修正 + + (1) TeX出力をコンパイルする際、「Underfill \hbox (badness 10000」の警告 +がたくさん出ていたが、これをできる限り排除した。といっても具体的には、空 +行をあけようとして「\\」を不適切に使っている箇所で、間に「\mbox{}」を挟 +んだだけ。とはいえ、もっと重要なエラーメッセージを見逃すのを防ぐ役には立 +つ(か?) + + (2) TeX出力時に、例示の直前の本文の行間が不当に狭くなることがあったのを +修正。具体的には、例えば + + ここは平文です。ここは平文です。ここは平文です。ここは平文です。 + ここは平文です。ここは平文です。ここは平文です。ここは平文です。 + 例示 例示 + 例示 例示 + ここは平文です。ここは平文です。ここは平文です。ここは平文です。 + ここは平文です。ここは平文です。ここは平文です。ここは平文です。 + +のような文書をplain2 -texで処理すると出力は + + ここは平文です。ここは平文です。ここは平文です。ここは平文です。 + ここは平文です。ここは平文です。ここは平文です。ここは平文です。 + {\baselineskip=10pt + \begin{verbatim} + 例示 例示 + 例示 例示 + \end{verbatim}} + \par + ここは平文です。ここは平文です。ここは平文です。ここは平文です。 + ここは平文です。ここは平文です。ここは平文です。ここは平文です。 + +のようになるが、\baselineskip の変更直前に改段落がないため、例示の直前の +平文の部分まで行間が狭くなってしまっていた。改段落を入れることによってこ +れを直した。 + + +[C] TeX出力に関する機能拡張 + + (1) NTT JLaTeX、ASCII日本語LaTeXのどちらにも通用する出力を吐くようにし +た。これまではコンパイルの段階でどちらかを選ばねばならず、オプションスイッ +チで切り替えることもできなかった。 + 具体的には、\gtfamあるいは\gtfamilyというマクロが定義されていたらASCII +日本語LaTeXと見なしてjarticleスタイルを、そうでなければNTT JLaTeXと見な +してj-articleスタイルを使う(ような出力を吐く)ようにした。また、こうする +とNTT JLaTeXの場合の\bfコマンドの再定義がいらなくなるのでこれを除去した。 + (ちなみにこれまでも、実はASCII日本語LaTeX用の出力でNTT JLaTeXにもほぼ +通っていたのだが、その場合jarticleスタイルを使っていた。今回の修正により +NTT JLaTeX本来のj-articleを使うようになる) + + (2) (1)に伴い、両方のJLaTeXで通用するような用紙サイズ指定が、plain2の +-tオプションで簡単に行えるようにした。 + 具体的には、-tstyle= オプションで [ab][45]j? を指定すると、NTT JLaTeX +の場合jをつけないa4.sty等、ASCII日本語LaTeXの場合jをつけたa4j.sty等を自 +動的に使い分ける。例えば、-tstyle=b4 あるいは -tstyle=b4j のように指定す +ると、NTT JLaTeXではb4.sty、ASCII日本語LaTeXではb4j.styを使う。 +-tstyle=b4j,12pt のような指定も大丈夫。 + plain2のデフォルトは用紙指定なしだが、A4用紙を使う指定をTeX出力のデフォ +ルトにすることもコンパイル時指定で可能。そのためには、src/plain2.hの +DEFAULT_STYの定義を変更する。 + + (3) -jverbオプションを新設した。TeX出力時にこのオプションを使うと、例示 +の部分にjverbatim環境というものを使うようになり、この結果、例示部に日本 +語が混じっていても縦が揃う。デフォルトでは、例示の部分にverbatim環境を使 +うため、日本語が混じると縦が揃わない。 + 但し、jverbatim環境用のstyファイル(jverb.sty)は別途用意しておくことが +必要。ftp://ftp.vector.co.jp/pack/mac/writing/other/jverb1.03.cpt.bin に +ある。 + + +[D] その他の拡張 + + (1) タイトルのパターンで「大学」「学部」などが所属部門を表す文字列として +認識されるようになった:-) src/title.c参照。 + + + なお、このパッチにはソースの差分の他、docディレクトリ下のmake時の警告 +メッセージを防ぐための差分、およびドキュメントの例示部にjverbatim環境(上 +記[C](3)参照)を使うようにする差分も含まれていますが、ドキュメントの内容 +自体の変更は含まれていません(つまり、パッチを当てても上記[C][D]がドキュ +メントに反映されない)。また、doc/plain2.psに対する差分も含まれていません +(つまり、パッチを当ててもdoc/plain2.psは元のままで、パッチ後のdocディレ +クトリ下をmakeして得られるものと同じにはならない)。ご注意下さい。 + このパッチについて、私は著作権を主張しません。また、このパッチは無保証 +です。このパッチに関するお問い合わせは私までお願いします(但し99年1月中は +応答できません)。 + 99/1/2 nide@ics.nara-wu.ac.jp --- plain2-2.54p1.orig/debian/README.obs +++ plain2-2.54p1/debian/README.obs @@ -0,0 +1,29 @@ +== Old README (until 2.54p1-1) == + +0. In TeX format, we set ASCII TeX. (#undef NTT_TEX in src/plain2.h) + +1. See examples directory for usage. It may be useful to do + "make plain2.dvi" + Remark: We make some modifications and supply eclepsf.sty for this to work. + +2. We apply the patch so that plain2 can convert into HTML. + But the patch is for plain2-2.53 so we slightly modify it. + +3. We modify plain2html script so that it works better in Debian. + We thanks to Debian JP members whose advices make this possible. + +---------------------- + +0. TeX の場合はアスキー日本語 TeX です。(#undef NTT_TEX in src/plain2.h) + +1. examples ディレクトリにドキュメントがあります。適当な作業用のディレクトリ + にコピーして以下のようにすると良いかもわかりません。 + "make plain2.dvi" + (注意。このために少し修正と eclepsf.sty の用意を行なっています。) + +2. HTML に変換できるパッチを当てています。元のパッチは plain2-2.53 + 用だったので少し修正してあります。 + +3. スクリプト plain2html は Debian 用にかなり修正してあります。 + この修正は Debian JP のメンバーの方々のご助言によるものです。 + --- plain2-2.54p1.orig/debian/README.patch +++ plain2-2.54p1/debian/README.patch @@ -0,0 +1,55 @@ +パッチについて:全ての適用したパッチは patch ディレクトリにあります。 + +plain2-2.53-html.94aug14.patch: + オリジナルの HTML パッチです。このままでは使っていません。(参照 patch-1) + From http://shika.aist-nara.ac.jp/products/plain2/ + By Mr. Chinen<k-chinen@is.aist-nara.ac.jp> + +plain2-2.54.nide-patch: + 機能拡張パッチです。Debian 用に修正した patch-5 を適用しています。 + From: nide@ics.nara-wu.ac.jp + Newsgroups: fj.sources + Subject: plain2 unofficial patch... + Date: 3 Jan 1999 07:22:58 GMT + Message-ID: <76n5si$i0g$1@narans.cc.nara-wu.ac.jp> + +patch-1: + HTML 対応パッチ plain2-2.53-html.94aug14.patch は plain2-2.53 用なので + plain2-2.54 には当たりませんでした。それを修正したものです。 + +patch-2: + Debian のシステムに合うようにするパッチです。 + +patch-3: + examples にあるドキュメントを Debian で make できるように + 修正するパッチです。(epsf.sty に対応) + これはソースには変更しないことに注意してください。 + その後の修正は rules で sed などで行なっています。 + +patch-4: + オリジナルの plain2html を Debian の環境に合わせるパッチです。 + ただし bash にして Debian 用に改良したものがインストールされていますから + 現在は使っていません。 + +patch-5: + plain2-2.54.nide-patch を HTML パッチを当ててあるソースに適用するため + 必要な修正をしたものです。 + +patch-6: + NTT 版のとき a4.sty にされるのが不都合なときに a4j.sty を使えるように + -strict オプションを追加しました。 + +patch-7: + Potato の tgif(4.1.18-1) には prtgif がなく tgif -print になっていること + と modules.obj が古い tgif のものらしく、そのままでは処理できないので新しい + tgif で作りなおした jmodules.obj を使うようにする patch です。 + +パッケージに修正を行なう場合 + debian/rules の depatch でほぼオリジナルの状態に戻せます。 + そのための修正が patch-0 ですが rules では設定していません。 + そして rules の patch-stamp を適当にコメントアウトして修正すれば他のパッチを + 当てたりできます。 + +-------------------------- +平成10年10月21日(水) +kohda@pm.tokushima-u.ac.jp --- plain2-2.54p1.orig/debian/copyright +++ plain2-2.54p1/debian/copyright @@ -0,0 +1,70 @@ +This package was debianized by Yasuhiro Take <take@debian.or.jp> on +Sat, 25 Mar 2000 20:52:00 +0900. + +It was downloaded from; +ftp://ftp.tohoku.ac.jp/pub/TeX/misc/plain2/plain2-2.54.tar.gz + +Upstream Author(s): Akihiro Uchida <uchida@ccs.mt.nec.co.jp> + +Copyright: + +The original copyright is written in Japanese and you can find it +/usr/share/doc/plain2/ja/distrib.ja but for your convenience I translate +it to English. Note the following translation is only for reference +and you should read the original one. + +1. plain2 is provided "AS IS" and any express or implied warranties are +disclaimed. In no event shall the author and the organization the author +belongs to, be liable for any damages arising in any way out of the use +of plain2. + +2. You can redistribute plain2 freely provided you retain this copyright. + +3. You can modify plain2 and use it freely. But you can not distribute +the modified version without the permission of the author. You must contact +the author. + +You can contact the author at <uchida@ccs.mt.nec.co.jp> when you report +the bug and/or the modification. + +NOTE: The condition 3. contradicts with DFSG, but Mr. Uchida, the author, +kindly modifys the condition 3. to DFSG 4. and now + +3. You can distribute the modified version only if the distribution of +"patch files" with the source code for the purpose of modifying the program +at build time. You must make derived works a different name or version number +from the original program. + +------------------------------------- +About the patch: + +plain2-2.53-html.94aug14.patch was downloaded from: +http://shika.aist-nara.ac.jp/products/DEST/plain2/plain2-2.53-html.94aug14.patch.gz + +plain2-2.53-html.94aug14.patch is written by Mr. Chinen +<k-chinen@is.aist-nara.ac.jp> +and shares the copyright of the original. + +-------------------- +plain2-2.54.nide-patch is written by nide@ics.nara-wu.ac.jp and was gotten: + From: nide@ics.nara-wu.ac.jp + Newsgroups: fj.sources + Subject: plain2 unofficial patch... + Date: 3 Jan 1999 07:22:58 GMT + Message-ID: <76n5si$i0g$1@narans.cc.nara-wu.ac.jp> + +-------------------- +About jverb.sty: + +It was downloaded from +ftp://ftp.vector.co.jp/pack/mac/writing/other/jverb1.04.cpt.bin +and is written by <pxk12131@niftyserve.or.jp> and <96492406@people.or.jp> + +It is stated as follows: + +%jverb.sty v1.04 +% +% by 21M e-mail: pxk12131@niftyserve.or.jp +% Modified by Yamane e-mail: 96492406@people.or.jp +% +% This file is in the public domain. --- plain2-2.54p1.orig/debian/dirs +++ plain2-2.54p1/debian/dirs @@ -0,0 +1,5 @@ +DEBIAN +usr/bin +usr/share/doc/plain2/ja +usr/lib/plain2 +usr/share/man/man1 --- plain2-2.54p1.orig/debian/distrib.ja +++ plain2-2.54p1/debian/distrib.ja @@ -0,0 +1,51 @@ +== from doc/plain2.pln == + +1.4. 配布条件 + +・plain2 は AS-IS の形で提供され,その動作についてはいかなる形での保証もな + されない.本プログラムを使用することにより生じた損失について,プログラム + の作者,並びに,作者の所属する組織はいかなる責任も負わない. + +・コピーライトをはずさない限り,plain2 の再配布は自由とする + +・plain2 を改造して利用することに制限はつけない.ただし,改造した版を作者 + の許可なく再配布してはならない.改造については,作者に報告して頂きたい. + +バグレポート,改造報告などは uchida@ccs.mt.nec.co.jp までお願いします. + +--------------- +付記:上記第三項の改造に関する条件は,作者の内田氏に確認したところ + +DFSG 4の,“変更したら別の名前”,“patchファイル添付での配布は許可”, +という条件で配布を認めることに問題はありません. + +との連絡を頂きました(1998.5.20, 5.22)。 +ここに内田氏に感謝すると共に上記条件に修正することを明らかにしておきます。 + +-------------------- +plain2-2.54.nide-patch について、作者の新出さんは以下のように記述しています。 + +== from patch/plain2-2.54.nide-patch == + + このパッチについて、私は著作権を主張しません。また、このパッチは無保証 +です。このパッチに関するお問い合わせは私までお願いします(但し99年1月中は +応答できません)。 + 99/1/2 nide@ics.nara-wu.ac.jp +-------------------- +jverb.sty について、以下の記述があります。 + +%jverb.sty v1.06 +% +% by 21M e-mail: czd16105@nifty.ne.jp +% Modified by やまね e-mail: rsm23381@biglobe.ne.jp +% +% This file is in the public domain. + +また jverbsty.doc には以下の記述があります。 + + 本品はパブリックドメインとし、作者(21M および やまね)は一切の著作権の +主張をしませんので、誰でも自由に利用・改造・再配布できます。しかし、無保 +証ですし、サポートもありません。今後バージョンアップの際は、Vector社の +ftpサイト ftp://www.vector.co.jp にアップロードの予定です(最新版の配布元 +がドキュメントに記されていないソフトに泣かされたことがあったので、このこ +とは明記しておきます)。 --- plain2-2.54p1.orig/debian/jmodules +++ plain2-2.54p1/debian/jmodules @@ -0,0 +1,494 @@ +%TGIF 4.1.18 +state(0,37,100.000,343,438,0,8,1,8,2,2,0,0,0,0,1,0,'Ryumin-Light-EUC-H',0,103680,0,0,0,10,0,0,1,1,0,16,0,0,1,1,1,1,1088,1408,1,0,2880,0). +% +% @(#)$Header: /avec/cvsroot/debian/plain2/debian/jmodules,v 1.1 1999/10/01 01:58:20 kohda Exp $ +% %W% +% +unit("1 pixel/pixel"). +shapeshadow(2,2). +color_info(11,65535,0,[ + "magenta", 65535, 0, 65535, 65535, 0, 65535, 1, + "red", 65535, 0, 0, 65535, 0, 0, 1, + "green", 0, 65535, 0, 0, 65535, 0, 1, + "blue", 0, 0, 65535, 0, 0, 65535, 1, + "yellow", 65535, 65535, 0, 65535, 65535, 0, 1, + "pink", 65535, 49931, 53052, 65535, 49344, 52171, 1, + "cyan", 0, 65535, 65535, 0, 65535, 65535, 1, + "CadetBlue", 22885, 40569, 42649, 24415, 40606, 41120, 1, + "white", 65535, 65535, 65535, 65535, 65535, 65535, 1, + "black", 0, 0, 0, 0, 0, 0, 1, + "DarkSlateGray", 10402, 19764, 18724, 12079, 20303, 20303, 1 +]). +script_frac("0.6"). +fg_bg_colors('white','Black'). +page(1,"",1,''). +poly('white','',2,[ + 788,296,888,428],1,1,1,123,0,0,0,0,0,0,0,'1',0,0, + "0","",[ + 0,8,3,0,'8','3','0'],[0,8,3,0,'8','3','0'],[ +]). +polygon('white','',11,[ + 352,392,596,392,596,416,504,416,492,424,492,468,516,476,596,476, + 596,512,352,512,352,392],2,1,1,0,25,0,0,0,0,0,'1',0, + "000",[ +]). +poly('white','',2,[ + 544,464,476,484],1,3,1,90,0,0,0,0,0,0,0,'3',0,0, + "0","",[ + 0,12,5,0,'12','5','0'],[0,12,5,0,'12','5','0'],[ +]). +text('white',408,269,1,0,1,84,13,12,11,2,0,0,0,0,2,84,13,0,0,"",0,0,0,0,280,'',[ +minilines(84,13,0,0,0,0,0,[ +mini_line(84,11,2,0,0,0,[ +str_block(0,84,11,2,0,0,0,0,0,[ +str_seg('white','Ryumin-Light-EUC-H',0,69120,84,11,2,0,0,0,1,1,0,0, + "\306\376\316\317\245\263\241\274\245\311\312\321\264\271")]) +]) +])]). +group([ +text('white',410,541,1,0,1,84,13,12,11,2,0,0,0,0,2,84,13,0,0,"",0,0,0,0,552,'',[ +minilines(84,13,0,0,0,0,0,[ +mini_line(84,11,2,0,0,0,[ +str_block(0,84,11,2,0,0,0,0,0,[ +str_seg('white','Ryumin-Light-EUC-H',0,69120,84,11,2,0,0,0,1,1,0,0, + "\275\320\316\317\245\263\241\274\245\311\312\321\264\271")]) +]) +])]), +box('white','',384,536,512,560,0,2,1,29,0,0,0,0,0,'2',0,[ +]) +], +124,0,0,[ +]). +group([ +text('white',420,321,1,0,1,56,15,16,13,2,0,0,0,0,2,56,15,0,0,"",0,0,0,0,334,'',[ +minilines(56,15,0,0,0,0,0,[ +mini_line(56,13,2,0,0,0,[ +str_block(0,56,13,2,0,0,0,0,0,[ +str_seg('white','Ryumin-Light-EUC-H',0,80640,56,13,2,0,0,0,1,1,0,0, + "\312\270\275\361\262\362\300\317")]) +]) +])]), +box('white','',384,304,512,352,0,2,1,27,0,0,0,0,0,'2',0,[ +]) +], +125,0,0,[ +]). +box('white','',384,264,512,288,0,2,1,47,0,0,0,0,0,'2',0,[ +]). +group([ +polygon('white','',9,[ + 416,176,416,232,480,232,480,160,432,160,416,176,428,176,432,160, + 416,176],2,2,1,0,34,0,0,0,0,0,'2',0, + "000",[ +]), +text('white',424,185,2,0,1,48,26,15,11,2,0,0,0,0,2,48,26,0,0,"",0,0,0,0,196,'',[ +minilines(48,26,0,0,0,0,0,[ +mini_line(48,11,2,0,0,0,[ +str_block(0,48,11,2,0,0,0,0,0,[ +str_seg('white','Ryumin-Light-EUC-H',0,69120,48,11,2,0,0,0,1,1,0,0, + "\244\331\244\277\275\361\244\255")]) +]), +mini_line(24,11,2,0,0,0,[ +str_block(0,24,11,2,0,0,0,0,0,[ +str_seg('white','Ryumin-Light-EUC-H',0,69120,24,11,2,0,0,0,1,1,0,0, + "\312\270\275\361")]) +]) +])]) +], +126,0,0,[ +]). +polygon('white','',9,[ + 416,624,416,680,480,680,480,608,432,608,416,624,428,624,432,608, + 416,624],2,2,1,0,52,0,0,0,0,0,'2',0, + "000",[ +]). +text('white',420,636,1,0,1,55,20,53,15,5,0,0,0,0,2,55,20,0,0,"",0,0,0,0,651,'',[ +minilines(55,20,0,0,0,0,0,[ +mini_line(55,15,5,0,0,0,[ +str_block(0,55,15,5,0,-1,0,0,0,[ +str_seg('white','Courier-Bold',1,103680,55,15,5,0,-1,0,0,0,0,0, + "LaTeX")]) +]) +])]). +box('white','',518,428,596,464,2,2,1,24,0,0,0,0,0,'2',0,[ +]). +box('white','',424,428,476,464,2,2,1,38,0,0,0,0,0,'2',0,[ +]). +text('white',332,364,1,0,1,70,17,18,14,3,0,0,0,0,2,70,17,0,0,"",0,0,0,0,378,'',[ +minilines(70,17,0,0,0,0,0,[ +mini_line(70,14,3,0,0,0,[ +str_block(0,42,14,3,0,0,0,0,0,[ +str_seg('white','Times-Roman',0,80640,42,14,3,0,0,0,0,0,0,0, + "LaTeX")]), +str_block(0,28,13,2,0,0,0,0,0,[ +str_seg('white','Ryumin-Light-EUC-H',0,80640,28,13,2,0,0,0,1,1,0,0, + "\275\320\316\317")]) +]) +])]). +group([ +box('white','',374,428,414,464,2,2,1,41,0,0,0,0,0,'2',0,[ +]), +text('white',376,433,2,0,1,36,26,19,11,2,0,0,0,0,2,36,26,0,0,"",0,0,0,0,444,'',[ +minilines(36,26,0,0,0,0,0,[ +mini_line(36,11,2,0,0,0,[ +str_block(0,36,11,2,0,0,0,0,0,[ +str_seg('white','Ryumin-Light-EUC-H',0,69120,36,11,2,0,0,0,1,1,0,0, + "\245\352\245\271\245\310")]) +]), +mini_line(24,11,2,0,0,0,[ +str_block(0,24,11,2,0,0,0,0,0,[ +str_seg('white','Ryumin-Light-EUC-H',0,69120,24,11,2,0,0,0,1,1,0,0, + "\275\320\316\317")]) +]) +])]) +], +127,0,0,[ +]). +text('white',426,433,2,0,1,48,26,12,11,2,0,0,0,0,2,48,26,0,0,"",0,0,0,0,444,'',[ +minilines(48,26,0,0,0,0,0,[ +mini_line(48,11,2,0,0,0,[ +str_block(0,48,11,2,0,0,0,0,0,[ +str_seg('white','Ryumin-Light-EUC-H',0,69120,48,11,2,0,0,0,1,1,0,0, + "\245\306\241\274\245\326\245\353")]) +]), +mini_line(24,11,2,0,0,0,[ +str_block(0,24,11,2,0,0,0,0,0,[ +str_seg('white','Ryumin-Light-EUC-H',0,69120,24,11,2,0,0,0,1,1,0,0, + "\275\320\316\317")]) +]) +])]). +text('white',521,432,2,0,1,72,26,21,11,2,0,0,0,0,2,72,26,0,0,"",0,0,0,0,443,'',[ +minilines(72,26,0,0,0,0,0,[ +mini_line(72,11,2,0,0,0,[ +str_block(0,72,11,2,0,0,0,0,0,[ +str_seg('white','Ryumin-Light-EUC-H',0,69120,72,11,2,0,0,0,1,1,0,0, + "\245\253\245\271\245\277\245\336\245\244\245\272")]) +]), +mini_line(48,11,2,0,0,0,[ +str_block(0,48,11,2,0,0,0,0,0,[ +str_seg('white','Ryumin-Light-EUC-H',0,69120,48,11,2,0,0,0,1,1,0,0, + "\262\304\307\275\275\320\316\317")]) +]) +])]). +group([ +box('white','',400,484,504,508,2,2,1,26,0,0,0,0,0,'2',0,[ +]), +text('white',404,489,1,0,1,96,13,12,11,2,0,0,0,0,2,96,13,0,0,"",0,0,0,0,500,'',[ +minilines(96,13,0,0,0,0,0,[ +mini_line(96,11,2,0,0,0,[ +str_block(0,96,11,2,0,0,0,0,0,[ +str_seg('white','Ryumin-Light-EUC-H',0,69120,96,11,2,0,0,0,1,1,0,0, + "\306\303\274\354\312\270\273\372\245\257\245\251\241\274\245\310")]) +]) +])]) +], +128,0,0,[ +]). +poly('white','',2,[ + 392,464,416,484],1,3,1,91,0,0,0,0,0,0,0,'3',0,0, + "0","",[ + 0,12,5,0,'12','5','0'],[0,12,5,0,'12','5','0'],[ +]). +poly('white','',2,[ + 448,232,448,264],1,3,1,85,0,0,0,0,0,0,0,'3',0,0, + "0","",[ + 0,12,5,0,'12','5','0'],[0,12,5,0,'12','5','0'],[ +]). +poly('white','',2,[ + 432,352,392,428],1,3,1,81,0,0,0,0,0,0,0,'3',0,0, + "0","",[ + 0,12,5,0,'12','5','0'],[0,12,5,0,'12','5','0'],[ +]). +poly('white','',2,[ + 448,352,448,428],1,3,1,83,0,0,0,0,0,0,0,'3',0,0, + "0","",[ + 0,12,5,0,'12','5','0'],[0,12,5,0,'12','5','0'],[ +]). +poly('white','',2,[ + 464,352,544,428],1,3,1,84,0,0,0,0,0,0,0,'3',0,0, + "0","",[ + 0,12,5,0,'12','5','0'],[0,12,5,0,'12','5','0'],[ +]). +poly('white','',2,[ + 448,288,448,304],1,3,1,86,0,0,0,0,0,0,0,'3',0,0, + "0","",[ + 0,12,5,0,'12','5','0'],[0,12,5,0,'12','5','0'],[ +]). +poly('white','',2,[ + 448,512,448,536],1,3,1,87,0,0,0,0,0,0,0,'3',0,0, + "0","",[ + 0,12,5,0,'12','5','0'],[0,12,5,0,'12','5','0'],[ +]). +poly('white','',2,[ + 448,560,448,608],1,3,1,88,0,0,0,0,0,0,0,'3',0,0, + "0","",[ + 0,12,5,0,'12','5','0'],[0,12,5,0,'12','5','0'],[ +]). +poly('white','',2,[ + 448,464,448,488],1,3,1,89,0,0,0,0,0,0,0,'3',0,0, + "0","",[ + 0,12,5,0,'12','5','0'],[0,12,5,0,'12','5','0'],[ +]). +poly('white','',2,[ + 296,528,344,528],3,6,7,94,0,0,0,0,0,0,0,'6',0,0, + "0","",[ + 0,20,8,0,'20','8','0'],[0,20,8,0,'20','8','0'],[ +]). +group([ +text('white',168,433,2,0,1,98,30,96,13,2,0,0,0,0,2,98,30,0,0,"",0,0,0,0,446,'',[ +minilines(98,30,0,0,0,0,0,[ +mini_line(98,13,2,0,0,0,[ +str_block(0,98,13,2,0,0,0,0,0,[ +str_seg('white','Ryumin-Light-EUC-H',0,80640,98,13,2,0,0,0,1,1,0,0, + "\245\352\245\312\245\363\245\320\245\352\245\363\245\260")]) +]), +mini_line(28,13,2,0,0,0,[ +str_block(0,28,13,2,0,0,0,0,0,[ +str_seg('white','Ryumin-Light-EUC-H',0,80640,28,13,2,0,0,0,1,1,0,0, + "\275\320\316\317")]) +]) +])]), +box('white','',160,424,288,480,0,2,1,97,0,0,0,0,0,'2',0,[ +]) +], +129,0,0,[ +]). +text('white',512,584,1,0,1,123,15,101,11,2,0,0,0,0,2,123,15,0,0,"",0,0,0,0,596,'',[ +minilines(123,15,0,0,0,0,0,[ +mini_line(123,12,3,0,0,0,[ +str_block(0,84,11,2,0,0,0,0,0,[ +str_seg('white','Ryumin-Light-EUC-H',0,69120,84,11,2,0,0,0,1,1,0,0, + "\275\320\316\317\245\263\241\274\245\311\301\252\302\362")]), +str_block(0,39,12,3,0,-2,0,0,0,[ +str_seg('white','Times-Roman',0,69120,39,12,3,0,-2,0,0,0,0,0, + "(-j, -s)")]) +]) +])]). +text('white',576,281,1,0,1,84,13,102,11,2,0,0,0,0,2,84,13,0,0,"",0,0,0,0,292,'',[ +minilines(84,13,0,0,0,0,0,[ +mini_line(84,11,2,0,0,0,[ +str_block(0,84,11,2,0,0,0,0,0,[ +str_seg('white','Ryumin-Light-EUC-H',0,69120,84,11,2,0,0,0,1,1,0,0, + "\275\320\316\317\245\252\245\327\245\267\245\347\245\363")]) +]) +])]). +text('white',576,257,1,0,1,84,13,103,11,2,0,0,0,0,2,84,13,0,0,"",0,0,0,0,268,'',[ +minilines(84,13,0,0,0,0,0,[ +mini_line(84,11,2,0,0,0,[ +str_block(0,84,11,2,0,0,0,0,0,[ +str_seg('white','Ryumin-Light-EUC-H',0,69120,84,11,2,0,0,0,1,1,0,0, + "\262\362\300\317\245\252\245\327\245\267\245\347\245\363")]) +]) +])]). +poly('white','',2,[ + 576,264,512,328],1,1,1,104,0,0,1,0,0,0,0,'1',0,0, + "0","",[ + 0,8,3,0,'8','3','0'],[0,8,3,0,'8','3','0'],[ +]). +poly('white','',2,[ + 576,288,536,384],1,1,1,105,0,0,1,0,0,0,0,'1',0,0, + "0","",[ + 0,8,3,0,'8','3','0'],[0,8,3,0,'8','3','0'],[ +]). +poly('white','',2,[ + 568,584,520,552],1,1,1,106,0,0,1,0,0,0,0,'1',0,0, + "0","",[ + 0,8,3,0,'8','3','0'],[0,8,3,0,'8','3','0'],[ +]). +group([ +polygon('white','',9,[ + 192,624,192,680,256,680,256,608,208,608,192,624,204,624,208,608, + 192,624],2,2,1,0,109,0,0,0,0,0,'2',0, + "000",[ +]), +text('white',200,633,2,0,1,48,26,110,11,2,0,0,0,0,2,48,26,0,0,"",0,0,0,0,644,'',[ +minilines(48,26,0,0,0,0,0,[ +mini_line(48,11,2,0,0,0,[ +str_block(0,48,11,2,0,0,0,0,0,[ +str_seg('white','Ryumin-Light-EUC-H',0,69120,48,11,2,0,0,0,1,1,0,0, + "\244\331\244\277\275\361\244\255")]) +]), +mini_line(24,11,2,0,0,0,[ +str_block(0,24,11,2,0,0,0,0,0,[ +str_seg('white','Ryumin-Light-EUC-H',0,69120,24,11,2,0,0,0,1,1,0,0, + "\312\270\275\361")]) +]) +])]) +], +130,0,0,[ +]). +text('white',713,264,2,0,1,72,26,120,11,2,0,0,0,0,2,72,26,0,0,"",0,0,0,0,275,'',[ +minilines(72,26,0,0,0,0,0,[ +mini_line(72,11,2,0,0,0,[ +str_block(0,72,11,2,0,0,0,0,0,[ +str_seg('white','Ryumin-Light-EUC-H',0,69120,72,11,2,0,0,0,1,1,0,0, + "\245\253\245\271\245\277\245\336\245\244\245\272")]) +]), +mini_line(48,11,2,0,0,0,[ +str_block(0,48,11,2,0,0,0,0,0,[ +str_seg('white','Ryumin-Light-EUC-H',0,69120,48,11,2,0,0,0,1,1,0,0, + "\245\325\245\241\245\244\245\353")]) +]) +])]). +poly('white','',2,[ + 712,296,596,428],1,1,1,122,0,0,0,0,0,0,0,'1',0,0, + "0","",[ + 0,8,3,0,'8','3','0'],[0,8,3,0,'8','3','0'],[ +]). +poly('white','',2,[ + 224,560,224,608],1,3,1,124,0,0,0,0,0,0,0,'3',0,0, + "0","",[ + 0,12,5,0,'12','5','0'],[0,12,5,0,'12','5','0'],[ +]). +box('white','',152,384,296,688,0,1,1,125,1,0,0,0,0,'1',0,[ +]). +box('white','',344,384,600,696,0,1,1,127,1,0,0,0,0,'1',0,[ +]). +box('white','',648,376,904,688,0,1,1,128,1,0,0,0,0,'1',0,[ +]). +group([ +polygon('white','',9,[ + 744,624,744,680,808,680,808,608,760,608,744,624,756,624,760,608, + 744,624],2,2,1,0,114,0,0,0,0,0,'2',0, + "000",[ +]), +text('white',748,636,1,0,1,55,20,115,15,5,0,0,0,0,2,55,20,0,0,"",0,0,0,0,651,'',[ +minilines(55,20,0,0,0,0,0,[ +mini_line(55,15,5,0,0,0,[ +str_block(0,55,15,5,0,-1,0,0,0,[ +str_seg('white','Courier-Bold',1,103680,55,15,5,0,-1,0,0,0,0,0, + "troff")]) +]) +])]) +], +131,0,0,[ +]). +poly('white','',2,[ + 600,528,648,528],3,6,7,129,0,0,0,0,0,0,0,'6',0,0, + "0","",[ + 0,20,8,0,'20','8','0'],[0,20,8,0,'20','8','0'],[ +]). +group([ +polygon('white','',11,[ + 656,392,900,392,900,416,808,416,796,424,796,468,820,476,900,476, + 900,512,656,512,656,392],2,1,1,0,107,0,0,0,0,0,'1',0, + "000",[ +]), +box('white','',720,484,824,508,2,2,1,71,0,0,0,0,0,'2',0,[ +]), +box('white','',822,428,900,464,2,2,1,72,0,0,0,0,0,'2',0,[ +]), +box('white','',728,428,780,464,2,2,1,73,0,0,0,0,0,'2',0,[ +]), +text('white',696,400,1,0,1,52,17,74,14,3,0,0,0,0,2,52,17,0,0,"",0,0,0,0,414,'',[ +minilines(52,17,0,0,0,0,0,[ +mini_line(52,14,3,0,0,0,[ +str_block(0,24,14,3,0,0,0,0,0,[ +str_seg('white','Times-Roman',0,80640,24,14,3,0,0,0,0,0,0,0, + "troff")]), +str_block(0,28,13,2,0,0,0,0,0,[ +str_seg('white','Ryumin-Light-EUC-H',0,80640,28,13,2,0,0,0,1,1,0,0, + "\275\320\316\317")]) +]) +])]), +group([ +box('white','',678,428,718,464,2,2,1,76,0,0,0,0,0,'2',0,[ +]), +text('white',680,433,2,0,1,36,26,77,11,2,0,0,0,0,2,36,26,0,0,"",0,0,0,0,444,'',[ +minilines(36,26,0,0,0,0,0,[ +mini_line(36,11,2,0,0,0,[ +str_block(0,36,11,2,0,0,0,0,0,[ +str_seg('white','Ryumin-Light-EUC-H',0,69120,36,11,2,0,0,0,1,1,0,0, + "\245\352\245\271\245\310")]) +]), +mini_line(24,11,2,0,0,0,[ +str_block(0,24,11,2,0,0,0,0,0,[ +str_seg('white','Ryumin-Light-EUC-H',0,69120,24,11,2,0,0,0,1,1,0,0, + "\275\320\316\317")]) +]) +])]) +], +132,0,0,[ +]), +text('white',730,433,2,0,1,48,26,78,11,2,0,0,0,0,2,48,26,0,0,"",0,0,0,0,444,'',[ +minilines(48,26,0,0,0,0,0,[ +mini_line(48,11,2,0,0,0,[ +str_block(0,48,11,2,0,0,0,0,0,[ +str_seg('white','Ryumin-Light-EUC-H',0,69120,48,11,2,0,0,0,1,1,0,0, + "\245\306\241\274\245\326\245\353")]) +]), +mini_line(24,11,2,0,0,0,[ +str_block(0,24,11,2,0,0,0,0,0,[ +str_seg('white','Ryumin-Light-EUC-H',0,69120,24,11,2,0,0,0,1,1,0,0, + "\275\320\316\317")]) +]) +])]), +text('white',825,432,2,0,1,72,26,79,11,2,0,0,0,0,2,72,26,0,0,"",0,0,0,0,443,'',[ +minilines(72,26,0,0,0,0,0,[ +mini_line(72,11,2,0,0,0,[ +str_block(0,72,11,2,0,0,0,0,0,[ +str_seg('white','Ryumin-Light-EUC-H',0,69120,72,11,2,0,0,0,1,1,0,0, + "\245\253\245\271\245\277\245\336\245\244\245\272")]) +]), +mini_line(48,11,2,0,0,0,[ +str_block(0,48,11,2,0,0,0,0,0,[ +str_seg('white','Ryumin-Light-EUC-H',0,69120,48,11,2,0,0,0,1,1,0,0, + "\262\304\307\275\275\320\316\317")]) +]) +])]), +text('white',724,489,1,0,1,96,13,80,11,2,0,0,0,0,2,96,13,0,0,"",0,0,0,0,500,'',[ +minilines(96,13,0,0,0,0,0,[ +mini_line(96,11,2,0,0,0,[ +str_block(0,96,11,2,0,0,0,0,0,[ +str_seg('white','Ryumin-Light-EUC-H',0,69120,96,11,2,0,0,0,1,1,0,0, + "\306\303\274\354\312\270\273\372\245\257\245\251\241\274\245\310")]) +]) +])]) +], +133,0,0,[ +]). +group([ +text('white',738,541,1,0,1,84,13,131,11,2,0,0,0,0,2,84,13,0,0,"",0,0,0,0,552,'',[ +minilines(84,13,0,0,0,0,0,[ +mini_line(84,11,2,0,0,0,[ +str_block(0,84,11,2,0,0,0,0,0,[ +str_seg('white','Ryumin-Light-EUC-H',0,69120,84,11,2,0,0,0,1,1,0,0, + "\275\320\316\317\245\263\241\274\245\311\312\321\264\271")]) +]) +])]), +box('white','',712,536,840,560,0,2,1,132,0,0,0,0,0,'2',0,[ +]) +], +134,0,0,[ +]). +poly('white','',2,[ + 776,512,776,536],1,3,1,133,0,0,0,0,0,0,0,'3',0,0, + "0","",[ + 0,12,5,0,'12','5','0'],[0,12,5,0,'12','5','0'],[ +]). +poly('white','',2,[ + 776,560,776,608],1,3,1,134,0,0,0,0,0,0,0,'3',0,0, + "0","",[ + 0,12,5,0,'12','5','0'],[0,12,5,0,'12','5','0'],[ +]). +group([ +text('white',186,541,1,0,1,84,13,136,11,2,0,0,0,0,2,84,13,0,0,"",0,0,0,0,552,'',[ +minilines(84,13,0,0,0,0,0,[ +mini_line(84,11,2,0,0,0,[ +str_block(0,84,11,2,0,0,0,0,0,[ +str_seg('white','Ryumin-Light-EUC-H',0,69120,84,11,2,0,0,0,1,1,0,0, + "\275\320\316\317\245\263\241\274\245\311\312\321\264\271")]) +]) +])]), +box('white','',160,536,288,560,0,2,1,137,0,0,0,0,0,'2',0,[ +]) +], +138,0,0,[ +]). +poly('white','',2,[ + 224,480,224,536],1,3,1,138,0,0,0,0,0,0,0,'3',0,0, + "0","",[ + 0,12,5,0,'12','5','0'],[0,12,5,0,'12','5','0'],[ +]). +box('white','',712,260,788,296,0,2,1,143,0,0,0,0,0,'2',0,[ +]). --- plain2-2.54p1.orig/debian/jverb.sty +++ plain2-2.54p1/debian/jverb.sty @@ -0,0 +1,238 @@ +%jverb.sty v1.06 +% +% by 21M e-mail: czd16105@nifty.ne.jp +% Modified by やまね e-mail: rsm23381@biglobe.ne.jp +% +% This file is in the public domain. +%%% +% Usage: +% \begin{jverbatim}…\end{jverbatim} +% \begin{jverbatim*}…\end{jverbatim*} +% \jverb|…| +% \jverb*|…| +%%% +\ifnum\the\catcode`\@=11 \let\jv@insty\relax \else \makeatletter \fi +%----------- +\typeout{jverb.sty 1.06 --- by 21M, Apr 21 1999}% +\def\jv@ksample{爍}% 何でもいいから漢字1字。注釈以外では本ファイル唯一の + % 日本語文字。念のため、MS漢字コードでも日本語文字になるようなのを選んである +\newif\ifjv@strhead\newif\ifjv@strsame +\def\jv@eatarg#1\relax#2\relax{} +\def\jv@strhead#1#2{% + \edef\jv@tmparg{% + #1\noexpand\jv@strend\relax#2\noexpand\jv@strend\relax + }% + \expandafter\jv@strheadsub\jv@tmparg +} +\def\jv@strheadsub#1#2\relax#3#4\relax{% + \let\jv@next\jv@eatarg + \ifx#1\jv@strend + \jv@strheadtrue + \ifx#3\jv@strend\jv@strsametrue \else\jv@strsamefalse \fi + \else + \if#1#3\let\jv@next\jv@strheadsub + \else \jv@strheadfalse\jv@strsamefalse \fi + \fi \jv@next#2\relax#4\relax +} +%----------- +\begingroup + {\catcode"D=12\gdef\jv@rawcr{^^M}} + {\catcode"9=12\gdef\jv@rawtab{^^I}} + {\catcode"20=12\gdef\jv@rawspc{ }} + {\catcode"7E=12\gdef\jv@rawtld{~}} + \catcode"5B=1\catcode"5D=2\catcode"21=0 + \catcode"7B=12\catcode"7D=12\catcode"5C=12 + !gdef!@endjverbatim[end{jverbatim}]% + !gdef!@endjverbstar[end{jverbatim*}]% + !gdef!jv@rawbksl[\]% +!endgroup +\def\jv@main#1{% + \def\jv@tmparg{#1}% + %\typeout{arg=#1}% + \ifx\jv@tmparg\jv@rawbksl + \let\jv@next=\jv@sub \def\jv@endcmp{}% + \else + \jv@charout#1\let\jv@next=\jv@main + \fi \jv@next +} +\newif\ifjv@starmode +\def\jv@sub#1{% + \edef\jv@endcmp{\jv@endcmp#1}\setbox\jv@onecharbox=\hbox{#1}% + % ASCII jTeX(の古い版?)では2バイト文字の比較にバグあり + \ifdim\jv@spclen=\the\wd\jv@onecharbox + \ifjv@starmode \jv@strhead\jv@endcmp\@endjverbstar + \else \jv@strhead\jv@endcmp\@endjverbatim \fi + \else \jv@strheadfalse\jv@strsamefalse \fi + \ifjv@strhead + \ifjv@strsame + \global\jv@curline=\jv@curline + \global\jv@curcol=\jv@curcol + \global\jv@igntabs=\jv@igntabs + \ifjv@nontabfound \global\jv@nontabfoundtrue + \else \global\jv@nontabfoundfalse \fi + \ifjv@aftercr \global\jv@aftercrtrue + \else \global\jv@aftercrfalse \fi + % + \ifjv@starmode \end{jverbatim*}\else \end{jverbatim}\fi + \let\jv@next\relax \let\jv@tmparg\empty + \else \let\jv@next\jv@sub \let\jv@tmparg\empty \fi + \else + \jv@charout\jv@rawbksl + \let\jv@next\jv@main \let\jv@tmparg\jv@endcmp + \fi \expandafter\jv@next\jv@tmparg +} +\newcount\jvtabstop \jvtabstop=8 +\newdimen\jvemptylinenarrow \jvemptylinenarrow0pt +\newif\ifjvusejisroman \jvusejisromanfalse +\newif\ifjvkwidthbase \jvkwidthbasefalse +\newif\ifjv@nontabfound \jv@nontabfoundfalse +\newif\ifjv@aftercr \jv@aftercrfalse \newif\ifjv@cont \jv@contfalse +\newif\ifjv@emptyline +\newcount\jv@curline \jv@curline=0 \newcount\jv@curcol \jv@curcol=0 +\newcount\jv@igntabs \jv@igntabs=0 +\newcount\jv@tmpcount \newcount\jv@igntabcount +\newbox\jv@onecharbox \newdimen\jv@spclen +\def\jverbatim{\jv@starmodefalse\jv@init} +\def\jv@init{% + \begingroup\ignorespaces\tt\parindent0pt\mbox{}% + \jv@tmpcount="20\loop\ifnum\the\jv@tmpcount<"7F + \catcode\the\jv@tmpcount=12 + \advance\jv@tmpcount by1\repeat + \catcode"9=12\catcode"D=12% \jv@charout uses following miscs + \ifjv@cont\relax\else + \jv@curline=0 \jv@curcol=0 \jv@igntabs=0 + \jv@nontabfoundfalse\jv@aftercrfalse + \fi \global\jv@contfalse + \setbox\jv@onecharbox=\hbox{ }\jv@spclen=\the\wd\jv@onecharbox + \jv@main +} +\def\endjverbatim{\endgroup} +\@namedef{jverbatim*}{\jv@starmodetrue\jv@init} +\@namedef{endjverbatim*}{\endgroup} +\def\jvintermed#1{\advance\jv@curcol by #1 \jv@conttrue} +%----------- +\def\jv@yen{{\ooalign{\hfill Y\hfill\crcr\hfill =\hfill}}} +\def\jv@ovl{\raisebox{.66em}{\char95}} +\def\jv@charout#1{% + \ifjv@aftercr + \ifnum\jv@curline>1 + \par \ifjv@emptyline \vskip-\jvemptylinenarrow \fi + \parskip0pt\mbox{}% + % \mbox{}は空行に警告が出ないためと行頭の空白有効化 + % \hbox{}だと行が余分に空く(\par直後だから) + % 最初の改行以後は\parskipを0にしておく + \else\relax \fi + \else + \ifx\jv@tmparg\jv@rawspc\hbox{}\fi + \fi + %\typeout{arg:#1}% + \def\jv@tmparg{#1}% + \ifx\jv@tmparg\jv@rawcr + \advance\jv@curline by1 \jv@aftercrtrue + \ifnum\jv@curcol=0 \jv@emptylinetrue \else\jv@emptylinefalse\fi + \jv@curcol=0 \jv@igntabcount=\jv@igntabs + \else\ifx\jv@tmparg\jv@rawtab + \ifnum\jv@curline=0\advance\jv@curline by1\fi \jv@aftercrfalse + \ifjv@nontabfound + \def\jv@tmparg{% + \ifjv@starmode\jv@rawspc \else\hbox{ }\fi + }% + \ifnum\jv@igntabcount=0 \loop + \ifjvkwidthbase \makebox[.5zw]{\jv@tmparg}% + \else\jv@tmparg \fi + \advance\jv@curcol by1 \jv@tmpcount=\jv@curcol + \divide\jv@tmpcount by\jvtabstop + \multiply\jv@tmpcount by\jvtabstop + \ifnum\jv@tmpcount<\jv@curcol \repeat + \else + \advance\jv@igntabcount by-1 + \fi + \else + \advance\jv@igntabs by1 + \fi + \else + \ifnum\jv@curline=0\advance\jv@curline by1\fi \jv@aftercrfalse + \jv@nontabfoundtrue\jv@igntabcount=0 + \setbox\jv@onecharbox=\hbox{#1}% + %\typeout{width(#1)=\the\wd\jv@onecharbox}% + \ifdim\jv@spclen=\the\wd\jv@onecharbox + %\tt環境のことしか考えていない + \ifx\jv@tmparg\jv@rawspc + \ifjv@starmode\relax + \else \def\jv@tmparg{\hbox{ }}\fi + \else + \ifjvusejisroman + \ifx#1\jv@rawbksl + \let\jv@tmparg\jv@yen + \else \ifx\jv@tmparg\jv@rawtld + \let\jv@tmparg\jv@ovl + \fi\fi + % \jv@rawbkslとの比較には#1、\jv@rawtld + % との比較には\jv@tmpargを使う + % #1に「\」が渡されるのは + % 「\end{jverbatim}」との比較に失敗して + % \jv@charout\jv@rawbkslをする時なので + % #1を使わないと正しく比較できない + \fi + \fi + \ifjvkwidthbase \makebox[.5zw]{\jv@tmparg}% + \else\jv@tmparg \fi + \advance\jv@curcol by1 + \else + \makebox[\ifjvkwidthbase 1zw\else 2\jv@spclen\fi]{% + \ifdim\the\wd\jv@onecharbox=1zw #1\else + \phantom{\jv@ksample #1}\mbox{#1}% + \phantom{#1\jv@ksample}% + \fi + }\advance\jv@curcol by2 + \fi + \fi\fi +} +%----------- +\def\jverb{% タブ・改行は特別扱いなし + \begingroup\tt\jv@curcol=0 + \jv@tmpcount="20\loop\ifnum\the\jv@tmpcount<"7F + \catcode\the\jv@tmpcount=12 + \advance\jv@tmpcount by1\repeat + % 全文字を非特殊にしてから次の文字を読む + \setbox\jv@onecharbox=\hbox{ }\jv@spclen=\the\wd\jv@onecharbox + \jv@body +} +\def\jv@body#1{% + \if#1*\let\jv@next\jv@star + \else \def\jv@endchar{#1}\jv@starmodefalse \let\jv@next\jv@lmain + \fi \jv@next +} +\def\jv@star#1{\def\jv@endchar{#1}\jv@starmodetrue \jv@lmain} +\def\jv@lmain#1{% + \def\jv@curchar{#1}\ifx\jv@curchar\jv@endchar + \let\jv@next\endgroup + \else + \ifdim\jv@spclen=\the\wd\jv@onecharbox + \setbox\jv@onecharbox=\hbox{#1}% + \ifdim\jv@spclen=\the\wd\jv@onecharbox \relax + \else\hskip0pt \fi + \else + \setbox\jv@onecharbox=\hbox{#1}% + \ifdim\jv@spclen=\the\wd\jv@onecharbox \hskip0pt\fi + \fi + \ifx\jv@curchar\jv@rawspc + \ifnum\jv@curcol=0 \hskip0pt\fi + % \hbox{}だと行頭で使った場合に余計に改行が入る? + \ifjv@starmode #1\else\hbox{}\hskip\jv@spclen\fi + % 単なる空白だと「:」の直後の空白が空き過ぎる + % (jverbatim環境の方は大丈夫。なぜ?) + % \hbox{ }だと途中での改行ができず不便 + \else + \ifjvusejisroman + \ifx\jv@curchar\jv@rawbksl \jv@yen + \else \ifx\jv@curchar\jv@rawtld \jv@ovl + \else #1\fi\fi + \else + #1% + \fi + \fi \let\jv@next\jv@lmain + \fi \jv@curcol=1\jv@next +} +%----------- +\ifx\jv@insty\undefined \makeatother \fi --- plain2-2.54p1.orig/debian/jverbsty.doc +++ plain2-2.54p1/debian/jverbsty.doc @@ -0,0 +1,307 @@ + jverb.sty +jverbatim環境―日本語文字と英字が2:1の幅になるverbatimライクな環境の定義 + v1.06 99/04/21 + + 21M / czd16105@nifty.ne.jp (original) + やまね / rsm23381@biglobe.ne.jp (一部修正) + + 上記タイトルの通り、verbatim環境に似ているが日本語文字と英字が2:1の幅 +になるような「jverbatim環境」を実現する、日本語LaTeX用のスタイルファイル +です。verbコマンドに似た、jverbコマンドというのも用意してあります。 + 利点として + + ・NTT JLaTeX、アスキー日本語LaTeXのいずれでも使える + ・jverb.styさえあれば他に特別なツールやフォントを必要としないし、前処 + 理の類もいらないので使用がとても簡単 + ・\ttの英字を日本語文字の自然な幅の半分に合わせるやり方だと英字がやや + 窮屈になってしまうが、jverb.styは(デフォルトでは)そうではなく、日本 + 語文字の幅を英字の自然な幅の倍に合わせるので、英字の部分が窮屈になら + ない + +などがあります。 + OSには依存しません。また、LaTeX2ε(の日本語版)でも、(ちょっと試してみ +た限りでは)問題なく使えるようです。 + 同様のものが既にありそうな気もしますが、まあ、新たに公開したって害はな +いでしょうから、公開します。 + 本品はパブリックドメインとし、作者(21M および やまね)は一切の著作権の +主張をしませんので、誰でも自由に利用・改造・再配布できます。しかし、無保 +証ですし、サポートもありません。今後バージョンアップの際は、Vector社の +ftpサイト ftp://www.vector.co.jp にアップロードの予定です(最新版の配布元 +がドキュメントに記されていないソフトに泣かされたことがあったので、このこ +とは明記しておきます)。 + + +[使い方] + + インストールの方法は簡単で、お使いの日本語TeXが利用する漢字コードに合 +わせてjverb.styの漢字コードを変換し、スタイルファイル用のディレクトリに +コピーするだけです。 + 各環境およびコマンドの使い方は以下の通りです。 + + +1. jverbatim環境 使い方: \begin{jverbatim}…\end{jverbatim} + + 使い方も機能もverbatim環境とほぼ同じですが、日本語文字と英字は2:1の幅 +になります。 + この他にも、以下のような性質がverbatim環境とは異なります。 + + [1] タブは無視されず、タブ1つがスペース8つ分(先頭から8の倍数文字目の + 位置まで移動する)の働きを持ちます。 + [2] jverbatim環境に囲まれた先頭行を見て、その行頭にタブがいくつ現れ + たかを記録しておき、jverbatim環境に囲まれた全ての行の行頭から数 + えて、その個数分までのタブは無視します。 + + 性質[2]の例としては、 + +\begin{quote} +[TAB]\begin{jverbatim} +[TAB][TAB]main() +[TAB][TAB]{ +[TAB][TAB][TAB]printf("Hello, World.\n"); +[TAB][TAB][TAB]printf("こんにちは、世界。\n"); +[TAB][TAB]} +[TAB]\end{jverbatim} +\end{quote} + +のような場合(「[TAB]」のところには実際には本物のタブコードが入っているも +のとします)、jverbatim環境に囲まれた先頭行には、行頭にタブが2つあります +ので、jverbatim環境に囲まれたすべての行に対し、行頭から2つまでのタブは無 +視します。囲まれた3行目は行頭に3つタブがありますので、先頭2つだけ無視さ +れて残り1つが有効になり、8つ分の空白として出力されます。もしこれを避けた +ければ、 + +\begin{quote} +[TAB]\begin{jverbatim} + [TAB][TAB]main() +… + +のように、先頭行の最初のタブの直前に空白を入れればOKです。 + [1][2]のような性質により、日本語を(注釈などに)含むようなプログラムソー +ス類を、インデントをそのまま生かしてTeXの文書中に取り込むのが非常に楽で +す。 + なお、AUC-TeX(emacsやmuleエディタ上でTeX文書を編集するためのマクロ集) +をお使いの方は、jverbatim環境を使うようなTeX文書を編集する際には、[2]の +性質を生かすために、初期設定ファイル.emacsに + + (setq TeX-auto-untabify nil) + +の1行を追加しておく方がよいでしょう(文書中のタブを空白に自動変換しなくな +る)。その他の環境(例えばYaTeXなど)でも同様の注意が必要かも知れません。 + + おまけの機能が、以下のように5つあります。 + + (1) タブはデフォルトでは空白8文字分ですが、カウンタ\jvtabstopを設定す +ることによって変更もできます。例えば + + \jvtabstop=4 + +とやると、タブは空白4つ分となります。 + + (2) \jvemptylinenarrow に何か長さを設定しておくと、jverbatim環境中に空 +行が現れた場合、その幅が \jvemptylinenarrow の分だけ縮まります。例えば + + \setlength{\jvemptylinenarrow}{2pt} + +としておくと、jverbatim環境中の空行の幅が2pt縮まります。(空白およびタブ +しか現れない行も「空行」に含まれます) + + (3) 文書中(むろんjverbatim環境の外)で \jvusejisromantrueと書くと、以後、 +jverbatim環境の中では、文字コード0x5cの文字がバックスラッシュでなく円マー +クに、文字コード0x7eの文字がチルダでなくオーバーラインになります。つまり、 +ASCII文字の代わりにJIS roman(JIS X0201ローマ字)の字体を使うわけです。 +\jvusejisromanfalse で元に戻ります。 + + (4) 同じく文書中で、\jvkwidthbasetrue と書くと、以後、jverbatim環境の +中で、日本語文字の幅を英字2字分に合わせるのでなく、逆に英字の幅を日本語 +文字の半分に合わせます。若干英字部分が窮屈になります。\jvkwidthbasefalse +で元に戻ります。但しこの機能は、ver 1.12より前のNTT JTeXでは使えません。 + + (5) jverbatim環境を抜けてから次のjverbatim環境までの間に \jvintermed{数} +と書いておくと、次のjverbatim環境は、前のjverbatim環境の最後から指定した +数カラムだけあけた続きから始まるように処理され、タブ位置も行頭タブ無視個 +数も引き継がれます。例えば、「\end{jverbatim}」という文字列を含むような +ものをjverbatim環境で出力したい場合に + + \begin{jverbatim} + この文章は、[TAB]タブ + や「\end{jverbatim}」という + 文字列を[TAB]含んでいます。 + \end{jverbatim} + +(ここで「[TAB]」のところには実際には本物のタブコードが入っているものとし +ます)とやると途中の「\end{jverbatim}」でjverbatim環境が終わってしまう問 +題がありますが、 + + \begin{jverbatim} + この文章は、[TAB]タブ + や「\end{jver\end{jverbatim}\jvintermed{0}% + \begin{jverbatim}batim}」という + 文字列を[TAB]含んでいます。 + \end{jverbatim} + +のようにするとうまくいき、タブ位置も揃います。また、 + + \begin{jverbatim} + この文章は、途中 + に\end{jverbatim}% + \jvintermed{2}{\tt\makebox[1em]{$\heartsuit$}}% + \begin{jverbatim}マークや[TAB]タブを + 含んで[TAB][TAB]います。 + \end{jverbatim} + +のような使い方もあります(\ttの場合1emが2カラム分の幅であることに注意)。 + + +2. jverbatim*環境 使い方: \begin{jverbatim*}…\end{jverbatim*} + + jverbatim環境と同様ですが、空白は、verbatim*環境での空白と同様に出力し +ます(タブも空白に変換されて同様に出力される)。 + + +3. jverbコマンド 使い方: 「\jverb」の次に出力したい内容を同じ文字で + 囲んで書く 例…\jverb|cat ファイル名1 ファイル名2| + + verbコマンドと同様ですが、verbコマンドとの違いは、英数字などと日本語文 +字との間に通常入る「四分空き」が入らないことです。例えば上の例では、verb +コマンドを使うと、「ファイル名」と「1」の間、およびその次の「ファイル名」 +と「2」の間に「四分空き」が入ってしまいます。コンピュータのコマンドライ +ンの説明の時などには、このように微妙な間が空いてしまうと、そこを空けて入 +力するのか空けないのかあいまいになり、好ましくありません。jverbコマンド +はそれに対処するため作ったものです。 + jverbコマンドはjverbatim環境と違い、日本語文字と英字が2:1の幅になるよ +うには作ってありません。2:1の幅にしたければ、中身が1行のjverbatim環境で +代用して下さい。また、タブが無視される点もjverbatim環境とは異なります。 + なお、jverbatim環境のおまけ機能のうち(3) (\jvusejisromantrue および +\jvusejisromanfalse によるASCIIとJIS romanの切り替え)は、jverbコマンド内 +へも影響を及ぼします。 + + +4. jverb*コマンド 使い方: 「\jverb*」の次に出力したい内容を同じ文字で + 囲んで書く 例…\jverb*|cat ファイル名1 ファイル名2| + + jverbコマンドと同様ですが、空白は、verb*コマンドでの空白と同様に出力し +ます。 + + - * - + + このファイルは、スタイルファイルとして使う他、これ自身を直接、LaTeXの +原稿ファイル(*.tex)の中に取り込んで使うこともできます。その場合の長所は、 +「dviファイルのみならずtexファイルも、特定の環境(特定のスタイルファイル +の存在)に依存せず、どこでもコンパイルできるようになる」という点です。 + + dviドライバによっては、本スタイルファイルで定義した環境やコマンドで、 +空白を大量に出力した場合、位置がずれることがあるようです。例えば、 +jverbatim*環境で空白を多く含む出力を行うと、右の方では空白マークが縦に揃 +わないことがあります。dviファイルのレベルで解析してみると、ずれていない +ようなので、これはdviドライバの不具合ではないかと思います。 + + +※注意事項 + + 1) ASCII日本語LaTeXでは、日本語がゴシックになっている状況でjverbatim環 +境やjverbコマンドを使うと、その内部まで日本語がゴシックになってしまいま +す(NTT JLaTeXでは試していません)。例えば「{\bf\jverb|aあ|}」とすると「あ」 +がゴシックになります。日本語が明朝に切り替わるようにした方がよいかなとも +思いましたが、普通のverbatim環境やverbコマンドでも同様なのでそのままにし +てあります。\bfは「{ }」で範囲を限定して使うことが多いので、この仕様で問 +題が起きることはほとんどないでしょう。 + + 2) verbatim環境と異なり、jverbatim環境の前後では自動的に改段落を「しま +せん」。例えば + + abc\begin{jverbatim} + defdef + ghighi + \end{jverbatim}jkl + +のような場合、「abc」と「defdef」、「ghighi」と「jkl」は同じ行に来ます。 +そうしたくない場合は\parコマンドなどで明示的に改段落して下さい。 + この仕様は、「abc\begin{jverbatim}dあいe\end{jverbatim}fgh」のように、 +中身が1行のjverbatim環境をjverbコマンドの代用として使うためのものです(上 +記3.の「jverbコマンド」の項参照)。 + ただ、この仕様のため次のような現象が起こります。 + + {\baselineskip8pt\begin{jverbatim} + abcabc + defdef + ghighi + jkljkl + \end{jverbatim}} + +のような場合(6行目の「\end{jverbatim}}」の行頭には空白はないものとします)、 +jverbatim環境内の行間は8ptになりますが、最後の2行の間だけが通常の行間に +戻ってしまいます。これは、 + + ・\baselineskipの設定は段落の中で有効(直前の改段落までが\baselineskip + の設定の影響の及ぶ範囲)。 + ・jverbatim環境は各行を独立の段落としている(jverbatim環境の中身が長い + 場合、全体を1段落にするとメモリ溢れを起こしやすいため)。従って、 + 「jkljkl」の行の直前にも改段落がある。 + ・一方、「jkljkl」の行の直後には改段落が行われないため、「jkljkl」の行 + は「\end{jverbatim}」の続きと同じ段落。 + ・よって、その段落の最後の時点での\baselineskipの値(最後の「}」を抜け + たことによって元に戻っている)が、「jkljkl」の行の直前の改段落におい + ても使われる。 + +という事情によります。「\end{jverbatim}\par}」のように、最後の「}」を抜 +ける前に明示的に改段落すればこの現象は回避できます。 + + 3) 本物のverbatim環境や\verbコマンドと同様、このjverbatim環境や\jverb +コマンドも、その実現の仕方の関係上、他のマクロの引数の中で使うことはでき +ません(他の環境の中で使うことはできます)。どうしても使いたければ、使いた +い内容を一旦箱レジスタに代入し、それを他のマクロの引数で使うという手法を +取ります。下記が具体例で、jverbコマンドを箱に代入してそれを\fboxマクロの +引数として使っています(参考: 磯崎秀樹「LaTeX自由自在」サイエンス社)。こ +の方法はverbコマンドやverbatim環境にも通用します。 + + \newsavebox{\verbbox} % 箱を宣言 + \setbox\verbbox=\hbox{% + \jverb|prompt% cp ファイル名1 ファイル名2|} % 箱に代入 + \fbox{\usebox{\verbbox}} % 箱を使用 + + +※変更履歴 + +1.00→1.01 (by 21M) + ・行頭で、\jverb| abc|のように先頭に空白のある出力をjverbコマンドで行 +うと、その行の上が不当に空いていたのを直した。 + ・\jverbは、\verbと違って途中での行折り曲げを必要に応じて行うようになっ +た。その方が便利と作者が判断したため。 + ・jverbatim環境のタブストップが8に固定だったのを可変にした。 + +1.01→1.02 (by やまね) + ・\jvemptylinenarrow を新設し、jverbatim環境中の空行の幅を調節可能にし +た。 + ・以前は、jverbatim環境の中身が数百行(標準的な場合で)を越えると、TeX +capacity exceededを引き起こしていたが、今回からは(1行が極端に長くない限 +り)中身がいくら多くても大丈夫。 + ・アスキー日本語TeX(の古い版?)のバグのため、これまで同TeXではjverbatim +環境の中身に『「\」+日本語文字』というものが混じっていると誤動作していた。 +これへの対策を行った。 + ・おまけk2tex2ps(但しUNIX専用)を添付。 + +1.02→1.02b (by やまね) + ・jverb.styそのものは1.02と全く変わっていない。おまけのk2tex2psの若干 +の不具合を手直ししただけ。 + +1.02b→1.03 (by 21M&やまね) + ・内部で使っているマクロが他のスタイルファイルと衝突して問題が起こる場 +合があることが判明したため、マクロ名を衝突しにくそうなものに変更。 + +1.03→1.04 (by 21M) + ・定義したのに使ってなかった箱レジスタの定義1つを消した。 + ・円マークとバックスラッシュ、オーバーラインとチルダの切り替えを可能に +した。 + ・英字の幅を日本語文字の半分に合わせることもできるようにした。 + ・やまね氏はドキュメントの英数字に2バイト文字を使う傾向があるようだが、 +1バイト文字に統一してしまった(^^;) + +1.04→1.05 (by 21M) + ・「著作権の主張はしない」旨を明記した。 + ・\jvintermedコマンドを新設。 + +1.05→1.06 (by 21M) + ・1.05では、jverbatim環境をASCII日本語TeXで使うと「、」「“」など幅の +狭い日本語記号文字が常に1字分の幅の真ん中に来ていた。適切な位置に寄るよ +うに直した。 + ・1.05で、typeoutされるバージョン番号が誤って1.5になっていた。 --- plain2-2.54p1.orig/debian/plain2.1 +++ plain2-2.54p1/debian/plain2.1 @@ -0,0 +1,37 @@ +.TH PLAIN2 1 +.SH NAME +plain2 \- converts plain text into TeX, troff or HTML format +.SH SYNOPSIS +.B plain2 +.I "[options] files ..." +.SH "DESCRIPTION" +This manual page documents briefly the +.BR plain2 +command. +This manual page was written for the Debian GNU/Linux distribution +because the original program does not have a manual page. +Instead, it has a user's guide (in Japanese!) in the TeX format; +see below. +.PP +.B plain2 +is a program that converts plain text into TeX, troff or HTML format files. +.SH OPTIONS +A very brief summary of options here and +for a complete description, see the user's guide. +.TP +.B \-tex +for TeX output. +.TP +.B \-roff +for troff output. +.TP +.B \-html +for HTML output. +.SH AUTHOR +This manual page was written by Atsuhito Kohda <kohda@pm.tokushima-u.ac.jp>, +for the Debian GNU/Linux system (but may be used by others). +.SH FILES +.TP +/usr/share/doc/plain2/examples/* user's guide +.TP +/usr/share/doc/plain2/README.* --- plain2-2.54p1.orig/debian/plain2html +++ plain2-2.54p1/debian/plain2html @@ -0,0 +1,151 @@ +#!/bin/bash +# +# plain2html:Debian version and change original csh script to sh script. +######################################################################## +# +# original plain2html: plain text to HTML file +# by k-chinen@is.aist-nara.ac.jp , 1994 +# require: +# +# program: +# plain2 ( have -html option verison ) +# awk +# groff ( gtbl, gpic ) +# latex or jlatex +# dvi2ps +# convert ( convertable PS to Any-format version ) +# pnmcrop ( included PBMPLUS ) +# ghostscript ( called by convert when convert PS format ) +# +# script: +# pt2htcol.awk ( included this packeage ) +# +# +# input: +# $1 (plain text file name. e.g., README.j) +# +# output: +# $1:r.html (e.g., README.html) +# +# temporary file: +# _src, pt2empty.sty +# TBL*.p TBL*.ps TBL*.src TBL*.tex TBL*.dvi TBL*.pnm +# PIC*.p PIC*.ps PIC*.src PIC*.tex PIC*.dvi PIC*.pnm +# + + +# +# Default values +# +tex=1 +roff=0 +lib=/usr/lib/plain2 + + +# +# Check args. +# +if [ $# -gt 0 ] ; then + case $1 in + -tex) tex=1; roff=0; shift ;; + -roff) tex=0; roff=1; shift ;; + esac +fi + +if [ $# -gt 0 ] ; then + target=$1 +else + cat << END_USAGE +***** This is Debian version of: ***** + +plain2html: plain text to HTML file + by k-chinen@is.aist-nara.ac.jp NAIST , 1994 + +usage: plain2html [option] input-filename + +option: -tex TeX mode (use latex, dvi2ps) [defauts] + -roff roff mode (use groff) + +END_USAGE +exit +fi + +namepart=${1/%.*/} + +# Start +# convert document's main body. +# collect table/picture location and cut these. + +echo "Copy Target $target ." +cp $target _src + +tmphtml=`tempfile` +echo "Process document main body" +plain2 -html -jis -here _src > $tmphtml + +tmpscript=`tempfile` + +echo "Collect Table/Picutre" +awk -f $lib/pt2htcol.awk $tmphtml > $tmpscript + +# Convert parts(table/picture) via LaTeX +# If you don't have jlatex substitute to "latex". +# ( jlatex is Japanese LaTeX ) + +if [ $tex -eq 1 ] ; then +cat << END_STYLEFILE > pt2empty.sty +\\thispagestyle{empty} +\\pagestyle{empty} +END_STYLEFILE +cat << 'END_TEX_CUT' >> $tmpscript +tmppnm=`tempfile` +shopt -s nullglob +for i in TBL*.p PIC*.p; do + echo "Part $i process" + base=${i/%.p/} + plain2 -tex -jis -tstyle=pt2empty $i > $base.tex + jlatex $base.tex + dvi2ps $base.dvi > $base.ps + convert -density 144x144 $base.ps $base.pnm + pnmcrop -white $base.pnm > $tmppnm + convert $tmppnm $base.gif + for j in ps dvi aux log tex p pnm; do + rm -f $base.$j + done + rm -f $tmppnm +done +END_TEX_CUT +fi + +# +# Convert parts(table/picture) via GROFF +# If you don't have gorff substitute to ROFF-like program. +# +if [ $roff -eq 1 ] ; then +cat << 'END_ROFF_CUT' >> $tmpscript +tmppnm=`tempfile` +shopt -s nullglob +for i in TBL*.p PIC*.p; do + echo "Part $i process" + base=${i/%.p/} + plain2 -roff -euc $i > $base.src + groff -me -t -p $base.src > $base.ps + convert -density 144x144 $base.ps $base.pnm + pnmcrop -white $base.pnm > $tmppnm + convert $tmppnm $base.gif + rm -f $base.ps $base.src $base.p $base.pnm $tmppnm +done +END_ROFF_CUT +fi + +# +# Run parts conversion script +# +echo "Cut Table/Picture" +sh $tmpscript + +rm -f $namepart.html +mv $tmphtml $namepart.html +rm -f pt2empty.sty _src $tmpscript + +echo "Complete" --- plain2-2.54p1.orig/debian/rules +++ plain2-2.54p1/debian/rules @@ -0,0 +1,107 @@ +#!/usr/bin/make -f +# MAde with the aid of dh_make, by Craig Small +# Sample debian/rules that uses debhelper. GNU copyright 1997 by Joey Hess. +# Some lines taken from debmake, by Cristoph Lameter. + +# Uncomment this to turn on verbose mode. +#export DH_VERBOSE=1 + +patch-stamp: + patch -p1 < debian/patch/patch-1 + cd src ; patch -p0 < ../debian/patch/patch-2 + patch -p1 < debian/patch/patch-5 + cd src ; patch -p0 < ../debian/patch/patch-6 + echo "HTML and nide patches are applied" > patch-stamp + +depatch: + cd src ; patch -p0 -R < ../debian/patch/patch-6 + patch -p1 -R < debian/patch/patch-5 + cd src ; patch -p0 -R < ../debian/patch/patch-2 + patch -p1 -R < debian/patch/patch-1 + -rm patch-stamp + +build: build-stamp +build-stamp: + dh_testdir + + # Add here commands to compile the package. + cd src ; $(MAKE) LIBDIR=/usr/lib/plain2 + + touch build-stamp + +clean: patch-stamp + dh_testdir + dh_testroot + rm -f build-stamp install-stamp + + # Add here commands to clean up after the build process. + -cd src ; $(MAKE) clean + + dh_clean + +install: install-stamp +install-stamp: build-stamp + dh_testdir + dh_testroot + dh_clean -k + dh_installdirs + + # Add here commands to install the package into debian/tmp. + install -s -c -m 755 src/plain2 debian/tmp/usr/bin + # HTML (4 lines) + install -c -m 755 debian/plain2html debian/tmp/usr/bin +# install -c -m 755 src/plain2html debian/tmp/usr/share/doc/plain2/ +# cd debian/tmp/usr/share/doc/plain2 ; patch -p0 < ../../../../patch/patch-4 + cp src/pt2htcol.awk debian/tmp/usr/lib/plain2 + cp debian/README.patch debian/README.nide debian/jverbsty.doc \ + debian/*.ja src/README.* debian/tmp/usr/share/doc/plain2/ja + cp -R debian/patch debian/tmp/usr/share/doc/plain2 + cp lib/*.p2 debian/tmp/usr/lib/plain2 + cp -R doc debian/tmp/usr/share/doc/plain2/examples +# jverb + cp debian/jverb.sty debian/tmp/usr/share/doc/plain2/examples + cd debian/tmp/usr/share/doc/plain2/examples ; patch -p0 < ../../../../../../patch/patch-3 + cd debian/tmp/usr/share/doc/plain2/examples ; sed -e 's/..\/src\/plain2/plain2 -strict/' -e 's/ -p400 / /' -e 's/prtgif+/prtgif/' -e 's/jlatex/platex/g' Makefile > Makefile.new ; mv -f Makefile.new Makefile + cd debian/tmp/usr/share/doc/plain2/examples ; patch -p0 < ../../../../../../patch/patch-7 + cp debian/jmodules debian/tmp/usr/share/doc/plain2/examples/jmodules.obj + cd debian/tmp/usr/share/doc/plain2 ; tar cvf examples.tar examples ;\ + rm -rf examples + +# cd debian/tmp/usr/share/doc/plain2/examples ; sed -e 's/epsf/eclepsf/g' guide.p2 > guide.p2.new ; mv -f guide.p2.new guide.p2 + + touch install-stamp + +# Build architecture-independent files here. +binary-indep: build install +# We have nothing to do by default. + +# Build architecture-dependent files here. +binary-arch: build install +# dh_testversion + dh_testdir + dh_testroot + dh_installdocs + dh_installexamples + dh_installmenu +# dh_installemacsen +# dh_installinit +# dh_installcron + dh_installmanpages + dh_undocumented plain2html.1 + dh_installchangelogs src/CHANGES + dh_strip + dh_compress + dh_fixperms +# dh_suidregister + dh_installdeb + dh_shlibdeps + dh_gencontrol +# dh_makeshlibs + dh_md5sums + dh_builddeb + +source diff: + @echo >&2 'source and diff are obsolete - use dpkg-source -b'; false + +binary: binary-indep binary-arch +.PHONY: build clean binary-indep binary-arch binary --- plain2-2.54p1.orig/debian/patch/patch-0 +++ plain2-2.54p1/debian/patch/patch-0 @@ -0,0 +1,53 @@ +diff -ur plain2-2.54p1.orig/src/output.c plain2-2/src/output.c +--- plain2-2.54p1.orig/src/output.c Tue Apr 19 19:16:51 1994 ++++ plain2-2/src/output.c Wed Feb 10 10:42:23 1999 +@@ -2,8 +2,8 @@ + * Copyright (C) 1991,1992,1993 NEC Corporation. + */ + #ifndef lint +-static char rcsid[] = +- "$Id: patch-0,v 1.2 1999/02/10 03:30:26 kohda Exp $ (NEC)"; ++ ++ + #endif + + #include <stdio.h> +diff -ur plain2-2.54p1.orig/src/picture.c plain2-2/src/picture.c +--- plain2-2.54p1.orig/src/picture.c Tue Apr 19 19:16:53 1994 ++++ plain2-2/src/picture.c Wed Feb 10 10:42:23 1999 +@@ -2,8 +2,8 @@ + * Copyright (C) 1991,1992 NEC Corporation. + */ + #ifndef lint +-static char rcsid[]= +- "$Id: patch-0,v 1.2 1999/02/10 03:30:26 kohda Exp $ (NEC)"; ++ ++ + #endif + + #ifdef PICTURE +diff -ur plain2-2.54p1.orig/src/plain2.c plain2-2/src/plain2.c +--- plain2-2.54p1.orig/src/plain2.c Tue Apr 19 19:40:29 1994 ++++ plain2-2/src/plain2.c Wed Feb 10 10:42:23 1999 +@@ -2,8 +2,8 @@ + * Copyright (C) 1991,1992,1994 NEC Corporation. + */ + #ifndef lint +-static char rcsid[] = +- "$Id: patch-0,v 1.2 1999/02/10 03:30:26 kohda Exp $ (NEC)"; ++ ++ + #endif + + #include <stdio.h> +--- plain2-1/lib/jbook.p2.orig Wed Feb 10 12:13:36 1999 ++++ plain2-1/lib/jbook.p2 Wed Feb 10 12:13:51 1999 +@@ -1,7 +1,7 @@ + # + # jbookスタイルを使う + # +-# $Id: patch-0,v 1.2 1999/02/10 03:30:26 kohda Exp $ ++# + # + DOC_BEGIN "\\documentstyle[]{jbook}\n\ + \\setcounter{secnumdepth}{6}\n\ --- plain2-2.54p1.orig/debian/patch/patch-1 +++ plain2-2.54p1/debian/patch/patch-1 @@ -0,0 +1,1481 @@ +diff -p -c -r -N orig-plain2-2.53/src/Makefile plain2/src/Makefile +*** orig-plain2-2.53/src/Makefile Fri Jan 7 05:34:39 1994 +--- plain2/src/Makefile Mon May 16 20:34:27 1994 +*************** LIBDIR=/usr/local/lib/plain2 +*** 10,16 **** + + SHELL=/bin/sh + +! DEFINES=-DKANJI -DPICTURE + + #CC=gcc + #CFLAGS= -fwritable-strings ${DEFINES} -DBSD -DDEBUG +--- 10,16 ---- + + SHELL=/bin/sh + +! DEFINES=-DKANJI -DPICTURE -DHTML + + #CC=gcc + #CFLAGS= -fwritable-strings ${DEFINES} -DBSD -DDEBUG +*************** #CFLAGS= -fwritable-strings ${DEFINES} -DBSD -DDEBUG +*** 22,32 **** + SRCS=plain2.c readfile.c analyze.c miscutil.c\ + section.c example.c list.c plaintxt.c table.c spacing.c\ + headfoot.c hint.c picture.c justify.c ftitle.c\ +! roffout.c texout.c title.c output.c renumout.c macro.c + OBJS_NOKANJI=plain2.o readfile.o miscutil.o\ + section.o example.o list.o plaintxt.o spacing.o\ + headfoot.o hint.o justify.o\ +! texout.o output.o renumout.o macro.o + # + # Following files contain Kanji characters(8bit) in EUC code. + # +--- 22,32 ---- + SRCS=plain2.c readfile.c analyze.c miscutil.c\ + section.c example.c list.c plaintxt.c table.c spacing.c\ + headfoot.c hint.c picture.c justify.c ftitle.c\ +! roffout.c texout.c title.c output.c renumout.c macro.c htmlout.c + OBJS_NOKANJI=plain2.o readfile.o miscutil.o\ + section.o example.o list.o plaintxt.o spacing.o\ + headfoot.o hint.o justify.o\ +! texout.o output.o renumout.o macro.o htmlout.o + # + # Following files contain Kanji characters(8bit) in EUC code. + # +*************** title.o: plain2.h +*** 96,98 **** +--- 96,99 ---- + output.o: plain2.h picture.h macro.h + renumout.o: plain2.h + macro.o: plain2.h macro.h ++ htmlout.o: plain2.h macro.h +diff -p -c -r -N orig-plain2-2.53/src/README.HTML plain2/src/README.HTML +*** orig-plain2-2.53/src/README.HTML +--- plain2/src/README.HTML Sun Aug 14 03:25:01 1994 +*************** +*** 0 **** +--- 1,176 ---- ++ by k-chinen@is.aist-nara.ac.jp ++ ++ 1. Prologue ++ ++ ++ This packege is patched HTML support plain2. ++ HTML support routines separated by Macro HTML. ++ ++ #ifdef HTML ++ ++ If you found bugs, please send mail k-chinen@is.aist-nara.ac.jp. ++ ++ ++ ++ ++ 2. What is HTML ? ++ ++ HTML was acronym for Hyper Text Markup Language, which is used in World ++ Wide Web. ++ World Wide Web is famous service for Mosaic. World Wide Web makes hypertext ++ over Network. ++ ++ ++ ++ 3. How to use ? ++ ++ 3.1. Basic ++ ++ 3.1.1. convert plain text to HTML ++ ++ ++ % plain2 -html foo.txt > bar.html ++ ++ plain2 convert foo.txt (plain text) to bar.html (HTML). ++ ++ ++ ++ 3.1.2. convert plain text to HTML with pictures and tables ++ ++ use -here option, plain2 made HTML which include pictures and tables. ++ But HTML not support picture and table. plain2 only express anchor for link ++ to picture and table ++ ++ % plain2 -html -here foo.txt > junk.html ++ ++ ++ 3.1.3. convert plain text to HTML with erasing pictures and tables ++ ++ If you want to erase picture or table, use -htmlonce option (don't use -html). ++ ++ ++ ++ 3.1.4. convert plain2 text to HTML with raw pictures and tables ++ ++ If you want to convert plain2 text with raw pictures and tables, ++ use -htmlonce and -raw. ++ ++ ++ ++ 3.2. Extended (plain2html) ++ ++ 3.2.1. require ++ ++ HTML is not support picture and table, you know. but plain2 generate ++ image and table via roff or TeX. ++ Then you need roff or TeX and image processing programs. ++ ++ For example, this packege include c-shell script which named plain2html. ++ This script ganerate HTML and picture and table files. ++ (pictures and tables are GIF format file). ++ and plain2html require follow programs. ++ ++ (1) plain2 ++ ++ (2) typesetting program ++ - TeX ++ * latex and dvi2ps ++ ('jlatex' is japanelized latex. please subsitute ++ 'jlatex' to 'latex' in script) ++ - roff ++ * groff ++ ++ (3) image processing program ++ - convert ( which included ImageMagick) ++ - pnmcrop ( which included pbmplus) ++ ++ (4) other ++ - csh or tcsh ++ - awk ++ - ghostscript ( convert calle it) ++ - pt2htcol.awk ( inclued this packege ) ++ ++ 3.2.2. How to use ++ ++ For eample, convert plain text file foo.txt to HTML. ++ ++ (1) Make working direcory, because plain2 generate many files. ++ ++ % mkdir foo.work ++ % cp foo.txt foo.work ++ % cd foo.work ++ ++ (2) run plain2html ++ ++ % plain2html foo.txt ++ ++ plain2html gerate HTML file foo.html, PIC*.gif (for picture) and ++ TBL*.gif (for table). ++ ++ So, you get HTML file. Please check result via Mosaic or Chimera. ++ ++ % Mosaic foo.html ++ ++ or ++ ++ % chimera foo.html ++ ++ ++ ++ 4. Changes for plain2 ++ ++ * add -html option ++ ++ * add -here option ++ Document size is important in WWW. switch include images or not. ++ ++ * new make htmlout.c (like texout.c) ++ ++ * Cannot found pictures begin and end, I modify picture.c ++ ++ * add plain2html and pt2htcol.awk ++ ++ 1. Genate HTML with -html ++ 2. Convert pictures and tables. ++ ++ a) groff ++ - conver to PS via groff ++ ++ b) latex ++ - convert to DVI via latex ++ - convert to PS via dvi2ps ++ ++ 3. cut improtant part in picures and convert to GIF. ++ - convet to PNM via 'convert' ++ - cut via 'pnmcrop' ++ - convet to GIF via 'convert' ++ ++ ++ ++ 5. Bugs. ++ ++ * It is multi path ++ plain2 is beauty, because plain2 is one path... ++ but plain2html is multi path. ++ ++ * I think to hard to install. because it require many programs. ++ ++ * on groff ++ - groff not support japanaes ++ ++ ++ 6. Acknowledgment ++ ++ Special thank for Mr. Uchida (uchida@ccs.mt.nec.co.jp). he release ++ plain2 r2.5 for this program. And he give important advice and ++ suggestion. ++ ++ ++ 7. Epilogue ++ ++ This packege is only patch for plain2. It is not new revision of plain2. ++ Then, If you have questions, advices and requiremnts. please mail ++ k-chinen@is.aist-nara.ac.jp ++ ++ Own your risk. ++ Enjoy !!! +diff -p -c -r -N orig-plain2-2.53/src/README.HTML.JPN plain2/src/README.HTML.JPN +*** orig-plain2-2.53/src/README.HTML.JPN +--- plain2/src/README.HTML.JPN Sun Aug 14 02:29:05 1994 +*************** +*** 0 **** +--- 1,197 ---- ++ $BBjL>(B plain2 $B$N(B HTML $BBP1~(B ++ by k-chinen@is.aist-nara.ac.jp ++ ++ 1. $B$O$8$a$K(B ++ ++ $B$3$N%G%#%l%/%H%j$N%=!<%9%U%!%$%k$NCf$G!"(B ++ ++ #ifdef HTML ++ ++ $B$H$7$F$"$k$N$O!"%*%j%8%J%k$N(B plain2 $B$rF`NI@hC<2J3X5;=QBg3X1!Bg3X$N(B ++ $BCNG0(B (k-chinen@is.aist-nara.ac.jp) $B$,(B HTML $BBP1~$N$?$a2~B$$7$?$H$3$m(B ++ $B$G$9!#(B ++ $B$=$NItJ,$G%P%0$,5/$-$?$H;W$o$l$k:]$K$O(B k-chinen@is.aist-nara.ac.jp ++ $B$X(B E-mail $B$G$*CN$i$;$/$@$5$$!#<!$N%j%j!<%9$N:]$N;29M$K$7$^$9!#(B ++ ++ ++ ++ 2. HTML $B$H$O(B ? ++ ++ HTML $B$H$O(B Hyper Text Markup Language $B$NN,$G!"(BWorld Wide Web $B$H$$$&(B ++ $B%5!<%S%9$GJ8>O$r:n@.$9$k0Y$N8@8l$G$9!#(BWorld Wide Web $B$O(B Mosaic $B$H(B ++ $B$$$&%W%m%0%i%`$GM-L>$J!"%M%C%H%o!<%/>e$K%O%$%Q!<%F%-%9%H$r:n$k%5!<(B ++ $B%S%9$G$9!#(B ++ ++ ++ 3. $B;H$$J}(B ++ ++ 3.1. $B4pK\(B ++ ++ 3.1.1. plain text $B$r(B HTML $B$K(B ++ ++ $B4pK\E*$J%*%j%8%J%k$N(B plain2 $B$H$[$H$s$IF1$8$G!"(B ++ ++ % plain2 -html -jis foo.txt > bar.html ++ ++ $B$H$$$&$h$&$K;H$$$^$9!#(B ++ $B$3$&$9$k$H!"(Bfoo.txt $B$H$$$&(B plain text $B$r(B bar.html $B$H$$$&(B HTML $B$N=q(B ++ $B<0$G$+$+$l$?%U%!%$%k$,$G$-$^$9!#(B ++ ++ 3.1.2. plain text $B$r?^$dI=$,F~$C$?(B HTML $B$K(B ++ ++ plain2 $B$K(B -here $B%*%W%7%g%s$r$D$1$k$H!"?^$dI=$rD>@\4^$a$k$h$&$K=q$+(B ++ $B$l$?(B HTML $B$N=q<0$N%U%!%$%k$,$G$-$^$9!#(B ++ ($B$?$@$7!";DG0$J$,$i(B plain2 $B$G?^$dI=$r(B HTML $B$K$9$k;v$O=PMh$^$;$s!#(B) ++ ++ % plain2 -html -here -jis foo.txt > junk.html ++ ++ $B$H$7$F;H$C$F$_$^$7$g$&!#(B ++ $B$3$N(B junk.html $B$G$O!"(B bar.html $B$G(B "Picture here" $B$H$+(B "Table here" ++ $B$H=q$$$F$"$C$?>l=j$K2?$+?^$,=P$k$H$*$b$$$^$9!#(B ++ ++ 3.1.3. plain text $B$N?^$dI=$rL5;k$7$F(B HTML $B$K(B ++ ++ $B?^$dI=$rL5;k$7$F(B HTML $B$K$7$?$$;~$K$O!"(B-html $B$G$O$J$/(B -htmlonce $B$r(B ++ $B;H$C$F$/$@$5$$!#(B ++ ++ 3.1.4. plain text $B$N?^$dI=$O$=$N$^$^$G(B HTML $B$K(B ++ ++ $B?^$dI=$r$=$N$^$^(B HTML $B$K4^$a$?$$;~$K$O!"(B-htmlonce $B$H(B -raw $B$r0l=o(B ++ $B$K;H$C$F$/$@$5$$!#(B ++ ++ ++ ++ 3.2. $B1~MQ(B (plain2html) ++ ++ 3.2.1. $BI,MW$JJ*(B ++ ++ plain2 $B$N(B HTML $B$r:n$k5!G=$G$O?^$dI=$O:n$l$^$;$s$,!"(Broff $B$d(B TeX $B$r(B ++ $B;H$C$F?^$dI=$r:n$k;v$,=PMh$^$9!#$3$N$?$a$K$O(B roff $B$d(B TeX $B$N7A<0$N(B ++ $B%U%!%$%k$r(B gif $BEy$N%$%a!<%8%G!<%?$K$9$k%W%m%0%i%`$,I,MW$G$9!#(B ++ ++ $B%5%s%W%k$H$7$F!"$3$N%Q%C%A$G$O(B plain2html $B$H$$$&(B csh script $B$r$D(B ++ $B$1$F$"$j$^$9!#$3$N%9%/%j%W%H$G$O(B HTML $B$N%U%!%$%k$H$=$l$KI,MW$J?^(B ++ $B$dI=$N$?$a$N%$%a!<%8%G!<%?$r:n$j$^$9!#(B ++ ++ $B$3$N%9%/%j%W%H$r;H$&$K$O0J2<$N$h$&$J%W%m%0%i%`$,I,MW$G$9!#(B ++ ++ (1) plain2 ++ ++ (2) $BAHHG%W%m%0%i%`(B ++ - TeX $B$r$D$+$&>l9g(B ++ * jlatex $B$H(B dvi2ps ++ - roff $B$r;H$&>l9g(B ++ * groff ++ ++ (3) $B%$%a!<%8%G!<%?JQ49%W%m%0%i%`(B ++ - convert ( ImageMagick $B$K4^$^$l$F$$$^$9(B ) ++ - pnmcrop ( pbmplus $B$K4^$^$l$F$$$^$9(B ) ++ ++ (4) $B$=$NB>(B ++ - csh $B$+(B tcsh ++ - awk ++ - ghostscript ( convert $B$,8F$S=P$7$^$9(B ) ++ - pt2htcol.awk ( $B$3$N%Q%C%A$K4^$^$l$F$$$^$9(B ) ++ ++ 3.2.2. $B;H$$J}(B ++ ++ foo.txt $B$r(B HTML $B$N%U%!%$%k$K$9$kNc$r>R2p$7$^$9!#(B ++ ++ (1) $B?^$dI=$N%$%a!<%8%G!<%?$,$G$-$k$N$GJL$N%G%#%l%/%H%j$r$D$/(B ++ $B$C$F$=$3$G:n6H$7$^$7$g$&!#(B ++ ++ % mkdir foo.work ++ % cp foo.txt foo.work ++ % cd foo.work ++ ++ (2) plain2html $B$r<B9T$7$^$9(B ++ ++ % plain2html foo.txt ++ ++ $B<B9T$,=*N;$9$k$H(B($B$$$m$$$m$J=hM}$r$9$k$N$G7k9=;~4V$+$+$j(B ++ $B$^$9(B)$B!"(Bfoo.html $B$H$$$&(B HTML $B$N=q<0$G$-$?%U%!%$%k$H!"?^(B ++ $B$dI=$N$?$a$N(B PIC*.gif $B$d(B TBL*.gif $B$G$-$^$9!#(B ++ ++ $B$H$$$&$o$1$G(B HTML $B$N=q<0$G$G$-$?%U%!%$%k$,$G$-$^$9!#(BMosaic $B$d(B ++ chimera $B$G7k2L$r3NG'$7$F$/$@$5$$!#(B ++ ++ % Mosaic foo.html ++ ++ $B$^$?$O!"(B ++ ++ % chimera foo.html ++ ++ $B$H$7$F$/$@$5$$!#(B ++ ++ ++ 4. $BJQ99E@(B ++ ++ * -html $B%*%W%7%g%s$r$D$1$?!#(B ++ $B$3$l$G!"(BHTML $B$N=PNO$r$9$k!#(B ++ ++ * -here $B%*%W%7%g%s$r$D$1$?!#(B ++ WWW $B$G$OJ8=q$NBg$-$5$O=EMW(B(64kbps $B$N%5%$%H$b$"$k(B)$B$J$N$G!"(BHTML ++ $B$NCf$KI=$d?^$r(B ++ ++ - $B$=$N$^$^F~$l$k(B ++ - $B%j%s%/$H$9$k(B ++ ++ $B$K@ZBX$($k!#(B ++ ++ * texout.c $B$r$^$M$F!"(Bhtmlout.c $B$r:n$C$?!#(B ++ html $B$G;O$^$k4X?t$r:n$C$F(B HMTL $BBP1~$7$?!#(B ++ ++ * $B$J$<$+!"?^$@$1$O(B *out.c $B$N4X?t$GNN0h(B($B;O$a$H=*$j$N9T(B) $B$rCN$k;v(B ++ $B$,$G$-$J$$$h$&$J$N$G!"(Bpicture.c $B$NCf$rJQ99$7$?!#(B ++ ++ * $B%9%/%j%W%H(B plain2html , pt2htcol.awk $B$rDI2C!#(B ++ mulit path $B$H$7$F2?2s$b<B9T$7$F!"A4BN$rJQ49$9$k;v$K$7$?!#(B ++ ++ 1. $BA4BN$r(B -html $B$GJQ49!#(B ++ 2. $BI=$d?^$NItJ,$r(B ps $B$KJQ49!#(B ++ ++ a) groff ++ - groff $B$G(B ps $B$K(B ++ ++ b) latex ++ - jlatex $B$G(B dvi $B$K(B ++ - dvi2ps $B$G(B ps $B$K(B ++ ++ 3. $BI=$d?^$NI,MW$J=j$r@Z$j=P$7$F!"(Bgif $B$KJQ49!#(B ++ - convert $B$G(B pnm $B$K(B ++ - pnmcrop $B$G@Z$j=P$9(B ++ - convert $B$G(B gif $B$K(B ++ ++ $B?^$N@Z$j=P$7$O!"(BTeX $B$G$O(B \thispagestyle{empty} $B$r=q(B ++ $B$$$?%9%?%$%k%U%!%$%k$rMQ0U$7$F2r7h!#(B ++ groff $B$G$O(B -me $B$G2r7h$7$?$h$&$@!#(B(roff $B$O>\$7$/$J$$(B ++ $B$N$G<+?.$,$J$$(B) ++ ++ ++ 5. $BLdBjE@(B ++ ++ * multi path $B$J$C$F$7$^$C$?!#(B ++ plain2 $B$O(B one path $B$@$+$iH~$7$$$N$K(B... ++ ++ * $B$$$m$$$m$J%D!<%k$r;H$&$N$G!"(Binstall $B$9$k;~$OBgJQ$+$bCN$l$J$$!#(B ++ ++ * groff $B$K4X$7$F(B ++ - $BF|K\8l$,DL$8$J$$(B ++ ++ ++ 6. $B<U<-(B ++ ++ plain2 $B$N:n<T$NFbED$5$s(B(uchida@ccs.mt.nec.co.jp)$B$K$O$*K;$7$$$N$K(B ++ plain2 r2.5 $B$N%j%j!<%9$r$7$F$b$i$$$^$7$?!#$^$?!"$$$m$$$m$H%3%a%s(B ++ $B%H$rD:$-$^$7$?!#$"$j$,$H$&$4$6$$$^$7$?!#(B ++ ++ ++ ++ 7. $B$*$o$j$K(B ++ ++ $B$3$N%Q%C%A$O(B plain2 $B$KBP$9$k$b$N$G!"(Bplain2 $B$N?7$7$$(B revison $B$G$O(B ++ $B$"$j$^$;$s!#$7$?$,$C$F!"$3$N%Q%C%A$K4X$9$k46A[!"MWK>!"<ALd$J$I$O(B ++ k-chinen@is.aist-nara.ac.jp $B08$G$*4j$$$7$^$9!#(B ++ ++ $B$J$*!"$3$N%Q%C%A$K$K$h$C$F@8$8$?$$$+$J$kB;32!"Mx1W$K$D$$$F:n<T$O(B ++ $B@UG$$rIi$$$^$;$s!#(B +diff -p -c -r -N orig-plain2-2.53/src/htmlout.c plain2/src/htmlout.c +*** orig-plain2-2.53/src/htmlout.c +--- plain2/src/htmlout.c Sun Aug 14 02:15:42 1994 +*************** +*** 0 **** +--- 1,469 ---- ++ /* ++ * Copyright (C) 1991,1992 NEC Corporation. ++ */ ++ /* ++ modify from texout.c, by k-chinen@is.aist-nara.ac.jp, 1994 ++ ++ NOTE: ++ * This module is prototype of HTML ouputting. ++ * HTML can markup. but HTML cannot layout. ++ Therfore this module cannot handle CENTER, RIGHT and SPACE. ++ * HTML cannout handle table and picture directly. ++ Therfore this module cannot handle table and picture with ++ TeX and TROFF outoputting's approach. ++ Then I could not implement it. ++ */ ++ ++ ++ ++ ++ #ifndef lint ++ ++ ++ #endif ++ ++ #include <stdio.h> ++ #include "plain2.h" ++ #include "picture.h" ++ #include "table.h" ++ #include "macro.h" ++ ++ ++ struct macDefs htmlMacros[] = { ++ M_DOC_BEGIN, "<HTML>\n", ++ M_DOC_END, "</HTML>\n", ++ M_PLAIN_BEGIN, "<P>\n", ++ M_PLAIN_END, "</P>\n", ++ M_EXAM_BEGIN, "<PRE><TT>\n", ++ M_EXAM_END, "</TT></PRE>\n", ++ M_APDX_BEGIN, "<!-- appendix -->\n", ++ M_APPENDIX, "<!-- appendix section -->\n", ++ M_BLANK, "\n", ++ M_PAGE, "\n<!-- PAGE -->\n", ++ M_NEWLINE, "\n<!-- NEWLINE -->\n", ++ M_CENTER_BEGIN, "<!-- CENTER -->\n", ++ M_CENTER_END, "<!-- end of CENTER -->\n", ++ M_RIGHT_BEGIN, "<!-- RIGHT -->\n", ++ M_RIGHT_END, "<!-- end of RIGHT -->\n", ++ M_INDENT, "<BLOCKQUOTE>\n", ++ M_INDENT0, "</BLOCKQUOTE>\n", ++ M_FOOTN_BEGIN, "", ++ M_FOOTN_END, "", ++ M_REFER_BEGIN, "<A HREF=\"#", ++ M_REFER_END, "\">GO</A>", ++ M_BOLD_BEGIN, "<B>", ++ M_BOLD_END, "</B>", ++ M_INDEX_BEGIN, "", ++ M_INDEX_END, "", ++ M_SECTION_1, "\n<H1>@1</H1>\n", ++ M_SECTION_2, "\n<H2>@1</H2>\n", ++ M_SECTION_3, "\n<H3>@1</H3>\n", ++ M_SECTION_4, "\n<H4>@1</H4>\n", ++ M_SECTION_5, "\n<H5>@1</H5>\n", ++ M_SECTION, "", ++ M_SETSEC_1, "", ++ M_SETSEC_2, "", ++ M_SETSEC_3, "", ++ M_SETSEC_4, "", ++ M_SETSEC_5, "", ++ M_TITLE, "<TITLE>&1</TITLE>\n<H1>&1</H1>\n<EM>&6</EM>\n<PRE>&4\n&3</PRE>\n<HR>", ++ -1, "", ++ }; ++ ++ ++ /* ++ * HTML text output routines ++ */ ++ ++ struct transTable *htmlTrans; ++ struct transTable *htmlTransM; ++ ++ static struct transTable htmlFullTrans[] = { ++ {'<', "<" }, ++ {'>', ">" }, ++ {'&', "&" }, ++ {0,0} }; ++ static struct transTable htmlFullTransM[] = { ++ {'<', "<" }, ++ {'>', ">" }, ++ {'&', "&" }, ++ {0,0} }; ++ ++ static struct transTable htmlHalfTrans[] = { ++ {'<', "<" }, ++ {'>', ">" }, ++ {'&', "&" }, ++ {0,0} }; ++ ++ static struct transTable htmlHalfTransM[] = { ++ {'<', "<" }, ++ {'>', ">" }, ++ {'&', "&" }, ++ {0,0} }; ++ ++ htmlSetTrans(full) ++ int full; ++ { ++ if (full) { ++ htmlTrans = htmlFullTrans; ++ htmlTransM = htmlFullTransM; ++ } ++ else { ++ htmlTrans = htmlHalfTrans; ++ htmlTransM = htmlHalfTransM; ++ } ++ } ++ ++ ++ char * ++ htmlTextQuote(str, quotable) ++ char *str; ++ int quotable; ++ { ++ char *s; ++ int len; ++ static char buf[MAX_LINE_LEN]; ++ ++ if (rawOutput) ++ return str; ++ ++ if (!quotable) ++ return textQuote(str, htmlTransM); ++ ++ return textQuote(str, htmlTrans); ++ } ++ ++ char *htmlQuote1(str) ++ char *str; ++ { ++ return htmlTextQuote(str, 1); ++ } ++ ++ char *htmlQuote2(str) ++ char *str; ++ { ++ return htmlTextQuote(str, 0); ++ } ++ ++ ++ htmlPutLabel(str) ++ char *str; ++ { ++ printf("<A NAME=\"%s\"> <EM>(here)</EM> </A>", codeCvt(str)); ++ } ++ ++ htmlPlain(str, attr, newline) ++ char *str; ++ int attr; ++ int newline; ++ { ++ if (attr == IL_RAW || attr == IL_REFERENCE) ++ printf("%s", codeCvt(str)); ++ else ++ printf("%s", codeCvt(htmlTextQuote(str, 1))); ++ if (newline) ++ printf("\n"); ++ } ++ ++ htmlExample(str) ++ char *str; ++ { ++ printf("%s\n",textQuote(str, htmlTrans)); ++ } ++ ++ static int enumLevel = 0; ++ htmlListBlock(begin, level, ltype, hint) ++ int begin; ++ int level; ++ int ltype; ++ char hint; ++ { ++ char *lstr; ++ if (begin) { ++ switch (ltype) { ++ case L_BULLET: ++ case L_DASH: ++ printf("<UL>\n"); ++ break; ++ case L_DLIST: ++ printf("<DL>\n"); ++ break; ++ case L_LROMAN: ++ case L_SROMAN: ++ case L_NUMBER: ++ case L_LALPHA: ++ case L_SALPHA: ++ enumLevel++; ++ printf("<OL>\n"); ++ break; ++ default: ++ break; ++ } ++ } ++ else { ++ switch (ltype) { ++ case L_BULLET: ++ case L_DASH: ++ printf("</UL>\n"); ++ break; ++ case L_LROMAN: ++ case L_SROMAN: ++ case L_NUMBER: ++ case L_LALPHA: ++ case L_SALPHA: ++ enumLevel--; ++ printf("</OL>\n"); ++ break; ++ case L_DLIST: ++ printf("</DL>\n"); ++ break; ++ default: ++ break; ++ } ++ } ++ } ++ ++ htmlDlistItem(level, dscr, cont) ++ int level; ++ char *dscr; ++ int cont; ++ { ++ printf("<DT><B>%s</B>\n", codeCvt(htmlTextQuote(dscr, 1))); ++ } ++ ++ htmlListItem(level) ++ int level; ++ { ++ printf("<LI> "); ++ } ++ ++ htmlRawText(str) ++ char *str; ++ { ++ printf("%s\n",codeCvt(str)); ++ } ++ ++ htmlSpace(length) ++ int length; ++ { ++ /* EMPTY --- I don't know what do here */ ++ } ++ ++ htmlFTitle(ft, str, capsule) ++ int ft; ++ char *str; /* if (str!=NULL) output title */ ++ int capsule; ++ { ++ static int figNumber = 1; ++ static int tblNumber = 1; ++ if (crossRefer && capsule) { ++ printf("<B>%s</B>\n", codeCvt(htmlTextQuote(str, 1))); ++ htmlPutLabel(str); ++ } ++ else { ++ printf ("<P>"); ++ #ifdef KANJI ++ if (japaneseText) { ++ if (ft == FT_FIGURE) ++ printf ("<B> %s %d.</B>", codeCvt("$B?^(B"), figNumber++); ++ ++ else if (ft == FT_TABLE) ++ printf ("<B> %s %d.</B>", codeCvt("$BI=(B"), tblNumber++); ++ } ++ else { ++ #endif ++ if (ft == FT_FIGURE) ++ printf ("<B> Figure %d.</B>", figNumber++); ++ else if (ft == FT_TABLE) ++ printf ("<B> Table %d.</B>", tblNumber++); ++ #ifdef KANJI ++ } ++ #endif ++ printf ("%s\n", codeCvt(htmlTextQuote(str, 1))); ++ } ++ } ++ ++ #ifdef PICTURE ++ /* ++ * Driver for HTML(picture) output ++ */ ++ static int picLines; /* Number of lines in the block */ ++ static int picMinInd; /* Indentation of the region */ ++ ++ static int htmlVsize; ++ static int htmlUnit; ++ ++ htmlPictureBlock(begin, lines, indent, maxLen) ++ int begin; ++ int lines; ++ int indent; ++ int maxLen; ++ { ++ if(htmlOnce) { ++ if(begin) ++ printf("<!-- PICTURE -->\n"); ++ } ++ else { ++ if(begin) ++ printf("<!-- PICTURE -->\n"); ++ } ++ } ++ ++ /* set line width */ ++ htmlLineWidth(style) ++ int style; ++ { ++ /* */ ++ } ++ ++ htmlEllipse(x0, y0, x1, y1, style) ++ int x0, x1, y0, y1; ++ int style; ++ { ++ /* */ ++ } ++ ++ /* ++ * Draw line ++ * Only ({-1,0,1},{-1,0,1}) direction. ++ */ ++ htmlPicLine(x0, y0, x1, y1, style, vector) ++ int x0, x1, y0, y1; ++ int style; ++ int vector; ++ { ++ /* */ ++ } ++ ++ htmlPicArc(x, y, r, dir, style) ++ int x, y, r; ++ enum direction dir; ++ int style; ++ { ++ /* */ ++ } ++ ++ htmlPicText(s, xpos, vpos, factor) ++ char *s; ++ int xpos; ++ int vpos; ++ int factor; ++ { ++ /* */ ++ } ++ #endif ++ ++ ++ ++ htmlTitle(style, haifu, title, shozoku, number, date, name, renraku ++ #ifdef TITLE_SPECIAL ++ ,special8, special9 ++ #endif ++ ) ++ int style; ++ char **haifu; ++ char **title; ++ char **shozoku; ++ char **number; ++ char **date; ++ char **name; ++ char **renraku; ++ #ifdef TITLE_SPECIAL ++ char **special8, **special9; ++ #endif ++ { ++ char **s; ++ if (style == 0) { ++ putMacro(M_TITLE, ++ title, number, date, shozoku, haifu, name, renraku ++ #ifdef TITLE_SPECIAL ++ ,special8, special9 ++ #endif ++ ); ++ return; ++ } ++ } ++ ++ htmlTable(begin, end, tblp) ++ int begin; ++ int end; ++ struct table *tblp; ++ { ++ if(htmlOnce) { ++ if(rawOutput) { ++ int l; ++ ++ printf("<PRE>\n"); ++ for (l = begin; l < end; l++) { ++ htmlRawText(texts[l]->body); ++ } ++ printf("</PRE>\n"); ++ } ++ else { ++ printf("<!-- TABLE -->\n"); ++ } ++ ++ } ++ else { ++ static int tbl_count=0; ++ printf("\n<!-- plain2:TABLE %05d %d %d -->\n",tbl_count,begin,end); ++ ++ if(htmlHere) { ++ printf("<P><IMG SRC=\"TBL%05d.gif\">\n", tbl_count); ++ } ++ else { ++ printf("<P><B><A HREF=\"TBL%05d.gif\">Table here</A></B></P>\n", ++ tbl_count); ++ } ++ tbl_count++; ++ } ++ } ++ ++ htmlCapsule(begin, type, center) ++ int begin; ++ int type; ++ int center; ++ { ++ static int count=0; ++ char *typeStr; ++ ++ if (crossRefer) { ++ switch (type) { ++ case FT_FIGURE: ++ typeStr = "figure"; ++ break; ++ case FT_TABLE: ++ typeStr = "table"; ++ break; ++ default: ++ fprintf(stderr, "PANIC(unknown capsule type)\n"); ++ exit(2); ++ break; ++ } ++ if (begin) { ++ count++; ++ printf("\n<!-- Start of #%d -->\n",count); ++ } ++ else { ++ printf("\n<!-- End of #%d -->\n",count); ++ } ++ } ++ else /* short paper */ { ++ if (begin) { ++ printf("\n<!-- Start of #%d -->\n",count); ++ } ++ else { ++ printf("\n<!-- End of #%d -->\n",count); ++ } ++ } ++ } ++ ++ htmlComment(begin, end) ++ int begin; ++ int end; ++ { ++ int l; ++ for (l = begin; l < end; l++) { ++ printf ("<!-- %s -->\n", codeCvt(texts[l]->body)); ++ } ++ } +diff -p -c -r -N orig-plain2-2.53/src/macro.c plain2/src/macro.c +*** orig-plain2-2.53/src/macro.c Fri Jan 7 05:34:40 1994 +--- plain2/src/macro.c Sun Aug 14 03:27:30 1994 +*************** char *fname; +*** 369,375 **** + } + if (ret == -1) + continue; +! s = (char *)malloc(strlen(defstr)); + strcpy(s, defstr); + outMacro[macroNum] = macroParse(s, macroNum, s); + } +--- 369,375 ---- + } + if (ret == -1) + continue; +! s = (char *)malloc(strlen(defstr)+1); + strcpy(s, defstr); + outMacro[macroNum] = macroParse(s, macroNum, s); + } +diff -p -c -r -N orig-plain2-2.53/src/output.c plain2/src/output.c +*** orig-plain2-2.53/src/output.c Fri Jan 7 05:34:46 1994 +--- plain2/src/output.c Wed Jan 19 19:08:44 1994 +*************** +*** 1,6 **** +--- 1,9 ---- + /* + * Copyright (C) 1991,1992,1993 NEC Corporation. + */ ++ /* ++ * modify by k-chinen@is.aist-nara.ac.jp, 1994 ++ */ + #ifndef lint + + +*************** static char rcsid[] = +*** 19,27 **** +--- 22,32 ---- + ?(textp)->body\ + :(textp)->body+(textp)->indent) + #endif ++ + /* + * Definition of Output driver routines. + */ ++ /***** roff *****/ + int roffPlain(), roffExample(), + roffListBlock(), roffDlistItem(), + roffListItem(), roffRawText(), roffSpace(), +*************** int roffPlain(), roffExample(), +*** 33,38 **** +--- 38,45 ---- + roffTable(), roffFTitle(), roffTitle(); + char *roffQuote1(), *roffQuote2(); + ++ ++ /***** TeX *****/ + int texPlain(), texExample(), + texListBlock(), texDlistItem(), + texListItem(), texRawText(), texSpace(), +*************** int texPlain(), texExample(), +*** 44,49 **** +--- 51,70 ---- + texTable(), texFTitle(), texTitle(); + char *texQuote1(), *texQuote2(); + ++ #ifdef HTML ++ /***** HTML *****/ ++ int htmlPlain(), htmlExample(), ++ htmlListBlock(), htmlDlistItem(), ++ htmlListItem(), htmlRawText(), htmlSpace(), ++ htmlCapsule(), htmlComment(), ++ #ifdef PICTURE ++ htmlPictureBlock(), htmlPicLine(), htmlPicArc(), ++ htmlPicText(), htmlLineWidth(), ++ #endif ++ htmlTable(), htmlFTitle(), htmlTitle(); ++ char *htmlQuote1(), *htmlQuote2(); ++ #endif ++ + struct outDev roffPut = { + roffPlain, roffExample, + roffListBlock, roffDlistItem, +*************** struct outDev texPut = { +*** 69,77 **** +--- 90,121 ---- + texTable, texFTitle, texTitle, + texQuote1, texQuote2, + }; ++ ++ #ifdef HTML ++ struct outDev htmlPut = { ++ htmlPlain, htmlExample, ++ htmlListBlock, htmlDlistItem, ++ htmlListItem, htmlRawText, htmlSpace, ++ htmlCapsule, htmlComment, ++ #ifdef PICTURE ++ htmlPictureBlock, htmlPicLine, htmlPicArc, ++ htmlPicText, htmlLineWidth, ++ #endif ++ htmlTable, htmlFTitle, htmlTitle, ++ htmlQuote1, htmlQuote2, ++ }; ++ #endif ++ ++ ++ #ifdef HTML + /* ++ * Output text in (roff, TeX or HTML) format. ++ */ ++ #else ++ /* + * Output text in (roff or TeX) format. + */ ++ #endif + + struct inline_mark { + char il_mark; +diff -p -c -r -N orig-plain2-2.53/src/picture.c plain2/src/picture.c +*** orig-plain2-2.53/src/picture.c Wed Dec 2 16:01:34 1992 +--- plain2/src/picture.c Wed Jan 19 19:09:26 1994 +*************** +*** 1,6 **** +--- 1,10 ---- + /* + * Copyright (C) 1991,1992 NEC Corporation. + */ ++ /* ++ * modify by k-chinen@is.aist-nara.ac.jp, 1994 ++ */ ++ + #ifndef lint + + +*************** int end; +*** 627,632 **** +--- 631,669 ---- + int l; + int maxLen; + int minInd; ++ ++ #ifdef HTML ++ static int pic_count=0; ++ if(put == &htmlPut) { ++ if(htmlOnce) { ++ if(rawOutput) { ++ printf("<PRE>\n"); ++ for( l = begin; l < end; l++) { ++ htmlRawText(texts[l]->body); ++ } ++ printf("</PRE>\n"); ++ } ++ else { ++ printf("<!-- PICTURE -->\n"); ++ } ++ return ; ++ } ++ else { ++ printf("<!-- plain2:PICTURE %05d %d %d -->\n", ++ pic_count, begin, end); ++ if(htmlHere) { ++ printf("<P><IMG SRC=\"PIC%05d.gif\">\n", pic_count); ++ } ++ else { ++ printf("<P><B><A HREF=\"PIC%05d.gif\">Picture here</A></B></P>\n", ++ pic_count); ++ } ++ pic_count++; ++ return ; ++ } ++ } ++ #endif /* HTML */ ++ + minInd = minIndent(begin, end); + maxLen = maxLength(begin, end); + if ((maxLen - minInd) * fontSize > pageWidth) +diff -p -c -r -N orig-plain2-2.53/src/plain2.c plain2/src/plain2.c +*** orig-plain2-2.53/src/plain2.c Fri Jan 7 18:40:47 1994 +--- plain2/src/plain2.c Wed Jan 19 19:09:44 1994 +*************** +*** 1,6 **** +--- 1,10 ---- + /* + * Copyright (C) 1991,1992,1994 NEC Corporation. + */ ++ /* ++ * modify by k-chinen@is.aist-nara.ac.jp, 1994 ++ */ ++ + #ifndef lint + + +*************** static char rcsid[] = +*** 12,17 **** +--- 16,44 ---- + #include "plain2.h" + #include "macro.h" + ++ #ifdef HTML ++ #define PLAIN2_USAGE_1 "\ ++ usage: plain2 [options] [files ...]\n\n\ ++ ---- parser options ---- ---- output options ----(default)\n\ ++ -table=dd: table factor [0-100](def=50) -roff: troff output\n\ ++ -exam=dd: example factor[0-100](def=50) -ms/-mm: troff macro (mm)\n\ ++ -indsec: sections can be indented -tex: tex output\n\ ++ -ktable:enable JIS keisen table -tstyle=ss:tex style\n\ ++ -ref: figure/picture reference -html: HTML output\n\ ++ -htmlonce: HTML (one path) output\n\ ++ -here: HTML table/picture ref.\n\ ++ -renum: renumbering only\n\ ++ -[no]listd:list decoration (on)\n\ ++ ---- Others ---- -[no]space:spacing (on)\n\ ++ -v: verbose output -[no]pre: preamble block (on)\n\ ++ -dLevel: debug level -[no]acursec: section numbers (off)\n\ ++ ----- experimental ---- -raw: quote special chars(off)\n\ ++ -pt=Size: font size -jis: JIS code output\n\ ++ -sjis: Shift-JIS code input/output\n\ ++ -f file: output customization\n\n" ++ #define VERSION "plain2 r2.53 1994/01 by A.Uchida C&C Open Systems Lab. NEC\n\ ++ \t(HTML output) by k-chinen@is.aist-nara.ac.jp, NAIST" ++ #else + #define PLAIN2_USAGE_1 "\ + usage: plain2 [options] [files ...]\n\ + ---- parser options ---- ---- output options ----(default)\n\ +*************** usage: plain2 [options] [files ...]\n\ +*** 29,40 **** + -sjis: Shift-JIS code input/output\n\ + -f file: output customization\n" + #define VERSION "plain2 r2.54 1994/04 by A.Uchida NEC Corporation" + +! extern char *getenv(); + extern char *optarg; + extern int optind; + extern struct macDefs roffMacros[], roffMsMacros[]; + extern struct macDefs texMacros[]; + /* + * Default parameters for Parsing + */ +--- 56,72 ---- + -sjis: Shift-JIS code input/output\n\ + -f file: output customization\n" + #define VERSION "plain2 r2.54 1994/04 by A.Uchida NEC Corporation" ++ #endif + +! extern char *getenv(); + extern char *optarg; + extern int optind; + extern struct macDefs roffMacros[], roffMsMacros[]; + extern struct macDefs texMacros[]; ++ #ifdef HTML ++ extern struct macDefs htmlMacros[]; ++ #endif ++ + /* + * Default parameters for Parsing + */ +*************** int texQuote = 0; +*** 64,69 **** +--- 96,105 ---- + int fontSize = 10; + int fontSpecified = 0; + int verbose = 0; ++ #ifdef HTML ++ int htmlOnce = 0; ++ int htmlHere = 0; ++ #endif + char *plain2Lib = NULL; + char *macroName = NULL; + char *texStyle = NULL; +*************** doPlain2() +*** 163,176 **** + + if (firstTime) { + firstTime = 0; + if (put == &roffPut) { + if (roffMacro == MS_MACRO) + initMacroDefs(roffMsMacros); + initMacroDefs(roffMacros); + } +! else if (put == &texPut) + initMacroDefs(texMacros); +- if (put == &texPut) { + if (halfCooked) { + texSetTrans(0); + } +--- 199,224 ---- + + if (firstTime) { + firstTime = 0; ++ #ifdef HTML ++ if (put == &htmlPut) { ++ initMacroDefs(htmlMacros); ++ /* sorry, nothing is change this "if" */ ++ if (halfCooked) { ++ htmlSetTrans(0); ++ } ++ else { ++ htmlSetTrans(1); ++ } ++ } ++ else ++ #endif + if (put == &roffPut) { + if (roffMacro == MS_MACRO) + initMacroDefs(roffMsMacros); + initMacroDefs(roffMacros); + } +! else if (put == &texPut) { + initMacroDefs(texMacros); + if (halfCooked) { + texSetTrans(0); + } +*************** char **xargv; +*** 407,412 **** +--- 455,476 ---- + OUTPUT_OPTION("-alfraw"); + halfCooked = 1; + } ++ #ifdef HTML ++ else if (strcmp(optarg, "tmlonce") == 0) { ++ OUTPUT_OPTION("-htmlonce"); ++ htmlOnce = 1; ++ put = &htmlPut; ++ } ++ else if (strcmp(optarg, "tml") == 0) { ++ OUTPUT_OPTION("-html"); ++ htmlOnce = 0; ++ put = &htmlPut; ++ } ++ else if (strcmp(optarg, "ere") == 0) { ++ OUTPUT_OPTION("-here"); ++ htmlHere = 1; ++ } ++ #endif + else goto usage; + break; + case 't': +diff -p -c -r -N orig-plain2-2.53/src/plain2.h plain2/src/plain2.h +*** orig-plain2-2.53/src/plain2.h Fri Jan 7 05:34:50 1994 +--- plain2/src/plain2.h Wed Jan 19 19:10:16 1994 +*************** +*** 19,24 **** +--- 19,28 ---- + * 2.4: 28/04/92 + * 2.5: 06/08/93 + */ ++ /* ++ * modify by k-chinen@is.aist-nara.ac.jp, 1994 ++ */ ++ + #define NEC_CCS /* NEC C&C Common Software Lab. dependent */ + + #define NTT_TEX /* NTT jlatex */ +*************** extern int accurateSecnum; /* Accurate +*** 203,208 **** +--- 207,216 ---- + extern int listDecor; /* List decoration */ + extern int reflectSpace; /* reflect space lines */ + extern int texQuote; /* Use \verb| | for tex output */ ++ #ifdef HTML ++ extern int htmlOnce; /* One/Multi-path flag for HTML */ ++ extern int htmlHere; /* flag of pic/tbl here or not */ ++ #endif + extern int indexEnabled; /* Enables Indexing */ + extern int fontSize; /* font size */ + extern int fontSpecified; /* font size specified */ +*************** struct outDev { +*** 309,314 **** +--- 317,325 ---- + }; + extern struct outDev roffPut; + extern struct outDev texPut; ++ #ifdef HTML ++ extern struct outDev htmlPut; ++ #endif + extern struct outDev *put; + + #define INLINE_BEGIN "((" +diff -p -c -r -N orig-plain2-2.53/src/plain2html plain2/src/plain2html +*** orig-plain2-2.53/src/plain2html +--- plain2/src/plain2html Sun Aug 14 02:27:11 1994 +*************** +*** 0 **** +--- 1,159 ---- ++ #!/usr/local/bin/tcsh ++ # ++ # plain2html: plain text to HTML file ++ # by k-chinen@is.aist-nara.ac.jp , 1994 ++ # ++ # NOTE: ++ # * This script will be running under csh or tcsh. ++ # * Handle with care for directory, because this script make ++ # a lot of temporary file and output file. ++ # ++ ++ ++ # ++ # require: ++ # ++ # program: ++ # csh or tcsh ++ # plain2 ( have -html option verison ) ++ # awk ++ # groff ( gtbl, gpic ) ++ # latex or jlatex ++ # dvi2ps ++ # convert ( convertable PS to Any-format version ) ++ # pnmcrop ( included PBMPLUS ) ++ # ghostscript ( called by convert when convert PS format ) ++ # ++ # script: ++ # pt2htcol.awk ( included this packeage ) ++ # ++ # ++ # input: ++ # $1 (plain text file name. e.g., README.j) ++ # ++ # output: ++ # $1:r.html (e.g., README.html) ++ # ++ # temporary file: ++ # _src, _cut.sh , _out.html , pt2empty.sty, _tmp.pnm ++ # TBL*.p TBL*.ps TBL*.src TBL*.tex TBL*.dvi TBL*.pnm ++ # PIC*.p PIC*.ps PIC*.src PIC*.tex PIC*.dvi PIC*.pnm ++ # ++ ++ ++ # ++ # Default values ++ # ++ set tex=1 ++ set roff=0 ++ set lib=/usr/local/lib/plain2 ++ ++ ++ # ++ # Check args. ++ # ++ if ( $#argv > 0 ) then ++ switch ($1) ++ case -tex: ++ set tex=1 ++ set roff=0 ++ shift ++ breaksw ++ case -roff: ++ set tex=0 ++ set roff=1 ++ shift ++ breaksw ++ default: ++ breaksw ++ endsw ++ endif ++ ++ if ( $#argv > 0 ) then ++ set target=$1 ++ else ++ cat << END_USAGE ++ plain2html: plain text to HTML file ++ by k-chinen@is.aist-nara.ac.jp NAIST , 1994 ++ ++ usage: plain2html [option] input-filename ++ ++ option: -tex TeX mode (use latex, dvi2ps) [defauts] ++ -roff roff mode (use groff) ++ ++ END_USAGE ++ exit ++ endif ++ ++ ++ ++ # ++ # Start ++ # convert document's main body. ++ # collect table/picture location and cut these. ++ # ++ ++ echo "Copy Target $target ." ++ cp $target _src ++ ++ echo "Process document main body" ++ plain2 -html -jis -here _src > _out.html ++ ++ echo "Collect Table/Picutre" ++ awk -f $lib/pt2htcol.awk _out.html > _cut.sh ++ ++ ++ ++ # ++ # Convert parts(table/picture) via LaTeX ++ # If you don't have jlatex substitute to "latex". ++ # ( jlatex is Japanese LaTeX ) ++ # ++ if ( $tex ) then ++ cat << END_STYLEFILE > pt2empty.sty ++ \\thispagestyle{empty} ++ \\pagestyle{empty} ++ END_STYLEFILE ++ cat << END_TEX_CUT >> _cut.sh ++ foreach i ( TBL*.p PIC*.p ) ++ echo "Part \$i process" ++ plain2 -tex -jis -tstyle=pt2empty \$i > \$i:r.tex ++ jlatex \$i:r.tex ++ dvi2ps \$i:r.dvi > \$i:r.ps ++ convert -density 144x144 \$i:r.ps \$i:r.pnm ++ pnmcrop -white \$i:r.pnm > _tmp.pnm ++ convert _tmp.pnm \$i:r.gif ++ rm -f \$i:r.ps \$i:r.dvi \$i:r.aux \$i:r.log \$i:r.tex \$i:r.p \$i:r.pnm ++ end ++ END_TEX_CUT ++ endif ++ ++ # ++ # Convert parts(table/picture) via GROFF ++ # If you don't have gorff substitute to ROFF-like program. ++ # ++ if ( $roff ) then ++ cat << END_ROFF_CUT >> _cut.sh ++ foreach i ( TBL*.p PIC*.p ) ++ echo "Part \$i process" ++ plain2 -roff -euc \$i > \$i:r.src ++ groff -me -t -p \$i:r.src > \$i:r.ps ++ convert -density 144x144 \$i:r.ps \$i:r.pnm ++ pnmcrop -white \$i:r.pnm > _tmp.pnm ++ convert _tmp.pnm \$i:r.gif ++ rm -f \$i:r.ps \$i:r.src \$i:r.p \$i:r.pnm ++ end ++ END_ROFF_CUT ++ endif ++ ++ # ++ # Run parts conversion script ++ # ++ echo "Cut Table/Picture" ++ $shell _cut.sh ++ ++ rm -f $target:r.html ++ mv _out.html $target:r.html ++ rm -f _cut.sh pt2empty.sty _src _tmp.pnm ++ ++ echo "Complete" +diff -p -c -r -N orig-plain2-2.53/src/pt2htcol.awk plain2/src/pt2htcol.awk +*** orig-plain2-2.53/src/pt2htcol.awk +--- plain2/src/pt2htcol.awk Wed Jan 19 11:20:18 1994 +*************** +*** 0 **** +--- 1,20 ---- ++ # ++ # pt2htcol.awk: plain2html's parts collection awk-script. ++ # by k-chinen@is.aist-nara.ac.jp , 1994 ++ # ++ # plain2's (with -html) output have "plain2:TABLE" and "plain2:PICTURE" ++ # sentence. It is mean that output have link to TABLE and PICTURE. ++ # Therefore, this script collect such sentence and make cutting script. ++ # ++ BEGIN{ ++ } ++ /^<!-- plain2:TABLE/{ ++ # print "# " $0 ++ printf "# table %d th, start %d, end %d\n", $3, $4, $5 ++ printf "head -%d _src| tail -%d > TBL%05d.p\n",$5, $5-$4+1, $3 ++ } ++ /^<!-- plain2:PICTURE/{ ++ # print "# " $0 ++ printf "# picture %d th, start %d, end %d\n", $3, $4, $5 ++ printf "head -%d _src| tail -%d > PIC%05d.p\n",$5, $5-$4+1, $3 ++ } --- plain2-2.54p1.orig/debian/patch/patch-2 +++ plain2-2.54p1/debian/patch/patch-2 @@ -0,0 +1,30 @@ +--- Makefile.orig Tue Oct 20 15:28:18 1998 ++++ Makefile Tue Oct 20 15:32:29 1998 +@@ -16,7 +16,7 @@ + #CFLAGS= -fwritable-strings ${DEFINES} -DBSD -DDEBUG + + CC=cc +-CFLAGS= -O ${DEFINES} -DBSD -DDEBUG ++CFLAGS= -O -fwritable-strings ${DEFINES} -DBSD -DDEBUG + #CFLAGS= -g ${DEFINES} -DDEBUG + + SRCS=plain2.c readfile.c analyze.c miscutil.c\ +--- plain2.h.orig Tue Oct 20 15:34:59 1998 ++++ plain2.h Tue Oct 20 15:35:25 1998 +@@ -25,14 +25,14 @@ + + #define NEC_CCS /* NEC C&C Common Software Lab. dependent */ + +-#define NTT_TEX /* NTT jlatex */ ++#undef NTT_TEX /* NTT jlatex */ + + #define TITLE_SPECIAL + + #define PLAIN2_ENV "PLAIN2_INIT" + #define PLAIN2_LIB "PLAIN2_LIB" + +-#define MACRO_LIB "/usr/local/lib/plain2" ++#define MACRO_LIB "/usr/lib/plain2" + + #define MIN_INDENT 4 /* minimum indentation to be indented region */ + #define MIN_SPACING 4 /* minimum number of lines to be space region*/ --- plain2-2.54p1.orig/debian/patch/patch-3 +++ plain2-2.54p1/debian/patch/patch-3 @@ -0,0 +1,51 @@ +--- plain2.pln.orig Tue Feb 9 10:02:22 1999 ++++ plain2.pln Tue Feb 9 10:04:11 1999 +@@ -8,7 +8,7 @@ + \vspace{1cm} + べた書き入力による文書清書システム\\ + \vspace{1cm} +-\epsfile{file=logo.eps}\\ ++\epsfbox{logo.eps}\\ + \vspace{0.2cm} + \Huge + {\bf r2.5\\ユーザガイド\\} +@@ -1845,7 +1845,7 @@ + + [[R + ~\\ +-\epsfile{file=modules.eps}\\ ++\epsfbox{modules.eps}\\ + ]]R + + 6.1. LaTeX出力 +@@ -2272,7 +2272,7 @@ + [[R + ~\\ + \mbox{}\begin{center} +-\epsfile{file=tgif_win.eps}\\ ++\epsfbox{tgif_win.eps}\\ + \end{center} + ]]R + +--- tgif_doc.pln.orig Tue Feb 9 10:02:36 1999 ++++ tgif_doc.pln Tue Feb 9 10:04:57 1999 +@@ -6,7 +6,7 @@ + [[R + \begin{figure}[h] + \begin{center} +-\epsfile{file=tgif_fig.eps} ++\epsfbox{tgif_fig.eps} + \end{center} + \end{figure} + ]]R +--- Tgif_doc.tex.orig Tue Feb 9 10:02:46 1999 ++++ Tgif_doc.tex Tue Feb 9 10:05:19 1999 +@@ -11,7 +11,7 @@ + \medskip + + \begin{center} +-\epsfile{file=tgif_fig.eps} ++\epsfbox{tgif_fig.eps} + \end{center} + \medskip + \par --- plain2-2.54p1.orig/debian/patch/patch-3.old +++ plain2-2.54p1/debian/patch/patch-3.old @@ -0,0 +1,83 @@ +diff -ur doc.orig/Beginning.tex doc/Beginning.tex +--- doc.orig/Beginning.tex Mon May 11 14:25:37 1998 ++++ doc/Beginning.tex Mon May 11 12:44:43 1998 +@@ -9,7 +9,7 @@ + } + \medskip + +-{\large \dg\bf\addtocounter{sectionx}{1}\setcounter{subsectionx}{0}{\thesectionx} ようこそ plain2 の世界へ} ++{\large \bf\addtocounter{sectionx}{1}\setcounter{subsectionx}{0}{\thesectionx} ようこそ plain2 の世界へ} + \medskip + \par + TeXなんて書けない,読めない.そんなユーザの声に応える +@@ -27,7 +27,7 @@ + \endlist} + \medskip + +-{\normalsize \dg\bf\addtocounter{subsectionx}{1}\setcounter{subsubsectionx}{0}{\thesectionx}.{\thesubsectionx} 多様なリスト} ++{\normalsize \bf\addtocounter{subsectionx}{1}\setcounter{subsubsectionx}{0}{\thesectionx}.{\thesubsectionx} 多様なリスト} + \medskip + \par + いろいろなリストが書けます.ネストもできます. +@@ -45,7 +45,7 @@ + \medskip + \end{itemize} + +-{\normalsize \dg\bf\addtocounter{subsectionx}{1}\setcounter{subsubsectionx}{0}{\thesectionx}.{\thesubsectionx} テーブルと線画の機能} ++{\normalsize \bf\addtocounter{subsectionx}{1}\setcounter{subsubsectionx}{0}{\thesectionx}.{\thesubsectionx} テーブルと線画の機能} + \medskip + \par + plain2ならテーブルも簡単に書けます +diff -ur doc.orig/Makefile doc/Makefile +--- doc.orig/Makefile Mon May 11 14:25:37 1998 ++++ doc/Makefile Mon May 11 14:26:18 1998 +@@ -45,7 +45,7 @@ + RAWTEXFILES=Tgif_doc.tex Beginning.tex Hint_all.tex \ + Example_adjust2.tex + +-PRTGIF=prtgif+ ++PRTGIF=prtgif + PLAIN2=../src/plain2 + VERBTEXFILES= + +@@ -53,8 +53,8 @@ + dvi2ps -p400 plain2.dvi > $@ + + plain2.dvi: ${SAMPLES} ${RAWTEXFILES} ${OTHERFILES} plain2.tex +- jlatex plain2.tex +- jlatex plain2.tex ++ ajlatex plain2.tex ++ ajlatex plain2.tex + + plain2.tex: plain2.pln guide.p2 + $(PLAIN2) -tex -ref -fguide plain2.pln > plain2.tex +@@ -63,7 +63,7 @@ + rm -f ${SAMPLES} ${OTHERFILES} plain2.tex plain2.dvi plain2.ps \ + plain2.toc plain2.aux plain2.log + +-title_a47.tex title_shounin.tex: ++title_a47.tex title_shounin.tex: title_a47.pln + $(PLAIN2) -tex -fexampl_left $< > $@ + + table_kanji.tex: table_kanji.pln +diff -ur doc.orig/Tgif_doc.tex doc/Tgif_doc.tex +--- doc.orig/Tgif_doc.tex Mon May 11 14:25:37 1998 ++++ doc/Tgif_doc.tex Mon May 11 12:42:36 1998 +@@ -2,7 +2,7 @@ + \hspace*{2cm}\framebox[13.5cm][l]{~~\begin{minipage}{12cm} + \setcounter{sectionx}{0}{\small\baselineskip=10pt + +-{\large \dg\bf\addtocounter{sectionx}{1}\setcounter{subsectionx}{0}{\thesectionx} tgif+ の利用} ++{\large \bf\addtocounter{sectionx}{1}\setcounter{subsectionx}{0}{\thesectionx} tgif+ の利用} + \medskip + \par + tgif+ で書いた絵を次のようにして +diff -ur doc.orig/guide.p2 doc/guide.p2 +--- doc.orig/guide.p2 Mon May 11 14:25:37 1998 ++++ doc/guide.p2 Mon May 11 13:06:36 1998 +@@ -1,4 +1,4 @@ +-DOC_BEGIN "\\documentstyle[epsf]{jarticle}\n\ ++DOC_BEGIN "\\documentstyle[a4j,eclepsf]{jarticle}\n\ + \\setcounter{secnumdepth}{6}\n\ + \\setcounter{tocdepth}{6}\n\ + \\topsep=0.1cm\n\ --- plain2-2.54p1.orig/debian/patch/patch-4 +++ plain2-2.54p1/debian/patch/patch-4 @@ -0,0 +1,17 @@ +--- plain2html.orig Thu Oct 22 15:10:35 1998 ++++ plain2html Thu Oct 22 15:10:35 1998 +@@ -1,4 +1,4 @@ +-#!/usr/local/bin/tcsh ++#!/usr/bin/tcsh + # + # plain2html: plain text to HTML file + # by k-chinen@is.aist-nara.ac.jp , 1994 +@@ -46,7 +46,7 @@ + # + set tex=1 + set roff=0 +-set lib=/usr/local/lib/plain2 ++set lib=/usr/lib/plain2 + + + # --- plain2-2.54p1.orig/debian/patch/patch-5 +++ plain2-2.54p1/debian/patch/patch-5 @@ -0,0 +1,803 @@ +diff -ur plain2.org/doc/Beginning.tex plain2/doc/Beginning.tex +--- plain2.org/doc/Beginning.tex Sat Feb 6 07:35:13 1999 ++++ plain2/doc/Beginning.tex Sat Feb 6 08:34:14 1999 +@@ -9,7 +9,7 @@ + } + \medskip + +-{\large \dg\bf\addtocounter{sectionx}{1}\setcounter{subsectionx}{0}{\thesectionx} ようこそ plain2 の世界へ} ++{\large \bf\addtocounter{sectionx}{1}\setcounter{subsectionx}{0}{\thesectionx} ようこそ plain2 の世界へ} + \medskip + \par + TeXなんて書けない,読めない.そんなユーザの声に応える +@@ -24,10 +24,10 @@ + \ \ \ \ \ \ \ \ ...\\ + \%~xdvi~example.dvi\\ + } +-\endlist} ++\mbox{}\endlist} + \medskip + +-{\normalsize \dg\bf\addtocounter{subsectionx}{1}\setcounter{subsubsectionx}{0}{\thesectionx}.{\thesubsectionx} 多様なリスト} ++{\normalsize \bf\addtocounter{subsectionx}{1}\setcounter{subsubsectionx}{0}{\thesectionx}.{\thesubsectionx} 多様なリスト} + \medskip + \par + いろいろなリストが書けます.ネストもできます. +@@ -45,12 +45,12 @@ + \medskip + \end{itemize} + +-{\normalsize \dg\bf\addtocounter{subsectionx}{1}\setcounter{subsubsectionx}{0}{\thesectionx}.{\thesubsectionx} テーブルと線画の機能} ++{\normalsize \bf\addtocounter{subsectionx}{1}\setcounter{subsubsectionx}{0}{\thesectionx}.{\thesubsectionx} テーブルと線画の機能} + \medskip + \par + plain2ならテーブルも簡単に書けます + ~\\ +-\begin{center} ++\mbox{}\begin{center} + \begin{tabular}{|c|c|c|c|} + \hline + & べた書き & マークアップ & ワープロ\\ +@@ -63,7 +63,7 @@ + \end{center} + \medskip + ~\\ +-\begin{center} ++\mbox{}\begin{center} + \begin{picture}(288,120)(0,0) + \put(3,97){簡単な絵くらいは書けます.} + \thinlines +diff -ur plain2.org/doc/Example_adjust2.tex plain2/doc/Example_adjust2.tex +--- plain2.org/doc/Example_adjust2.tex Sat Feb 6 07:19:47 1999 ++++ plain2/doc/Example_adjust2.tex Sat Feb 6 08:34:14 1999 +@@ -19,5 +19,5 @@ + cc $-$DKANJI $-$DPICTURE $-$DBSD $-$DDEBUG $-$target sun4 $-$c hint.c\\ + cc $-$DKANJI $-$DPICTURE $-$DBSD $-$DDEBUG $-$target sun4 $-$c justify.c\\ + cc $-$DKANJI $-$DPICTURE $-$DBSD $-$DDEBUG $-$target sun4 $-$c texout.c\\ +-\endlist} ++\mbox{}\endlist} + }\end{minipage}}\\ +diff -ur plain2.org/doc/Makefile plain2/doc/Makefile +--- plain2.org/doc/Makefile Sat Feb 6 07:35:13 1999 ++++ plain2/doc/Makefile Sat Feb 6 08:34:14 1999 +@@ -46,7 +46,7 @@ + Example_adjust2.tex + + PRTGIF=prtgif+ +-PLAIN2=../src/plain2 ++PLAIN2=../src/plain2 -tstyle=a4j -jverb + VERBTEXFILES= + + plain2.ps: plain2.dvi +@@ -63,7 +63,10 @@ + rm -f ${SAMPLES} ${OTHERFILES} plain2.tex plain2.dvi plain2.ps \ + plain2.toc plain2.aux plain2.log + +-title_a47.tex title_shounin.tex: ++title_a47.tex: title_a47.raw ++ $(PLAIN2) -tex -fexampl_left $< > $@ ++ ++title_shounin.tex: title_shounin.raw + $(PLAIN2) -tex -fexampl_left $< > $@ + + table_kanji.tex: table_kanji.pln +diff -ur plain2.org/doc/Tgif_doc.tex plain2/doc/Tgif_doc.tex +--- plain2.org/doc/Tgif_doc.tex Sat Feb 6 07:35:13 1999 ++++ plain2/doc/Tgif_doc.tex Sat Feb 6 08:34:14 1999 +@@ -2,11 +2,11 @@ + \hspace*{2cm}\framebox[13.5cm][l]{~~\begin{minipage}{12cm} + \setcounter{sectionx}{0}{\small\baselineskip=10pt + +-{\large \dg\bf\addtocounter{sectionx}{1}\setcounter{subsectionx}{0}{\thesectionx} tgif+ の利用} ++{\large \bf\addtocounter{sectionx}{1}\setcounter{subsectionx}{0}{\thesectionx} tgif+ の利用} + \medskip + \par + tgif+ で書いた絵を次のようにして +-べた書き文書に取り込みます.\\ ++べた書き文書に取り込みます.\\\mbox{} + + \medskip + +diff -ur plain2.org/doc/exampl.p2 plain2/doc/exampl.p2 +--- plain2.org/doc/exampl.p2 Sat Feb 6 07:19:47 1999 ++++ plain2/doc/exampl.p2 Sat Feb 6 08:34:14 1999 +@@ -7,6 +7,8 @@ + + EXAM_BEGIN "{\\baselineskip=#1pt\n\\tt\\obeylines\\catcode` =11\n" + EXAM_END "}\n", ++JEXAM_BEGIN "{\\baselineskip=#1pt\n\\tt\\obeylines\\catcode` =11\n" ++JEXAM_END "}\n", + BOLD_BEGIN, "{\\bf " + + SECTION_1 "\n{\\normalsize \\bf\\addtocounter{sectionx}{1}\ +diff -ur plain2.org/doc/exampl_star.p2 plain2/doc/exampl_star.p2 +--- plain2.org/doc/exampl_star.p2 Sat Feb 6 07:19:47 1999 ++++ plain2/doc/exampl_star.p2 Sat Feb 6 08:34:14 1999 +@@ -7,6 +7,8 @@ + + EXAM_BEGIN "{\\baselineskip=#1pt\n\\tt\\obeylines\\catcode` =11\n" + EXAM_END "}\n", ++JEXAM_BEGIN "{\\baselineskip=#1pt\n\\tt\\obeylines\\catcode` =11\n" ++JEXAM_END "}\n", + + SECTION_1 "\n\\section*{@1}\n" + SECTION_2 "\n\\subsection*{@1}\n" +diff -ur plain2.org/doc/guide.p2 plain2/doc/guide.p2 +--- plain2.org/doc/guide.p2 Sat Feb 6 07:35:13 1999 ++++ plain2/doc/guide.p2 Sat Feb 6 08:34:14 1999 +@@ -1,4 +1,10 @@ +-DOC_BEGIN "\\documentstyle[epsf]{jarticle}\n\ ++DOC_BEGIN "\ ++ \\newif\\ifNTT\\NTTfalse\n\ ++ \\ifx\\gtfam\\undefined\\ifx\\gtfamily\\undefined\\NTTtrue\\fi\\fi\n\ ++ \\ifNTT\\documentstyle[$2,epsf]{j-article}\n\ ++ \\else\\documentstyle[$3,epsf]{jarticle}\\fi\n\ ++ \\advance\\textwidth1.4cm \\advance\\oddsidemargin-.7cm\n\ ++ \\advance\\textheight2cm \\advance\\topmargin-1cm\n\ + \\setcounter{secnumdepth}{6}\n\ + \\setcounter{tocdepth}{6}\n\ + \\topsep=0.1cm\n\ +@@ -15,12 +21,12 @@ + \\let\\@mkboth=\\@gobbletwo\n\ + \\def\\@evenhead{}\\def\\@evenfoot{}%\n\ + \\def\\@oddhead{\\makebox[\\textwidth]%\n\ +- {\\ plain2ユーザガイド(r2.5)\\hfill\\thesection\\ 章}}%\n\ ++ {plain2ユーザガイド(r2.5)\\hfill\\thesection\\ 章}}%\n\ + \\def\\@oddfoot{\\makebox[\\textwidth]%\n\ +- {\\rightmark\\leaders\\hbox{\\tiny ~plain2}\\hfill}\\ \\thepage}}\n\ +- \\@ifundefined{jintercharskip}{%\n\ +- \\def\\p2zerointerskip{\\kanjiskip=0cm}}{%\n\ +- \\def\\p2zerointerskip{\\jintercharskip=0cm}}\n\ ++ {\\rightmark\\leaders\\hbox{\\tiny ~plain2}\\hfill\\ \\thepage}}}\n\ ++ %\\@ifundefined{jintercharskip}{%\n\ ++ % \\def\\p2zerointerskip{\\kanjiskip=0cm}}{%\n\ ++ % \\def\\p2zerointerskip{\\jintercharskip=0cm}}\n\ + \\makeatother\n" + SECTION_1 "\n\ + \\section{@1}\ +diff -ur plain2.org/doc/plain2.pln plain2/doc/plain2.pln +--- plain2.org/doc/plain2.pln Sat Feb 6 07:19:47 1999 ++++ plain2/doc/plain2.pln Sat Feb 6 08:34:14 1999 +@@ -377,6 +377,7 @@ + + [[R + \input{picture_intro.tex} ++\mbox{} % to avoid `Underfull \hbox (badness 10000)' + ]]R + + 3. plain2 コマンド +@@ -2270,7 +2271,7 @@ + "tgif_fig.eps"とします. + [[R + ~\\ +-\begin{center} ++\mbox{}\begin{center} + \epsfile{file=tgif_win.eps}\\ + \end{center} + ]]R +diff -ur plain2.org/doc/pln2raw plain2/doc/pln2raw +--- plain2.org/doc/pln2raw Sat Feb 6 07:19:47 1999 ++++ plain2/doc/pln2raw Sat Feb 6 08:34:14 1999 +@@ -9,22 +9,25 @@ + LNUM= + while getopts n c + do +- case $c in ++ case "$c" in + n) LNUM="on" + shift + ;; + esac + done + +-echo '{\list{}{\leftmargin=0.5in}\item[]' +-echo '{\baselineskip=10pt' +-echo '\p2zerointerskip' +-echo '\begin{verbatim}' ++cat <<'EOF' ++{\list{}{\leftmargin=0.5in}\item[] ++{\par\baselineskip=10pt ++\begin{jverbatim} ++EOF + if [ "$LNUM" = "on" ] + then +- awk '{printf "%3d: %s\n",NR,$0}' $1 ++ awk '{printf "%3d: %s\n",NR,$0}' ${1+"$@"} + else +- cat $1 ++ cat ${1+"$@"} + fi | expand +-echo '\end{verbatim}}' +-echo '\endlist}' ++cat <<'EOF' ++\end{jverbatim}\par} ++\endlist} ++EOF +diff -ur plain2.org/doc/table_adjust.texv plain2/doc/table_adjust.texv +--- plain2.org/doc/table_adjust.texv Sat Feb 6 07:19:47 1999 ++++ plain2/doc/table_adjust.texv Sat Feb 6 08:34:14 1999 +@@ -1,7 +1,7 @@ + {\list{}{\leftmargin=0.5in}\item[] + {\baselineskip=10pt +-\jintercharskip=0cm +-\begin{verbatim} ++\par ++\begin{jverbatim} + % plain2 -tex -nopre table_adjust.pln + \par + 次のように枠のないテーブルは, +@@ -12,5 +12,5 @@ + 明示的に指定する "[[T"と"]]T" + そのまま我慢する 多分例示になる + \endlist} +-\end{verbatim}} ++\end{jverbatim}\par} + \endlist} +diff -ur plain2.org/lib/jbook.p2 plain2/lib/jbook.p2 +--- plain2.org/lib/jbook.p2 Sat Feb 6 07:19:47 1999 ++++ plain2/lib/jbook.p2 Sat Feb 6 08:34:14 1999 +@@ -3,7 +3,11 @@ + # + # + # +-DOC_BEGIN "\\documentstyle[]{jbook}\n\ ++DOC_BEGIN "\ ++\\newif\\ifNTT\\NTTfalse\n\ ++\\ifx\\gtfam\\undefined\\ifx\\gtfamily\\undefined\\NTTtrue\\fi\\fi\n\ ++\\ifNTT\\documentstyle[$2]{j-book}\n\ ++\\else\\documentstyle[$3]{jbook}\\fi\n\ + \\setcounter{secnumdepth}{6}\n\ + \\setcounter{tocdepth}{6}\n\ + \\topsep=0.1cm\n\ +diff -ur plain2.org/src/Makefile plain2/src/Makefile +--- plain2.org/src/Makefile Sat Feb 6 07:35:14 1999 ++++ plain2/src/Makefile Sat Feb 6 08:34:14 1999 +@@ -12,11 +12,11 @@ + + DEFINES=-DKANJI -DPICTURE -DHTML + +-#CC=gcc +-#CFLAGS= -fwritable-strings ${DEFINES} -DBSD -DDEBUG ++CC=gcc ++CFLAGS= -fwritable-strings ${DEFINES} -DBSD -DDEBUG -O2 -s + +-CC=cc +-CFLAGS= -O -fwritable-strings ${DEFINES} -DBSD -DDEBUG ++#CC=cc ++#CFLAGS= -O -fwritable-strings ${DEFINES} -DBSD -DDEBUG + #CFLAGS= -g ${DEFINES} -DDEBUG + + SRCS=plain2.c readfile.c analyze.c miscutil.c\ +diff -ur plain2.org/src/headfoot.c plain2/src/headfoot.c +--- plain2.org/src/headfoot.c Sat Feb 6 07:19:47 1999 ++++ plain2/src/headfoot.c Sat Feb 6 08:34:14 1999 +@@ -282,6 +282,8 @@ + } + /* + * Build and print Header/Footer string for troff output ++ * (Note: This function returns a pointer to a static buffer which will be ++ * re-written at next call) + */ + extern struct transTable roffTransQ[]; + char * +@@ -290,7 +292,7 @@ + { + char left[HF_MAXLEN]; + char right[HF_MAXLEN]; +- char ret[64]; ++ static char ret[64]; + if (build(pat1, pat2, left, right)) { + (void)strcpy(ret, codeCvt(textQuote(left, roffTransQ))); + (void)strcat(ret, "\\\\\\\\nP"); +diff -ur plain2.org/src/hint.c plain2/src/hint.c +--- plain2.org/src/hint.c Sat Feb 6 07:19:47 1999 ++++ plain2/src/hint.c Sat Feb 6 08:34:14 1999 +@@ -47,7 +47,7 @@ + } + hp++; + } +- return NULL; ++ return 0; + } + hint(begin, end) + int begin; +diff -ur plain2.org/src/macro.c plain2/src/macro.c +--- plain2.org/src/macro.c Sat Feb 6 07:35:14 1999 ++++ plain2/src/macro.c Sat Feb 6 08:34:14 1999 +@@ -15,12 +15,14 @@ + #define MACRO_SUFFIX ".p2" + + struct macNames macNames[] = { +- "DOC_BEGIN", M_DOC_BEGIN, "#$", ++ "DOC_BEGIN", M_DOC_BEGIN, "#$$", + "DOC_END", M_DOC_END, "", + "PLAIN_BEGIN", M_PLAIN_BEGIN, "", + "PLAIN_END", M_PLAIN_END, "", + "EXAM_BEGIN", M_EXAM_BEGIN, "#", + "EXAM_END", M_EXAM_END, "", ++ "JEXAM_BEGIN", M_JEXAM_BEGIN, "#", ++ "JEXAM_END", M_JEXAM_END, "", + "SET_SEC", M_SET_SEC, "#$", + "APPENDIX", M_APPENDIX, "$", + "APDX_BEGIN", M_APDX_BEGIN, "", +@@ -86,12 +88,18 @@ + struct cmpMac *mip, *new_mip; + int def_type; + mip = (struct cmpMac *)malloc(sizeof(struct cmpMac)); ++ if(mip == NULL){ /* Add Nide */ ++ malloc_error: ++ fprintf(stderr, "PANIC(malloc in macroParse)\n"); ++ exit (2); ++ } + mip->cmac_next = NULL; + mip->cmac_argnum = -1; + mip->cmac_str = s; + while (*s) { + if (isdigit(*(s+1)) && (def_type = atype(*s)) != ATYPE_VOID) { + new_mip=(struct cmpMac *)malloc(sizeof(struct cmpMac)); ++ if(new_mip == NULL) goto malloc_error; /* Add Nide */ + mip->cmac_next = new_mip; + new_mip->cmac_next = NULL; + new_mip->cmac_argtype = *s; +@@ -369,8 +377,7 @@ + } + if (ret == -1) + continue; +- s = (char *)malloc(strlen(defstr)+1); +- strcpy(s, defstr); ++ s = strsave(defstr); /* Changed Nide (but don't we need free?)*/ + outMacro[macroNum] = macroParse(s, macroNum, s); + } + fclose(fd); +diff -ur plain2.org/src/macro.h plain2/src/macro.h +--- plain2.org/src/macro.h Sat Feb 6 07:19:47 1999 ++++ plain2/src/macro.h Sat Feb 6 08:34:14 1999 +@@ -10,29 +10,31 @@ + #define M_PLAIN_END 3 + #define M_EXAM_BEGIN 4 + #define M_EXAM_END 5 +-#define M_SET_SEC 6 +-#define M_APPENDIX 7 +-#define M_APDX_BEGIN 8 +-#define M_BLANK 9 +-#define M_PAGE 10 +-#define M_NEWLINE 11 +-#define M_CENTER_BEGIN 12 +-#define M_CENTER_END 13 +-#define M_RIGHT_BEGIN 14 +-#define M_RIGHT_END 15 +-#define M_INDENT 16 +-#define M_INDENT0 17 +-#define M_TITLE 18 +-#define M_FOOTN_BEGIN 19 +-#define M_FOOTN_END 20 +-#define M_REFER_BEGIN 21 +-#define M_REFER_END 22 +-#define M_BOLD_BEGIN 23 +-#define M_BOLD_END 24 +-#define M_INDEX_BEGIN 25 +-#define M_INDEX_END 26 +-#define M_SECTION_END 27 +-#define M_SECTION_1 28 ++#define M_JEXAM_BEGIN 6 /* Inserted by Nide */ ++#define M_JEXAM_END 7 /* Inserted by Nide */ ++#define M_SET_SEC 8 ++#define M_APPENDIX 9 ++#define M_APDX_BEGIN 10 ++#define M_BLANK 11 ++#define M_PAGE 12 ++#define M_NEWLINE 13 ++#define M_CENTER_BEGIN 14 ++#define M_CENTER_END 15 ++#define M_RIGHT_BEGIN 16 ++#define M_RIGHT_END 17 ++#define M_INDENT 18 ++#define M_INDENT0 19 ++#define M_TITLE 20 ++#define M_FOOTN_BEGIN 21 ++#define M_FOOTN_END 22 ++#define M_REFER_BEGIN 23 ++#define M_REFER_END 24 ++#define M_BOLD_BEGIN 25 ++#define M_BOLD_END 26 ++#define M_INDEX_BEGIN 27 ++#define M_INDEX_END 28 ++#define M_SECTION_END 29 ++#define M_SECTION_1 30 + #define M_SECTION_2 (M_SECTION_1 + 1) + #define M_SECTION_3 (M_SECTION_1 + 2) + #define M_SECTION_4 (M_SECTION_1 + 3) +diff -ur plain2.org/src/output.c plain2/src/output.c +--- plain2.org/src/output.c Sat Feb 6 07:35:14 1999 ++++ plain2/src/output.c Sat Feb 6 08:34:14 1999 +@@ -452,12 +452,19 @@ + + texts[begin]->indent + + texts[begin]->headLen, capsule); + PRINTED(begin); +- if (!capsule) ++ if (!capsule){ ++ if(texts[begin]->indent && put == &texPut){ ++ /* この場合、texFTitle()の出力が「\\」で終わっており、 ++ 次のputIndent()が「\endlist」を出力する直前に ++ 「\mbox{}」を入れてunderfull hboxの警告を抑える */ ++ printf("\\mbox{}"); ++ } + putIndent(IND_RESUME, 0); ++ } + break; + case TB_QUOTE: + case TB_EXAMPLE: +- putMacro(M_EXAM_BEGIN, fontSize); ++ putMacro(useJverb ? M_JEXAM_BEGIN : M_EXAM_BEGIN, fontSize); + for (i = begin; i < end; i++) { + PRINTED(i); + if (texts[i]->blank) +@@ -465,7 +472,7 @@ + else + (*put->example)(texts[i]->body + listIndent); + } +- putMacro(M_EXAM_END); ++ putMacro(useJverb ? M_JEXAM_END : M_EXAM_END); + break; + case TB_LISTHD: + printf("ERROR(List Output%d)%s\n", begin, texts[begin]->body); +@@ -496,17 +503,40 @@ + case TB_TABLE: + { + int center; ++ int indent_amount = 0; ++ + if (!capsule) { + center = isCenter(begin, end); + (*put->capsule)(BEGIN, FT_TABLE, center); +- if (!center) +- putIndent(IND_INDENT, +- texts[begin]->indent / 2); ++ if (!center){ ++ indent_amount = ++ texts[begin]->indent / 2; ++ ++ if(!crossRefer && put == &texPut && ++ indent_amount){ ++ /* この場合、texCapsule()の出力が ++ 「\\」で終わっており、次の ++ putIndent()が「{\list{}…」を出力 ++ する直前に「\mbox{}」を入れて ++ underfull hboxの警告を抑える */ ++ printf("\\mbox{}"); ++ } ++ putIndent(IND_INDENT, indent_amount); ++ } + } + tblOutput(begin, end); + if (!capsule) { +- if (!center) ++ if (!center){ ++ if(put == &texPut && indent_amount){ ++ /* この場合、直前のputIndent()の出力 ++ が「\\」で終わっており、次の ++ putIndent()が「\endlist」を出力 ++ する直前に「\mbox{}」を入れて ++ underfull hboxの警告を抑える */ ++ printf("\\mbox{}"); ++ } + putIndent(IND_RESUME, 0); ++ } + (*put->capsule)(END, FT_TABLE, center); + } + } +diff -ur plain2.org/src/plain2.c plain2/src/plain2.c +--- plain2.org/src/plain2.c Sat Feb 6 07:35:14 1999 ++++ plain2/src/plain2.c Sat Feb 6 08:36:31 1999 +@@ -36,8 +36,9 @@ + -pt=Size: font size -jis: JIS code output\n\ + -sjis: Shift-JIS code input/output\n\ + -f file: output customization\n\n" +-#define VERSION "plain2 r2.53 1994/01 by A.Uchida C&C Open Systems Lab. NEC\n\ +-\t(HTML output) by k-chinen@is.aist-nara.ac.jp, NAIST" ++#define VERSION "plain2 r2.54 1994/04 by A.Uchida NEC Corporation\n\ ++\t(HTML output) by k-chinen@is.aist-nara.ac.jp, NAIST\n\ ++\t(unofficial patch 98/08/13 by N.Nide)" + #else + #define PLAIN2_USAGE_1 "\ + usage: plain2 [options] [files ...]\n\ +@@ -55,7 +56,8 @@ + -pt=Size: font size -jis: JIS code output\n\ + -sjis: Shift-JIS code input/output\n\ + -f file: output customization\n" +-#define VERSION "plain2 r2.54 1994/04 by A.Uchida NEC Corporation" ++#define VERSION "plain2 r2.54 1994/04 by A.Uchida NEC Corporation\n\ ++\t(HTML output) by k-chinen@is.aist-nara.ac.jp, NAIST" + #endif + + extern char *getenv(); +@@ -102,8 +104,9 @@ + #endif + char *plain2Lib = NULL; + char *macroName = NULL; +-char *texStyle = NULL; ++char *texStyle = DEFAULT_STY; /* Nide */ + struct outDev *put = &roffPut; ++int useJverb = 0; /* Nide */ + + FILE *inFile; + struct text **texts; +@@ -148,6 +151,7 @@ + (void)fprintf(stderr, "%s\n", VERSION); + exit (2); + } ++ if (put != &texPut) useJverb = 0; + if (macroName) + macroFile(macroName); + saveParseDefaults(); +@@ -182,6 +186,46 @@ + putMacro(M_DOC_END); + exit(0); + } ++ ++ /* "a4j,12pt" -> "a4,12pt" etc. Return value can be free'ed afterward */ ++char *styleConv(s, nttflag) ++char *s; ++int nttflag; ++{ ++ char *buf, *p; ++ int sty_appeared = 0; ++ ++ if(NULL == (p = buf = malloc(strlen(s)*3/2+6+1))){ /* 6 for ",jverb" */ ++ fprintf(stderr, "PANIC(malloc in styleConv)\n"); ++ exit(2); ++ } ++ while(*s){ ++ while(isspace(*s)) *p++ = *s++; ++ if(*s) sty_appeared = 1; ++ if((*s == 'a' || *s == 'b') && (s[1] == '4' || s[1] == '5')){ ++ if(nttflag){ ++ if(s[2] == 'j' && (!s[3] || s[3] == ',')){ ++ strncpy(p, s, 2), p += 2, s += 3; ++ } ++ } else { ++ if(!s[2] || s[2] == ','){ ++ strncpy(p, s, 2), p += 2, s += 2; ++ *p++ = 'j'; ++ } ++ } ++ } ++ while(*s) if(',' == (*p++ = *s++)) break; ++ } ++ if(useJverb){ ++ if(sty_appeared) *p++ = ','; ++ strcpy(p, "jverb"), p += 5; ++ } ++ *p = '\0'; ++ return buf; ++} ++#define nttSty(s) styleConv(s, 1) ++#define asciiSty(s) styleConv(s, 0) ++ + /* + * Do parse & output + */ +@@ -227,10 +271,10 @@ + } + } + if (preamble) { +- if (texStyle) +- putMacro(M_DOC_BEGIN, (long)fontSize, texStyle); +- else +- putMacro(M_DOC_BEGIN, (long)fontSize, ""); ++ char *p = nttSty(texStyle), *q = asciiSty(texStyle); ++ ++ putMacro(M_DOC_BEGIN, (long)fontSize, p, q); ++ free(p), free(q); + } + } + +@@ -333,6 +377,13 @@ + } + else + #endif ++ /* Add Nide (need jverb,sty to use this option) */ ++ if (strcmp(optarg, "verb") == 0) { ++ OUTPUT_OPTION("-jverb"); ++ useJverb = 1; ++ } ++ else ++ /* Add Nide end */ + goto usage; + break; + case 'l': +diff -ur plain2.org/src/plain2.h plain2/src/plain2.h +--- plain2.org/src/plain2.h Sat Feb 6 07:35:14 1999 ++++ plain2/src/plain2.h Sat Feb 6 08:34:14 1999 +@@ -23,9 +23,9 @@ + * modify by k-chinen@is.aist-nara.ac.jp, 1994 + */ + +-#define NEC_CCS /* NEC C&C Common Software Lab. dependent */ ++/* #define NEC_CCS /* NEC C&C Common Software Lab. dependent */ + +-#undef NTT_TEX /* NTT jlatex */ ++/* #undef NTT_TEX /* NTT jlatex */ /* no longer needed */ + + #define TITLE_SPECIAL + +@@ -34,6 +34,9 @@ + + #define MACRO_LIB "/usr/lib/plain2" + ++#define DEFAULT_STY "" /* default style in TeX output */ ++/*#define DEFAULT_STY "a4" */ ++ + #define MIN_INDENT 4 /* minimum indentation to be indented region */ + #define MIN_SPACING 4 /* minimum number of lines to be space region*/ + #define MAX_DSCRLEN 40 /* maximum length for description list */ +@@ -214,6 +217,7 @@ + extern int indexEnabled; /* Enables Indexing */ + extern int fontSize; /* font size */ + extern int fontSpecified; /* font size specified */ ++extern int useJverb; /* use jverbatim (Nide) */ + /* */ + extern FILE *inFile; /* intput File */ + extern struct text **texts; /* texts[lineNum] array of text +@@ -276,6 +280,8 @@ + int markAsPlain(); + int markIfQuote(); + int markIfTable(); ++struct picLineElm *picLineMatch(); ++struct picMiscLines *picMiscMatch(); + + /* + * Output driver +diff -ur plain2.org/src/readfile.c plain2/src/readfile.c +--- plain2.org/src/readfile.c Sat Feb 6 07:19:47 1999 ++++ plain2/src/readfile.c Sat Feb 6 08:34:14 1999 +@@ -201,6 +201,7 @@ + while (fgets(buf, MAX_LINE_LEN, inFile) != NULL) { + textp->next = (struct text *)malloc(sizeof(struct text)); + if (textp->next == NULL){ ++ malloc_error: + fprintf(stderr, "PANIC(malloc in readAndStore)\n"); + exit (2); + } +@@ -222,8 +223,10 @@ + */ + texts = (struct text **) + malloc(sizeof(struct text *) * (textLines + 1)); ++ if(texts == NULL) goto malloc_error; /* Add Nide */ + for (textp = textTop, i=1; i < textLines; textp = textp->next, i++) + texts[i] = textp; + texts[textLines] = (struct text *)malloc(sizeof(struct text)); ++ if(texts[textLines] == NULL) goto malloc_error; /* Add Nide */ + bzero((char *)texts[textLines], sizeof(struct text)); + } +diff -ur plain2.org/src/roffout.c plain2/src/roffout.c +--- plain2.org/src/roffout.c Sat Feb 6 07:19:47 1999 ++++ plain2/src/roffout.c Sat Feb 6 08:34:14 1999 +@@ -19,6 +19,10 @@ + M_PLAIN_END, "", + M_EXAM_BEGIN, ".ft CW\n.vs -2\n.nf\n", + M_EXAM_END, ".fi\n.vs +2\n.ft\n", ++ M_JEXAM_BEGIN, "", ++ M_JEXAM_END, "", /* These two are not actually used, because when ++ roff output is selected, the flag useJverb ++ is always 0 */ + M_APPENDIX, "\\fBAppendix $1\\fP\n", + M_BLANK, "\n", + M_PAGE, ".bp\n", +diff -ur plain2.org/src/table.c plain2/src/table.c +--- plain2.org/src/table.c Sat Feb 6 07:19:47 1999 ++++ plain2/src/table.c Sat Feb 6 08:34:14 1999 +@@ -464,7 +464,7 @@ + if (colVline[col] == COLV_ASC + && tblAsciAttr[(unsigned char)*s] == 0 + && tblKanjiByte[(unsigned char)*s] +- && tblKwakuAttr(s) == NULL) ++ && tblKwakuAttr(s) == 0) + nilg++; + #ifdef KANJI + if (isZenkaku(s)) { +diff -ur plain2.org/src/texout.c plain2/src/texout.c +--- plain2.org/src/texout.c Sat Feb 6 07:19:48 1999 ++++ plain2/src/texout.c Sat Feb 6 08:34:14 1999 +@@ -12,32 +12,30 @@ + #include "table.h" + #include "macro.h" + +-#ifdef NTT_TEX +-#define STR_DOC_BEGIN "\\documentstyle[$2]{jarticle}\n\ ++#define STR_DOC_BEGIN "\ ++\\newif\\ifNTT\\NTTfalse\n\ ++\\ifx\\gtfam\\undefined\\ifx\\gtfamily\\undefined\\NTTtrue\\fi\\fi\n\ ++\\ifNTT\\documentstyle[$2]{j-article}\n\ ++\\else\\documentstyle[$3]{jarticle}\\fi\n\ + \\setcounter{secnumdepth}{6}\n\ + \\setcounter{tocdepth}{6}\n\ + \\topsep=0.1cm\n\ + \\parsep=0.1cm\n\ + \\itemsep=0.0cm\n\ +-\\renewcommand{\\bf}{\\protect\\pbf\\protect\\pdg}\n\ ++%\\renewcommand{\\bf}{\\protect\\pbf\\protect\\pdg}\n\ + \\begin{document}\n" +-#else /* ASCII_TEX */ +-#define STR_DOC_BEGIN "\\documentstyle[$2]{jarticle}\n\ +-\\setcounter{secnumdepth}{6}\n\ +-\\setcounter{tocdepth}{6}\n\ +-\\topsep=0.1cm\n\ +-\\parsep=0.1cm\n\ +-\\itemsep=0.0cm\n\ +-\\begin{document}\n" +-#endif + + struct macDefs texMacros[] = { + M_DOC_BEGIN, STR_DOC_BEGIN, + M_DOC_END, "\\end{document}\n", + M_PLAIN_BEGIN, "\\par\n", + M_PLAIN_END, "", +- M_EXAM_BEGIN, "{\\baselineskip=#1pt\n\\begin{verbatim}\n", ++ M_EXAM_BEGIN, "{\\par\\baselineskip=#1pt\n\\begin{verbatim}\n", ++ /* 直前の行間まで狭まってしまうのを防ぐため\parを置いた */ + M_EXAM_END, "\\end{verbatim}}\n", ++ M_JEXAM_BEGIN, "{\\par\\baselineskip=#1pt\n\\begin{jverbatim}\n", ++ M_JEXAM_END, "\\end{jverbatim}\\par}\n", ++ /* jverbatimの前後には\par必要。jverb.styのドキュメント参照 */ + M_APDX_BEGIN, "\\appendix\n", + M_APPENDIX, "\\section{@1}\n", + M_BLANK, "\\medskip\n", +@@ -180,8 +178,9 @@ + s = buf; + while(*str) { + if (len = alpha(str)) { +- (void)strcpy(s, "\\verb|"); +- s += strlen("\\verb|"); ++ char *p = useJverb ? "\\jverb|" : "\\verb|"; ++ (void)strcpy(s, p); ++ s += strlen(p); + (void)strncpy(s, str, len); + s += len; + str += len; +@@ -805,7 +804,9 @@ + if (begin) { + printf("~\\\\\n"); + if (center) { +- printf("\\begin{center}\n"); ++ /* 「\begin{center}」の直前が「\\」となるため ++ 「\mbox{}」を入れてunderfill hboxの警告を抑える */ ++ printf("\\mbox{}\\begin{center}\n"); + } + } + else { +diff -ur plain2.org/src/title.c plain2/src/title.c +--- plain2.org/src/title.c Sat Feb 6 07:19:48 1999 ++++ plain2/src/title.c Sat Feb 6 08:34:14 1999 +@@ -101,6 +101,12 @@ + "事業部", TENT_SHOZOKU, S_ALL, 0, W_ANYWHERE, + "研究所", TENT_SHOZOKU, S_ALL, 0, W_ANYWHERE, + "研究部", TENT_SHOZOKU, S_ALL, 0, W_ANYWHERE, ++/* Add Nide */ ++ "大学", TENT_SHOZOKU, S_ALL, 0, W_ANYWHERE, ++ "学部", TENT_SHOZOKU, S_ALL, 0, W_ANYWHERE, ++ "学科", TENT_SHOZOKU, S_ALL, 0, W_ANYWHERE, ++ "研究室", TENT_SHOZOKU, S_ALL, 0, W_ANYWHERE, ++/* Add Nide end */ + "文書番号", TENT_NUMBER, S_FROMRIGHT, 0, W_ANYWHERE, + "日付", TENT_DATE, S_FROMRIGHT, 0, W_ANYWHERE, + "月", TENT_DATE, S_ALL, 0, W_ANYWHERE, +@@ -132,6 +138,18 @@ + "/97", TENT_DATE, S_ALL, 0, W_ANYWHERE, + "/98", TENT_DATE, S_ALL, 0, W_ANYWHERE, + "/99", TENT_DATE, S_ALL, 0, W_ANYWHERE, ++/* Add Nide */ ++ "2000/", TENT_DATE, S_ALL, 0, W_ANYWHERE, ++ "2001/", TENT_DATE, S_ALL, 0, W_ANYWHERE, ++ "2002/", TENT_DATE, S_ALL, 0, W_ANYWHERE, ++ "2003/", TENT_DATE, S_ALL, 0, W_ANYWHERE, ++ "2004/", TENT_DATE, S_ALL, 0, W_ANYWHERE, ++ "/2000", TENT_DATE, S_ALL, 0, W_ANYWHERE, ++ "/2001", TENT_DATE, S_ALL, 0, W_ANYWHERE, ++ "/2002", TENT_DATE, S_ALL, 0, W_ANYWHERE, ++ "/2003", TENT_DATE, S_ALL, 0, W_ANYWHERE, ++ "/2004", TENT_DATE, S_ALL, 0, W_ANYWHERE, ++/* Add Nide end */ + #ifdef NEC_CCS + "開本", TENT_SHOZOKU, S_ALL, 0, W_ANYWHERE, + "開研", TENT_SHOZOKU, S_ALL, 0, W_ANYWHERE, --- plain2-2.54p1.orig/debian/patch/patch-6 +++ plain2-2.54p1/debian/patch/patch-6 @@ -0,0 +1,48 @@ +--- plain2.c.orig Sun Feb 7 08:50:26 1999 ++++ plain2.c Tue Feb 9 14:55:05 1999 +@@ -128,6 +128,8 @@ + extern unsigned _stklen = 32768U; + #endif + ++int stflag = 1; ++ + main(argc, argv) + int argc; + char **argv; +@@ -271,10 +273,18 @@ + } + } + if (preamble) { ++ if (stflag) { + char *p = nttSty(texStyle), *q = asciiSty(texStyle); + + putMacro(M_DOC_BEGIN, (long)fontSize, p, q); + free(p), free(q); ++ } ++ else { ++ char *p = asciiSty(texStyle), *q = asciiSty(texStyle); ++ ++ putMacro(M_DOC_BEGIN, (long)fontSize, p, q); ++ free(p), free(q); ++ } + } + } + +@@ -399,11 +409,16 @@ + outputCode = CODE_SJIS; + inputCode = CODE_SJIS; + } +- else ++ else if (strcmp(optarg, "trict") == 0) { ++ stflag = 0; ++ } + #endif + if (strcmp(optarg, "pace") == 0) { + OUTPUT_OPTION("-space"); + reflectSpace = 1; ++ } ++ else if (strcmp(optarg, "trict") == 0) { ++ stflag = 0; + } + else goto usage; + break; --- plain2-2.54p1.orig/debian/patch/patch-7 +++ plain2-2.54p1/debian/patch/patch-7 @@ -0,0 +1,28 @@ +--- Makefile.orig Fri Oct 1 10:41:06 1999 ++++ Makefile Fri Oct 1 10:40:44 1999 +@@ -40,12 +40,12 @@ + title_shounin.tex header_text.raw ftitle_illeg.raw ftitle_illeg.tex\ + help_message.raw + +-OTHERFILES=tgif_fig.eps tgif_win.eps logo.eps modules.eps help_message ++OTHERFILES=tgif_fig.eps tgif_win.eps logo.eps jmodules.eps help_message + + RAWTEXFILES=Tgif_doc.tex Beginning.tex Hint_all.tex \ + Example_adjust2.tex + +-PRTGIF=prtgif ++PRTGIF=tgif -print + PLAIN2=plain2 -strict -tstyle=a4j -jverb + VERBTEXFILES= + +--- plain2.pln.orig Fri Oct 1 11:11:19 1999 ++++ plain2.pln Fri Oct 1 11:11:38 1999 +@@ -1845,7 +1845,7 @@ + + [[R + ~\\ +-\epsfbox{modules.eps}\\ ++\epsfbox{jmodules.eps}\\ + ]]R + + 6.1. LaTeX出力 --- plain2-2.54p1.orig/debian/patch/plain2-2.53-html.94aug14.patch +++ plain2-2.54p1/debian/patch/plain2-2.53-html.94aug14.patch @@ -0,0 +1,1481 @@ +diff -p -c -r -N orig-plain2-2.53/src/Makefile plain2/src/Makefile +*** orig-plain2-2.53/src/Makefile Fri Jan 7 05:34:39 1994 +--- plain2/src/Makefile Mon May 16 20:34:27 1994 +*************** LIBDIR=/usr/local/lib/plain2 +*** 10,16 **** + + SHELL=/bin/sh + +! DEFINES=-DKANJI -DPICTURE + + #CC=gcc + CFLAGS= -g ${DEFINES} -DBSD -DDEBUG +--- 10,16 ---- + + SHELL=/bin/sh + +! DEFINES=-DKANJI -DPICTURE -DHTML + + #CC=gcc + CFLAGS= -g ${DEFINES} -DBSD -DDEBUG +*************** CFLAGS= -g ${DEFINES} -DBSD -DDEBUG +*** 20,30 **** + SRCS=plain2.c readfile.c analyze.c miscutil.c\ + section.c example.c list.c plaintxt.c table.c spacing.c\ + headfoot.c hint.c picture.c justify.c ftitle.c\ +! roffout.c texout.c title.c output.c renumout.c macro.c + OBJS_NOKANJI=plain2.o readfile.o miscutil.o\ + section.o example.o list.o plaintxt.o spacing.o\ + headfoot.o hint.o justify.o\ +! texout.o output.o renumout.o macro.o + # + # Following files contain Kanji characters(8bit) in EUC code. + # +--- 20,30 ---- + SRCS=plain2.c readfile.c analyze.c miscutil.c\ + section.c example.c list.c plaintxt.c table.c spacing.c\ + headfoot.c hint.c picture.c justify.c ftitle.c\ +! roffout.c texout.c title.c output.c renumout.c macro.c htmlout.c + OBJS_NOKANJI=plain2.o readfile.o miscutil.o\ + section.o example.o list.o plaintxt.o spacing.o\ + headfoot.o hint.o justify.o\ +! texout.o output.o renumout.o macro.o htmlout.o + # + # Following files contain Kanji characters(8bit) in EUC code. + # +*************** title.o: plain2.h +*** 94,96 **** +--- 94,97 ---- + output.o: plain2.h picture.h macro.h + renumout.o: plain2.h + macro.o: plain2.h macro.h ++ htmlout.o: plain2.h macro.h +diff -p -c -r -N orig-plain2-2.53/src/README.HTML plain2/src/README.HTML +*** orig-plain2-2.53/src/README.HTML +--- plain2/src/README.HTML Sun Aug 14 03:25:01 1994 +*************** +*** 0 **** +--- 1,176 ---- ++ by k-chinen@is.aist-nara.ac.jp ++ ++ 1. Prologue ++ ++ ++ This packege is patched HTML support plain2. ++ HTML support routines separated by Macro HTML. ++ ++ #ifdef HTML ++ ++ If you found bugs, please send mail k-chinen@is.aist-nara.ac.jp. ++ ++ ++ ++ ++ 2. What is HTML ? ++ ++ HTML was acronym for Hyper Text Markup Language, which is used in World ++ Wide Web. ++ World Wide Web is famous service for Mosaic. World Wide Web makes hypertext ++ over Network. ++ ++ ++ ++ 3. How to use ? ++ ++ 3.1. Basic ++ ++ 3.1.1. convert plain text to HTML ++ ++ ++ % plain2 -html foo.txt > bar.html ++ ++ plain2 convert foo.txt (plain text) to bar.html (HTML). ++ ++ ++ ++ 3.1.2. convert plain text to HTML with pictures and tables ++ ++ use -here option, plain2 made HTML which include pictures and tables. ++ But HTML not support picture and table. plain2 only express anchor for link ++ to picture and table ++ ++ % plain2 -html -here foo.txt > junk.html ++ ++ ++ 3.1.3. convert plain text to HTML with erasing pictures and tables ++ ++ If you want to erase picture or table, use -htmlonce option (don't use -html). ++ ++ ++ ++ 3.1.4. convert plain2 text to HTML with raw pictures and tables ++ ++ If you want to convert plain2 text with raw pictures and tables, ++ use -htmlonce and -raw. ++ ++ ++ ++ 3.2. Extended (plain2html) ++ ++ 3.2.1. require ++ ++ HTML is not support picture and table, you know. but plain2 generate ++ image and table via roff or TeX. ++ Then you need roff or TeX and image processing programs. ++ ++ For example, this packege include c-shell script which named plain2html. ++ This script ganerate HTML and picture and table files. ++ (pictures and tables are GIF format file). ++ and plain2html require follow programs. ++ ++ (1) plain2 ++ ++ (2) typesetting program ++ - TeX ++ * latex and dvi2ps ++ ('jlatex' is japanelized latex. please subsitute ++ 'jlatex' to 'latex' in script) ++ - roff ++ * groff ++ ++ (3) image processing program ++ - convert ( which included ImageMagick) ++ - pnmcrop ( which included pbmplus) ++ ++ (4) other ++ - csh or tcsh ++ - awk ++ - ghostscript ( convert calle it) ++ - pt2htcol.awk ( inclued this packege ) ++ ++ 3.2.2. How to use ++ ++ For eample, convert plain text file foo.txt to HTML. ++ ++ (1) Make working direcory, because plain2 generate many files. ++ ++ % mkdir foo.work ++ % cp foo.txt foo.work ++ % cd foo.work ++ ++ (2) run plain2html ++ ++ % plain2html foo.txt ++ ++ plain2html gerate HTML file foo.html, PIC*.gif (for picture) and ++ TBL*.gif (for table). ++ ++ So, you get HTML file. Please check result via Mosaic or Chimera. ++ ++ % Mosaic foo.html ++ ++ or ++ ++ % chimera foo.html ++ ++ ++ ++ 4. Changes for plain2 ++ ++ * add -html option ++ ++ * add -here option ++ Document size is important in WWW. switch include images or not. ++ ++ * new make htmlout.c (like texout.c) ++ ++ * Cannot found pictures begin and end, I modify picture.c ++ ++ * add plain2html and pt2htcol.awk ++ ++ 1. Genate HTML with -html ++ 2. Convert pictures and tables. ++ ++ a) groff ++ - conver to PS via groff ++ ++ b) latex ++ - convert to DVI via latex ++ - convert to PS via dvi2ps ++ ++ 3. cut improtant part in picures and convert to GIF. ++ - convet to PNM via 'convert' ++ - cut via 'pnmcrop' ++ - convet to GIF via 'convert' ++ ++ ++ ++ 5. Bugs. ++ ++ * It is multi path ++ plain2 is beauty, because plain2 is one path... ++ but plain2html is multi path. ++ ++ * I think to hard to install. because it require many programs. ++ ++ * on groff ++ - groff not support japanaes ++ ++ ++ 6. Acknowledgment ++ ++ Special thank for Mr. Uchida (uchida@ccs.mt.nec.co.jp). he release ++ plain2 r2.5 for this program. And he give important advice and ++ suggestion. ++ ++ ++ 7. Epilogue ++ ++ This packege is only patch for plain2. It is not new revision of plain2. ++ Then, If you have questions, advices and requiremnts. please mail ++ k-chinen@is.aist-nara.ac.jp ++ ++ Own your risk. ++ Enjoy !!! +diff -p -c -r -N orig-plain2-2.53/src/README.HTML.JPN plain2/src/README.HTML.JPN +*** orig-plain2-2.53/src/README.HTML.JPN +--- plain2/src/README.HTML.JPN Sun Aug 14 02:29:05 1994 +*************** +*** 0 **** +--- 1,197 ---- ++ $@BjL>(J plain2 $@$N(J HTML $@BP1~(J ++ by k-chinen@is.aist-nara.ac.jp ++ ++ 1. $@$O$8$a$K(J ++ ++ $@$3$N%G%#%l%/%H%j$N%=!<%9%U%!%$%k$NCf$G!"(J ++ ++ #ifdef HTML ++ ++ $@$H$7$F$"$k$N$O!"%*%j%8%J%k$N(J plain2 $@$rF`NI@hC<2J3X5;=QBg3X1!Bg3X$N(J ++ $@CNG0(J (k-chinen@is.aist-nara.ac.jp) $@$,(J HTML $@BP1~$N$?$a2~B$$7$?$H$3$m(J ++ $@$G$9!#(J ++ $@$=$NItJ,$G%P%0$,5/$-$?$H;W$o$l$k:]$K$O(J k-chinen@is.aist-nara.ac.jp ++ $@$X(J E-mail $@$G$*CN$i$;$/$@$5$$!#<!$N%j%j!<%9$N:]$N;29M$K$7$^$9!#(J ++ ++ ++ ++ 2. HTML $@$H$O(J ? ++ ++ HTML $@$H$O(J Hyper Text Markup Language $@$NN,$G!"(JWorld Wide Web $@$H$$$&(J ++ $@%5!<%S%9$GJ8>O$r:n@.$9$k0Y$N8@8l$G$9!#(JWorld Wide Web $@$O(J Mosaic $@$H(J ++ $@$$$&%W%m%0%i%`$GM-L>$J!"%M%C%H%o!<%/>e$K%O%$%Q!<%F%-%9%H$r:n$k%5!<(J ++ $@%S%9$G$9!#(J ++ ++ ++ 3. $@;H$$J}(J ++ ++ 3.1. $@4pK\(J ++ ++ 3.1.1. plain text $@$r(J HTML $@$K(J ++ ++ $@4pK\E*$J%*%j%8%J%k$N(J plain2 $@$H$[$H$s$IF1$8$G!"(J ++ ++ % plain2 -html -jis foo.txt > bar.html ++ ++ $@$H$$$&$h$&$K;H$$$^$9!#(J ++ $@$3$&$9$k$H!"(Jfoo.txt $@$H$$$&(J plain text $@$r(J bar.html $@$H$$$&(J HTML $@$N=q(J ++ $@<0$G$+$+$l$?%U%!%$%k$,$G$-$^$9!#(J ++ ++ 3.1.2. plain text $@$r?^$dI=$,F~$C$?(J HTML $@$K(J ++ ++ plain2 $@$K(J -here $@%*%W%7%g%s$r$D$1$k$H!"?^$dI=$rD>@\4^$a$k$h$&$K=q$+(J ++ $@$l$?(J HTML $@$N=q<0$N%U%!%$%k$,$G$-$^$9!#(J ++ ($@$?$@$7!";DG0$J$,$i(J plain2 $@$G?^$dI=$r(J HTML $@$K$9$k;v$O=PMh$^$;$s!#(J) ++ ++ % plain2 -html -here -jis foo.txt > junk.html ++ ++ $@$H$7$F;H$C$F$_$^$7$g$&!#(J ++ $@$3$N(J junk.html $@$G$O!"(J bar.html $@$G(J "Picture here" $@$H$+(J "Table here" ++ $@$H=q$$$F$"$C$?>l=j$K2?$+?^$,=P$k$H$*$b$$$^$9!#(J ++ ++ 3.1.3. plain text $@$N?^$dI=$rL5;k$7$F(J HTML $@$K(J ++ ++ $@?^$dI=$rL5;k$7$F(J HTML $@$K$7$?$$;~$K$O!"(J-html $@$G$O$J$/(J -htmlonce $@$r(J ++ $@;H$C$F$/$@$5$$!#(J ++ ++ 3.1.4. plain text $@$N?^$dI=$O$=$N$^$^$G(J HTML $@$K(J ++ ++ $@?^$dI=$r$=$N$^$^(J HTML $@$K4^$a$?$$;~$K$O!"(J-htmlonce $@$H(J -raw $@$r0l=o(J ++ $@$K;H$C$F$/$@$5$$!#(J ++ ++ ++ ++ 3.2. $@1~MQ(J (plain2html) ++ ++ 3.2.1. $@I,MW$JJ*(J ++ ++ plain2 $@$N(J HTML $@$r:n$k5!G=$G$O?^$dI=$O:n$l$^$;$s$,!"(Jroff $@$d(J TeX $@$r(J ++ $@;H$C$F?^$dI=$r:n$k;v$,=PMh$^$9!#$3$N$?$a$K$O(J roff $@$d(J TeX $@$N7A<0$N(J ++ $@%U%!%$%k$r(J gif $@Ey$N%$%a!<%8%G!<%?$K$9$k%W%m%0%i%`$,I,MW$G$9!#(J ++ ++ $@%5%s%W%k$H$7$F!"$3$N%Q%C%A$G$O(J plain2html $@$H$$$&(J csh script $@$r$D(J ++ $@$1$F$"$j$^$9!#$3$N%9%/%j%W%H$G$O(J HTML $@$N%U%!%$%k$H$=$l$KI,MW$J?^(J ++ $@$dI=$N$?$a$N%$%a!<%8%G!<%?$r:n$j$^$9!#(J ++ ++ $@$3$N%9%/%j%W%H$r;H$&$K$O0J2<$N$h$&$J%W%m%0%i%`$,I,MW$G$9!#(J ++ ++ (1) plain2 ++ ++ (2) $@AHHG%W%m%0%i%`(J ++ - TeX $@$r$D$+$&>l9g(J ++ * jlatex $@$H(J dvi2ps ++ - roff $@$r;H$&>l9g(J ++ * groff ++ ++ (3) $@%$%a!<%8%G!<%?JQ49%W%m%0%i%`(J ++ - convert ( ImageMagick $@$K4^$^$l$F$$$^$9(J ) ++ - pnmcrop ( pbmplus $@$K4^$^$l$F$$$^$9(J ) ++ ++ (4) $@$=$NB>(J ++ - csh $@$+(J tcsh ++ - awk ++ - ghostscript ( convert $@$,8F$S=P$7$^$9(J ) ++ - pt2htcol.awk ( $@$3$N%Q%C%A$K4^$^$l$F$$$^$9(J ) ++ ++ 3.2.2. $@;H$$J}(J ++ ++ foo.txt $@$r(J HTML $@$N%U%!%$%k$K$9$kNc$r>R2p$7$^$9!#(J ++ ++ (1) $@?^$dI=$N%$%a!<%8%G!<%?$,$G$-$k$N$GJL$N%G%#%l%/%H%j$r$D$/(J ++ $@$C$F$=$3$G:n6H$7$^$7$g$&!#(J ++ ++ % mkdir foo.work ++ % cp foo.txt foo.work ++ % cd foo.work ++ ++ (2) plain2html $@$r<B9T$7$^$9(J ++ ++ % plain2html foo.txt ++ ++ $@<B9T$,=*N;$9$k$H(J($@$$$m$$$m$J=hM}$r$9$k$N$G7k9=;~4V$+$+$j(J ++ $@$^$9(J)$@!"(Jfoo.html $@$H$$$&(J HTML $@$N=q<0$G$-$?%U%!%$%k$H!"?^(J ++ $@$dI=$N$?$a$N(J PIC*.gif $@$d(J TBL*.gif $@$G$-$^$9!#(J ++ ++ $@$H$$$&$o$1$G(J HTML $@$N=q<0$G$G$-$?%U%!%$%k$,$G$-$^$9!#(JMosaic $@$d(J ++ chimera $@$G7k2L$r3NG'$7$F$/$@$5$$!#(J ++ ++ % Mosaic foo.html ++ ++ $@$^$?$O!"(J ++ ++ % chimera foo.html ++ ++ $@$H$7$F$/$@$5$$!#(J ++ ++ ++ 4. $@JQ99E@(J ++ ++ * -html $@%*%W%7%g%s$r$D$1$?!#(J ++ $@$3$l$G!"(JHTML $@$N=PNO$r$9$k!#(J ++ ++ * -here $@%*%W%7%g%s$r$D$1$?!#(J ++ WWW $@$G$OJ8=q$NBg$-$5$O=EMW(J(64kbps $@$N%5%$%H$b$"$k(J)$@$J$N$G!"(JHTML ++ $@$NCf$KI=$d?^$r(J ++ ++ - $@$=$N$^$^F~$l$k(J ++ - $@%j%s%/$H$9$k(J ++ ++ $@$K@ZBX$($k!#(J ++ ++ * texout.c $@$r$^$M$F!"(Jhtmlout.c $@$r:n$C$?!#(J ++ html $@$G;O$^$k4X?t$r:n$C$F(J HMTL $@BP1~$7$?!#(J ++ ++ * $@$J$<$+!"?^$@$1$O(J *out.c $@$N4X?t$GNN0h(J($@;O$a$H=*$j$N9T(J) $@$rCN$k;v(J ++ $@$,$G$-$J$$$h$&$J$N$G!"(Jpicture.c $@$NCf$rJQ99$7$?!#(J ++ ++ * $@%9%/%j%W%H(J plain2html , pt2htcol.awk $@$rDI2C!#(J ++ mulit path $@$H$7$F2?2s$b<B9T$7$F!"A4BN$rJQ49$9$k;v$K$7$?!#(J ++ ++ 1. $@A4BN$r(J -html $@$GJQ49!#(J ++ 2. $@I=$d?^$NItJ,$r(J ps $@$KJQ49!#(J ++ ++ a) groff ++ - groff $@$G(J ps $@$K(J ++ ++ b) latex ++ - jlatex $@$G(J dvi $@$K(J ++ - dvi2ps $@$G(J ps $@$K(J ++ ++ 3. $@I=$d?^$NI,MW$J=j$r@Z$j=P$7$F!"(Jgif $@$KJQ49!#(J ++ - convert $@$G(J pnm $@$K(J ++ - pnmcrop $@$G@Z$j=P$9(J ++ - convert $@$G(J gif $@$K(J ++ ++ $@?^$N@Z$j=P$7$O!"(JTeX $@$G$O(J \thispagestyle{empty} $@$r=q(J ++ $@$$$?%9%?%$%k%U%!%$%k$rMQ0U$7$F2r7h!#(J ++ groff $@$G$O(J -me $@$G2r7h$7$?$h$&$@!#(J(roff $@$O>\$7$/$J$$(J ++ $@$N$G<+?.$,$J$$(J) ++ ++ ++ 5. $@LdBjE@(J ++ ++ * multi path $@$J$C$F$7$^$C$?!#(J ++ plain2 $@$O(J one path $@$@$+$iH~$7$$$N$K(J... ++ ++ * $@$$$m$$$m$J%D!<%k$r;H$&$N$G!"(Jinstall $@$9$k;~$OBgJQ$+$bCN$l$J$$!#(J ++ ++ * groff $@$K4X$7$F(J ++ - $@F|K\8l$,DL$8$J$$(J ++ ++ ++ 6. $@<U<-(J ++ ++ plain2 $@$N:n<T$NFbED$5$s(J(uchida@ccs.mt.nec.co.jp)$@$K$O$*K;$7$$$N$K(J ++ plain2 r2.5 $@$N%j%j!<%9$r$7$F$b$i$$$^$7$?!#$^$?!"$$$m$$$m$H%3%a%s(J ++ $@%H$rD:$-$^$7$?!#$"$j$,$H$&$4$6$$$^$7$?!#(J ++ ++ ++ ++ 7. $@$*$o$j$K(J ++ ++ $@$3$N%Q%C%A$O(J plain2 $@$KBP$9$k$b$N$G!"(Jplain2 $@$N?7$7$$(J revison $@$G$O(J ++ $@$"$j$^$;$s!#$7$?$,$C$F!"$3$N%Q%C%A$K4X$9$k46A[!"MWK>!"<ALd$J$I$O(J ++ k-chinen@is.aist-nara.ac.jp $@08$G$*4j$$$7$^$9!#(J ++ ++ $@$J$*!"$3$N%Q%C%A$K$K$h$C$F@8$8$?$$$+$J$kB;32!"Mx1W$K$D$$$F:n<T$O(J ++ $@@UG$$rIi$$$^$;$s!#(J +diff -p -c -r -N orig-plain2-2.53/src/htmlout.c plain2/src/htmlout.c +*** orig-plain2-2.53/src/htmlout.c +--- plain2/src/htmlout.c Sun Aug 14 02:15:42 1994 +*************** +*** 0 **** +--- 1,469 ---- ++ /* ++ * Copyright (C) 1991,1992 NEC Corporation. ++ */ ++ /* ++ modify from texout.c, by k-chinen@is.aist-nara.ac.jp, 1994 ++ ++ NOTE: ++ * This module is prototype of HTML ouputting. ++ * HTML can markup. but HTML cannot layout. ++ Therfore this module cannot handle CENTER, RIGHT and SPACE. ++ * HTML cannout handle table and picture directly. ++ Therfore this module cannot handle table and picture with ++ TeX and TROFF outoputting's approach. ++ Then I could not implement it. ++ */ ++ ++ ++ ++ ++ #ifndef lint ++ static char rcsid[] = ++ "$Id: plain2-2.53-html.94aug14.patch,v 1.1 1999/02/05 22:36:10 kohda Exp $"; ++ #endif ++ ++ #include <stdio.h> ++ #include "plain2.h" ++ #include "picture.h" ++ #include "table.h" ++ #include "macro.h" ++ ++ ++ struct macDefs htmlMacros[] = { ++ M_DOC_BEGIN, "<HTML>\n", ++ M_DOC_END, "</HTML>\n", ++ M_PLAIN_BEGIN, "<P>\n", ++ M_PLAIN_END, "</P>\n", ++ M_EXAM_BEGIN, "<PRE><TT>\n", ++ M_EXAM_END, "</TT></PRE>\n", ++ M_APDX_BEGIN, "<!-- appendix -->\n", ++ M_APPENDIX, "<!-- appendix section -->\n", ++ M_BLANK, "\n", ++ M_PAGE, "\n<!-- PAGE -->\n", ++ M_NEWLINE, "\n<!-- NEWLINE -->\n", ++ M_CENTER_BEGIN, "<!-- CENTER -->\n", ++ M_CENTER_END, "<!-- end of CENTER -->\n", ++ M_RIGHT_BEGIN, "<!-- RIGHT -->\n", ++ M_RIGHT_END, "<!-- end of RIGHT -->\n", ++ M_INDENT, "<BLOCKQUOTE>\n", ++ M_INDENT0, "</BLOCKQUOTE>\n", ++ M_FOOTN_BEGIN, "", ++ M_FOOTN_END, "", ++ M_REFER_BEGIN, "<A HREF=\"#", ++ M_REFER_END, "\">GO</A>", ++ M_BOLD_BEGIN, "<B>", ++ M_BOLD_END, "</B>", ++ M_INDEX_BEGIN, "", ++ M_INDEX_END, "", ++ M_SECTION_1, "\n<H1>@1</H1>\n", ++ M_SECTION_2, "\n<H2>@1</H2>\n", ++ M_SECTION_3, "\n<H3>@1</H3>\n", ++ M_SECTION_4, "\n<H4>@1</H4>\n", ++ M_SECTION_5, "\n<H5>@1</H5>\n", ++ M_SECTION, "", ++ M_SETSEC_1, "", ++ M_SETSEC_2, "", ++ M_SETSEC_3, "", ++ M_SETSEC_4, "", ++ M_SETSEC_5, "", ++ M_TITLE, "<TITLE>&1</TITLE>\n<H1>&1</H1>\n<EM>&6</EM>\n<PRE>&4\n&3</PRE>\n<HR>", ++ -1, "", ++ }; ++ ++ ++ /* ++ * HTML text output routines ++ */ ++ ++ struct transTable *htmlTrans; ++ struct transTable *htmlTransM; ++ ++ static struct transTable htmlFullTrans[] = { ++ {'<', "<" }, ++ {'>', ">" }, ++ {'&', "&" }, ++ {0,0} }; ++ static struct transTable htmlFullTransM[] = { ++ {'<', "<" }, ++ {'>', ">" }, ++ {'&', "&" }, ++ {0,0} }; ++ ++ static struct transTable htmlHalfTrans[] = { ++ {'<', "<" }, ++ {'>', ">" }, ++ {'&', "&" }, ++ {0,0} }; ++ ++ static struct transTable htmlHalfTransM[] = { ++ {'<', "<" }, ++ {'>', ">" }, ++ {'&', "&" }, ++ {0,0} }; ++ ++ htmlSetTrans(full) ++ int full; ++ { ++ if (full) { ++ htmlTrans = htmlFullTrans; ++ htmlTransM = htmlFullTransM; ++ } ++ else { ++ htmlTrans = htmlHalfTrans; ++ htmlTransM = htmlHalfTransM; ++ } ++ } ++ ++ ++ char * ++ htmlTextQuote(str, quotable) ++ char *str; ++ int quotable; ++ { ++ char *s; ++ int len; ++ static char buf[MAX_LINE_LEN]; ++ ++ if (rawOutput) ++ return str; ++ ++ if (!quotable) ++ return textQuote(str, htmlTransM); ++ ++ return textQuote(str, htmlTrans); ++ } ++ ++ char *htmlQuote1(str) ++ char *str; ++ { ++ return htmlTextQuote(str, 1); ++ } ++ ++ char *htmlQuote2(str) ++ char *str; ++ { ++ return htmlTextQuote(str, 0); ++ } ++ ++ ++ htmlPutLabel(str) ++ char *str; ++ { ++ printf("<A NAME=\"%s\"> <EM>(here)</EM> </A>", codeCvt(str)); ++ } ++ ++ htmlPlain(str, attr, newline) ++ char *str; ++ int attr; ++ int newline; ++ { ++ if (attr == IL_RAW || attr == IL_REFERENCE) ++ printf("%s", codeCvt(str)); ++ else ++ printf("%s", codeCvt(htmlTextQuote(str, 1))); ++ if (newline) ++ printf("\n"); ++ } ++ ++ htmlExample(str) ++ char *str; ++ { ++ printf("%s\n",textQuote(str, htmlTrans)); ++ } ++ ++ static int enumLevel = 0; ++ htmlListBlock(begin, level, ltype, hint) ++ int begin; ++ int level; ++ int ltype; ++ char hint; ++ { ++ char *lstr; ++ if (begin) { ++ switch (ltype) { ++ case L_BULLET: ++ case L_DASH: ++ printf("<UL>\n"); ++ break; ++ case L_DLIST: ++ printf("<DL>\n"); ++ break; ++ case L_LROMAN: ++ case L_SROMAN: ++ case L_NUMBER: ++ case L_LALPHA: ++ case L_SALPHA: ++ enumLevel++; ++ printf("<OL>\n"); ++ break; ++ default: ++ break; ++ } ++ } ++ else { ++ switch (ltype) { ++ case L_BULLET: ++ case L_DASH: ++ printf("</UL>\n"); ++ break; ++ case L_LROMAN: ++ case L_SROMAN: ++ case L_NUMBER: ++ case L_LALPHA: ++ case L_SALPHA: ++ enumLevel--; ++ printf("</OL>\n"); ++ break; ++ case L_DLIST: ++ printf("</DL>\n"); ++ break; ++ default: ++ break; ++ } ++ } ++ } ++ ++ htmlDlistItem(level, dscr, cont) ++ int level; ++ char *dscr; ++ int cont; ++ { ++ printf("<DT><B>%s</B>\n", codeCvt(htmlTextQuote(dscr, 1))); ++ } ++ ++ htmlListItem(level) ++ int level; ++ { ++ printf("<LI> "); ++ } ++ ++ htmlRawText(str) ++ char *str; ++ { ++ printf("%s\n",codeCvt(str)); ++ } ++ ++ htmlSpace(length) ++ int length; ++ { ++ /* EMPTY --- I don't know what do here */ ++ } ++ ++ htmlFTitle(ft, str, capsule) ++ int ft; ++ char *str; /* if (str!=NULL) output title */ ++ int capsule; ++ { ++ static int figNumber = 1; ++ static int tblNumber = 1; ++ if (crossRefer && capsule) { ++ printf("<B>%s</B>\n", codeCvt(htmlTextQuote(str, 1))); ++ htmlPutLabel(str); ++ } ++ else { ++ printf ("<P>"); ++ #ifdef KANJI ++ if (japaneseText) { ++ if (ft == FT_FIGURE) ++ printf ("<B> %s %d.</B>", codeCvt("$@?^(J"), figNumber++); ++ ++ else if (ft == FT_TABLE) ++ printf ("<B> %s %d.</B>", codeCvt("$@I=(J"), tblNumber++); ++ } ++ else { ++ #endif ++ if (ft == FT_FIGURE) ++ printf ("<B> Figure %d.</B>", figNumber++); ++ else if (ft == FT_TABLE) ++ printf ("<B> Table %d.</B>", tblNumber++); ++ #ifdef KANJI ++ } ++ #endif ++ printf ("%s\n", codeCvt(htmlTextQuote(str, 1))); ++ } ++ } ++ ++ #ifdef PICTURE ++ /* ++ * Driver for HTML(picture) output ++ */ ++ static int picLines; /* Number of lines in the block */ ++ static int picMinInd; /* Indentation of the region */ ++ ++ static int htmlVsize; ++ static int htmlUnit; ++ ++ htmlPictureBlock(begin, lines, indent, maxLen) ++ int begin; ++ int lines; ++ int indent; ++ int maxLen; ++ { ++ if(htmlOnce) { ++ if(begin) ++ printf("<!-- PICTURE -->\n"); ++ } ++ else { ++ if(begin) ++ printf("<!-- PICTURE -->\n"); ++ } ++ } ++ ++ /* set line width */ ++ htmlLineWidth(style) ++ int style; ++ { ++ /* */ ++ } ++ ++ htmlEllipse(x0, y0, x1, y1, style) ++ int x0, x1, y0, y1; ++ int style; ++ { ++ /* */ ++ } ++ ++ /* ++ * Draw line ++ * Only ({-1,0,1},{-1,0,1}) direction. ++ */ ++ htmlPicLine(x0, y0, x1, y1, style, vector) ++ int x0, x1, y0, y1; ++ int style; ++ int vector; ++ { ++ /* */ ++ } ++ ++ htmlPicArc(x, y, r, dir, style) ++ int x, y, r; ++ enum direction dir; ++ int style; ++ { ++ /* */ ++ } ++ ++ htmlPicText(s, xpos, vpos, factor) ++ char *s; ++ int xpos; ++ int vpos; ++ int factor; ++ { ++ /* */ ++ } ++ #endif ++ ++ ++ ++ htmlTitle(style, haifu, title, shozoku, number, date, name, renraku ++ #ifdef TITLE_SPECIAL ++ ,special8, special9 ++ #endif ++ ) ++ int style; ++ char **haifu; ++ char **title; ++ char **shozoku; ++ char **number; ++ char **date; ++ char **name; ++ char **renraku; ++ #ifdef TITLE_SPECIAL ++ char **special8, **special9; ++ #endif ++ { ++ char **s; ++ if (style == 0) { ++ putMacro(M_TITLE, ++ title, number, date, shozoku, haifu, name, renraku ++ #ifdef TITLE_SPECIAL ++ ,special8, special9 ++ #endif ++ ); ++ return; ++ } ++ } ++ ++ htmlTable(begin, end, tblp) ++ int begin; ++ int end; ++ struct table *tblp; ++ { ++ if(htmlOnce) { ++ if(rawOutput) { ++ int l; ++ ++ printf("<PRE>\n"); ++ for (l = begin; l < end; l++) { ++ htmlRawText(texts[l]->body); ++ } ++ printf("</PRE>\n"); ++ } ++ else { ++ printf("<!-- TABLE -->\n"); ++ } ++ ++ } ++ else { ++ static int tbl_count=0; ++ printf("\n<!-- plain2:TABLE %05d %d %d -->\n",tbl_count,begin,end); ++ ++ if(htmlHere) { ++ printf("<P><IMG SRC=\"TBL%05d.gif\">\n", tbl_count); ++ } ++ else { ++ printf("<P><B><A HREF=\"TBL%05d.gif\">Table here</A></B></P>\n", ++ tbl_count); ++ } ++ tbl_count++; ++ } ++ } ++ ++ htmlCapsule(begin, type, center) ++ int begin; ++ int type; ++ int center; ++ { ++ static int count=0; ++ char *typeStr; ++ ++ if (crossRefer) { ++ switch (type) { ++ case FT_FIGURE: ++ typeStr = "figure"; ++ break; ++ case FT_TABLE: ++ typeStr = "table"; ++ break; ++ default: ++ fprintf(stderr, "PANIC(unknown capsule type)\n"); ++ exit(2); ++ break; ++ } ++ if (begin) { ++ count++; ++ printf("\n<!-- Start of #%d -->\n",count); ++ } ++ else { ++ printf("\n<!-- End of #%d -->\n",count); ++ } ++ } ++ else /* short paper */ { ++ if (begin) { ++ printf("\n<!-- Start of #%d -->\n",count); ++ } ++ else { ++ printf("\n<!-- End of #%d -->\n",count); ++ } ++ } ++ } ++ ++ htmlComment(begin, end) ++ int begin; ++ int end; ++ { ++ int l; ++ for (l = begin; l < end; l++) { ++ printf ("<!-- %s -->\n", codeCvt(texts[l]->body)); ++ } ++ } +diff -p -c -r -N orig-plain2-2.53/src/macro.c plain2/src/macro.c +*** orig-plain2-2.53/src/macro.c Fri Jan 7 05:34:40 1994 +--- plain2/src/macro.c Sun Aug 14 03:27:30 1994 +*************** char *fname; +*** 369,375 **** + } + if (ret == -1) + continue; +! s = (char *)malloc(strlen(defstr)); + strcpy(s, defstr); + outMacro[macroNum] = macroParse(s, macroNum, s); + } +--- 369,375 ---- + } + if (ret == -1) + continue; +! s = (char *)malloc(strlen(defstr)+1); + strcpy(s, defstr); + outMacro[macroNum] = macroParse(s, macroNum, s); + } +diff -p -c -r -N orig-plain2-2.53/src/output.c plain2/src/output.c +*** orig-plain2-2.53/src/output.c Fri Jan 7 05:34:46 1994 +--- plain2/src/output.c Wed Jan 19 19:08:44 1994 +*************** +*** 1,6 **** +--- 1,9 ---- + /* + * Copyright (C) 1991,1992,1993 NEC Corporation. + */ ++ /* ++ * modify by k-chinen@is.aist-nara.ac.jp, 1994 ++ */ + #ifndef lint + static char rcsid[] = + "$Id: plain2-2.53-html.94aug14.patch,v 1.1 1999/02/05 22:36:10 kohda Exp $ (NEC)"; +*************** static char rcsid[] = +*** 19,27 **** +--- 22,32 ---- + ?(textp)->body\ + :(textp)->body+(textp)->indent) + #endif ++ + /* + * Definition of Output driver routines. + */ ++ /***** roff *****/ + int roffPlain(), roffExample(), + roffListBlock(), roffDlistItem(), + roffListItem(), roffRawText(), roffSpace(), +*************** int roffPlain(), roffExample(), +*** 33,38 **** +--- 38,45 ---- + roffTable(), roffFTitle(), roffTitle(); + char *roffQuote1(), *roffQuote2(); + ++ ++ /***** TeX *****/ + int texPlain(), texExample(), + texListBlock(), texDlistItem(), + texListItem(), texRawText(), texSpace(), +*************** int texPlain(), texExample(), +*** 44,49 **** +--- 51,70 ---- + texTable(), texFTitle(), texTitle(); + char *texQuote1(), *texQuote2(); + ++ #ifdef HTML ++ /***** HTML *****/ ++ int htmlPlain(), htmlExample(), ++ htmlListBlock(), htmlDlistItem(), ++ htmlListItem(), htmlRawText(), htmlSpace(), ++ htmlCapsule(), htmlComment(), ++ #ifdef PICTURE ++ htmlPictureBlock(), htmlPicLine(), htmlPicArc(), ++ htmlPicText(), htmlLineWidth(), ++ #endif ++ htmlTable(), htmlFTitle(), htmlTitle(); ++ char *htmlQuote1(), *htmlQuote2(); ++ #endif ++ + struct outDev roffPut = { + roffPlain, roffExample, + roffListBlock, roffDlistItem, +*************** struct outDev texPut = { +*** 69,77 **** +--- 90,121 ---- + texTable, texFTitle, texTitle, + texQuote1, texQuote2, + }; ++ ++ #ifdef HTML ++ struct outDev htmlPut = { ++ htmlPlain, htmlExample, ++ htmlListBlock, htmlDlistItem, ++ htmlListItem, htmlRawText, htmlSpace, ++ htmlCapsule, htmlComment, ++ #ifdef PICTURE ++ htmlPictureBlock, htmlPicLine, htmlPicArc, ++ htmlPicText, htmlLineWidth, ++ #endif ++ htmlTable, htmlFTitle, htmlTitle, ++ htmlQuote1, htmlQuote2, ++ }; ++ #endif ++ ++ ++ #ifdef HTML + /* ++ * Output text in (roff, TeX or HTML) format. ++ */ ++ #else ++ /* + * Output text in (roff or TeX) format. + */ ++ #endif + + struct inline_mark { + char il_mark; +diff -p -c -r -N orig-plain2-2.53/src/picture.c plain2/src/picture.c +*** orig-plain2-2.53/src/picture.c Wed Dec 2 16:01:34 1992 +--- plain2/src/picture.c Wed Jan 19 19:09:26 1994 +*************** +*** 1,6 **** +--- 1,10 ---- + /* + * Copyright (C) 1991,1992 NEC Corporation. + */ ++ /* ++ * modify by k-chinen@is.aist-nara.ac.jp, 1994 ++ */ ++ + #ifndef lint + static char rcsid[]= + "$Id: plain2-2.53-html.94aug14.patch,v 1.1 1999/02/05 22:36:10 kohda Exp $ (NEC)"; +*************** int end; +*** 627,632 **** +--- 631,669 ---- + int l; + int maxLen; + int minInd; ++ ++ #ifdef HTML ++ static int pic_count=0; ++ if(put == &htmlPut) { ++ if(htmlOnce) { ++ if(rawOutput) { ++ printf("<PRE>\n"); ++ for( l = begin; l < end; l++) { ++ htmlRawText(texts[l]->body); ++ } ++ printf("</PRE>\n"); ++ } ++ else { ++ printf("<!-- PICTURE -->\n"); ++ } ++ return ; ++ } ++ else { ++ printf("<!-- plain2:PICTURE %05d %d %d -->\n", ++ pic_count, begin, end); ++ if(htmlHere) { ++ printf("<P><IMG SRC=\"PIC%05d.gif\">\n", pic_count); ++ } ++ else { ++ printf("<P><B><A HREF=\"PIC%05d.gif\">Picture here</A></B></P>\n", ++ pic_count); ++ } ++ pic_count++; ++ return ; ++ } ++ } ++ #endif /* HTML */ ++ + minInd = minIndent(begin, end); + maxLen = maxLength(begin, end); + if ((maxLen - minInd) * fontSize > pageWidth) +diff -p -c -r -N orig-plain2-2.53/src/plain2.c plain2/src/plain2.c +*** orig-plain2-2.53/src/plain2.c Fri Jan 7 18:40:47 1994 +--- plain2/src/plain2.c Wed Jan 19 19:09:44 1994 +*************** +*** 1,6 **** +--- 1,10 ---- + /* + * Copyright (C) 1991,1992,1994 NEC Corporation. + */ ++ /* ++ * modify by k-chinen@is.aist-nara.ac.jp, 1994 ++ */ ++ + #ifndef lint + static char rcsid[] = + "$Id: plain2-2.53-html.94aug14.patch,v 1.1 1999/02/05 22:36:10 kohda Exp $ (NEC)"; +*************** static char rcsid[] = +*** 12,17 **** +--- 16,44 ---- + #include "plain2.h" + #include "macro.h" + ++ #ifdef HTML ++ #define PLAIN2_USAGE_1 "\ ++ usage: plain2 [options] [files ...]\n\n\ ++ ---- parser options ---- ---- output options ----(default)\n\ ++ -table=dd: table factor [0-100](def=50) -roff: troff output\n\ ++ -exam=dd: example factor[0-100](def=50) -ms/-mm: troff macro (mm)\n\ ++ -indsec: sections can be indented -tex: tex output\n\ ++ -ktable:enable JIS keisen table -tstyle=ss:tex style\n\ ++ -ref: figure/picture reference -html: HTML output\n\ ++ -htmlonce: HTML (one path) output\n\ ++ -here: HTML table/picture ref.\n\ ++ -renum: renumbering only\n\ ++ -[no]listd:list decoration (on)\n\ ++ ---- Others ---- -[no]space:spacing (on)\n\ ++ -v: verbose output -[no]pre: preamble block (on)\n\ ++ -dLevel: debug level -[no]acursec: section numbers (off)\n\ ++ ----- experimental ---- -raw: quote special chars(off)\n\ ++ -pt=Size: font size -jis: JIS code output\n\ ++ -sjis: Shift-JIS code input/output\n\ ++ -f file: output customization\n\n" ++ #define VERSION "plain2 r2.53 1994/01 by A.Uchida C&C Open Systems Lab. NEC\n\ ++ \t(HTML output) by k-chinen@is.aist-nara.ac.jp, NAIST" ++ #else + #define PLAIN2_USAGE_1 "\ + usage: plain2 [options] [files ...]\n\ + ---- parser options ---- ---- output options ----(default)\n\ +*************** usage: plain2 [options] [files ...]\n\ +*** 29,40 **** + -sjis: Shift-JIS code input/output\n\ + -f file: output customization\n" + #define VERSION "plain2 r2.53 1994/01 by A.Uchida C&C Open Systems Lab. NEC" + +! extern char *getenv(); + extern char *optarg; + extern int optind; + extern struct macDefs roffMacros[], roffMsMacros[]; + extern struct macDefs texMacros[]; + /* + * Default parameters for Parsing + */ +--- 56,72 ---- + -sjis: Shift-JIS code input/output\n\ + -f file: output customization\n" + #define VERSION "plain2 r2.53 1994/01 by A.Uchida C&C Open Systems Lab. NEC" ++ #endif + +! extern char *getenv(); + extern char *optarg; + extern int optind; + extern struct macDefs roffMacros[], roffMsMacros[]; + extern struct macDefs texMacros[]; ++ #ifdef HTML ++ extern struct macDefs htmlMacros[]; ++ #endif ++ + /* + * Default parameters for Parsing + */ +*************** int texQuote = 0; +*** 64,69 **** +--- 96,105 ---- + int fontSize = 10; + int fontSpecified = 0; + int verbose = 0; ++ #ifdef HTML ++ int htmlOnce = 0; ++ int htmlHere = 0; ++ #endif + char *plain2Lib = NULL; + char *macroName = NULL; + char *texStyle = NULL; +*************** doPlain2() +*** 163,176 **** + + if (firstTime) { + firstTime = 0; + if (put == &roffPut) { + if (roffMacro == MS_MACRO) + initMacroDefs(roffMsMacros); + initMacroDefs(roffMacros); + } +! else if (put == &texPut) + initMacroDefs(texMacros); +- if (put == &texPut) { + if (halfCooked) { + texSetTrans(0); + } +--- 199,224 ---- + + if (firstTime) { + firstTime = 0; ++ #ifdef HTML ++ if (put == &htmlPut) { ++ initMacroDefs(htmlMacros); ++ /* sorry, nothing is change this "if" */ ++ if (halfCooked) { ++ htmlSetTrans(0); ++ } ++ else { ++ htmlSetTrans(1); ++ } ++ } ++ else ++ #endif + if (put == &roffPut) { + if (roffMacro == MS_MACRO) + initMacroDefs(roffMsMacros); + initMacroDefs(roffMacros); + } +! else if (put == &texPut) { + initMacroDefs(texMacros); + if (halfCooked) { + texSetTrans(0); + } +*************** char **xargv; +*** 407,412 **** +--- 455,476 ---- + OUTPUT_OPTION("-alfraw"); + halfCooked = 1; + } ++ #ifdef HTML ++ else if (strcmp(optarg, "tmlonce") == 0) { ++ OUTPUT_OPTION("-htmlonce"); ++ htmlOnce = 1; ++ put = &htmlPut; ++ } ++ else if (strcmp(optarg, "tml") == 0) { ++ OUTPUT_OPTION("-html"); ++ htmlOnce = 0; ++ put = &htmlPut; ++ } ++ else if (strcmp(optarg, "ere") == 0) { ++ OUTPUT_OPTION("-here"); ++ htmlHere = 1; ++ } ++ #endif + else goto usage; + break; + case 't': +diff -p -c -r -N orig-plain2-2.53/src/plain2.h plain2/src/plain2.h +*** orig-plain2-2.53/src/plain2.h Fri Jan 7 05:34:50 1994 +--- plain2/src/plain2.h Wed Jan 19 19:10:16 1994 +*************** +*** 19,24 **** +--- 19,28 ---- + * 2.4: 28/04/92 + * 2.5: 06/08/93 + */ ++ /* ++ * modify by k-chinen@is.aist-nara.ac.jp, 1994 ++ */ ++ + #define NEC_CCS /* NEC C&C Common Software Lab. dependent */ + + #define NTT_TEX /* NTT jlatex */ +*************** extern int accurateSecnum; /* Accurate +*** 203,208 **** +--- 207,216 ---- + extern int listDecor; /* List decoration */ + extern int reflectSpace; /* reflect space lines */ + extern int texQuote; /* Use \verb| | for tex output */ ++ #ifdef HTML ++ extern int htmlOnce; /* One/Multi-path flag for HTML */ ++ extern int htmlHere; /* flag of pic/tbl here or not */ ++ #endif + extern int indexEnabled; /* Enables Indexing */ + extern int fontSize; /* font size */ + extern int fontSpecified; /* font size specified */ +*************** struct outDev { +*** 309,314 **** +--- 317,325 ---- + }; + extern struct outDev roffPut; + extern struct outDev texPut; ++ #ifdef HTML ++ extern struct outDev htmlPut; ++ #endif + extern struct outDev *put; + + #define INLINE_BEGIN "((" +diff -p -c -r -N orig-plain2-2.53/src/plain2html plain2/src/plain2html +*** orig-plain2-2.53/src/plain2html +--- plain2/src/plain2html Sun Aug 14 02:27:11 1994 +*************** +*** 0 **** +--- 1,159 ---- ++ #!/usr/local/bin/tcsh ++ # ++ # plain2html: plain text to HTML file ++ # by k-chinen@is.aist-nara.ac.jp , 1994 ++ # ++ # NOTE: ++ # * This script will be running under csh or tcsh. ++ # * Handle with care for directory, because this script make ++ # a lot of temporary file and output file. ++ # ++ ++ ++ # ++ # require: ++ # ++ # program: ++ # csh or tcsh ++ # plain2 ( have -html option verison ) ++ # awk ++ # groff ( gtbl, gpic ) ++ # latex or jlatex ++ # dvi2ps ++ # convert ( convertable PS to Any-format version ) ++ # pnmcrop ( included PBMPLUS ) ++ # ghostscript ( called by convert when convert PS format ) ++ # ++ # script: ++ # pt2htcol.awk ( included this packeage ) ++ # ++ # ++ # input: ++ # $1 (plain text file name. e.g., README.j) ++ # ++ # output: ++ # $1:r.html (e.g., README.html) ++ # ++ # temporary file: ++ # _src, _cut.sh , _out.html , pt2empty.sty, _tmp.pnm ++ # TBL*.p TBL*.ps TBL*.src TBL*.tex TBL*.dvi TBL*.pnm ++ # PIC*.p PIC*.ps PIC*.src PIC*.tex PIC*.dvi PIC*.pnm ++ # ++ ++ ++ # ++ # Default values ++ # ++ set tex=1 ++ set roff=0 ++ set lib=/usr/local/lib/plain2 ++ ++ ++ # ++ # Check args. ++ # ++ if ( $#argv > 0 ) then ++ switch ($1) ++ case -tex: ++ set tex=1 ++ set roff=0 ++ shift ++ breaksw ++ case -roff: ++ set tex=0 ++ set roff=1 ++ shift ++ breaksw ++ default: ++ breaksw ++ endsw ++ endif ++ ++ if ( $#argv > 0 ) then ++ set target=$1 ++ else ++ cat << END_USAGE ++ plain2html: plain text to HTML file ++ by k-chinen@is.aist-nara.ac.jp NAIST , 1994 ++ ++ usage: plain2html [option] input-filename ++ ++ option: -tex TeX mode (use latex, dvi2ps) [defauts] ++ -roff roff mode (use groff) ++ ++ END_USAGE ++ exit ++ endif ++ ++ ++ ++ # ++ # Start ++ # convert document's main body. ++ # collect table/picture location and cut these. ++ # ++ ++ echo "Copy Target $target ." ++ cp $target _src ++ ++ echo "Process document main body" ++ plain2 -html -jis -here _src > _out.html ++ ++ echo "Collect Table/Picutre" ++ awk -f $lib/pt2htcol.awk _out.html > _cut.sh ++ ++ ++ ++ # ++ # Convert parts(table/picture) via LaTeX ++ # If you don't have jlatex substitute to "latex". ++ # ( jlatex is Japanese LaTeX ) ++ # ++ if ( $tex ) then ++ cat << END_STYLEFILE > pt2empty.sty ++ \\thispagestyle{empty} ++ \\pagestyle{empty} ++ END_STYLEFILE ++ cat << END_TEX_CUT >> _cut.sh ++ foreach i ( TBL*.p PIC*.p ) ++ echo "Part \$i process" ++ plain2 -tex -jis -tstyle=pt2empty \$i > \$i:r.tex ++ jlatex \$i:r.tex ++ dvi2ps \$i:r.dvi > \$i:r.ps ++ convert -density 144x144 \$i:r.ps \$i:r.pnm ++ pnmcrop -white \$i:r.pnm > _tmp.pnm ++ convert _tmp.pnm \$i:r.gif ++ rm -f \$i:r.ps \$i:r.dvi \$i:r.aux \$i:r.log \$i:r.tex \$i:r.p \$i:r.pnm ++ end ++ END_TEX_CUT ++ endif ++ ++ # ++ # Convert parts(table/picture) via GROFF ++ # If you don't have gorff substitute to ROFF-like program. ++ # ++ if ( $roff ) then ++ cat << END_ROFF_CUT >> _cut.sh ++ foreach i ( TBL*.p PIC*.p ) ++ echo "Part \$i process" ++ plain2 -roff -euc \$i > \$i:r.src ++ groff -me -t -p \$i:r.src > \$i:r.ps ++ convert -density 144x144 \$i:r.ps \$i:r.pnm ++ pnmcrop -white \$i:r.pnm > _tmp.pnm ++ convert _tmp.pnm \$i:r.gif ++ rm -f \$i:r.ps \$i:r.src \$i:r.p \$i:r.pnm ++ end ++ END_ROFF_CUT ++ endif ++ ++ # ++ # Run parts conversion script ++ # ++ echo "Cut Table/Picture" ++ $shell _cut.sh ++ ++ rm -f $target:r.html ++ mv _out.html $target:r.html ++ rm -f _cut.sh pt2empty.sty _src _tmp.pnm ++ ++ echo "Complete" +diff -p -c -r -N orig-plain2-2.53/src/pt2htcol.awk plain2/src/pt2htcol.awk +*** orig-plain2-2.53/src/pt2htcol.awk +--- plain2/src/pt2htcol.awk Wed Jan 19 11:20:18 1994 +*************** +*** 0 **** +--- 1,20 ---- ++ # ++ # pt2htcol.awk: plain2html's parts collection awk-script. ++ # by k-chinen@is.aist-nara.ac.jp , 1994 ++ # ++ # plain2's (with -html) output have "plain2:TABLE" and "plain2:PICTURE" ++ # sentence. It is mean that output have link to TABLE and PICTURE. ++ # Therefore, this script collect such sentence and make cutting script. ++ # ++ BEGIN{ ++ } ++ /^<!-- plain2:TABLE/{ ++ # print "# " $0 ++ printf "# table %d th, start %d, end %d\n", $3, $4, $5 ++ printf "head -%d _src| tail -%d > TBL%05d.p\n",$5, $5-$4+1, $3 ++ } ++ /^<!-- plain2:PICTURE/{ ++ # print "# " $0 ++ printf "# picture %d th, start %d, end %d\n", $3, $4, $5 ++ printf "head -%d _src| tail -%d > PIC%05d.p\n",$5, $5-$4+1, $3 ++ } --- plain2-2.54p1.orig/debian/patch/plain2-2.54.nide-patch +++ plain2-2.54p1/debian/patch/plain2-2.54.nide-patch @@ -0,0 +1,895 @@ + 奈良女子大学の新出と申します。 + べた書きテキストをroffやLaTeXの原稿ファイルに変換するソフト「plain2」 +(の最新版、v2.54)に対する、若干のバグ修正&拡張を行うパッチを作りましたの +で、大したものではありませんが流します。 + このパッチは公式なものではありません。バグ修正については、オリジナルに +吸収したい旨(plain2の作者の)内田さんから連絡頂きましたが、機能拡張につい +てはオリジナルには取り込まれないかも知れません。 + このパッチには次のような機能があります。 + + +[A] ソースのバグ修正 + + (1) 一部の関数がauto配列へのポインタを戻り値として返していた。 + (2) malloc()の戻り値チェックが抜けているところがあった。 + + +[B] TeX出力の不具合修正 + + (1) TeX出力をコンパイルする際、「Underfill \hbox (badness 10000」の警告 +がたくさん出ていたが、これをできる限り排除した。といっても具体的には、空 +行をあけようとして「\\」を不適切に使っている箇所で、間に「\mbox{}」を挟 +んだだけ。とはいえ、もっと重要なエラーメッセージを見逃すのを防ぐ役には立 +つ(か?) + + (2) TeX出力時に、例示の直前の本文の行間が不当に狭くなることがあったのを +修正。具体的には、例えば + + ここは平文です。ここは平文です。ここは平文です。ここは平文です。 + ここは平文です。ここは平文です。ここは平文です。ここは平文です。 + 例示 例示 + 例示 例示 + ここは平文です。ここは平文です。ここは平文です。ここは平文です。 + ここは平文です。ここは平文です。ここは平文です。ここは平文です。 + +のような文書をplain2 -texで処理すると出力は + + ここは平文です。ここは平文です。ここは平文です。ここは平文です。 + ここは平文です。ここは平文です。ここは平文です。ここは平文です。 + {\baselineskip=10pt + \begin{verbatim} + 例示 例示 + 例示 例示 + \end{verbatim}} + \par + ここは平文です。ここは平文です。ここは平文です。ここは平文です。 + ここは平文です。ここは平文です。ここは平文です。ここは平文です。 + +のようになるが、\baselineskip の変更直前に改段落がないため、例示の直前の +平文の部分まで行間が狭くなってしまっていた。改段落を入れることによってこ +れを直した。 + + +[C] TeX出力に関する機能拡張 + + (1) NTT JLaTeX、ASCII日本語LaTeXのどちらにも通用する出力を吐くようにし +た。これまではコンパイルの段階でどちらかを選ばねばならず、オプションスイッ +チで切り替えることもできなかった。 + 具体的には、\gtfamあるいは\gtfamilyというマクロが定義されていたらASCII +日本語LaTeXと見なしてjarticleスタイルを、そうでなければNTT JLaTeXと見な +してj-articleスタイルを使う(ような出力を吐く)ようにした。また、こうする +とNTT JLaTeXの場合の\bfコマンドの再定義がいらなくなるのでこれを除去した。 + (ちなみにこれまでも、実はASCII日本語LaTeX用の出力でNTT JLaTeXにもほぼ +通っていたのだが、その場合jarticleスタイルを使っていた。今回の修正により +NTT JLaTeX本来のj-articleを使うようになる) + + (2) (1)に伴い、両方のJLaTeXで通用するような用紙サイズ指定が、plain2の +-tオプションで簡単に行えるようにした。 + 具体的には、-tstyle= オプションで [ab][45]j? を指定すると、NTT JLaTeX +の場合jをつけないa4.sty等、ASCII日本語LaTeXの場合jをつけたa4j.sty等を自 +動的に使い分ける。例えば、-tstyle=b4 あるいは -tstyle=b4j のように指定す +ると、NTT JLaTeXではb4.sty、ASCII日本語LaTeXではb4j.styを使う。 +-tstyle=b4j,12pt のような指定も大丈夫。 + plain2のデフォルトは用紙指定なしだが、A4用紙を使う指定をTeX出力のデフォ +ルトにすることもコンパイル時指定で可能。そのためには、src/plain2.hの +DEFAULT_STYの定義を変更する。 + + (3) -jverbオプションを新設した。TeX出力時にこのオプションを使うと、例示 +の部分にjverbatim環境というものを使うようになり、この結果、例示部に日本 +語が混じっていても縦が揃う。デフォルトでは、例示の部分にverbatim環境を使 +うため、日本語が混じると縦が揃わない。 + 但し、jverbatim環境用のstyファイル(jverb.sty)は別途用意しておくことが +必要。ftp://ftp.vector.co.jp/pack/mac/writing/other/jverb1.03.cpt.bin に +ある。 + + +[D] その他の拡張 + + (1) タイトルのパターンで「大学」「学部」などが所属部門を表す文字列として +認識されるようになった:-) src/title.c参照。 + + + なお、このパッチにはソースの差分の他、docディレクトリ下のmake時の警告 +メッセージを防ぐための差分、およびドキュメントの例示部にjverbatim環境(上 +記[C](3)参照)を使うようにする差分も含まれていますが、ドキュメントの内容 +自体の変更は含まれていません(つまり、パッチを当てても上記[C][D]がドキュ +メントに反映されない)。また、doc/plain2.psに対する差分も含まれていません +(つまり、パッチを当ててもdoc/plain2.psは元のままで、パッチ後のdocディレ +クトリ下をmakeして得られるものと同じにはならない)。ご注意下さい。 + このパッチについて、私は著作権を主張しません。また、このパッチは無保証 +です。このパッチに関するお問い合わせは私までお願いします(但し99年1月中は +応答できません)。 + 99/1/2 nide@ics.nara-wu.ac.jp + +diff -ur plain2-2.54.orig/doc/Beginning.tex plain2-2.54/doc/Beginning.tex +--- plain2-2.54.orig/doc/Beginning.tex Tue Apr 19 18:32:36 1994 ++++ plain2-2.54/doc/Beginning.tex Thu Aug 13 13:03:00 1998 +@@ -9,7 +9,7 @@ + } + \medskip + +-{\large \dg\bf\addtocounter{sectionx}{1}\setcounter{subsectionx}{0}{\thesectionx} ようこそ plain2 の世界へ} ++{\large \bf\addtocounter{sectionx}{1}\setcounter{subsectionx}{0}{\thesectionx} ようこそ plain2 の世界へ} + \medskip + \par + TeXなんて書けない,読めない.そんなユーザの声に応える +@@ -24,10 +24,10 @@ + \ \ \ \ \ \ \ \ ...\\ + \%~xdvi~example.dvi\\ + } +-\endlist} ++\mbox{}\endlist} + \medskip + +-{\normalsize \dg\bf\addtocounter{subsectionx}{1}\setcounter{subsubsectionx}{0}{\thesectionx}.{\thesubsectionx} 多様なリスト} ++{\normalsize \bf\addtocounter{subsectionx}{1}\setcounter{subsubsectionx}{0}{\thesectionx}.{\thesubsectionx} 多様なリスト} + \medskip + \par + いろいろなリストが書けます.ネストもできます. +@@ -45,12 +45,12 @@ + \medskip + \end{itemize} + +-{\normalsize \dg\bf\addtocounter{subsectionx}{1}\setcounter{subsubsectionx}{0}{\thesectionx}.{\thesubsectionx} テーブルと線画の機能} ++{\normalsize \bf\addtocounter{subsectionx}{1}\setcounter{subsubsectionx}{0}{\thesectionx}.{\thesubsectionx} テーブルと線画の機能} + \medskip + \par + plain2ならテーブルも簡単に書けます + ~\\ +-\begin{center} ++\mbox{}\begin{center} + \begin{tabular}{|c|c|c|c|} + \hline + & べた書き & マークアップ & ワープロ\\ +@@ -63,7 +63,7 @@ + \end{center} + \medskip + ~\\ +-\begin{center} ++\mbox{}\begin{center} + \begin{picture}(288,120)(0,0) + \put(3,97){簡単な絵くらいは書けます.} + \thinlines +diff -ur plain2-2.54.orig/doc/Example_adjust2.tex plain2-2.54/doc/Example_adjust2.tex +--- plain2-2.54.orig/doc/Example_adjust2.tex Tue Apr 19 18:32:38 1994 ++++ plain2-2.54/doc/Example_adjust2.tex Thu Aug 13 13:03:00 1998 +@@ -19,5 +19,5 @@ + cc $-$DKANJI $-$DPICTURE $-$DBSD $-$DDEBUG $-$target sun4 $-$c hint.c\\ + cc $-$DKANJI $-$DPICTURE $-$DBSD $-$DDEBUG $-$target sun4 $-$c justify.c\\ + cc $-$DKANJI $-$DPICTURE $-$DBSD $-$DDEBUG $-$target sun4 $-$c texout.c\\ +-\endlist} ++\mbox{}\endlist} + }\end{minipage}}\\ +diff -ur plain2-2.54.orig/doc/Makefile plain2-2.54/doc/Makefile +--- plain2-2.54.orig/doc/Makefile Tue Apr 19 18:32:40 1994 ++++ plain2-2.54/doc/Makefile Thu Aug 13 13:03:00 1998 +@@ -46,7 +46,7 @@ + Example_adjust2.tex + + PRTGIF=prtgif+ +-PLAIN2=../src/plain2 ++PLAIN2=../src/plain2 -tstyle=a4j -jverb + VERBTEXFILES= + + plain2.ps: plain2.dvi +@@ -63,7 +63,10 @@ + rm -f ${SAMPLES} ${OTHERFILES} plain2.tex plain2.dvi plain2.ps \ + plain2.toc plain2.aux plain2.log + +-title_a47.tex title_shounin.tex: ++title_a47.tex: title_a47.raw ++ $(PLAIN2) -tex -fexampl_left $< > $@ ++ ++title_shounin.tex: title_shounin.raw + $(PLAIN2) -tex -fexampl_left $< > $@ + + table_kanji.tex: table_kanji.pln +diff -ur plain2-2.54.orig/doc/Tgif_doc.tex plain2-2.54/doc/Tgif_doc.tex +--- plain2-2.54.orig/doc/Tgif_doc.tex Tue Apr 19 18:32:42 1994 ++++ plain2-2.54/doc/Tgif_doc.tex Thu Aug 13 13:03:00 1998 +@@ -2,11 +2,11 @@ + \hspace*{2cm}\framebox[13.5cm][l]{~~\begin{minipage}{12cm} + \setcounter{sectionx}{0}{\small\baselineskip=10pt + +-{\large \dg\bf\addtocounter{sectionx}{1}\setcounter{subsectionx}{0}{\thesectionx} tgif+ の利用} ++{\large \bf\addtocounter{sectionx}{1}\setcounter{subsectionx}{0}{\thesectionx} tgif+ の利用} + \medskip + \par + tgif+ で書いた絵を次のようにして +-べた書き文書に取り込みます.\\ ++べた書き文書に取り込みます.\\\mbox{} + + \medskip + +diff -ur plain2-2.54.orig/doc/exampl.p2 plain2-2.54/doc/exampl.p2 +--- plain2-2.54.orig/doc/exampl.p2 Tue Apr 19 18:32:48 1994 ++++ plain2-2.54/doc/exampl.p2 Thu Aug 13 13:03:00 1998 +@@ -7,6 +7,8 @@ + + EXAM_BEGIN "{\\baselineskip=#1pt\n\\tt\\obeylines\\catcode` =11\n" + EXAM_END "}\n", ++JEXAM_BEGIN "{\\baselineskip=#1pt\n\\tt\\obeylines\\catcode` =11\n" ++JEXAM_END "}\n", + BOLD_BEGIN, "{\\bf " + + SECTION_1 "\n{\\normalsize \\bf\\addtocounter{sectionx}{1}\ +diff -ur plain2-2.54.orig/doc/exampl_star.p2 plain2-2.54/doc/exampl_star.p2 +--- plain2-2.54.orig/doc/exampl_star.p2 Tue Apr 19 18:32:51 1994 ++++ plain2-2.54/doc/exampl_star.p2 Thu Aug 13 13:03:00 1998 +@@ -7,6 +7,8 @@ + + EXAM_BEGIN "{\\baselineskip=#1pt\n\\tt\\obeylines\\catcode` =11\n" + EXAM_END "}\n", ++JEXAM_BEGIN "{\\baselineskip=#1pt\n\\tt\\obeylines\\catcode` =11\n" ++JEXAM_END "}\n", + + SECTION_1 "\n\\section*{@1}\n" + SECTION_2 "\n\\subsection*{@1}\n" +diff -ur plain2-2.54.orig/doc/guide.p2 plain2-2.54/doc/guide.p2 +--- plain2-2.54.orig/doc/guide.p2 Tue Apr 19 18:32:57 1994 ++++ plain2-2.54/doc/guide.p2 Thu Aug 13 13:03:00 1998 +@@ -1,4 +1,10 @@ +-DOC_BEGIN "\\documentstyle[epsf]{jarticle}\n\ ++DOC_BEGIN "\ ++ \\newif\\ifNTT\\NTTfalse\n\ ++ \\ifx\\gtfam\\undefined\\ifx\\gtfamily\\undefined\\NTTtrue\\fi\\fi\n\ ++ \\ifNTT\\documentstyle[$2,epsf]{j-article}\n\ ++ \\else\\documentstyle[$3,epsf]{jarticle}\\fi\n\ ++ \\advance\\textwidth1.4cm \\advance\\oddsidemargin-.7cm\n\ ++ \\advance\\textheight2cm \\advance\\topmargin-1cm\n\ + \\setcounter{secnumdepth}{6}\n\ + \\setcounter{tocdepth}{6}\n\ + \\topsep=0.1cm\n\ +@@ -15,12 +21,12 @@ + \\let\\@mkboth=\\@gobbletwo\n\ + \\def\\@evenhead{}\\def\\@evenfoot{}%\n\ + \\def\\@oddhead{\\makebox[\\textwidth]%\n\ +- {\\ plain2ユーザガイド(r2.5)\\hfill\\thesection\\ 章}}%\n\ ++ {plain2ユーザガイド(r2.5)\\hfill\\thesection\\ 章}}%\n\ + \\def\\@oddfoot{\\makebox[\\textwidth]%\n\ +- {\\rightmark\\leaders\\hbox{\\tiny ~plain2}\\hfill}\\ \\thepage}}\n\ +- \\@ifundefined{jintercharskip}{%\n\ +- \\def\\p2zerointerskip{\\kanjiskip=0cm}}{%\n\ +- \\def\\p2zerointerskip{\\jintercharskip=0cm}}\n\ ++ {\\rightmark\\leaders\\hbox{\\tiny ~plain2}\\hfill\\ \\thepage}}}\n\ ++ %\\@ifundefined{jintercharskip}{%\n\ ++ % \\def\\p2zerointerskip{\\kanjiskip=0cm}}{%\n\ ++ % \\def\\p2zerointerskip{\\jintercharskip=0cm}}\n\ + \\makeatother\n" + SECTION_1 "\n\ + \\section{@1}\ +diff -ur plain2-2.54.orig/doc/plain2.pln plain2-2.54/doc/plain2.pln +--- plain2-2.54.orig/doc/plain2.pln Fri Jan 7 18:41:22 1994 ++++ plain2-2.54/doc/plain2.pln Thu Aug 13 13:03:00 1998 +@@ -377,6 +377,7 @@ + + [[R + \input{picture_intro.tex} ++\mbox{} % to avoid `Underfull \hbox (badness 10000)' + ]]R + + 3. plain2 コマンド +@@ -2270,7 +2271,7 @@ + "tgif_fig.eps"とします. + [[R + ~\\ +-\begin{center} ++\mbox{}\begin{center} + \epsfile{file=tgif_win.eps}\\ + \end{center} + ]]R +diff -ur plain2-2.54.orig/doc/pln2raw plain2-2.54/doc/pln2raw +--- plain2-2.54.orig/doc/pln2raw Tue Apr 19 18:29:07 1994 ++++ plain2-2.54/doc/pln2raw Thu Aug 13 13:03:00 1998 +@@ -9,22 +9,25 @@ + LNUM= + while getopts n c + do +- case $c in ++ case "$c" in + n) LNUM="on" + shift + ;; + esac + done + +-echo '{\list{}{\leftmargin=0.5in}\item[]' +-echo '{\baselineskip=10pt' +-echo '\p2zerointerskip' +-echo '\begin{verbatim}' ++cat <<'EOF' ++{\list{}{\leftmargin=0.5in}\item[] ++{\par\baselineskip=10pt ++\begin{jverbatim} ++EOF + if [ "$LNUM" = "on" ] + then +- awk '{printf "%3d: %s\n",NR,$0}' $1 ++ awk '{printf "%3d: %s\n",NR,$0}' ${1+"$@"} + else +- cat $1 ++ cat ${1+"$@"} + fi | expand +-echo '\end{verbatim}}' +-echo '\endlist}' ++cat <<'EOF' ++\end{jverbatim}\par} ++\endlist} ++EOF +diff -ur plain2-2.54.orig/doc/table_adjust.texv plain2-2.54/doc/table_adjust.texv +--- plain2-2.54.orig/doc/table_adjust.texv Tue Apr 19 18:34:02 1994 ++++ plain2-2.54/doc/table_adjust.texv Thu Aug 13 13:03:00 1998 +@@ -1,7 +1,7 @@ + {\list{}{\leftmargin=0.5in}\item[] + {\baselineskip=10pt +-\jintercharskip=0cm +-\begin{verbatim} ++\par ++\begin{jverbatim} + % plain2 -tex -nopre table_adjust.pln + \par + 次のように枠のないテーブルは, +@@ -12,5 +12,5 @@ + 明示的に指定する "[[T"と"]]T" + そのまま我慢する 多分例示になる + \endlist} +-\end{verbatim}} ++\end{jverbatim}\par} + \endlist} +diff -ur plain2-2.54.orig/lib/jbook.p2 plain2-2.54/lib/jbook.p2 +--- plain2-2.54.orig/lib/jbook.p2 Fri Feb 26 04:40:32 1993 ++++ plain2-2.54/lib/jbook.p2 Thu Aug 13 13:03:00 1998 +@@ -3,7 +3,11 @@ + # + # $Id: plain2-2.54.nide-patch,v 1.3 1999/02/10 03:30:26 kohda Exp $ + # +-DOC_BEGIN "\\documentstyle[]{jbook}\n\ ++DOC_BEGIN "\ ++\\newif\\ifNTT\\NTTfalse\n\ ++\\ifx\\gtfam\\undefined\\ifx\\gtfamily\\undefined\\NTTtrue\\fi\\fi\n\ ++\\ifNTT\\documentstyle[$2]{j-book}\n\ ++\\else\\documentstyle[$3]{jbook}\\fi\n\ + \\setcounter{secnumdepth}{6}\n\ + \\setcounter{tocdepth}{6}\n\ + \\topsep=0.1cm\n\ +diff -ur plain2-2.54.orig/src/Makefile plain2-2.54/src/Makefile +--- plain2-2.54.orig/src/Makefile Tue Apr 19 19:35:38 1994 ++++ plain2-2.54/src/Makefile Thu Aug 13 13:58:00 1998 +@@ -12,11 +12,11 @@ + + DEFINES=-DKANJI -DPICTURE + +-#CC=gcc +-#CFLAGS= -fwritable-strings ${DEFINES} -DBSD -DDEBUG ++CC=gcc ++CFLAGS= -fwritable-strings ${DEFINES} -DBSD -DDEBUG -O2 -s + +-CC=cc +-CFLAGS= -O ${DEFINES} -DBSD -DDEBUG ++#CC=cc ++#CFLAGS= -O ${DEFINES} -DBSD -DDEBUG + #CFLAGS= -g ${DEFINES} -DDEBUG + + SRCS=plain2.c readfile.c analyze.c miscutil.c\ +diff -ur plain2-2.54.orig/src/headfoot.c plain2-2.54/src/headfoot.c +--- plain2-2.54.orig/src/headfoot.c Tue Apr 19 19:16:22 1994 ++++ plain2-2.54/src/headfoot.c Thu Aug 13 13:04:25 1998 +@@ -282,6 +282,8 @@ + } + /* + * Build and print Header/Footer string for troff output ++ * (Note: This function returns a pointer to a static buffer which will be ++ * re-written at next call) + */ + extern struct transTable roffTransQ[]; + char * +@@ -290,7 +292,7 @@ + { + char left[HF_MAXLEN]; + char right[HF_MAXLEN]; +- char ret[64]; ++ static char ret[64]; + if (build(pat1, pat2, left, right)) { + (void)strcpy(ret, codeCvt(textQuote(left, roffTransQ))); + (void)strcat(ret, "\\\\\\\\nP"); +diff -ur plain2-2.54.orig/src/hint.c plain2-2.54/src/hint.c +--- plain2-2.54.orig/src/hint.c Tue Apr 19 19:16:41 1994 ++++ plain2-2.54/src/hint.c Thu Aug 13 13:03:00 1998 +@@ -47,7 +47,7 @@ + } + hp++; + } +- return NULL; ++ return 0; + } + hint(begin, end) + int begin; +diff -ur plain2-2.54.orig/src/macro.c plain2-2.54/src/macro.c +--- plain2-2.54.orig/src/macro.c Tue Apr 19 19:16:48 1994 ++++ plain2-2.54/src/macro.c Thu Aug 13 13:03:00 1998 +@@ -15,12 +15,14 @@ + #define MACRO_SUFFIX ".p2" + + struct macNames macNames[] = { +- "DOC_BEGIN", M_DOC_BEGIN, "#$", ++ "DOC_BEGIN", M_DOC_BEGIN, "#$$", + "DOC_END", M_DOC_END, "", + "PLAIN_BEGIN", M_PLAIN_BEGIN, "", + "PLAIN_END", M_PLAIN_END, "", + "EXAM_BEGIN", M_EXAM_BEGIN, "#", + "EXAM_END", M_EXAM_END, "", ++ "JEXAM_BEGIN", M_JEXAM_BEGIN, "#", ++ "JEXAM_END", M_JEXAM_END, "", + "SET_SEC", M_SET_SEC, "#$", + "APPENDIX", M_APPENDIX, "$", + "APDX_BEGIN", M_APDX_BEGIN, "", +@@ -86,12 +88,18 @@ + struct cmpMac *mip, *new_mip; + int def_type; + mip = (struct cmpMac *)malloc(sizeof(struct cmpMac)); ++ if(mip == NULL){ /* Add Nide */ ++ malloc_error: ++ fprintf(stderr, "PANIC(malloc in macroParse)\n"); ++ exit (2); ++ } + mip->cmac_next = NULL; + mip->cmac_argnum = -1; + mip->cmac_str = s; + while (*s) { + if (isdigit(*(s+1)) && (def_type = atype(*s)) != ATYPE_VOID) { + new_mip=(struct cmpMac *)malloc(sizeof(struct cmpMac)); ++ if(new_mip == NULL) goto malloc_error; /* Add Nide */ + mip->cmac_next = new_mip; + new_mip->cmac_next = NULL; + new_mip->cmac_argtype = *s; +@@ -369,8 +377,7 @@ + } + if (ret == -1) + continue; +- s = (char *)malloc(strlen(defstr)); +- strcpy(s, defstr); ++ s = strsave(defstr); /* Changed Nide (but don't we need free?)*/ + outMacro[macroNum] = macroParse(s, macroNum, s); + } + fclose(fd); +diff -ur plain2-2.54.orig/src/macro.h plain2-2.54/src/macro.h +--- plain2-2.54.orig/src/macro.h Tue Apr 19 19:16:49 1994 ++++ plain2-2.54/src/macro.h Thu Aug 13 13:03:00 1998 +@@ -10,29 +10,31 @@ + #define M_PLAIN_END 3 + #define M_EXAM_BEGIN 4 + #define M_EXAM_END 5 +-#define M_SET_SEC 6 +-#define M_APPENDIX 7 +-#define M_APDX_BEGIN 8 +-#define M_BLANK 9 +-#define M_PAGE 10 +-#define M_NEWLINE 11 +-#define M_CENTER_BEGIN 12 +-#define M_CENTER_END 13 +-#define M_RIGHT_BEGIN 14 +-#define M_RIGHT_END 15 +-#define M_INDENT 16 +-#define M_INDENT0 17 +-#define M_TITLE 18 +-#define M_FOOTN_BEGIN 19 +-#define M_FOOTN_END 20 +-#define M_REFER_BEGIN 21 +-#define M_REFER_END 22 +-#define M_BOLD_BEGIN 23 +-#define M_BOLD_END 24 +-#define M_INDEX_BEGIN 25 +-#define M_INDEX_END 26 +-#define M_SECTION_END 27 +-#define M_SECTION_1 28 ++#define M_JEXAM_BEGIN 6 /* Inserted by Nide */ ++#define M_JEXAM_END 7 /* Inserted by Nide */ ++#define M_SET_SEC 8 ++#define M_APPENDIX 9 ++#define M_APDX_BEGIN 10 ++#define M_BLANK 11 ++#define M_PAGE 12 ++#define M_NEWLINE 13 ++#define M_CENTER_BEGIN 14 ++#define M_CENTER_END 15 ++#define M_RIGHT_BEGIN 16 ++#define M_RIGHT_END 17 ++#define M_INDENT 18 ++#define M_INDENT0 19 ++#define M_TITLE 20 ++#define M_FOOTN_BEGIN 21 ++#define M_FOOTN_END 22 ++#define M_REFER_BEGIN 23 ++#define M_REFER_END 24 ++#define M_BOLD_BEGIN 25 ++#define M_BOLD_END 26 ++#define M_INDEX_BEGIN 27 ++#define M_INDEX_END 28 ++#define M_SECTION_END 29 ++#define M_SECTION_1 30 + #define M_SECTION_2 (M_SECTION_1 + 1) + #define M_SECTION_3 (M_SECTION_1 + 2) + #define M_SECTION_4 (M_SECTION_1 + 3) +diff -ur plain2-2.54.orig/src/output.c plain2-2.54/src/output.c +--- plain2-2.54.orig/src/output.c Tue Apr 19 19:16:51 1994 ++++ plain2-2.54/src/output.c Thu Aug 13 13:39:31 1998 +@@ -408,12 +408,19 @@ + + texts[begin]->indent + + texts[begin]->headLen, capsule); + PRINTED(begin); +- if (!capsule) ++ if (!capsule){ ++ if(texts[begin]->indent && put == &texPut){ ++ /* この場合、texFTitle()の出力が「\\」で終わっており、 ++ 次のputIndent()が「\endlist」を出力する直前に ++ 「\mbox{}」を入れてunderfull hboxの警告を抑える */ ++ printf("\\mbox{}"); ++ } + putIndent(IND_RESUME, 0); ++ } + break; + case TB_QUOTE: + case TB_EXAMPLE: +- putMacro(M_EXAM_BEGIN, fontSize); ++ putMacro(useJverb ? M_JEXAM_BEGIN : M_EXAM_BEGIN, fontSize); + for (i = begin; i < end; i++) { + PRINTED(i); + if (texts[i]->blank) +@@ -421,7 +428,7 @@ + else + (*put->example)(texts[i]->body + listIndent); + } +- putMacro(M_EXAM_END); ++ putMacro(useJverb ? M_JEXAM_END : M_EXAM_END); + break; + case TB_LISTHD: + printf("ERROR(List Output%d)%s\n", begin, texts[begin]->body); +@@ -452,17 +459,40 @@ + case TB_TABLE: + { + int center; ++ int indent_amount = 0; ++ + if (!capsule) { + center = isCenter(begin, end); + (*put->capsule)(BEGIN, FT_TABLE, center); +- if (!center) +- putIndent(IND_INDENT, +- texts[begin]->indent / 2); ++ if (!center){ ++ indent_amount = ++ texts[begin]->indent / 2; ++ ++ if(!crossRefer && put == &texPut && ++ indent_amount){ ++ /* この場合、texCapsule()の出力が ++ 「\\」で終わっており、次の ++ putIndent()が「{\list{}…」を出力 ++ する直前に「\mbox{}」を入れて ++ underfull hboxの警告を抑える */ ++ printf("\\mbox{}"); ++ } ++ putIndent(IND_INDENT, indent_amount); ++ } + } + tblOutput(begin, end); + if (!capsule) { +- if (!center) ++ if (!center){ ++ if(put == &texPut && indent_amount){ ++ /* この場合、直前のputIndent()の出力 ++ が「\\」で終わっており、次の ++ putIndent()が「\endlist」を出力 ++ する直前に「\mbox{}」を入れて ++ underfull hboxの警告を抑える */ ++ printf("\\mbox{}"); ++ } + putIndent(IND_RESUME, 0); ++ } + (*put->capsule)(END, FT_TABLE, center); + } + } +diff -ur plain2-2.54.orig/src/plain2.c plain2-2.54/src/plain2.c +--- plain2-2.54.orig/src/plain2.c Tue Apr 19 19:40:29 1994 ++++ plain2-2.54/src/plain2.c Thu Aug 13 13:46:37 1998 +@@ -27,8 +27,9 @@ + ----- experimental ---- -raw: quote special chars(off)\n\ + -pt=Size: font size -jis: JIS code output\n\ + -sjis: Shift-JIS code input/output\n\ ++ -jverb: use jverbatim\n\ + -f file: output customization\n" +-#define VERSION "plain2 r2.54 1994/04 by A.Uchida NEC Corporation" ++#define VERSION "plain2 r2.54 1994/04 by A.Uchida NEC Corporation\n(unofficial patch 98/08/13 by N.Nide)" + + extern char *getenv(); + extern char *optarg; +@@ -66,8 +67,9 @@ + int verbose = 0; + char *plain2Lib = NULL; + char *macroName = NULL; +-char *texStyle = NULL; ++char *texStyle = DEFAULT_STY; /* Nide */ + struct outDev *put = &roffPut; ++int useJverb = 0; /* Nide */ + + FILE *inFile; + struct text **texts; +@@ -112,6 +114,7 @@ + (void)fprintf(stderr, "%s\n", VERSION); + exit (2); + } ++ if (put != &texPut) useJverb = 0; + if (macroName) + macroFile(macroName); + saveParseDefaults(); +@@ -146,6 +149,46 @@ + putMacro(M_DOC_END); + exit(0); + } ++ ++ /* "a4j,12pt" -> "a4,12pt" etc. Return value can be free'ed afterward */ ++char *styleConv(s, nttflag) ++char *s; ++int nttflag; ++{ ++ char *buf, *p; ++ int sty_appeared = 0; ++ ++ if(NULL == (p = buf = malloc(strlen(s)*3/2+6+1))){ /* 6 for ",jverb" */ ++ fprintf(stderr, "PANIC(malloc in styleConv)\n"); ++ exit(2); ++ } ++ while(*s){ ++ while(isspace(*s)) *p++ = *s++; ++ if(*s) sty_appeared = 1; ++ if((*s == 'a' || *s == 'b') && (s[1] == '4' || s[1] == '5')){ ++ if(nttflag){ ++ if(s[2] == 'j' && (!s[3] || s[3] == ',')){ ++ strncpy(p, s, 2), p += 2, s += 3; ++ } ++ } else { ++ if(!s[2] || s[2] == ','){ ++ strncpy(p, s, 2), p += 2, s += 2; ++ *p++ = 'j'; ++ } ++ } ++ } ++ while(*s) if(',' == (*p++ = *s++)) break; ++ } ++ if(useJverb){ ++ if(sty_appeared) *p++ = ','; ++ strcpy(p, "jverb"), p += 5; ++ } ++ *p = '\0'; ++ return buf; ++} ++#define nttSty(s) styleConv(s, 1) ++#define asciiSty(s) styleConv(s, 0) ++ + /* + * Do parse & output + */ +@@ -179,10 +222,10 @@ + } + } + if (preamble) { +- if (texStyle) +- putMacro(M_DOC_BEGIN, (long)fontSize, texStyle); +- else +- putMacro(M_DOC_BEGIN, (long)fontSize, ""); ++ char *p = nttSty(texStyle), *q = asciiSty(texStyle); ++ ++ putMacro(M_DOC_BEGIN, (long)fontSize, p, q); ++ free(p), free(q); + } + } + +@@ -285,6 +328,13 @@ + } + else + #endif ++ /* Add Nide (need jverb,sty to use this option) */ ++ if (strcmp(optarg, "verb") == 0) { ++ OUTPUT_OPTION("-jverb"); ++ useJverb = 1; ++ } ++ else ++ /* Add Nide end */ + goto usage; + break; + case 'l': +diff -ur plain2-2.54.orig/src/plain2.h plain2-2.54/src/plain2.h +--- plain2-2.54.orig/src/plain2.h Tue Apr 19 19:16:57 1994 ++++ plain2-2.54/src/plain2.h Thu Aug 13 13:03:00 1998 +@@ -19,9 +19,9 @@ + * 2.4: 28/04/92 + * 2.5: 06/08/93 + */ +-#define NEC_CCS /* NEC C&C Common Software Lab. dependent */ ++/* #define NEC_CCS /* NEC C&C Common Software Lab. dependent */ + +-#define NTT_TEX /* NTT jlatex */ ++/* #define NTT_TEX /* NTT jlatex */ /* no longer needed */ + + #define TITLE_SPECIAL + +@@ -30,6 +30,9 @@ + + #define MACRO_LIB "/usr/local/lib/plain2" + ++#define DEFAULT_STY "" /* default style in TeX output */ ++/*#define DEFAULT_STY "a4" */ ++ + #define MIN_INDENT 4 /* minimum indentation to be indented region */ + #define MIN_SPACING 4 /* minimum number of lines to be space region*/ + #define MAX_DSCRLEN 40 /* maximum length for description list */ +@@ -206,6 +209,7 @@ + extern int indexEnabled; /* Enables Indexing */ + extern int fontSize; /* font size */ + extern int fontSpecified; /* font size specified */ ++extern int useJverb; /* use jverbatim (Nide) */ + /* */ + extern FILE *inFile; /* intput File */ + extern struct text **texts; /* texts[lineNum] array of text +@@ -268,6 +272,8 @@ + int markAsPlain(); + int markIfQuote(); + int markIfTable(); ++struct picLineElm *picLineMatch(); ++struct picMiscLines *picMiscMatch(); + + /* + * Output driver +diff -ur plain2-2.54.orig/src/readfile.c plain2-2.54/src/readfile.c +--- plain2-2.54.orig/src/readfile.c Tue Apr 19 19:17:00 1994 ++++ plain2-2.54/src/readfile.c Thu Aug 13 13:03:00 1998 +@@ -201,6 +201,7 @@ + while (fgets(buf, MAX_LINE_LEN, inFile) != NULL) { + textp->next = (struct text *)malloc(sizeof(struct text)); + if (textp->next == NULL){ ++ malloc_error: + fprintf(stderr, "PANIC(malloc in readAndStore)\n"); + exit (2); + } +@@ -222,8 +223,10 @@ + */ + texts = (struct text **) + malloc(sizeof(struct text *) * (textLines + 1)); ++ if(texts == NULL) goto malloc_error; /* Add Nide */ + for (textp = textTop, i=1; i < textLines; textp = textp->next, i++) + texts[i] = textp; + texts[textLines] = (struct text *)malloc(sizeof(struct text)); ++ if(texts[textLines] == NULL) goto malloc_error; /* Add Nide */ + bzero((char *)texts[textLines], sizeof(struct text)); + } +diff -ur plain2-2.54.orig/src/roffout.c plain2-2.54/src/roffout.c +--- plain2-2.54.orig/src/roffout.c Tue Apr 19 19:17:03 1994 ++++ plain2-2.54/src/roffout.c Thu Aug 13 13:06:32 1998 +@@ -19,6 +19,10 @@ + M_PLAIN_END, "", + M_EXAM_BEGIN, ".ft CW\n.vs -2\n.nf\n", + M_EXAM_END, ".fi\n.vs +2\n.ft\n", ++ M_JEXAM_BEGIN, "", ++ M_JEXAM_END, "", /* These two are not actually used, because when ++ roff output is selected, the flag useJverb ++ is always 0 */ + M_APPENDIX, "\\fBAppendix $1\\fP\n", + M_BLANK, "\n", + M_PAGE, ".bp\n", +diff -ur plain2-2.54.orig/src/table.c plain2-2.54/src/table.c +--- plain2-2.54.orig/src/table.c Tue Apr 19 19:17:06 1994 ++++ plain2-2.54/src/table.c Thu Aug 13 13:03:00 1998 +@@ -464,7 +464,7 @@ + if (colVline[col] == COLV_ASC + && tblAsciAttr[(unsigned char)*s] == 0 + && tblKanjiByte[(unsigned char)*s] +- && tblKwakuAttr(s) == NULL) ++ && tblKwakuAttr(s) == 0) + nilg++; + #ifdef KANJI + if (isZenkaku(s)) { +diff -ur plain2-2.54.orig/src/texout.c plain2-2.54/src/texout.c +--- plain2-2.54.orig/src/texout.c Tue Apr 19 19:17:09 1994 ++++ plain2-2.54/src/texout.c Thu Aug 13 13:56:18 1998 +@@ -12,32 +12,30 @@ + #include "table.h" + #include "macro.h" + +-#ifdef NTT_TEX +-#define STR_DOC_BEGIN "\\documentstyle[$2]{jarticle}\n\ ++#define STR_DOC_BEGIN "\ ++\\newif\\ifNTT\\NTTfalse\n\ ++\\ifx\\gtfam\\undefined\\ifx\\gtfamily\\undefined\\NTTtrue\\fi\\fi\n\ ++\\ifNTT\\documentstyle[$2]{j-article}\n\ ++\\else\\documentstyle[$3]{jarticle}\\fi\n\ + \\setcounter{secnumdepth}{6}\n\ + \\setcounter{tocdepth}{6}\n\ + \\topsep=0.1cm\n\ + \\parsep=0.1cm\n\ + \\itemsep=0.0cm\n\ +-\\renewcommand{\\bf}{\\protect\\pbf\\protect\\pdg}\n\ ++%\\renewcommand{\\bf}{\\protect\\pbf\\protect\\pdg}\n\ + \\begin{document}\n" +-#else /* ASCII_TEX */ +-#define STR_DOC_BEGIN "\\documentstyle[$2]{jarticle}\n\ +-\\setcounter{secnumdepth}{6}\n\ +-\\setcounter{tocdepth}{6}\n\ +-\\topsep=0.1cm\n\ +-\\parsep=0.1cm\n\ +-\\itemsep=0.0cm\n\ +-\\begin{document}\n" +-#endif + + struct macDefs texMacros[] = { + M_DOC_BEGIN, STR_DOC_BEGIN, + M_DOC_END, "\\end{document}\n", + M_PLAIN_BEGIN, "\\par\n", + M_PLAIN_END, "", +- M_EXAM_BEGIN, "{\\baselineskip=#1pt\n\\begin{verbatim}\n", ++ M_EXAM_BEGIN, "{\\par\\baselineskip=#1pt\n\\begin{verbatim}\n", ++ /* 直前の行間まで狭まってしまうのを防ぐため\parを置いた */ + M_EXAM_END, "\\end{verbatim}}\n", ++ M_JEXAM_BEGIN, "{\\par\\baselineskip=#1pt\n\\begin{jverbatim}\n", ++ M_JEXAM_END, "\\end{jverbatim}\\par}\n", ++ /* jverbatimの前後には\par必要。jverb.styのドキュメント参照 */ + M_APDX_BEGIN, "\\appendix\n", + M_APPENDIX, "\\section{@1}\n", + M_BLANK, "\\medskip\n", +@@ -180,8 +178,9 @@ + s = buf; + while(*str) { + if (len = alpha(str)) { +- (void)strcpy(s, "\\verb|"); +- s += strlen("\\verb|"); ++ char *p = useJverb ? "\\jverb|" : "\\verb|"; ++ (void)strcpy(s, p); ++ s += strlen(p); + (void)strncpy(s, str, len); + s += len; + str += len; +@@ -805,7 +804,9 @@ + if (begin) { + printf("~\\\\\n"); + if (center) { +- printf("\\begin{center}\n"); ++ /* 「\begin{center}」の直前が「\\」となるため ++ 「\mbox{}」を入れてunderfill hboxの警告を抑える */ ++ printf("\\mbox{}\\begin{center}\n"); + } + } + else { +diff -ur plain2-2.54.orig/src/title.c plain2-2.54/src/title.c +--- plain2-2.54.orig/src/title.c Tue Apr 19 19:17:10 1994 ++++ plain2-2.54/src/title.c Thu Aug 13 13:03:00 1998 +@@ -101,6 +101,12 @@ + "事業部", TENT_SHOZOKU, S_ALL, 0, W_ANYWHERE, + "研究所", TENT_SHOZOKU, S_ALL, 0, W_ANYWHERE, + "研究部", TENT_SHOZOKU, S_ALL, 0, W_ANYWHERE, ++/* Add Nide */ ++ "大学", TENT_SHOZOKU, S_ALL, 0, W_ANYWHERE, ++ "学部", TENT_SHOZOKU, S_ALL, 0, W_ANYWHERE, ++ "学科", TENT_SHOZOKU, S_ALL, 0, W_ANYWHERE, ++ "研究室", TENT_SHOZOKU, S_ALL, 0, W_ANYWHERE, ++/* Add Nide end */ + "文書番号", TENT_NUMBER, S_FROMRIGHT, 0, W_ANYWHERE, + "日付", TENT_DATE, S_FROMRIGHT, 0, W_ANYWHERE, + "月", TENT_DATE, S_ALL, 0, W_ANYWHERE, +@@ -132,6 +138,18 @@ + "/97", TENT_DATE, S_ALL, 0, W_ANYWHERE, + "/98", TENT_DATE, S_ALL, 0, W_ANYWHERE, + "/99", TENT_DATE, S_ALL, 0, W_ANYWHERE, ++/* Add Nide */ ++ "2000/", TENT_DATE, S_ALL, 0, W_ANYWHERE, ++ "2001/", TENT_DATE, S_ALL, 0, W_ANYWHERE, ++ "2002/", TENT_DATE, S_ALL, 0, W_ANYWHERE, ++ "2003/", TENT_DATE, S_ALL, 0, W_ANYWHERE, ++ "2004/", TENT_DATE, S_ALL, 0, W_ANYWHERE, ++ "/2000", TENT_DATE, S_ALL, 0, W_ANYWHERE, ++ "/2001", TENT_DATE, S_ALL, 0, W_ANYWHERE, ++ "/2002", TENT_DATE, S_ALL, 0, W_ANYWHERE, ++ "/2003", TENT_DATE, S_ALL, 0, W_ANYWHERE, ++ "/2004", TENT_DATE, S_ALL, 0, W_ANYWHERE, ++/* Add Nide end */ + #ifdef NEC_CCS + "開本", TENT_SHOZOKU, S_ALL, 0, W_ANYWHERE, + "開研", TENT_SHOZOKU, S_ALL, 0, W_ANYWHERE,