|
General software and network General OS-independent software and network questions, X11, MTA, routing, etc. |
|
Thread Tools | Display Modes |
|
||||
troff/nroff Q; how to put a linebreak in a tag labeled lists item
For a program I'm putting together, I've several flags that have both a positive and negative form (e.g. --foo, --no-foo) for things that are not implicitly set by other options. Each pair of options is done in both these forms + their corresponding short options where available. Each of which is described in a single paragraph, but I'm having trouble formatting the options.
Code:
.Sh OPTIONS .Bl -tag -width indent .\" The item in question .It Cm --interactive, -i Cm --non-interactive, -b paragraph describing the options .\" other options, several of which are like the above .El Code:
OPTIONS --interactive, -i --non-interactive, -b paragraph describing the options Code:
--interactive, -i --non-interactive, -b paragraph describing the options Code:
.It Cm --interactive, -i Pp Cm --non-interactive, -b paragraph describing the options --interactive, -i paragraph describing the options I haven't been able to find anything by searching the web or in the mdoc(7) manual page. Before I end up splitting them up into separate list items, does anyone know how I might be able to do this?
__________________
My Journal Thou shalt check the array bounds of all strings (indeed, all arrays), for surely where thou typest ``foo'' someone someday shall type ``supercalifragilisticexpialidocious''. |
|
|||
Quote:
You might also look at the ".Bd/Ed" command pair. It looks to be similar to the ".DS/.DE" pair in -ms. Displays do not need separate ".br" commands added -- line splits follow carriage returns (unlike most of troff, which reads characters without regard to line breaks). |
|
||||
I tried the .br command as soon as I found it in my reference, but it displays a literal '.br' in the output.
Code:
.It Cm --interactive, -i .br Cm --non-interactive, -b paragraph describing the options --interactive, -i .br --non-interactive, -b paragraph describing the options 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. Thanks DrJ
__________________
My Journal Thou shalt check the array bounds of all strings (indeed, all arrays), for surely where thou typest ``foo'' someone someday shall type ``supercalifragilisticexpialidocious''. |
|
|||
Quote:
Quote:
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 Code:
.DS \fBtext string 1\fP \fItext string 2\fP text string 3 .DE Code:
text string 1 text string 2 text string 3 Code:
text string 1 text string 2 text string 3 |
|
||||
Quote:
Code:
.It --interactive, -i .br --non-interactive, -b paragraph text Quote:
I am by no means familiar with troff syntax or common style conventions in formating the commands/macros. Unlike Tex/LaTeX most of what I know comes from reading existing troff files, figuring out what it means (where possible), then comparing the results of test cases to what was expected. Quote:
I think it's time to steal a few nights off my usual study routines and properly inhale more documentation on troff, to fill out the gaps between what I know how to do in troff, and what I'll eventually need to do with it.the troff users manual should at least help in understanding the syntax better w/o writing test files.
__________________
My Journal Thou shalt check the array bounds of all strings (indeed, all arrays), for surely where thou typest ``foo'' someone someday shall type ``supercalifragilisticexpialidocious''. |
|
|||
Why don't you just use this:?
Code:
.It Cm --interactive, -i .It Cm --non-interactive, -b
__________________
You don't need to be a genius to debug a pf.conf firewall ruleset, you just need the guts to run tcpdump |
|
|||
I don't know what to say about the .br issues. Usually you can intersperse troff commands with the macro packages, with some limitations. It depends on how the macro package is written. Since I've not used the man page macros, I'm afraid I can't offer many useful alternatives.
If you want to learn troff better, here is a place to look: http://www.troff.org/papers.html I'd suggest you start with the -ms macro package, as it is very simple and covers most of the practical document formatting requirements. From there, move to the preprocessors: tbl (for tables), eqn (for complicated math), pic (for line drawings), grap (for graphs), refer (for references) and chem (for chemistry). I don't think that chem is part of any of the BSDs -- I did a port for FreeBSD if you want it. Also keep in mind that groff has some extensions that are not part of the documentation, like .PSPIC to insert graphics elements into documents (in .eps format). Also you might be interested in the TeX/troff thread that has popped up. |
|
|||
That would follow the troff idiom of using one command to do one thing.
|
|
||||
@J65nko that will create separate list items for each, it's not very pretty to look at either.
Thanks for the link DrJ, adding a few more documents to my reading list as I type this. I've seen some of them on other sites but not all :-) I originally started with BWKs tutorial, but I've got a copy of the troff users manual by Ossanna and Kernighan stored for inhalation. I'm the kind of person, that if I want to learn something - I go find (or ask for) a point of reference and start munching away at the task at hand; I love documents like these. I think it's more important to learn the troff side right now, so I actually know what is going on behind the scenes. It seems that the ms and mdoc macro packages will be the meat and potatoes once troff is incorporated into my toolchain, but it can taste a little bit bland to skip the gravy, if you know what I mean DrJ. @the TeX/troff thread, it interests me intently but more so in the reading-focused capacity, then offering comment in. You are arguably the most knowledgeable person on troff that I've encountered, and likewise OKO on TeX; you both have much more demanding needs of these tools then people like me and many more years of experience with them. Most of what I need done formatting wise, can be done in pure ASCII, aside from inserting images and tables in a /sane/ way. It's one of my mid-term goals to properly reevaluate troff, TeX, docbook, and texinfo; and find where each belongs in my larger répertoire of tools. -- Threads like this one we are posting in, are largely the difference between what I can learn on my own and trying to find the point at which the only way to go forward, is to go around another way; rather then keep walking into things.
__________________
My Journal Thou shalt check the array bounds of all strings (indeed, all arrays), for surely where thou typest ``foo'' someone someday shall type ``supercalifragilisticexpialidocious''. |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
The big TeX and (g)troff thread | JMJ_coder | General software and network | 23 | 10th November 2008 01:19 PM |
TeX for troff users? | DrJ | Off-Topic | 0 | 2nd May 2008 09:29 PM |