Solved

Using groff

Posted on 1998-07-28
5
253 Views
Last Modified: 2010-04-21
Hello,
I want to use groff to format a document (mostly a txt file).  However, when I do "groff -Tascii test.txt | more", it shows up the line won't break even I put in a newline character in it.  So what should I do to make my document look normal.
0
Comment
Question by:andrewma
5 Comments
 
LVL 84

Expert Comment

by:ozo
ID: 2009161
.LQ
0
 

Author Comment

by:andrewma
ID: 2009162
Sorry I don't understand.  Can you make it more explicily
0
 
LVL 1

Expert Comment

by:ksb
ID: 2009163
The groff text formatter expects commands (mark-up) in the document to describe how to format the text.  For example ".br" on a line by itself "breaks" the line.

You only need about 10 markups to write letters and stuff.  The manual pages are not so helpful.  The manual page you need to read for the description of groff mark-up is "troff".  It goes into blow-by-blow descriptions.

For exmaple ".break" breaks a loop in groff.  I don't see all the mark-up I remember in the manual page, there must be another.  The customary macro packages (like the "-me" and "-ms" macros)  make groff much nicer to use.

Manual pages are coded to "-man" macros ".SH" ".P" ".BI" and the like.

0
 

Author Comment

by:andrewma
ID: 2009164
Can you give me a little example for how to put in the marks-up into the document ?  Also where can I find a man or command refrence of the marks-up ?


0
 
LVL 1

Accepted Solution

by:
chytrace earned 100 total points
ID: 2009165
Hi,

            here folows man page I made for my program...

fmadd.mm - text formatted by troff mm macros
To see it exec: nroff -mm fmadd.mm | more

------------------- fmadd.mm ----------------------
PH "'FMADD'\\\\*(DT'\\\\nP'"
SA 1
SP 2
B fmadd
[-h] [-d] [-t c] [-g s] [-m s] [-l s] file1 file2 ...
SP 1
nr Hc 1
nr Hu 1
HU Introduction
SP 1
The
I fmupdate
utility provides possibiity to update file(s) to
I FATMEN.
Current release works just for Monte Carlo files.
The next one will also work for data files. The only
reason why this release doesn't support data files
is naming convention for data files. When suitable
naming convention will be available this utilitiy
will be complete as soon as possible.
HU Command\ line\ options
Not all the command line options work at this time.
Some of them are reserved for the next release.
Note that [,] brackets mean the command line
option is optional. If not set the default value
is taken into account, see section
I Examples
bellow.
Here is the description of the command line options for
I fmadd
utility:
\"''''''''Variable list one''''''''''''''''''''''
VL 15
LI -h
Prints help message and exits.
LI -d
Turns on debugging messages.
LI -t\ char
Explicitly sets type of input file(s). The char may
be set to:
\"''''''''Variable list two''''''''''''''''''''''
VL 6 2
LI m
Monte Carlo file(s)
LI d
Data file(s)
LE
\"''''''''End of variable list two'''''''''''''''
LI -g\ string
Where the string is a
I generic\ name
of the file. This option doesn't work with this release.
Is reserved for data file(s). The format of the
I generic\ name
is:
br

ce
//DESY/H1/SOME/PATH/NAME/WITH/FILE/...
br
LI -m\ string
Explicitly defines media type for the file. List of the media  
types
is in the file /h1/fatmen/fatmen.medtypes, where important is the
second item of the each line, i.e.: 3480, DAT60, REWOOD, ...
LI -l\ string
Defines a location on which the file(s) reside(s). At this time
the only
BI ACS
location is supported. The future releases may support also
other location(s), i.e. AMPEX, ...
LI file(s)
List of the file names separated by spaces. On the command line
also wild chars can occur, the pattern recognition depends on
current interactive shell. This release work great with /bin/zsh
as user's interactive shell. More details see in man page zsh(1).
LE
\"''''''''End of variable list one'''''''''''''''
HU Examples
AL 1 4
LI
When executed without parameters on command line prints the help
message and exits, the same as option -h.
LI
If user puts just filenames on the command line, then
I fmadd
takes into account default values for various parameters
required for file's addition to
I FATMEN.
The default values are:
VL 15 2
LI debugging
OFF
LI type
Monte Carlo
LI media
for ACS is default media type 3490E
LI location
ACS
LE

------------------------- end of fmadd.mm ---------------

fmadd.man - formatted using man macros for reading with man

to see it exec: nroff -man fmadd.man | more

------------------- fmadd.man ---------------------------
TH FMADD 1 "FATMEN Update System" H1
SH NAME
B fmadd
- utility for update files in FATMEN
SH SYNTAX
fmadd [-h] [-d] [-t c] [-m s] [-l s] [-f ifile] file(s)
SH INTRODUCTION
The
I fmadd
utility provides possibiity to update file(s) to
I FATMEN.
This release supports update for both Monte Carlo and the data files.
A new feature has been added to this release, it is possibility
to supply a filenames list in a file, so it is allowed to update files
even for a location where is not possible to supply filenames from command
line.
Along with this feature also a new command line option was added.

