View Single Post
  #4   (View Single Post)  
Old 9th November 2008
DrJ DrJ is offline
ISO Quartermaster
Join Date: Apr 2008
Location: Gold Country, CA
Posts: 507

Originally Posted by TerryP View Post
I tried the .br command as soon as I found it in my reference, but it displays a literal '.br' in the output.
Really? That's very odd. Did you put the .br as the first characters on a line? If you don't, then troff does not interpret it. It is that way for all raw troff dot commands.
The .Bd/.Ed and .DS/.DE pairs seem to fulfill the same purposes from what I can see in the manuals, but .Bd/.Ed appear to require a bit more manual formatting then I have the skill to complete with troff right now. Looks like I'm going to be splitting them into separate list items for now.
Manual formatting? The block commands take what is on each line, and honor the line breaks when doing the formatting. That's the idea of using them.

I don't recall your original code, but if I remember properly, you put things on the same line to use the same font command. That's in general not good troff style. You want to use font commands that are independent of text location, so that you can move them around if you want. One way to do that, for example, is to use the raw troff \fB (or \fI) and \fP when you are done. That is the bold (or italic) font of the currently-mounted font family (like Times Roman), returning to the previous font (which usually is the "normal" one).

So if you use
\fBtext string 1\fP
\fItext string 2\fP
text string 3
you would get
text string 1
text string 2
text string 3
This of course uses the -ms block commands, but the man block commands are likely similar. If you did not use the block command, you would get
text string 1 text string 2 text string 3
which is not what you are after.
Reply With Quote