Re: Learning troff - where to start?

2020-10-14 Thread Thomas Dupond
Peter Schaffter did make this shell script for font installation available on 
his website :

http://schaffter.ca/mom/mom-05.html#install-font

Regards, Thomas


‐‐‐ Original Message ‐‐‐
Le mercredi, octobre 14, 2020 8:16 PM, Johann Höchtl  
a écrit :

>
>
> On 14.10.20 18:41, Peter Schaffter wrote:
>
> > Also not sure what
> > you mean by "easily switch fonts." Since '.ft " is as easy as
> > it gets, I assume you mean something else.
>
> I have been imprecise. By switching fonts I actually meant making fonts
> available to groff, which requires fontforge to generate the Type1 font
> and metrics and then afmtodit.
>
> Best, Johann





Re: "can't transparently output node at top level"

2020-10-20 Thread Thomas Dupond
This bug is acknowledged in pdfmom(1) in section Bugs :

   pdfmom sometimes issues warnings of the type
  ...: can't transparently output node at top level
   but this is more of an annoyance than a bug, and may safely be
   ignored.

Regards, Thomas



‐‐‐ Original Message ‐‐‐
Le mardi 20 octobre 2020 06:19, Larry Kollar  a écrit :

> I pulled the latest down, and did “make.” Things went OK until I got down to 
> the documentation:
>
> > GROFF contrib/mom/examples/letter.pdf
> > troff: contrib/mom/examples/letter.mom:12: error: can't transparently 
> > output node at top level
> > GROFF contrib/mom/examples/mom-pdf.pdf
> > troff: contrib/mom/examples/mom-pdf.mom:20: error: can't transparently 
> > output node at top level
> > troff: contrib/mom/examples/mom-pdf.mom:149: error: can't transparently 
> > output node at top level
> > troff: contrib/mom/examples/mom-pdf.mom:580: error: can't transparently 
> > output node at top level
> > troff: contrib/mom/examples/mom-pdf.mom:580: error: can't transparently 
> > output node at top level
> > troff: contrib/mom/examples/mom-pdf.mom:580: error: can't transparently 
> > output node at top level
> > troff: contrib/mom/examples/mom-pdf.mom:580: error: can't transparently 
> > output node at top level
> > troff: contrib/mom/examples/mom-pdf.mom:580: error: can't transparently 
> > output node at top level
> > troff: contrib/mom/examples/mom-pdf.mom:580: error: can't transparently 
> > output node at top level
> > troff: contrib/mom/examples/mom-pdf.mom:580: error: can't transparently 
> > output node at top level
> > troff: contrib/mom/examples/mom-pdf.mom:580: error: can't transparently 
> > output node at top level
> > GROFF contrib/mom/examples/mon_premier_doc.pdf
> > troff: contrib/mom/examples/mon_premier_doc.mom:13: error: can't translate 
> > character code 233 to special character ''e' in transparent throughput
> > troff: contrib/mom/examples/mon_premier_doc.mom:28: error: can't 
> > transparently output node at top level
> > troff: contrib/mom/examples/mon_premier_doc.mom:30: error: can't translate 
> > character code 233 to special character ''e' in transparent throughput
> > troff: contrib/mom/examples/mon_premier_doc.mom:108: error: can't translate 
> > character code 233 to special character ''e' in transparent throughput
> > troff: contrib/mom/examples/mon_premier_doc.mom:136: error: can't translate 
> > character code 232 to special character '`e' in transparent throughput
> > GROFF contrib/mom/examples/sample_docs.pdf
> > troff: contrib/mom/examples/sample_docs.mom:130: error: can't transparently 
> > output node at top level
> > troff: contrib/mom/examples/sample_docs.mom:300: error: can't transparently 
> > output node at top level
> > troff: contrib/mom/examples/sample_docs.mom:479: error: can't transparently 
> > output node at top level
> > GROFF contrib/mom/examples/typesetting.pdf
> > GROFF contrib/mom/examples/slide-demo.pdf
> > troff: contrib/mom/examples/slide-demo.mom:83: error: can't transparently 
> > output node at top level
> > GROFF contrib/mom/examples/copyright-default.pdf
> > troff: contrib/mom/examples/copyright-default.mom:61: error: can't 
> > transparently output node at top level
> > troff: contrib/mom/examples/copyright-default.mom:89: error: can't 
> > transparently output node at top level
> > GROFF contrib/mom/examples/copyright-chapter.pdf
> > troff: contrib/mom/examples/copyright-chapter.mom:62: error: can't 
> > transparently output node at top level
> > troff: contrib/mom/examples/copyright-chapter.mom:93: error: can't 
> > transparently output node at top level
> > GROFF doc/meref.ps
> > GROFF doc/meintro.ps
> > GROFF doc/meintro_fr.ps
> > GROFF doc/ms.ps
> > GROFF doc/pic.ps
> > GROFF contrib/pdfmark/pdfmark.pdf
> > GPL Ghostscript 9.26: Unrecoverable error, exit code 1
>
> Any idea what’s happening? Running MacOS 10.15.7, if that makes a difference.
>
> — Larry





Re: "can't transparently output node at top level"

2020-10-23 Thread Thomas Dupond
I also pulled the last version down and everything compiled just fine. I 
observed the same
"can't transparently output node at top level" messages but no unrecoverable 
error from Ghostscript.
My Ghostscript version is 9.53.3 so maybe consider upgrading ? This looks like 
an error between gs
and pdfmark.pdf. Can you compile pdfmark.pdf on its own ?

Regards, Thomas

‐‐‐ Original Message ‐‐‐
Le mercredi, octobre 21, 2020 4:34 AM, Larry Kollar  a 
écrit :

>
>
> Thomas dupondthomasdup...@protonmail.com wrote:
>
> > This bug is acknowledged in pdfmom(1) in section Bugs :
> >
> >   pdfmom sometimes issues warnings of the type
> >  ...: can't transparently output node at top level
> >   but this is more of an annoyance than a bug, and may safely be
> >   ignored.
> >
>
> OK, that’s good. Can you suggest what caused the “unrecoverable error”
> from Ghostscript at the end of the make run?
>
> Thanks,
>
> — Larry
>



Re: Small offset in overlapping Polygons

2020-11-02 Thread Thomas Dupond
Hi Wim,
If I may, your project looks good ! I recently learned about the .ta request
and I think it could help better your project, especially to align the opening
hours in your table.
I hastily wrote the text below, and the rendering is quite good.
|---| represent a tab.