To make the update of the data files easier the configuration file is provided
for this purpose, see
B CONFIGURATION.
Since it has been used also for a definition of the location
parameters for the Monte Carlo files a new functionality was added which allows
setting of the parameters for a group of the data files.
The syntax of the records of the configuration file is described inside the
configuration file.

SH COMMAND\ LINE\ OPTIONS
Note that [,] brackets mean that the command line
option is optional.
The main difference in comparison to the previous releases is that
a type of the file must be explicitly set on the command line.
Here is the description of the command line options for
I fmadd
utility:
IP -h 10
Prints help message and exits.
IP -d 10
Turns on debugging messages.
IP -t\ char 10
Explicitly sets type of input file(s). The char may
be set to:
RS 10
IP m
Monte Carlo file
IP d
Data file
RE
IP -m\ string
Explicitly defines media type for the file. List of the media  
types
is in the file /h1/fatmen/fatmen.medtypes, where important is the
second item of the each line, i.e.: 3480, DAT60, REWOOD, ...
IP -l\ string
Defines a location on which the file(s) reside(s).
IP -f\ ifile
where
B ifile
is the input file which contains list of the filenames in 1 column format.
When this option is set
I fmadd
will not accept filenames from the command line!
IP file(s)
List of the file names separated by spaces. On the command line
also wild chars can occur, the pattern recognition depends on
current interactive shell. This release work great with /bin/zsh
as user's interactive shell. More details see in man page zsh(1).

SH CONFIGURATION

For the Monte Carlo files no special configuration is needed.
On the other hand the data files need their
configuration records in the configuration file.
The basic configuration includes records for locations and , if needed,
records for data files. Following example is for location ACS:
br

l+:ACS:L00000:L00000:1:FPS:IEEE:F:6930:6930:1
br

The fields are described in the configuration file. The fields in
record for a location are parameters used by FATMEN.
Following example shows record for group of the data files:
br

f+:H1POT5.L4RJT.C95:ACS:3490E://DESY/H1/EPDATA/95/POT3/L4RJT/
br

Yes, it is for a group of data files, because second field is fixed
filename prefix typical for the files of the group. It doesn't contain
part of a filename which can vary, i.e. serial number.
The other fields are the location name, media type, generic pathname prefix.
The last field will be completed to full generic pathname by
I fmadd
utility.

No configuration record is needed for Monte Carlo files.
I Fmadd
follows the naming convention for Monte Carlo files, so their filenames
are converted to full generic pathnames without any additional
information.

SH EXAMPLES
IP 1. 3
When executed without parameters on command line prints the help
message and exits, the same as option -h.
IP 2. 3
If user puts just filenames on the command line, then
I fmadd
takes into account default values for various parameters
required for file's addition to
I FATMEN.
The default values are:
RS 8
IP debugging: 14
OFF
IP media: 14
for ACS is default media type 3490E
IP location: 14
ACS
RE

RS 3
The invoking of
I fmadd
command for this case may look like:
br

dice2:~$ cd /acs/mc/aroma21
br
dice2:/acs/mc/aroma21$ fmadd -t m Q2G6.DSTKPIPI.*
RE
IP 3. 3
The default media type may be changed by the next command:
br

fmadd -m REDWOOD Q2G6.DSTKPIPI.S30624.A03
br

which changes media type for the specified file
in /acs/mc/aroma21 directory to REDWOOD instead of the default
3490E.
RE
IP 4. 3
For the data files the command line may look like:
br

fmadd -t d *.L4RJT.*
br

or
br

fmadd -t d -f rawd93.lst
br

where the file rawd93.lst contains list of filenames in 1 column format.

SH SEE\ ALSO
fmdel(1), fmupdate(1), fmcheck(1)
SH VERSION
$Revision: 2.0 $
SH AUTHOR
Radovan Chytracek, Institute of Experimantal Physics, Slovak
Academy of Sciencies, Kosice, Slovak Republic. Any question
or comment may be sent to:
ce 3

chytrace@saske.sk
br
or
br
chytrace@dice2.desy.de

--------------------- end of fmadd.man -----------------------

Hope you find it useful


           Regards Radovan


0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Attention: This article will no longer be maintained. If you have any questions, please feel free to mail me. jgh@FreeBSD.org Please see http://www.freebsd.org/doc/en_US.ISO8859-1/articles/freebsd-update-server/ for the updated article. It is avail…
A metadevice consists of one or more devices (slices). It can be expanded by adding slices. Then, it can be grown to fill a larger space while the file system is in use. However, not all UNIX file systems (UFS) can be expanded this way. The conca…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now