In the current git version of gnuplot, docs/Makefile.am has the target gnuplot-ja.pdf. But it may not be sufficient to make correct pdf file of japanese version. To make the gnuplot-ja.pdf, we need allterm-ja.h and doc2tex of japanese version. For example, see attached file.
And also, to make the correct reference for "see also" sentences, to use tex2ja.awk after the doc2tex. For example,
./doc2tex-ja$(EXEEXT) -figures ja.doc | awk -f tex2ja.awk | sed 's/titlepag.tex/title-ja.tex/' > gnuplot-ja.tex
Sorry for my delay in looking at this.
I understand the part about including a japanese version of allterm.h.
But I do not understand why a different version of doc2tex is needed. Can you explain?
I see in the Makefile fragment that you attached that doc2tex is compiled with a flag
-DJAPANESE_DOC but that conditional symbol is not used anywhere in doc2tex.c.
What does the awk script do? Can you attach a copy of that here?
Can we do the same manipulation in doc2tex.c and avoid the need for a separate step and a separate script?
Q1
A1. In fact, doc2tex.c itself doesn't have conditional macros
"#ifdef JAPANESE_DOC", but allterm-ja.h has them per each terminal
help, and doc2tex.c include allterm-ja.h through doc2x.h.
So, the doc2tex binary compiled with the flag -DJAPANESE_DOC is differ
from the binary without the flag.
Q2.
It does as the doc2tex do for "see
[keyword]
". In Japanese, we write"IkaSansyo" ("see" in English) or "IkamoSansyo" ("see also" in
English). However, the doc2tex did convert "
[keyword]
" part to"{\bf [keyword]}"
only, not
"{\bf [keyword] (p.~\pageref{[keyword]})\index{[keyword]})"
for Japanese document.
So, I made tex2ja.awk to search the string
"Ika(mo)?Sansyo {\bf [keyword]}"
in the output of "doc2tex gnuplot-ja.doc", and to modify it to
"Ika(mo)?Sansyo {\bf [keyword]
(p.~\pageref{[keyword]})\index{[keyword]})"
But, the script tex2ja.awk is old and may be incorrect, it
doesn't do the process correctly for the current document.
Q3.
Q4.
I have modified the makefiles to build and include allterm-ja.h when making gnuplot-ja.pdf
Please test and let me know if more needs to be done. Is the awk script needed for any of the other build targets?
I think attached patch is need for doc2tex.c.
1) The first strncmp() search the Japanese string "Sansyo". But "Sansho" is also used at not the target of ja_see. Since I use "Sansyo:" for the target of ja_see, ':' should be included in the search string.
2) strncmp() functions searching "Sansyo" and Japanese-period is placed after str is incremented. But it may fail the process of '
' for the string "
name[Japanese-period]". At the second '
', ja_see == FALSE because str is incremented before strncmp() and it matches the Japanese-period. The str should be incremented after strncomp().3) Because "see" or "See" string may appear in Japanese document, they may fail the process for '`'. The see (not ja_see) variable should not be TRUE for japanese doc. (I think ja_see may become see.)