/share/doc/usd/22.trofftut/tt05

https://bitbucket.org/freebsd/freebsd-head/ · #! · 130 lines · 130 code · 0 blank · 0 comment · 0 complexity · 917fff896a2dd740ad14a53ab9439ec6 MD5 · raw file

  1. .\" This module is believed to contain source code proprietary to AT&T.
  2. .\" Use and redistribution is subject to the Berkeley Software License
  3. .\" Agreement and your Software Agreement with AT&T (Western Electric).
  4. .\"
  5. .\" @(#)tt05 8.1 (Berkeley) 6/8/93
  6. .\" Copyright (C) Caldera International Inc. 2001-2002. All rights reserved.
  7. .\"
  8. .\" Redistribution and use in source and binary forms, with or without
  9. .\" modification, are permitted provided that the following conditions are
  10. .\" met:
  11. .\"
  12. .\" Redistributions of source code and documentation must retain the above
  13. .\" copyright notice, this list of conditions and the following
  14. .\" disclaimer.
  15. .\"
  16. .\" Redistributions in binary form must reproduce the above copyright
  17. .\" notice, this list of conditions and the following disclaimer in the
  18. .\" documentation and/or other materials provided with the distribution.
  19. .\"
  20. .\" All advertising materials mentioning features or use of this software
  21. .\" must display the following acknowledgement:
  22. .\"
  23. .\" This product includes software developed or owned by Caldera
  24. .\" International, Inc. Neither the name of Caldera International, Inc.
  25. .\" nor the names of other contributors may be used to endorse or promote
  26. .\" products derived from this software without specific prior written
  27. .\" permission.
  28. .\"
  29. .\" USE OF THE SOFTWARE PROVIDED FOR UNDER THIS LICENSE BY CALDERA
  30. .\" INTERNATIONAL, INC. AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR
  31. .\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
  32. .\" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  33. .\" DISCLAIMED. IN NO EVENT SHALL CALDERA INTERNATIONAL, INC. BE LIABLE
  34. .\" FOR ANY DIRECT, INDIRECT INCIDENTAL, SPECIAL, EXEMPLARY, OR
  35. .\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
  36. .\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
  37. .\" BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
  38. .\" WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
  39. .\" OR OTHERWISE) RISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
  40. .\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  41. .\"
  42. .\" $FreeBSD$
  43. .\"
  44. .NH
  45. Tabs
  46. .PP
  47. Tabs
  48. (the \s8ASCII\s0 `horizontal tab' character)
  49. can be used to produce output in columns,
  50. or to set the horizontal position of output.
  51. Typically
  52. tabs are used only in unfilled text.
  53. Tab stops are set by default every half inch from the
  54. current indent,
  55. but
  56. can be changed by the
  57. .BD .ta
  58. command.
  59. To set stops every inch, for example,
  60. .P1
  61. ^ta 1i 2i 3i 4i 5i 6i
  62. .P2
  63. .PP
  64. Unfortunately the stops are left-justified only
  65. (as on a typewriter),
  66. so lining up columns of right-justified numbers can be painful.
  67. If you have many numbers,
  68. or if you need more complicated table layout,
  69. .ul
  70. don't
  71. use
  72. .UL troff
  73. directly;
  74. use the
  75. .UL tbl
  76. program described in [3].
  77. .PP
  78. For a handful of numeric columns, you can do it this way:
  79. Precede every number by enough blanks to make it line up
  80. when typed.
  81. .P1
  82. ^nf
  83. ^ta 1i 2i 3i
  84. \0\01\0\fItab\fR\0\0\02\0\fItab\fR\0\0\03
  85. \040\0\fItab\fR\0\050\0\fItab\fR\0\060
  86. 700\0\fItab\fR\0800\0\fItab\fR\0900
  87. ^fi
  88. .P2
  89. Then change each leading blank into the string
  90. .BD \e0 .
  91. This is a character that does not print, but that has
  92. the same width as a digit.
  93. When printed, this will produce
  94. .P1
  95. .ta 1i 2i 3i
  96. \0\01 \0\02 \0\03
  97. \040 \050 \060
  98. 700 800 900
  99. .P2
  100. .PP
  101. It is also possible to fill up tabbed-over space with
  102. some character other than blanks by setting the `tab replacement character'
  103. with the
  104. .BD .tc
  105. command:
  106. .P1
  107. ^ta 1.5i 2.5i
  108. ^tc \e(ru (\e(ru is "\(ru")
  109. Name \fItab\fR Age \fItab\fR
  110. .P2
  111. produces
  112. .P1 3
  113. .ta 1.5i 2.5i
  114. .tc \(ru
  115. Name Age
  116. .tc
  117. .P2
  118. To reset the tab replacement character to a blank, use
  119. .BD .tc
  120. with no argument.
  121. (Lines can also be drawn with the
  122. .BD \el
  123. command, described in Section 6.)
  124. .PP
  125. .UL troff
  126. also provides a very general mechanism called `fields'
  127. for setting up complicated columns.
  128. (This is used by
  129. .UL tbl ).
  130. We will not go into it in this paper.