.nf
.ta 15m +5m +3m
Maandag:|--|gesloten
Dinsdag:|--|10u|---|\(->|---|17u
Woensdag:|-|9u||\(->|---|12u
Donderdag:||gesloten
Vrijdag:|--|10u|---|\(->|---|17u
Zaterdag:|-|10u|---|\(->|---|17u
Zondag:|---|gesloten



‐‐‐ Original Message ‐‐‐
Le dimanche 1 novembre 2020 21:42, Wim Stockman  a 
écrit :

> So I finished my first small project in groff. Wanted to share with the
> community.
> If you have any suggestions let me know.
> Kind regards
> Wim Stockman
>
> P.S. Keep up the good work
>
> Op zo 1 nov. 2020 om 07:53 schreef Wim Stockman wim.stock...@gmail.com:
>
> > Thank you Tadziu indeed when I put everything on one line it is perfect.
> > Kind regards
> > Wim Stockman
> > Op za 31 okt. 2020 17:30 schreef Tadziu Hoffmann <
> > hoffm...@usm.uni-muenchen.de>:
> >
> > > The newline acts like a regular space between the two rectangles.
> > > You can either draw the two rectangles on a single input line:
> > > \Z@...@\Z@...@
> > > or hide the newline with a backslash:
> > > \Z@...@\
> > > \Z@...@
> > > Make sure there are no leading or trailing spaces.





Re: Bulleted list items without ms macros?

2021-02-10 Thread Thomas Dupond
> Is there a way to get bulleted list items
> ( ".IP \(bu 2" in the ms macros) without using ms and
> without getting a "scrambled" document as result?

In the book Unix Text Processing, you can find an example of exactly
this by using the .ti and .in macros:

.in 4
.ti -4
1.  Going through a demo session gave me a much better understanding
of the product.  I confess to being amazed by Alcuin...

However this simple example only works well in nroff were every
character has the same width.  There is however a better version of
this macro in the chapter 17: An Extended ms Macro Package. Here it
is:

.de IP
.sp \\n(PDu
.in \\$2u
.ti -\\$2u
.ta \\$2u
\\$1\t\c
..

This very book has been since revisited and can be found here:

https://github.com/larrykollar/Unix-Text-Processing

Have a nice day,
Thomas




groff-examples repository

2021-07-12 Thread Thomas Dupond
Dave Kemper  wrote:

> These would be great candidates for the groff-examples repository that
> I keep trying to trick someone into creating and maintaining
> (http://lists.gnu.org/archive/html/groff/2021-05/msg00059.html).  So
> far no one has fallen for it.

I'm skimming through the archives to try to create such a document -- it
is taking a lot of time since it goes back to 1999 and many of the
examples have been rendered obsolete by the growth of groff -- and I
wondered what would be actually eligible to end up in the document.

I'm currently keeping examples using native groff syntax but I'm
hesitant on including personal macro sets posted to the mailing list.
Should they be part of MORE.STUFF?  Although I don't see any macro
packages being listed there so maybe not?

Wim Stockman  wrote:

> I see the troff.org domain name is well a goed candidate to host something
> like that. Maybe it would also nice to make it Lo Fi in a gopher format and
> Gemini capsule ?
> I don't know who maintainers are of the troff.org domain. Maybe we could
> ask them to collaborate.

I'm currently writing the document in gemini markup and will then use a
tool to translate it to html.  I cannot speak for the owners of
troff.org but I can host the final document on the web and on
geminispace myself if need be.  I do not have much knowledge of gopher
though.

Thomas




Re: groff-examples repository

2021-07-15 Thread Thomas Dupond
Hans Bezemer  wrote:

> One of the advantages is that users can submit their own
> snippets.

Wim Stockman  wrote:

> Maybe create some managed wikipage
> So the community can contribute to it.

As much as I enjoy the kind words around this project, I would like to
say that my trade is not related in any way to software development so
maintaining a wikipage is beyond my grasp.

Sorry if it's a bummer :/ I will go for a static website for now.

If anyone finds an interesting groff macro, feel free to email it to me,
I will add it to the web page (when it launches).

Thomas




Groff examples repository

2021-08-25 Thread Thomas Dupond
Hi everyone,

The Groff examples repository is now available on the web at
https://froude.eu/groff and on geminispace at gemini://froude.eu/groff
They have exactly the same content and I plan to make it available on
the gopherspace.

Sorry it took such a long time.

As noted on the first page, feel free to email me any macro you find
interesting, I will put it online as soon as I can :) .

Regards,
Thomas Dupond




Re: Groff examples repository

2021-08-26 Thread Thomas Dupond
Oliver Corff  wrote:

> Hi Thomas,
>
> a very nice collection this is!

Thanks!

> One little typo in the overview, "Relowing the text [...]" should be
> "Reflowing [...]".

Fixed it and some other typos (should have run aspell sooner).

> Best wishes,
>
> Oliver.

Regards,

Thomas




Re: Groff examples repository

2021-08-28 Thread Thomas Dupond
Douglas McIlroy  wrote:

> https://froude.eu/groff/examples/reflow.html is a very cleanly written and
> interesting demo. The following comments might perfect it even further.
>
> It would be helpful to remark that .YY is a dumping ground, never to be
> used.
>
> Point out that EB need not be defined. It carries the .tm for the demo, but
> is irrelevant to the underlying purpose. Nevertheless, it's useful to
> illustrate that the macro-end indicator will be expanded if it's defined.
> (But see below.)

I added both of your explanations to the page, I hope that it's as clear
as you are.

> At first glance I read "Text before" and "Text after" as headings for
> paragraphs that show how the processed text would look before and after
> expansion to 2cm height. A change to "Preceding text" and "Following text"
> would avert this mistake.

Indeed, done.

> -
>
> A small anomaly. Consider
>
> .de .
> .tm Hi
> ,..
> ..
>
> The second .. emits "Hi". This fragment also emits "Hi":
>
> .de end end
> .tm Hi
> .end
>
> But this (with macro . not previously defined)
> does not:
>
> .de . .
> .tm Hi
> ..

This is very interesting!  I did not add it to the page though.  I don't
think it would be very helpful in this particular example of reflowing
text to know that there are anomalies in end macros.

> Doug

Regards,

Thomas




Re: Groff examples repository

2021-08-29 Thread Thomas Dupond
Heinz-Jürgen Oertel  wrote:

> Hi,
>
> in the past for technical papers I often used dformat:
>
> https://noxz.tech/guides/groff/papers/dformat_--_a_program_for_typesetting_data_formats__142.pdf

This is excellent, I'm always impressed by what can be achieved with
groff and pic.

> extracted the source from this paper, but it can be found now at
>
> https://github.com/sathlan/dformat
>
> Unfortunately it does not contain the changes I did to use gpic
> "shaded" command to use Colored Objects

Would you mind sharing your changes so I can include them?
>
> Regards
>   Heinz

The DFORMAT program is now listed on the website at
https://froude.eu/groff/examples/dformat.html and on gemini at
gemini://froude.eu/groff/examples/dformat.gmi

Regards,

Thomas




Re: Groff examples repository

2021-08-30 Thread Thomas Dupond
Dave Kemper  wrote:

> On 8/25/21, Thomas Dupond  wrote:
> > The Groff examples repository is now available on the web at
> > https://froude.eu/groff and on geminispace at gemini://froude.eu/groff
>
> Fantastic!  Thanks so much for putting this together.
>
> I see that each page has a link to the source mailing list post, so
> that the original contributor can be identified.  But for pages with
> code that has a specific author (not all the pages fall into this
> category), I wonder if the author ought to be credited on the
> repository page itself as well.

Sure thing, every page has a credit to the author directly in the text
now.

Regards,

Thomas




Groff examples on gopher

2021-09-02 Thread Thomas Dupond
Hello everyone,

No one asked for it, no one will use it, but now the repository is
available on gopher as well at gopher://froude.eu/1/groff .

If you find any mistakes in this gopher hole, please tell me, my
formatting script is terrible so there should be some mistakes.

Regards,

Thomas




Re: Groff examples repository

2021-09-14 Thread Thomas Dupond
Hi Ingo,

Ingo Schwarze  wrote:

> Hi Thomas,
>
> I added a link to it to
>
>   https://mandoc.bsd.lv/links.html

Thank you :) .

> I think on your start page, you ought to add a link to
>
>   https://www.gnu.org/software/groff/ .

Of course! It seemed so obvious but I forgot it!

> Since John Gardner will (rightly) insist that examples of mdoc(7)
> code are nothing more than mere examples of roff(7) code, i would
> consider a link to
>
>   https://mandoc.bsd.lv/mdoc/

Link added on the front page.

> useful as well; your call.
>
> If you want to add a full-blown example of how to use groff to
> set up a complete conference presentation, feel free to link to
>
>   https://www.openbsd.org/papers/eurobsdcon2018-mandoc.roff
>   https://www.openbsd.org/papers/eurobsdcon2018-mandoc.pdf

I'm impressed by the many things groff can do.  Nice work.  I linked to
it in https://froude.eu/groff/examples/conference.html

> Even if you consider mdoc(7) off-topic, you definitely want to link
> to these two pages:
>
>   https://mandoc.bsd.lv/mdoc/details/recursion.html
>   https://mandoc.bsd.lv/mdoc/details/redefine_self.mdoc
>
> You think that is insane?
>
> Well, i can't really disagree with you.  :-)
>
>
> Then again, if a programming language can be used to print Fibonacci
> numbers, that *is* useful, don't you think?
>
>  $ man -cl redefine_self.mdoc
> ()()
>
> 1 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 1597 2584

This is insane.  It is absolutely needed on the examples repository.  Thank
you for this.

Regards,
Thomas




Re: an officially maintained version of dformat outthere ?

2021-11-03 Thread Thomas Dupond
Marc Chantreux  wrote:

> Now what ? is it worth to create a repo and maintain it? I really would
> like to hear about Heinz-Jürgen Oertel now.

Maybe you could create a merge request with
https://github.com/sathlan/dformat ?

It would be really cool to have all the changes in the same repository.

--
Regards,
Thomas




Re: macro returning a value?

2021-11-14 Thread Thomas Dupond
Ulrich Lauther  wrote:

> >   .de Pos
> >   \R'foo (\\n[.d]-\\n[.v]*254+1)/72000'\\n[foo]mm/10
> >   ..
> >
> > which allows you to enter
> >
> >   position: \n[.d] units, \*[Pos].
> >
>
> Wow! Works nicely.
>
> But why is "R" escaped only once? \\R works too.
> And I had to add a line ".sp -1v" at the end of the  macro; otherwise I get a
> blank line after position: ...
>
> ulrich
>

Hi Ulrich,

I think I know why, if I'm mistaken, please correct me.

To be executed, macros are effectively executed twice by groff.  Once to
be defined and once more at execution.  Backslashes are needed to
distinguish between definition and execution.

\\n[.d] is escaped twice because we need the number register .d at the
time of execution not at the time of definition.  As for \R foo, it is
equivalent to .nr foo so it is OK if it is executed at the time of
definition.

--
Regards,
Thomas




Re: [Wishlist] Don't discard groff comments on HTML output

2022-01-27 Thread Thomas Dupond
T. Kurt Bond  wrote:

> And troff comments appearing in html output as html comments is something I
> explicitly DON’T want happening.  My comments are NOT intended to be part
> of the finished document in any form.

I second this feeling.  I'm new to this but to me groff output is
supposed to be a polished document ready to print/visualize.  I don't
think comments should be kept in a final document.
--
Regards,
Thomas




Re: preview of man(7) navigation/hyperlink features in groff 1.23

2022-01-27 Thread Thomas Dupond
Hi Branden,

This is incredibly better for discoverability, thank you very much to
you and Deri James.

I noticed that the PDF you are showing includes all groff related man
pages.  How did you generate this PDF?
--
Regards,
Thomas




Re: preview of man(7) navigation/hyperlink features in groff 1.23

2022-01-28 Thread Thomas Dupond
Hi Branden,

G. Branden Robinson  wrote:

> Hi, Thomas!
>
> I should mention that my email to the linux-man list bounced.  The
> attachment made the message too big.  I guess the list config served as
> the better angel of my nature: I hate marketing.
>
> At 2022-01-27T18:04:44+, Thomas Dupond wrote:
> > Hi Branden,
> >
> > This is incredibly better for discoverability, thank you very much to
> > you and Deri James.
>
> It's no exaggeration to say that I've been working toward this goal
> since I first started contributing to groff in 2017.  There were many
> bugs to fix in batch rendering of man pages, and I had much to learn
> before I could fix them.
>
> A significant amount of work remains with respect to improving page
> content.  That effort will extend well past the 1.23 release, I expect.
>
> There is also the issue of converting the `MR` macro hyperlinks (the new
> thing from October of last year for man page cross references) into
> within-document PDF links.  Deri's already sent me an example
> implementation of that, which I'm still studying.  It needs to be an
> optional feature: man pages will not always, and perhaps not often, be
> compiled as we are doing (except in our own distribution).
>
> I'm also extending these features to our mdoc(7) implementation, and am
> curious to see what Ingo has to say.  I'm putting on my asbestos long
> johns, as they used to say on USENET.  ;-)
>
> > I noticed that the PDF you are showing includes all groff related man
> > pages.  How did you generate this PDF?
>
> We're generating it as part of the build.  The PDFfy bits are embedded
> in the macro package.  The rest is a matter of selecting which man(7)
> and mdoc(7) documents you want, and telling groff to render them.
>
> First we build a big list of our man pages (actually 3 lists because
> of localization gymnastics combined with lexicographical ordering[1]).
> https://git.savannah.gnu.org/cgit/groff.git/tree/doc/doc.am#n147
>
> Then we define a Makefile target to depend on those man pages and
> generate a PDF from them.
> https://git.savannah.gnu.org/cgit/groff.git/tree/doc/doc.am#n225
>
> Nothing about this is intended to be specialized for or confined to
> groff man pages.  These are features any man(7) page can take advantage
> of when rendered to PDF with groff, without even having to do any
> work--with the exception of the `MR` macro.  Even without that, any set
> of man pages can get the results seen in my screenshot, because it
> doesn't show the `MR`->PDF hyperlink translation feature in place.

Thank you very much for this detailed answer.  I discovered the .lf
macro thanks to this Makefile, very interesting.

> I've pushed the commits that enable PDF bookmarks for man pages, so
> people can play with it now if they want to.
>
> I join you in thanking Deri.  He understands PDF, and I truly don't.
>
> Regards,
> Branden
>
> [1] This happily also serves as a sensitive regression test for
> localization issues, since the Swedish groff locale has to be loaded, a
> page rendered using it, and then the English groff locale re-loaded,
> all without screwing up man(7) volume section titles, inter-sentence
> spacing, or hyphenation.  It took me several tries to get this right.

--
Regards,
Thomas




Re: How to use the "mom" '.FT' macro with a period?

2022-04-09 Thread Thomas Dupond
Steve Ross via  wrote:

> Groffers,
> Following is the content of a "mom"-formatted file that poses a question to 
> you.
> 
> --- begin ---This is Roman font.
> .br
> This is a sentence ending with a word in the italic font
> (by using in-line escape sequences)
> before ending with a Roman font \fIperiod\fP.
> .br
> When using the "mom" macro of `.FT' instead of escape sequences,
> I would like to end a sentence with a Roman font
> .FT I
> period
> .FT R
> .br
> How would I do that?

I would do

.FT I
Some sentence\c
.FT R
\&.
.br

> My problem is that I cannot start the next text line with the period
> that ends the sentence because "groff" would interpret that as a control 
> linewith a command rather than a period.--- end ---
> 
> Thanks for any help,
> -- Steve

-- 
Regards,
Thomas



Re: Setting up repository for user macrosets

2022-05-30 Thread Thomas Dupond
"hbeze...@kliksafe.nl" via  wrote:

> Dear all,
> 
> For a while I've been thinking of creating a github public repository
> with user macrosets for groff.
> 
> Per macroset I could make a folder containing the macroset, a snippet
> / example and a README(.md) file with some background on the macroset
> and a info on how to use the macroset and how to build the snippet.

I maintain a list of useful groff tricks at https://froude.eu/groff and
you can find a handful of macrosets here: 
https://froude.eu/groff/examples/macro-sets.html

You should add them to your repository!

> Macrosets could either be extensions on the mm, ms, mom macrosets (or
> others) or standalone macrosets.
> 
> I think it could be helpful for other users to be able to see if a
> specific macroset is available before writing one on their own.
> 
> Personally I find it inspiring to see what others have come up with to
> solve a specific problem.
> 
> I can check if the macrosets produces the expected output before
> pushing to the repo.
> 
> Would that be a good idea?
> 
> Kind regards,
> 
> Hans

-- 
Regards,
Thomas



Re: using groff/troff in producing academic journals

2022-08-11 Thread Thomas Dupond
Larry McVoy  wrote:

> On Wed, Aug 10, 2022 at 09:29:29PM -0500, Dave Kemper wrote:
> > On 8/10/22, Damian McGuckin  wrote:
> > > Do we just send them as attachments and let some poor bunny collate them?
> > > I do not want to overburden somebody limke Branden. How do we make them
> > > available?
> > 
> > The groff examples repository (http://www.froude.eu/groff/) so far has
> > only snippets showing how to do specific things, but I've cc:ed its
> > webmaster to get his thoughts on whether this site would also be an
> > appropriate venue for full articles.
> 
> Or even good pic/eqn/tbl/grap examples.  It's been established that I have
> a weird brain (I "see" the picture from the pic source, I talked with my
> wife who was a tech writer for a while, she said I was weird) and my weird
> brain learns a lot from examples.  I'm probably not the only one.

Sorry I'm in holidays so I missed this great paper by Robert Marks.

I would be happy to make a dedicated part of the groff examples
repository for full papers.  I already added last year a presentation by
Ingo Schwarze to EuroBSDCon 2018.

I have some spare time so if anyone wants to send me sources to their
own files either in full or in snippets I would be happy to incorporate
them.

If there are some copyright worries we can discuss on how to make the
code available to the public.

--
Regards,
Thomas



Re: using groff/troff in producing academic journals

2022-08-12 Thread Thomas Dupond
Robert Marks  wrote:

> Dear All,
> 
> I have added two files (a source file sourcepr, and its processed PDF file
> sourcepr-3.pdf)
> in the directory https://www.agsm.edu.au/bobm/groff/
> 
> This is a slideshow for a presentation; it uses eqn, grap, and tbl, with
> some unusual fonts for display.

Thank you Robert for all this.  I added the two documents you shared in
the groff examples repository at:

https://www.froude.eu/groff/documents/moyal-dirac.html
https://www.froude.eu/groff/documents/decision-making.html

I try to write a short description for each document I add to the
repository.  However if you wish to add or modify some things, I'm all
ears :D

--
Regards,
Thomas



Re: About groff and dformat

2022-08-16 Thread Thomas Dupond
Riza Dindir  wrote:

> Hello All,

Hi!

> I am trying to get dformat to work. What I did was this.
> 
> I first tried to include an example dformat script into my document. I
> got the first example from the troff.org site
> (https://troff.org/prog.html). The first example for the dformat
> processor. That example has been using inline equations/math
> expressions.
> 
> Then I went and got the dformat awk script. That script I got from
> (https://github.com/arnoldrobbins/dformat) which might not be the
> original script.

I know the following github repo is a transcript of the dformat by
Jon L. Bentley:

https://github.com/sathlan/dformat

I had no problem generating your document with it. :)

> Anyways I have this simple document.
> 
> .TL
> Some format
> .NH
> deneme
> .EQ
> delim @@
> .EN
> .LP
> .begin dformat
> style bitwid 0.08
> style charwid 0
> style recspread 0.3
> noname
> --16 Frame
> --16 Frame
>   A1:   --16 Frame
> --16 Frame
> --8-dashed ...
> noname
>   A2:   8--8 Flags
> 8--8 Status
> --8 @roman Chunk sub 1@
>   B1:   --8 @roman Chunk sub 2@
> --8-dashed ...
> --8 @roman Chunk sub m@
> 16--16 CRC
>   A3:   8--8 Flags
> noname
>   B2:   8--8 @roman Data sub 1@
> 8--8 @roman Data sub 2@
> 8--8 @roman Data sub 3@
> 8--8 @roman Data sub 4@
> --8-dashed ...
> 8--8 @roman Data sub n-1@
> 8--8 @roman Data sub n@
> 6--6 Length
>   B3:   10--10 Channel #
> pic line dotted from A1.sw to A2.nw
> pic line dotted from A1.se to A3.ne
> pic line dotted from B1.sw to B2.nw
> pic line dotted from B1.se to B3.ne
> .end
> 
> And am running the command line as
> 
> !sh dformat.sh format-test.ms | eqn | pic | groff -ms > main.ps
> 
> The command says this
> 
> pic::98: syntax error before '\'
> pic::98: giving up on this picture
> 
> Does anybody use dformat? Which dformat script are you using?
> 
> Regards,
> Riza
> 
> 

-- 
Regards,
Thomas



Re: About groff and dformat

2022-08-17 Thread Thomas Dupond
Riza Dindir  wrote:

> Hello Thomas,

Hi!

> Finally I was able to use the dformat without problems.

Congrats! :)

> The problem was the order in the pipe. In the original paper the
> author provided an example on the order of the preprocessors. I did
> not have the correct order. It should have been
> 
> !sh dformat.sh format-test.ms | pic | tbl | eqn | groff -ms > main.ps

I have the same result as you have. I don't know why the order matters,
my knowledge of prepocessors is lacking.

However I recreated your document easily with:

$ dformat.awk format-test.ms | groff -ms -pe -Tps > main.ps

I did not use tbl (with the -t switch) and it worked perfectly.  You
don't need tbl for this particular document.

I noted that when producing the pdf (either with groff -Tpdf or ps2pdf),
the dotted lines appear thinner than in the postscript file.  To be
honest, I would not have noticed them if I only looked at the pdf file.

> That solved the problem, and I can create the dformat in the document.
> 
> Thanks for the help.
> 
> Regards,
> Riza
> 
> On Wed, Aug 17, 2022 at 6:59 AM Riza Dindir  wrote:
> >
> > Hello Thomas,
> >
> > To make sure, I have this in my dformat.sh
> >
> > awk -f dformat.awk $*
> >
> > I tried with the dformat.awk that I have found
> > (https://github.com/arnoldrobbins/dformat) and the dformat.awk that
> > you have pointed out (https://github.com/sathlan/dformat). But still I
> > am getting the same error message and the dformat picture is displayed
> > partially.
> >
> > What is the version of groff (mine is 1.22.4), and awk (mine is
> > 20210215) that you are using? Clearly I must be doing something wrong.
> >
> > Although I could just remove inline equations from the dformat spec in
> > the document, I would like to understand what is wrong.
> >
> > Regards,
> > Riza
> >
> > On Tue, Aug 16, 2022 at 9:59 PM Thomas Dupond  wrote:
> > >
> > > Riza Dindir  wrote:
> > >
> > > > Hello All,
> > >
> > > Hi!
> > >
> > > > I am trying to get dformat to work. What I did was this.
> > > >
> > > > I first tried to include an example dformat script into my document. I
> > > > got the first example from the troff.org site
> > > > (https://troff.org/prog.html). The first example for the dformat
> > > > processor. That example has been using inline equations/math
> > > > expressions.
> > > >
> > > > Then I went and got the dformat awk script. That script I got from
> > > > (https://github.com/arnoldrobbins/dformat) which might not be the
> > > > original script.
> > >
> > > I know the following github repo is a transcript of the dformat by
> > > Jon L. Bentley:
> > >
> > > https://github.com/sathlan/dformat
> > >
> > > I had no problem generating your document with it. :)
> > >
> > > > Anyways I have this simple document.
> > > >
> > > > .TL
> > > > Some format
> > > > .NH
> > > > deneme
> > > > .EQ
> > > > delim @@
> > > > .EN
> > > > .LP
> > > > .begin dformat
> > > > style bitwid 0.08
> > > > style charwid 0
> > > > style recspread 0.3
> > > > noname
> > > > --16 Frame
> > > > --16 Frame
> > > >   A1:   --16 Frame
> > > > --16 Frame
> > > > --8-dashed ...
> > > > noname
> > > >   A2:   8--8 Flags
> > > > 8--8 Status
> > > > --8 @roman Chunk sub 1@
> > > >   B1:   --8 @roman Chunk sub 2@
> > > > --8-dashed ...
> > > > --8 @roman Chunk sub m@
> > > > 16--16 CRC
> > > >   A3:   8--8 Flags
> > > > noname
> > > >   B2:   8--8 @roman Data sub 1@
> > > > 8--8 @roman Data sub 2@
> > > > 8--8 @roman Data sub 3@
> > > > 8--8 @roman Data sub 4@
> > > > --8-dashed ...
> > > > 8--8 @roman Data sub n-1@
> > > > 8--8 @roman Data sub n@
> > > > 6--6 Length
> > > >   B3:   10--10 Channel #
> > > > pic line dotted from A1.sw to A2.nw
> > > > pic line dotted from A1.se to A3.ne
> > > > pic line dotted from B1.sw to B2.nw
> > > > pic line dotted from B1.se to B3.ne
> > > > .end
> > > >
> > > > And am running the command line as
> > > >
> > > > !sh dformat.sh format-test.ms | eqn | pic | groff -ms > main.ps
> > > >
> > > > The command says this
> > > >
> > > > pic::98: syntax error before '\'
> > > > pic::98: giving up on this picture
> > > >
> > > > Does anybody use dformat? Which dformat script are you using?
> > > >
> > > > Regards,
> > > > Riza
> > > >
> > > >
> > >
> > > --
> > > Regards,
> > > Thomas

-- 
Regards,
Thomas



Re: Please nominate NEWS items for the 1.23 release announcement

2022-08-24 Thread Thomas Dupond
G. Branden Robinson  wrote:

> Hi folks,
> 
> The 1.23 section of the groff "NEWS" file is about 560 lines long.
> 
> https://git.savannah.gnu.org/cgit/groff.git/tree/NEWS
> 
> Some people won't read 500+ lines of text to decide if the new groff
> release interests them, so I'd like to hear your nominations for the
> items you consider most important, whether they're cool new features or
> frustrating backward-incompatible changes to be warned about, so that
> the 1.23(.0.rc2) announcement can fairly characterize the release.

>From my perspective of a simple user, I think mom v2.5, the sboxes macro
packages, `<` and `>` for subscripting, and .link are really
interesting.

But I would like to especially thank the authors of the revision and
resurrection of the documentation!  As a new user I would have loved to
see this :D

-- 
Regards,
Thomas



Re: Macro to add sheetmusic either inline or as a figure with lilypond

2022-11-18 Thread Thomas Dupond
hbezemer--- via  wrote:

> Dear all,
> 
> I've created a macroset (see below) which enables me to use lilypond source 
> files and build
> pdf images from them.
> When using '.LILY ' lilypond gets called and builds a
> pdf.

Thank you for this!  If you're okay with it, I'll add it to the groff
examples repository :)
-- 
Regards,
Thomas



a bit of French translation for groff 1.23.0

2023-02-22 Thread Thomas Dupond

"G. Branden Robinson"  a écrit :
> Hi folks,
>
> I had forgotten about this, but there is a wart in doc/meintro_fr.me.in
> that would be nice to sand off before final release.
>
> +.\" BEGIN TRANSLATOR HELP NEEDED
> +The
> +.b \-mfr
> +option
> +sets up appropriate inter-sentence spacing and hyphenation,
> +presuming that
> +.q foo.me
> +is written in French.
> +.\" END TRANSLATOR HELP NEEDED

I would translate it like this:

L'option
.b \-mfr
permet de configurer les espaces entre les phrases
ainsi que les césures de manière appropriée
s'il on suppose que
.q foo.me
est rédigé en français.

--
Regards,
Thomas




Re: a bit of French translation for groff 1.23.0

2023-02-22 Thread Thomas Dupond

Le 22/02/2023 à 09:58, G. Branden Robinson a écrit :

Hi Thomas,

At 2023-02-22T09:52:21+0100, Thomas Dupond wrote:

I would translate it like this:

L'option
.b \-mfr
permet de configurer les espaces entre les phrases
ainsi que les césures de manière appropriée
s'il on suppose que
.q foo.me
est rédigé en français.


Thank you!  I've committed this and it will be in my text push.


Oops, I made a phonetic mistake it should be:

"si l'on suppose" and not "s'il on suppose"

Sorry!

--
Thomas




Re: a bit of French translation for groff 1.23.0

2023-02-22 Thread Thomas Dupond

Le 22/02/2023 à 10:06, Kusoneko a écrit :


L'option
.b \-mfr
permet de configurer les espaces entre les phrases
ainsi que les césures de manière appropriée
s'il on suppose que
.q foo.me
est rédigé en français.

--
Regards,
Thomas

I agree with your translation, but I'd replace "s'il on" with "si on"


I did make a mistake with "s'il on" however the choice between "si l'on" 
and "si on" is not obvious as the two are correct.


I ultimately agree with you and we should choose "si on".
It's closer to present-day French.

--
Regards,
Thomas




Re: Is there a Groff showcase?

2023-12-18 Thread Thomas Dupond

Le 2023-12-16 à 09:44, Mike a écrit :
>> A showcase as like at a trade show?
>
>> I think it would be better to have easy to understand single topic
> prove-of-concepts samples, a bin to throw in and a whatever-grep-
> function for searching.
>
> My original thought was:
>
> Is there a website where the various document layouts and visual
> capabilities of groff are displayed?
>
> - Drop caps

A paper with drop caps can be found here:
https://www.froude.eu/groff/documents/moyal-dirac.html

> - Text in the margin
> - Text around an image or quote

Some example of this can be found here:
https://www.froude.eu/groff/examples/one-page-dungeon.html

> - Graphical title pages
> - Background images
> - Coloured backgrounds

Tangentially, gray alternating backgrounds in tables, here: 
https://www.froude.eu/groff/examples/table-background.html


> - Custom bullet points
> - Coloured text boxes
> - Custom paper sizes

This paper has coloured text and custom paper:
https://www.froude.eu/groff/documents/conference.html

> ...
>
> I have found information on technical aspects of groff and people here
> have been kind enough to point me toward some useful online resources.
>
> However, I have not seen any resources which focus on the visual
> aspects.
>
> This would allow people, including myself, to see at a glance how groff
> visually stacks up against word processors, LaTeX and desktop
> publishing software. To see if groff is the right choice for their
> project.
>
> I am, currently, exploring to find the visual boundaries of the
> software and any help from groff users would be appreciated.
>
> Has anyone achieved flowing text around an image or text box, I would
> love to know? (I have seen discussion on this topic, but no examples).
>
> Mike

I maintain www.froude.eu/groff after some people asked for a repository 
for useful macros and examples to be avaible in one place.


This is far from perfect.  As you said, a more visual presentation would 
be preferable and a lot more examples are needed.  If you have a quick 
sketch as to how you would prefer the website to be presented, I can try 
to achieve the layout you prefer.


I welcome any contribution :)
--
Thomas




Re: Enumerator spacing in bullet lists with mom

2024-04-16 Thread Thomas Dupond

Hello Jan,

Jan Eden  a écrit :
> Hi,
>
> I am currently testing the mom and mm macro packages, and noticed that
> mom uses sensible defaults for almost anything out of the box.
>
> Bullet lists (or lists with other static enumerators like dashes),
> however, are set with very little space between the enumerator and the
> item text. This is not true for ALPHA or DIGIT lists, which are set very
> well.
>
> I wonder if I am doing something wrong – because the spacing looks really
> bad in an otherwise properly formatted document – and how the spacing can
> be changed manually (in case I did not do anything wrong).
>
> This is my test file:
>
> .PAPER A4
>
> .TITLE "Some Title"
> .AUTHOR "Jan Eden"
> .PRINTSTYLE TYPESET
> .FAMILY Garamond
> .START
>
> .HEADING 1 "First Heading"
> .PP
> Some text ...
> .LIST
> .ITEM
> First item
> .ITEM
> Second item
> .LIST OFF

You can see what a list should look like thanks to the document 
"mon_premier_doc.pdf" provided with your groff install.


On my debian system it is present at
/usr/share/doc/groff/examples/mom/mon_premier_doc.pdf.gz

In case you do want to modify the spacing you can follow the documentation:

- locally at file:///usr/share/doc/groff-base/html/mom/docelement.html#list
- online at http://www.schaffter.ca/mom/momdoc/docelement.html#list

> Creating a similar document with mm (with the .BL macro) resulted in 
proper spacing.

>
> - Jan

--
Regards,
Thomas



Re: Enumerator spacing in bullet lists with mom

2024-04-16 Thread Thomas Dupond

Le 2024-04-16 à 09:49, Jan Eden a écrit :

[...]


You can see what a list should look like thanks to the document
"mon_premier_doc.pdf" provided with your groff install.

On my debian system it is present at
/usr/share/doc/groff/examples/mom/mon_premier_doc.pdf.gz


Thanks – this document displays the same (minimal) spacing I described
above.


In case you do want to modify the spacing you can follow the documentation:

- locally at file:///usr/share/doc/groff-base/html/mom/docelement.html#list
- online at http://www.schaffter.ca/mom/momdoc/docelement.html#list


I did read the documentation on lists, but I only found a 
argument to the .ITEM macro, which refers to the vertical spacing
between list elements.



You could do something like this:

.LIST USER "\[bu]\h[0.3c]"
.ITEM
First item
.ITEM
Second item
.LIST OFF

--
Thomas



Re: Enumerator spacing in bullet lists with mom

2024-04-16 Thread Thomas Dupond

Le 2024-04-16 à 12:18, Jan Eden a écrit :

[...]


You could do something like this:

.LIST USER "\[bu]\h[0.3c]"
.ITEM
First item
.ITEM
Second item
.LIST OFF


That works, thank you (although it is a bit of a hack, and I expected a
more structured option to control the spacing)!


If this is to much to bare you can hide it under the carpet with your 
own macro like such:


.de maListe
.LIST USER "\[bu]\h[0.3c]"
..
.maListe
.ITEM
First item
.ITEM
Second item
.LIST OFF

Or if you want to be able to change it on the fly you can do:

.de maListe
.LIST USER "\[bu]\h[\\$1]"
..
.maListe 0.3c
.ITEM
First item
.ITEM
Second item
.LIST OFF

Have fun :)


--
Thomas



Re: Changing header/footer font in mm

2024-04-18 Thread Thomas Dupond

Le 2024-04-18 à 07:11, Jan Eden a écrit :

Hi,

there is probably a really simple solution to this, but I cannot find it
in the docs. When selecting a default font in a mm document like this –

.nr N 1
.fam H
.
.TL
Title
.AU "Author"
.MT 4
.
.H 1 "First Heading"
.P
Some text.

– all text is set in Helvetica, except for the header/footer (Times New
Roman). Why is that, and how can I change the header/footer font to
match the rest of the document?


You can add .fp 1 HR after .fam H, it will do the trick.

Although I have to admit I would have expected .fam H to be enough to 
also change header/footer font.


--
Thomas




Re: An example of a multiplication table: some unresolved questions

2023-05-29 Thread Thomas Dupond via
Dear Oliver,

Oliver Corff  wrote:

> Dear All,
> 
> the attached attempt to create a multiplication table was inspired by
> https://rosettacode.org/wiki/Multiplication_tables
> 
> but I fail to do the right thing with regard to typesetting the computed
> output.
> 
> I followed the groff manual, section Tabs and Fields, and set up my tab
> positions as follows:
> 
> .ta 4mR 4mR 4mR 4mR 4mR 4mR 4mR 4mR 4mR 4mR 4mR 4mR
> 
> So, 12 tab stops at a distance of 4 m (I never have more than three
> digits in my table example), all right-justified.
> 
> However, the \t escape seems to be completely ignored.
> 
> The alternative, conditionally prepending \~ if \n[p] < 100 and \~\~ if
> \n[p] < 10 also seems to fail.
> 
> Thank you all for your enlightenment!

Does this example fill some of what you are trying to achieve?

.nf
.ta 4mR 4mR 4mR 4mR 4mR 4mR 4mR 4mR 4mR 4mR 4mR 4mR
.nr x 1 1
.nr y 1 1
.nr p 0
.while (\n[x] <= 12) \{\
.while (\n[y] <= 12) \{\
.nr p \n[x]*\n[y]
\n[p]   \c
.nr y +1
.\}
.br
.nr x +1
.nr y 1 1
.\}

-- 
Regards,
Thomas



Re: An example of a multiplication table: some unresolved questions

2023-05-30 Thread Thomas Dupond via

Dear Oliver,

Le 2023-05-30 à 09:17, Oliver Corff a écrit :

Dear Thomas,

thank you very much indeed.

Beyond your critical correction of using a genuine tab (0x09) character
instead of \t, it was \c which does the trick.

Furthermore, my setting of tab stops had been flawed.


Using .nf is also important but I think it is not clear from the manual 
(either info or groff(7)) that this is needed, if only for getting rid 
of the 'cant break line' errors.



I now use

.ta T 6m

which works as desired. Yet I still run into a now definitely minor 
problem.


Given the general syntax .ta T 6mX where X is one of L C R,

I get the same output for any of L C R, the numbers are always adjusted
to the left.

1 2 3 4 5 6
2 4 6 8 10    12
3 6 9 12    15    18

instead of

1 2 3 4 5 6
2 4 6 8    10    12
3 6 9    12    15    18

I think I can tinker with prepending \~.


I think this achieves the desired result:

.nf
.ta 2mR T 2mR
.nr x 1
.nr y 1
.nr p 0
.while (\n[x] <= 12) \{\
.while (\n[y] <= 12) \{\
.nr p \n[x]*\n[y]
.nr y +1
\n[p]   \c
.\}
.br
.nr x +1
.nr y 1
.\}

As you can see I added a tab character before and after \n[p] to achieve 
this.  The previous example did not work because I did not remember that 
you should begin with a tab character.


For this kind of thing I tend to rely on the Unix Text Processing book 
more and more.  A very similar example of what you are trying to achieve 
is described on page 66 (4. nroff and troff > Page Layout > Setting 
tabs).  You can get this book here:


http://chuzzlewit.co.uk/utp_book-1.1.pdf

It is a build of the book (hosted on Deri James' website) from the UTP 
revival project.


https://github.com/larrykollar/Unix-Text-Processing/

Also there is no need to specify the steps x or y should take if auto 
incremented because we don't use that here.  The step value is 
interesting if you use \n+[x] or \n+[y] somewhere in your code.  There 
are more examples in section 5.6.3 of the info manual.



I produce the output as follows:

$ groff -Tascii table.roff | less

Thank you very much again, best regards,


You're welcome :D
Thomas



Re: Multi-columns in ms, again

2023-11-22 Thread Thomas Dupond via

Le 2023-11-20 à 19:55, Oliver Corff a écrit :

Dear All,


Hello,


in April 29, I asked whether there is a possibility to resume one-column
text after a two-column text on the same page. Your answers, uni sono,
said what the the manual says: returning to one-column mode will always
finish the page and begin a new one.

The reason for this behaviour is to "[m]ake sure we don't exit if there
are still floats or footnotes left-over." (line 578 of s.tmac, groff
1.22.4)*

I am by far not familiar enough to modify the macros in s.tmac, so may I
kindly ask for some guidance?


I think the section "Multicolumn Processing" beginning on page 391 from 
the Unix Text Processing book[1] might be helpful.  It explains a simple 
macro to do two-column processing.


Although it does not solve your issue since it also implements a page 
break if you go from one column to two, I found these macro to be simple 
enough to bend to my needs.


1: http://chuzzlewit.co.uk/utp_book-1.1.pdf

Best regards,
--
Thomas





Re: Using .[ and .] in a macro

2023-12-05 Thread Thomas Dupond via

Le 2023-12-03 à 07:47, hbezemer--- via a écrit :

Dear all,I would like to create a macro along the lines of:.de CITE.[\\$2\\$1.]\\$3..Which would 
result in:.CITE   The problem that arises is that refer sees the definition of the macro asa 
citation (of course).Is there an elegant way to get this to work?Kind regards,Hans



Hi,

It sounds like you should not be able to do what you want since refer 
process the file before groff and thus your .CITE macro will not be 
defined when the file goes through refer.


Regards,
--
Thomas





Re: Is there a Groff showcase?

2023-12-08 Thread Thomas Dupond via

Le 2023-12-07 à 22:35, Mike a écrit :

I was thinking of a website or web page which demonstrates the extent
of groff's capabilities.

If there isn't anything like this, currently. Has this been considered?

I have only just learned of groff. The manual is awesome (though tough
reading for me in places). groff does so much more than I first
imagined.

I don't know if this aligns with the goals of the contributors, but
examples of some well-designed, finished documents might attract new
users and potential contributors.


Hello Mike,

I have a small list of documents typeset with groff with source 
available on the "groff examples repository" website.


The website is here : https://froude.eu/groff

You will have to scroll some to find the section labelled "Documents 
edited with groff".  There are only 3 documents right now but they cover 
a lot of ground (math, dropcaps, hyperlinks, bibliography, coloured 
text, etc.)


Any contribution is welcome :)

--
Thomas





Re: Avoid page break in tables without box option

2024-04-23 Thread Thomas Dupond via
Jan Eden  a écrit :
> Unfortunately, I failed to describe my requirements properly – sorry
> again. My document contains multiple relatively small tables, and each
> table should appear on exactly one page (i.e. should not cross page
> boundaries).
>
> I attached sample documents and the respective outputs of
>
> groff -mm -t -Kutf8 -Tpdf test_boxed.groff > test_boxed.pdf
>
> to this message, and I would like to achieve the page break behaviour of
> the boxed variant, but without having actual boxes drawn around the
> tables.

Hello Jan,

If you are using the mm macros, you can achieve what you want by
following the first advice of Branden, call .DS before each .TS and
.DE after each .TE.

"G. Branden Robinson"  a écrit :
> Hi Jan,
>
> At 2024-04-23T07:28:41+0200, Jan Eden wrote:
>> enclosing a table in a box avoids page breaks within the table
>> reliably for me – is it possible to get the same behaviour without the
>> box?
>
> Yes.  This is what "keep" macros are for, assuming the macro package
> you're using offers those (all full-service packages except those for
> man pages[1] do).
>
> Hmm, your recent questions about mm suggest to me that that's the
> package you're using, and our groff_mm(7) page does not employ the word
> "keep".
>
> However, mm's display macros can serve this purpose and §7.3 of the DWB
> 3.3 mm manual mentions this fact.
>
> Bracket your table with the `DS` and `DE` macros.


-- 
Thomas




Re: Changing header/footer font in mm

2024-04-24 Thread Thomas Dupond via
"G. Branden Robinson"  a écrit :
> Hi Jan,
>
> At 2024-04-24T07:53:51+0200, Jan Eden wrote:
>> On 2024-04-24 00:07, G. Branden Robinson wrote:
>> > At 2024-04-21T23:52:48-0500, G. Branden Robinson wrote:
>> > > For mm, what I would do is set up the mounting positions to replace
>> > > Times with Helvetica.
>> > > 
>> > > .fp 1 HR
>> > > .fp 2 HI
>> > > .fp 3 HB
>> > > .fp 4 HBI

Hello Branden,

This question is naive but why isn’t .fam implemented as a wrapping to
the .fp macro like:

.de fam
.fp 1 R \\$1R
.fp 2 I \\$1I
.fp 3 B \\$1B
.fp 4 BI \\$1BI
..

Of course this doesn’t implement the capability of going to the
previous font family with an empty .fam call.

>> > 
>> > I retract this advice.  Using ".fam H" early in the document (in
>> > groff 1.23.0) is better.
>> 
>> This did not work in groff 1.23.0 for the header/footer issue (with
>> `.fam H` as the very first request in the document), I had to use both
>> requests –
>> 
>> .fam H
>> .fp 1 H
>> 
>> – as suggested by Thomas.
>
> Ah, right.  Okay.  I un-retract the advice.  Yes, Thomas was right.
>
> The reason is that, quite apart from environment issues, groff mm is
> faithful to the DWB mm tradition in that internally it refers to fonts
> by mounting position rather than a named style, even though it has
> cognizance of only one family.[1]  Jörgen Hägg, the author groff mm,
> appears to have added some limited support for switching the font family
> to his multicolumn macro extensions, MULB/MULN/MULE, but it's not clear
> to me exactly how they work.  (Rather, I can read and understand the
> requests just fine but I'm not sure they're necessary...?  Perhaps this
> was the beginning of an unfinished idea.)
>
> This fact is totally separate from the environment stuff I was talking
> about earlier because, as I noted previously, the list of font mounting
> positions is global, and consistent among all environments.
>
> The concept of mounting positions is a fairly baroque aspect of troff
> and completely, as far as I know, a consequence of the hardware design
> of the C/A/T phototypesetter used by the Bell Labs CSRG.  They used this
> indirection to refer to fonts because the machine itself did.  You
> didn't have any idea what font's photographic plate would be loaded into
> the various positions of the typesetter's mechanical carousel.  One of
> your co-workers could scramble their order, ruining your document and
> you had no way of knowing until it was printed.
>
> I expect this didn't happen often, not with the imploding gaze of an
> office balrog to fear...
>
> I would prefer to wean groff mm off of explicit use of mounting
> positions altogether, but doing so is not a high-urgency project.
> (This also means it's good task for a contributor who wants a modestly
> sized project to learn with.  :) )
>
> Regards,
> Branden
>
> [1] I grepped and could find _no_ matches in our m.tmac for `ft [BIR]`,
> `\\f[BIR] or `\\f\[[BIR]\]`.  Replacing "BIR" with "123" is more
> fruitful.

-- 
Thomas




Re: More on writing academic papers

2024-05-22 Thread Thomas Dupond via
Hello Bento,

Damian McGuckin  a écrit :
> Bento,
>
> On Tue, 21 May 2024, Bento Borges Schirmer wrote:
>
>> I think I will stop reproducing templates for conferences for now.
>
> Wise move. I just tweak my standard template every time.
>
>> different template, such as that of ACM!
>
> Mine is close to this.
>
>> That's the entire idea after all, right!? I'll be using defaults for
>> now and worry less.
>
> Very wise move.
>
>> And then, after getting the actual research done and written, I can
>> spend some time tailoring the final print, I hope to find help here :)
>> :) Like how to handle all the ABNT rules for citations and references
>> :(
>
> That is the 'refer' tool. Which is a whole new ball game. I wish I
> understood it better than I do.

Refer is very powerful but may require some tweaking like Hans Bezemer
did to get APA-style citations:

https://www.froude.eu/groff/examples/refer-apa.html

>> Now I'm thinking about writing filters and preprocessors. I dunno if
>> groff or mm provide mechanisms to reference figures and headers,
>> which would be handy. Unless that is the case, I'm thinking about
>> writing small C programs that recognize some commands and count
>> figures and headers and replace text for me when referencing them,
>> something like that. I dunno I dunno. Let's see.
>
> The Table of Contents macro already handles Figures and Tables and
> Headings.  You caption each table and figure with .TB and .FG macros
> respectively/

To add to what Damian said, you could look at page 121 in the Unix
Text Processing book:

http://chuzzlewit.co.uk/utp_book-1.1.pdf

>> Whenever I search for users of groff, people frequently mention
>> computer generated content, such as for business. So I guess troff
>> can be used "directly" by writers, but it also suited to be easy to
>> be... generated?
>
> Yes. We process a database to automatically generate the invoice details
> which is then run through 'groff -mm' to provide the invoice on a
> company letterhead.

Also did an ersatz of this at my previous job to generate numbered
invoices.  The hardest part was finding the company logo in postscript
format :D

-- 
Thomas




Re: More on writing academic papers

2024-05-22 Thread Thomas Dupond via
"G. Branden Robinson"  a écrit :
> At 2024-05-22T09:28:46+0200, Thomas Dupond via wrote:
>> Damian McGuckin  a écrit :
>> > Yes. We process a database to automatically generate the invoice
>> > details which is then run through 'groff -mm' to provide the invoice
>> > on a company letterhead.
>> 
>> Also did an ersatz of this at my previous job to generate numbered
>> invoices.  The hardest part was finding the company logo in postscript
>> format :D
>
> If you're outputting PDF, you can use groff's `PDFPIC` macro from the
> stock "pdfpic.tmac" file to achieve the same end.
>
> https://git.savannah.gnu.org/cgit/groff.git/tree/tmac/pdfpic.tmac?h=1.23.0

Yes!  Tremendous macro file this one.  Although I don’t remember
exactly why I used postscript but I think it is because I compiled in
the default Debian WSL on MS Windows without an admin account.  By
default Debian does not include the full groff package and thus you
cannot output to PDF, only to PS.

Regards,
-- 
Thomas




Re: adjusting font picks for code snippets and math

2024-09-09 Thread Thomas DUPOND via

Le 2024-09-06 à 11:38, Norwid Behrnd a écrit :

Hello,


Hello Norwid,


I would like a different font for the display of snippets of source code in pdf
the default installation of groff in Linux Debian (version 1.23.0) renders with
Courier, and improve the one of mathematics.  Unsure if this a question of
proper font installation, or perhaps using groff in general, I want to address
the question here.

part 1) The conversion of a markdown file into .ms with Pandoc writes a
preamble including the two lines

```
.\" font family: A, BM, H, HN, N, P, T, ZCM
.fam P
```

Following the demonstration of Gavin Freeborn,[1] I fetched font files about
Libertine from CTAN,[2] and successfully installed the data for regular,
italic, and bold characters with Peter Schaffter's script[3] by

```
$ sudo ./install-font.sh -s -d -F Libertine -f +R LinLibertineO.pfb
$ sudo ./install-font.sh -s -d -F Libertine -f +I LinLibertineOI.pfb
$ sudo ./install-font.sh -s -d -F Libertine -f +B LinLibertineOB.pfb
```

This now allows me to use

```
.fam Libertine
```

for the running text. While the documentation[4] states groff's set of R, I,
B, BI fonts can be extended, the large table does not explicitly hint how one
can add a non-proportional font (e.g., Bera Mono[5]) to the effect this one to
be used only for snippets of code.


You can switch to any installed font you want for your snippets of code. 
 It looks like you use this kind of command:


> Code snippet: \f[CR]write(fileunit,"(I3,1x,F5.2)") counter, area\f[R].

Here you switch to Courier (C) Roman (R) font with \f[CR].  You could 
use anything else like \f[HR] to have your snippet in Helvetica.


If you absolutely want to keep using \f[CR] for your code, you can do 
this and you would have your snippet in Helvetica:


.fp 5 CR HR
Code snippet: \f[CR]write(fileunit,"(I3,1x,F5.2)") counter, area\f[R].

I mounted the font here at position 5 since the first 4 font positions 
are usually taken by the Roman (1), Italic (2), Bold (3) and Special (4) 
font.


Also, I think at the end of your snippet \fP is better suited than \f[R] 
since \fP make groff switch back to the previous (P) font.



Is there a particular "key" -- like `R`
for regular/Roman -- to restrain the eventual use of this font one can provide
during the installation?

1b) Presuming there were two non-proportional fonts at disposition, what can I
add to the document's preamble to let groff know to then use Bera Mono instead
of Courier for snippets of code?

