Menu

#806 docs/Makefile.am for gnuplot-ja.pdf

Version 5
closed-accepted
nobody
None
5
2023-03-29
2022-10-17
No

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
1 Attachments

Discussion

  • Ethan Merritt

    Ethan Merritt - 2022-12-01

    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?

     
  • Shigeharu TAKENO

    Q1

    I do not understand why a different version of doc2tex is needed.
    Can you explain ?

    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.

    What does the awk script do ?

    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.

    Can you attach a copy of that here?
    It is included in term-ja.diff.

    Q4.

    Can we do the same manipulation in doc2tex.c and avoid the
    need for separate step and a separate script ?
    It may be the correct way. In fact, I found the code about "ja_see" in
    current doc2tex.c. So, I try to check whether the code do the process
    for Japanese "Ika(mo)?Sansyo" strings.

     
  • Ethan Merritt

    Ethan Merritt - 2022-12-03

    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?

    commit 7d63cb58fa309d1e9496956e09616ade9e717f81 (HEAD -> master, origin/master, origin/HEAD)
    Author: Ethan A Merritt <merritt@u.washington.edu>
    Date:   Fri Dec 2 14:19:51 2022 -0800
    
        japanese docs:  Handle terminal help in the Makefile target gnuplot-ja.pdf
    
        Notes:
    
         - I'm not great at autotools modifications.  Please check!
    
         - The awk script in term-ja.diff is no longer needed for doc->tex.
           I do not know if it is used for anything else.
    
         - allterm-ja.h is now added to the git repository so that it is
           unconditionally available for #include by doc2x.h, but it is
           only used by doc2tex if the command line switch -japanese is present.
           It will be rebuilt if any terminal text changes.
    
         - I could not get inclusion of translated gnuplot-tikz.help
           to work properly.  The make ordering is wrong.
           However the existing text correctly instructs users to retrieve
           the full help text using 'set term lua tikz help'.
    
         - term-ja.diff is modified to fix the section patching block.trm
           and to remove inclusion of gnuplot-tikz.help by lua.trm
    
     
  • Shigeharu TAKENO

    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.)

     
  • Ethan Merritt

    Ethan Merritt - 2022-12-15
    • status: open --> pending-accepted
     
  • Ethan Merritt

    Ethan Merritt - 2023-03-29
    • status: pending-accepted --> closed-accepted
     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.