aligrudi / neatroff_make

Neatroff top-level makefile
50 stars 15 forks source link

Missing examples in the demo directory #19

Open mtbakerguy opened 2 years ago

mtbakerguy commented 2 years ago

It's not clear how (if?) you can do the following:

If these are possible, adding something to the demo directory or as a FAQ section in the documentation would be helpful.

aligrudi commented 2 years ago

mtbakerguy @.***> wrote:

It's not clear how (if?) you can do the following:

  • insert a unicode character (e.g. \spade) into the output.

You can either insert the UTF-8 character of use Troff character aliases (like (xy or [xyz]); see font descriptions for their names of the latter (like neatroff_make/devutf/R).

For spade there is no character alias, so you can insert ♠ in your documents. You can also define character alises using commands like ochar or fmap.

Correct.

That is OK too:

*[post.url "http://litcave.rudi.ir" "\m[green]♠\m[]"]

Or you can define your own macro:

.ds myurl "\*[post.url "\$1" "\m[green]\$2\m[]"]

And use:

*[myurl "http://litcave.rudi.ir" "♠"]

  • using the above three -- put them in as a table cell
  • have multiple word text: *[post.url http://litcave.rudi.ir "hello world"]

It is better to use non-breakable space:

*[myurl "http://litcave.rudi.ir" "hello\~world"]

If these are possible, adding something to the demo directory or as a FAQ section in the documentation would be helpful.

Maybe an examples section in neatroff.pdf or neatstart.pdf would be a good start. What is your opinion?

Ali
mtbakerguy commented 2 years ago

I think the main document is a better place as it's more comprehensive.

mtbakerguy commented 2 years ago

If the header can be made to work correctly, the attached would make a complex example: jh.txt

aligrudi commented 2 years ago

mtbakerguy @.***> wrote:

If the header can be made to work correctly, the attached would make a complex example: jh.txt

I think a tutorial that introduces Troff with an emphasis on Neatroff helps very much. neatroff.pdf is mostly a reference and I think a new section in neatstart.pdf makes more sense. I suggest covering the following topics in 3 or 4 pages:

mtbakerguy commented 2 years ago

All of those would be helpful and you're right that neatstart.pdf works well.

I'd never looked at tmac.tbl before. It looks reasonably simple. How hard would it be to remove the 7-column limitation? I took a quick look at tmac.gr. Examples would definitely help as, in contrast with tmac.tbl, it's not clear to me how I'd use it.

aligrudi commented 2 years ago

mtbakerguy @.***> wrote:

All of those would be helpful and you're right that neatstart.pdf works well.

I'd never looked at tmac.tbl before. It looks reasonably simple. How hard would it be to remove the 7-column limitation? I took a

It can be removed using macro recursive calls (with the help of shift request), but the simplicity may suffer.

quick look at tmac.gr. Examples would definitely help as, in contrast with tmac.tbl, it's not clear to me how I'd use it.

I find it useful when drawing simple charts. Two small examples:

.grclr #036 #289 .de grbar2 . grbar \$1 \$2 . grtxt \$1 \$2-300 \s-2\m[#f]\$2\m[]\s+2 . .grbeg "xmin 04" "xmax 126" "ymin 0" "ymax 11400" "barwid 6" . grlab.x "Month" +1m . grlab.y "Value" -1m . grnum 10 "99/1" . grnum 20 "99/2" . grnum 30 "99/3" . grnum 40 "99/4" . grnum 50 "99/5" . grnum 60 "99/6" . grnum 70 "99/7" . grnum 80 "99/8" . grnum 90 "99/9" . grnum 100 "99/10" . grnum 110 "99/11" . grnum 120 "99/12" . grval 2000 "2M" 1 . grval 4000 "4M" 1 . grval 6000 "6M" 1 . grval 8000 "8M" 1 . grval 10000 "10M" 1 . grbar2 10 2367 . grbar2 20 6781 . grbar2 30 3083 . grbar2 40 6713 . grbar2 50 8299 . grbar2 60 3612 . grbar2 70 3840 . grbar2 80 3192 . grbar2 90 2730 . grbar2 100 4254 . grbar2 110 9026 . grbar2 120 11242 . nr grbarwid 8 . grclr #036 #2a9 . grbar2 12 6274 . grbar2 22 3068 . grbar2 32 3966 . grbar2 42 4845 . grbar2 52 4311 . grbar2 62 2577 .grend

.grclr #036 #fff .grbeg "xmin 0" "xmax 100" "ymin 0" "ymax 200" . grnum 0 "0" 1 . grnum 20 "20" 1 . grnum 40 "40" 1 . grnum 60 "60" 1 . grnum 80 "80" 1 . grnum 100 "100" 1 . grval 50 "5" 1 . grval 100 "10" 1 . grval 150 "15" 1 . grval 200 "20" 1 . grcurbeg . grcur 0 46 . grcur 10 50 . grcur 20 70 . grcur 30 94 . grcur 40 110 . grcur 50 120 . grcur 60 154 . grcur 70 166 . grcur 80 164 . grcur 90 156 . grcur 100 150 . grcurend . grclr #630 - . grcurbeg . grcur 0 40 . grcur 100 156 . grcurend .grend

Ali
mtbakerguy commented 2 years ago

There's a typo in the grbar2 declaration...missing a second period.

aligrudi commented 2 years ago

mtbakerguy @.***> wrote:

There's a typo in the grbar2 declaration...missing a second period.

Maybe it is due to mail servers/clients escaping periods that appear at the beginning of lines.

Ali
aligrudi commented 2 years ago

I finally decided that a Troff file in demo/ would be more interesting. Have a look at demo/demo1.tr. It is incomplete; patches are welcome. Anything important (but basic) missing?

I also plan to add demo/demo2.ms to introduce macro packages like -mpost, -mtbl, -mgr, and maybe briefly -ms. Patches are welcome here too.

Maybe it is a good idea to dedicate another file to preprocessors like eqn and pic?

Ali