1c) (pdf)LateX allows to activate fonts with an optional scaling of their
glyphs' height, e.g. `\usepackage[scaled]{beramono}`[6].  Does groff provide a
similar functionality?

---

part 2) Compiling the snippet shared below with

```
$ groff -e -ms -Tpdf 2test.ms > 2test.pdf
```

the variation of the font family from the default set of A, BM, H, HN, N, or P,
does not affect the glyph about rho during var.  Using for instance font family
BM depicts the plus signs differently in text and math mode.  With the amended
Libertine font, a

```
.fam Libertine
```

in the document's preamble now picks a different glyph about rho however
breaks the square root into pieces.

Based on these observations, what could be the/a recommended "groff key" during
the installation (as in 1a) and subsequent use (as in 1b) to substitute this
default font?  In the present context, `LibertinusT1Math.pfb` of
LibertinusT1Math[7] appears as suitable pick for that its glyphs are closely
related to the ones of Libertine.  On the other hand, this set simultaneously
contains glyphs which are regular [Roman, Greek, Cyrillic], italic, bold, math
doublestroke -- a blend beyond the scope of Peter Schaffter's present guide.


In EQN you can use gfont, grfont and gbfont to set the fonts you want. 
(See the man page eqn(1)).


For all your font related questions, some answers can be found in the 
man pages groff_font(5) and groff(7).


