components/groff/patches/an-old.tmac-long-TH.patch
branchs11-update
changeset 3706 bd45826ad92c
equal deleted inserted replaced
3704:69ab8eca01c5 3706:bd45826ad92c
       
     1 Fix for handling long .TH as overlaping in header and foot (CD #19873798)
       
     2 
       
     3 Fix has been submitted upstream:
       
     4 http://savannah.gnu.org/bugs/?43532
       
     5 
       
     6 --- groff-1.22.2/tmac/an-old.tmac.orig	2013-02-07 21:06:08.000000000 +0900
       
     7 +++ groff-1.22.2/tmac/an-old.tmac	2014-12-01 13:32:30.713605080 +0900
       
     8 @@ -253,19 +253,111 @@
       
     9  .
       
    10  .\" Redefine these to customize the header & footer
       
    11  .
       
    12 +.de1 TLPT
       
    13 +.  ds str1 "\\$1\"
       
    14 +.  ds str2 "\\$2\"
       
    15 +.\"
       
    16 +.\" Based on .lt, the following 3 formats are used.
       
    17 +.\"
       
    18 +.\"     (str1 < 1/3) and (str2 < 1/3)
       
    19 +.\"             str1, str2, str1
       
    20 +.\"     ((str1 < 2/3) and (str2 < 1/3)) or ((str1 < 1/3) and (str2 < 2/3))
       
    21 +.\"             str1,       str2,
       
    22 +.\"     else
       
    23 +.\"             str1,
       
    24 +.\"                         str2
       
    25 +.\"
       
    26 +.  nr lt_13 (\\n[.lt] / 3)
       
    27 +.  nr lt_23 (\\n[.lt] * 2 / 3)
       
    28 +.  ie ((\\w'\\*[str1]'u < \\n[lt_13]u) & (\\w'\\*[str2]'u < \\n[lt_13]u)) \{\
       
    29 +.    tl '\\*[str1]'\\*[str2]'\\*[str1]'
       
    30 +.  \}
       
    31 +.  el \{\
       
    32 +.    ie (((\\w'\\*[str1]'u < \\n[lt_23]u) & (\\w'\\*[str2]'u < \\n[lt_13]u)) : ((\\w'\\*[str1]'u < \\n[lt_13]u) & (\\w'\\*[str2]'u < \\n[lt_23]u))) \{\
       
    33 +.      tl '\\*[str2]''\\*[str1]'
       
    34 +.    \}
       
    35 +.    el \{\
       
    36 +.      tl '\\*[str2]'''
       
    37 +.      tl '''\\*[str1]'
       
    38 +.    \}
       
    39 +.  \}
       
    40 +..
       
    41 +.
       
    42 +.de1 TLBT
       
    43 +.  ds str1 "\\$1\"
       
    44 +.  ds str2 "\\$2\"
       
    45 +.  ds str3 "\\$3\"
       
    46 +.\"
       
    47 +.\" Based on .lt, the following 6 formats are used.
       
    48 +.\"
       
    49 +.\"     (str1 < 1/3) and (str2 < 1/3), str3 < 1/3)
       
    50 +.\"             str1, str2, str3
       
    51 +.\"     (str1 < 1/3) and (str2 < 1/3)
       
    52 +.\"             str1, str2,
       
    53 +.\"                         str3
       
    54 +.\"     (str2 < 1/3) and (str3 < 1/3)
       
    55 +.\"             str1, 
       
    56 +.\"                   str2, str3
       
    57 +.\"     ((str1 < 2/3) and (str2 < 1/3)) or ((str1 < 1/3) and (str2 < 2/3))
       
    58 +.\"             str1,       str2,
       
    59 +.\"                         str3
       
    60 +.\"     ((str2 < 2/3) and (str3 < 1/3)) or ((str2 < 1/3) and (str3 < 2/3))
       
    61 +.\"             str1,
       
    62 +.\"             str2,       str3
       
    63 +.\"     else
       
    64 +.\"             str1,
       
    65 +.\"                   str2,
       
    66 +.\"                         str3
       
    67 +.\"
       
    68 +.  nr lt_13 (\\n[.lt] / 3)
       
    69 +.  nr lt_23 (\\n[.lt] * 2 / 3)
       
    70 +.  ie ((\\w'\\*[str1]'u < \\n[lt_13]u) & (\\w'\\*[str2]'u < \\n[lt_13]u) & (\\w'\\*[str3]'u < \\n[lt_13]u)) \{\
       
    71 +.    tl '\\*[str1]'\\*[str2]'\\*[str3]'
       
    72 +.  \}
       
    73 +.  el \{\
       
    74 +.    ie ((\\w'\\*[str1]'u < \\n[lt_13]u) & (\\w'\\*[str2]'u < \\n[lt_13]u)) \{\
       
    75 +.      tl '\\*[str1]'\\*[str2]''
       
    76 +.      tl '''\\*[str3]'
       
    77 +.    \}
       
    78 +.    el \{\
       
    79 +.      ie ((\\w'\\*[str2]'u < \\n[lt_13]u) & (\\w'\\*[str3]'u < \\n[lt_13]u)) \{\
       
    80 +.        tl '\\*[str1]'''
       
    81 +.        tl ''\\*[str2]'\\*[str3]'
       
    82 +.      \}
       
    83 +.      el \{\
       
    84 +.        ie (((\\w'\\*[str1]'u < \\n[lt_23]u) & (\\w'\\*[str2]'u < \\n[lt_13]u)) : ((\\w'\\*[str1]'u < \\n[lt_13]u) & (\\w'\\*[str2]'u < \\n[lt_23]u))) \{\
       
    85 +.          tl '\\*[str1]''\\*[str2]'
       
    86 +.          tl '''\\*[str3]'
       
    87 +.        \}
       
    88 +.        el \{\
       
    89 +.          ie (((\\w'\\*[str2]'u < \\n[lt_23]u) & (\\w'\\*[str3]'u < \\n[lt_13]u)) : ((\\w'\\*[str2]'u < \\n[lt_13]u) & (\\w'\\*[str3]'u < \\n[lt_23]u))) \{\
       
    90 +.            tl '\\*[str1]'''
       
    91 +.            tl '\\*[str2]''\\*[str3]'
       
    92 +.          \}
       
    93 +.          el \{\
       
    94 +.            tl '\\*[str1]'''
       
    95 +.            tl ''\\*[str2]''
       
    96 +.            tl '''\\*[str3]'
       
    97 +.          \}
       
    98 +.        \}
       
    99 +.      \}
       
   100 +.    \}
       
   101 +.  \}
       
   102 +..
       
   103 +.
       
   104  .de1 PT
       
   105 -.  tl '\\*[an-title](\\*[an-section])'\\*[an-extra3]'\\*[an-title](\\*[an-section])'
       
   106 +.  TLPT "\\*[an-title](\\*[an-section])" "\\*[an-extra3]"
       
   107  ..
       
   108  .
       
   109  .de1 BT
       
   110  .  if r ps4html \
       
   111  .    return
       
   112  .  ie \\n[D] \{\
       
   113 -.    if o .tl '\\*[an-extra2]'\\*[an-extra1]'\\*[an-page-string]'
       
   114 -.    if e .tl '\\*[an-page-string]'\\*[an-extra1]'\\*[an-extra2]'
       
   115 +.    if o .TLBT "\\*[an-extra2]" "\\*[an-extra1]" "\\*[an-page-string]"
       
   116 +.    if e .TLBT "\\*[an-page-string]" "\\*[an-extra1]" "\\*[an-extra2]"
       
   117  .  \}
       
   118  .  el \
       
   119 -.    tl '\\*[an-extra2]'\\*[an-extra1]'\\*[an-page-string]'
       
   120 +.    TLBT "\\*[an-extra2]" "\\*[an-extra1]" "\\*[an-page-string]"
       
   121  ..
       
   122  .
       
   123  .de1 an-header