Server IP : 195.201.23.43 / Your IP : 18.217.163.75 Web Server : Apache System : Linux webserver2.vercom.be 5.4.0-192-generic #212-Ubuntu SMP Fri Jul 5 09:47:39 UTC 2024 x86_64 User : kdecoratie ( 1041) PHP Version : 7.1.33-63+ubuntu20.04.1+deb.sury.org+1 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals, MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /usr/share/doc/groff/html/ |
Upload File : |
<!-- Creator : groff version 1.22.4 --> <!-- CreationDate: Sat Mar 21 12:27:30 2020 --> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta name="generator" content="groff -Thtml, see www.gnu.org"> <meta http-equiv="Content-Type" content="text/html; charset=US-ASCII"> <meta name="Content-Style" content="text/css"> <style type="text/css"> p { margin-top: 0; margin-bottom: 0; vertical-align: top } pre { margin-top: 0; margin-bottom: 0; vertical-align: top } table { margin-top: 0; margin-bottom: 0; vertical-align: top } h1 { text-align: center } </style> <title>pic-17.html</title> </head> <hr> [ <a href="pic-16.html">prev</a> | <a href="pic-18.html">next</a> | <a href="pic.html">top</a> ] <hr> <h2>17. Interface To [gt]roff <a name="17. Interface To [gt]roff"></a> </h2> <p style="margin-top: 1em"><font color="#000000">The output of <b>pic</b> is <b>[gt]roff</b> drawing commands. The GNU <i>gpic</i>(1) command warns that it relies on drawing extensions present in <i>groff</i>(1) that are not present in <i>troff</i>(1).</font></p> <h3>17.1. Scaling Arguments <a name="17.1. Scaling Arguments"></a> </h3> <p style="margin-top: 1em"><font color="#000000">The DWB <i>pic</i>(1) program accepts one or two arguments to <b>.PS</b>, which is interpreted as a width and height in inches to which the results of <i>pic</i>(1) should be scaled (width and height scale independently). If there is only one argument, it is interpreted as a width to scale the picture to, and height is scaled by the same proportion.</font></p> <p style="margin-top: 1em"><font color="#000000">GNU <b>gpic</b> is less general; it accepts a single width to scale to, or a zero width and a maximum height to scale to. With two non-zero arguments, it scales to the maximum height.</font></p> <h3>17.2. How Scaling is Handled <a name="17.2. How Scaling is Handled"></a> </h3> <p style="margin-top: 1em"><font color="#000000">When <b>pic</b> processes a picture description on input, it passes <b>.PS</b> and <b>.PE</b> through to the postprocessor. The <b>.PS</b> gets decorated with two numeric arguments which are the X and Y dimensions of the picture in inches. The post-processor can use these to reserve space for the picture and center it.</font></p> <p style="margin-top: 1em"><font color="#000000">The GNU incarnation of the <b>ms</b> macro package, for example, includes the following definitions:</font></p> <p style="margin-left:10%; margin-top: 1em"><font color="#000000"><small>.de PS <br> .br <br> .sp \\n[DD]u <br> .ie \\n[.$]<2 .@error bad arguments to PS (not preprocessed with pic?) <br> .el \{\</small></font></p> <table width="100%" border="0" rules="none" frame="void" cellspacing="0" cellpadding="0"> <tr valign="top" align="left"> <td width="10%"></td> <td width="10%"> <p><font color="#000000"><small>.</small></font></p></td> <td width="80%"> <p><font color="#000000"><small>ds@need (u;\\$1)+1v</small></font></p> </td></tr> <tr valign="top" align="left"> <td width="10%"></td> <td width="10%"> <p><font color="#000000"><small>.</small></font></p></td> <td width="80%"> <p><font color="#000000"><small>in +(u;\\n[.l]-\\n[.i]-\\$2/2>?0)</small></font></p> </td></tr> </table> <p style="margin-left:10%;"><font color="#000000"><small>.\} <br> .. <br> .de PE <br> .par@reset <br> .sp \\n[DD]u+.5m <br> ..</small></font></p> <p style="margin-top: 1em"><font color="#000000">Equivalent definition is supplied by GNU <i>pic</i>(1) if you use the −mpic option; this should make it usable with macro pages other than <i>ms</i>(1).</font></p> <p style="margin-top: 1em"><font color="#000000">If <b>.PF</b> is used instead of <b>.PE</b>, the <b>troff</b> position is restored to what it was at the picture start (Kernighan notes that the F stands for “flyback”).</font></p> <p style="margin-top: 1em"><font color="#000000">The invocation</font></p> <p style="margin-left:10%; margin-top: 1em"><font color="#000000"><b>.PS <</b><i>file</i></font></p> <p style="margin-top: 1em"><font color="#000000">causes the contents of <i>file</i> to replace the <b>.PS</b> line. This feature is deprecated; use ‘<b>copy</b> <i>file</i>’ instead).</font></p> <h3>17.3. PIC and [gt]roff commands <a name="17.3. PIC and [gt]roff commands"></a> </h3> <p style="margin-top: 1em"><font color="#000000">By default, input lines that begin with a period are passed to the postprocessor, embedded at the corresponding point in the output. Messing with horizontal or vertical spacing is an obvious recipe for bugs, but point size and font changes are usually safe.</font></p> <p style="margin-top: 1em"><font color="#000000">Point sizes and font changes are also safe within text strings, as long as they are undone before the end of string.</font></p> <p style="margin-top: 1em"><font color="#000000">The state of <b>[gt]roff</b>’s fill mode is preserved across pictures.</font></p> <h3>17.4. PIC and EQN <a name="17.4. PIC and EQN"></a> </h3> <p style="margin-top: 1em"><font color="#000000">The Kernighan paper notes that there is a subtle problem with complicated equations inside <b>pic</b> pictures; they come out wrong if <i>eqn</i>(1) has to leave extra vertical space for the equation. If your equation involves more than subscripts and superscripts, you must add to the beginning of each equation the extra information <b>space 0</b>. He gives the following example:</font></p> <p style="margin-left:10%; margin-top: 1em"><font color="#000000">arrow <br> box "$space 0 {H( omega )} over {1 - H( omega )}$" <br> arrow</font></p> <p align="center" style="margin-top: 1em"><font color="#000000"><img src="img/pic47.png" alt="Image img/pic47.png"></font></p> <p align="center" style="margin-top: 1em"><font color="#000000">Figure 17-1: Equations within pictures</font></p> <h3>17.5. Absolute Positioning of Pictures <a name="17.5. Absolute Positioning of Pictures"></a> </h3> <p style="margin-top: 1em"><font color="#000000">A <b>pic</b> picture is positioned vertically by troff at the current position. The topmost position possible on a page is not the paper edge but a position which is one baseline lower so that the first row of glyphs is visible. To make a picture really start at the paper edge you have to make the baseline-to-baseline distance zero, this is, you must set the vertical spacing to 0 (using <b>.vs</b>) before starting the picture.</font></p> <hr> [ <a href="pic-16.html">prev</a> | <a href="pic-18.html">next</a> | <a href="pic.html">top</a> ] <hr>Private