Also it looks like your are using ms so groff_ms(7) is helpful.

For examples you could look at the Unix Text Processing book[1], chapter 
4, section Changing Fonts (page 86/527).


Regards,

Norwid


```
.\" name: 2test.ms
.\" compilation: groff -e -ms -Tpdf 2test.ms > 2test.pdf
.\" font family: A, BM, H, HN, N, P, T, ZCM
.fam BM
.EQ
delim @@
.EN
.LP
This is normal text, \f[I]italic\f[R], and \f[B]bold\f[R].
An in\-line equation @E = m c sup 2@ followed by one in display-style
.EQ
x sub {1 , 2} = p over 2 +- sqrt {{p sup 2} over 4 - q}
.EN
.LP
Code snippet: \f[CR]write(fileunit,"(I3,1x,F5.2)") counter, area\f[R].
.PP
.EQ
rho = m over V
.EN
Glyphs about the plus sign appear of different origin, see + vs @+@.
```

[1] https://www.youtube.com/watch?v=CzUHjtGBdZs
[2] https://ctan.org/pkg/libertine
[3] https://www.schaffter.ca/mom/bin/install-font.sh
[4] https://www.schaffter.ca/mom/momdoc/appendices.html#fonts
[5] https://www.ctan.org/pkg/bera
[6] https://tug.org/FontCatalogue/beramono/
[7] https://ctan.org/pkg/libertinust1math


Best regards,
Thomas

[1]: http://chuzzle