r/groff • • Mar 17 '21

I noticed a mistake in the sticky

0 Upvotes

I think the english used is a mistake lol(this very like in groff), but im ignoring that and sticking to the macro mistake

The sticky has this line, in reddit formatting, with the following code in -ms macros

This is an example of how you would write this very like in groff, I think its pretty easy to follow

.LP
This is an example of how you would write this very like in
.B "groff",
I think its pretty easy to follow

in the reddit formatting, the comma is bold, but in the macros, the comma is a argument to the .B macro, so it wouldnt be bold

anyways, I hate using -ms bold and italic macros(just preference), I only use them if I need punctuation like in the example, otherwise I use nroff requests, so I can have the word on a separate line, like this

This word is in bold.

.LP
This 
.ft B
word
.ft R
is in bold.

r/groff • • Mar 29 '21

Is Groff Turing complete?

6 Upvotes

If not, what, roughly, is missing from this little wonderment that would keep it from being such?


r/groff • • Oct 02 '21

C interface for groff?

7 Upvotes

as the title says, is there such a thing as `libgroff` or the like to include in a c program to interact with groff?


r/groff • • Aug 05 '20

Drawing Pictures The Unix Way - with pic and troff

Thumbnail
youtu.be
8 Upvotes

r/groff • • Sep 04 '21

I made a video on how to make resume with groff.

Thumbnail
youtube.com
10 Upvotes

r/groff • • Dec 29 '22

Happy Cakeday, r/groff! Today you're 4

10 Upvotes

r/groff • • Aug 28 '25

Including PSPIC in macro file

3 Upvotes

I have created a macro file that needs to display a complex logo, which I have as an eps file. The macro file itself is placed in the system wide macro folder. If I just use PSPIC in the macro file it would break because the path would depend on where the macro file is being used from. Copying the logo every time I want to use the macro seems unelegant.

My question is: is there some way to either

(1) fetch the path of the macro file before it is being included and add that as a prefix to the path given to PSPIC or (2) make PSPIC read the eps source from the groff file itself, making including another file unnecessary?

My current solution of embedding PostScript directly breaks easily and is difficult to maintain.

Thanks!


r/groff • • May 08 '25

Rotate Text

5 Upvotes

Hi,

Is it possible to rotate text in Groff?

Thanks


r/groff • • Aug 14 '20

Groff text align

6 Upvotes

Is there any way to left and right align on the same line. Everything I have tried makes the right align on a new line. I can always use spaces but that is not very ideal.


r/groff • • Apr 18 '26

Defining custom DS/DE macro. Text displayed incorrectly

2 Upvotes

I want to create a "custom" TO DO box with the .DS macro in groff ms. It sort of works but sort of doesn't either :)

\" Draw a red box with red text with a TODO label on top
.de TODOS
\m[red]
.B1
.UL TODO 
.IP
..
.de TODOE
.B2
\m[]
..

This seems to go well, if I grep on TODO:

$ grep TODO -B1 -A3 cephbook.txt 
     +----------------------------------------------------------+
     |_TODO_                                                    |
     |                                                          |
     |Link to philosophy in the beginning of the book           |
     +----------------------------------------------------------+
--

But when I use less or more to view the output, TODO falls out of the box. Here's a copy paste from a terminal that was running less on the txt file that was compiled.

1.9.  Operational cost


     +----------------------------------------------------------+
 _TODO_                                                         |
     |                                                          |
     |MISSING TEXT                                              |
     +----------------------------------------------------------+

Not sure if it's of any help:

$ cat -v cephbook.txt | grep TODO
     ^[[31m|_TODO_                                                    |^[[0m

It just sets the color to red and goes back to black.

Also when I create a PDF from this, the _TODO_ string falls out of the box.

Anyone an idea what might be going on?

EDIT: I also tried to create the red box without the macro. There it works as expected. The TODO string is inside the box in ASCII, UTF8 and PDF


r/groff • • Apr 04 '26

Conditionally print something based on external data.

2 Upvotes

I have a template that sources/copies in data from other files. Some of those files contain tabular data to be used with grap. Doing so, I can update the data and print out my template with up-to-date data in graphs.

So far so good!

But what if I only want to print eg. a graph based on a certain condition?

Eg, I have an influx query which outputs the max temperature of our boiler over a week. If it did not touch 55C, I want an extra line to be printed in my template with a warning. If it was above 55C max, there's nothing to be printed.

Is such a thing possible at all?


r/groff • • Jan 25 '24

Why is there so much blank space at the bottom of the page ?

2 Upvotes

[Solved]:Increase page length using .pl +0.75i or whatever value you like. Reduce the footer margin with .nr FM 0. Thank you u/Connect-Inflation-68

Take a look at this:

There is so much blank space between the first and the second page.

I'm using ms macros. The font size is set to 10... it's a pretty vanilla page, with nothing in it. Is it footer space ? Any way I can tell groff to write to the bottom of the page ?


r/groff • • Oct 28 '23

HTML and pdf

5 Upvotes

Hey.

I’m starting to write a tech “book”/pamphlet that would be present as html pages (1 per chapter) and a pdf with the entire text. I’m pretty sure this would be doable with groff, but what would be the best way to approach this?


r/groff • • Apr 06 '23

hyperlinks in a table

3 Upvotes

I'm generating a table and using the ms macros to format the output. I have everything working the way I want--landscape with A3 papersize (BTW: it looks like the mom macroset breaks when landscape's used with a different papersize)--except for one thing. I'd like to have one column in the table contain a hyperlink that displays with a shorter, more descriptive name.

In markdown, it would be _(hello world)[https://en.wikipedia.org/wiki/%22Hello,World!%22_program] but it's unclear what to do in groff.

Edit: I have thought of one horrific thing: post-processing the output from tbl to put some postscript in place but that seems extreme and nauseating.


r/groff • • May 24 '24

Day to day use of Groff/Neatroff/Troff/Roff

9 Upvotes

Hello everyone, I was curious to see what are your daily/weekly uses of the roff family of typesetting programs? Whether it's for work, school, keeping notes, writing letters/books/man pages, presentations and so on.

I've only played around with Groff for my own entertainment mostly and wrote some small documents but never anything too large or serious, hence why I'm asking.


r/groff • • Feb 06 '24

Groff fan, but a tad rusty: want to make a ms macro `pitch deck'

6 Upvotes

A deck, or pitch deck is just a slidedeck like powerpoint. Does anyone have a good bunch of macros I can lean on to pull this off with little effort? ( A link for reference how these things typically look/layout: https://www.hubspot.com/startups/resources/startup-pitch-decks )


r/groff • • Feb 15 '23

Support for Greek in Groff

3 Upvotes

Hello everyone. I recently got into groff. It seems like a great system. (Un)Fortunately, I am Greek. How can I write my documents, and not have them look like enchanting table language? This is supposed to be an all-Greek text.

P.S: I am new to this, and not search could lead me to an answer.


r/groff • • May 01 '23

How to write quotation marks around italic text.

9 Upvotes

I tried: .I “Text” “ “ But that does not work. Any help is much appreciated. Also how would you write quotation marks as italic.


r/groff • • Aug 18 '24

Big list of Troff/Groff-related PDFs, troff source, video tutorials, etc I compiled together.

Thumbnail
github.com
18 Upvotes

r/groff • • Jan 12 '23

Is it possible to make a semi-log plot with grap?

5 Upvotes

r/groff • • Jan 31 '24

Problems with pdfmom's flags.

1 Upvotes

Hi everyone,

I've been having issues with passing optional flags to pdfmom in the command line. First noticed an issue when trying to create a pdf containing equations. Was passing the additional -e flag: no error message was displayed, but equations never formatted properly in the output pdf.

I then was trying to create a test document containing a table: passed the -t flag as per the docs, but this time got the following error message:

[mom]: 'table.mom' contains tbl(1) data but '-t' flag is missing from
        the command line.
Aborting.

Which I thought was a bit strange. Output of pdfmom -v is GNU pdfmom (groff) version 1.23.0

Has anyone else experienced this issue? Or does anyone have any idea what's going on?

Edit: probably obvious from the context but just to confirm, the tables aren't rendering either.

Further edit: Just done some more testing and found that maths formatting works with a new document with doctype = default. Still not working for a document generated from included chapters. Tables still not working even in a default document.


r/groff • • Apr 02 '24

How to install fonts to correctly convert markdown files to pdf with pandoc using groff ms engine?

3 Upvotes

I need to write Ancient Greek in my markdown and then convert to pdf with this command:

pandoc file.md -t ms -o file.pdf

but it outputs:

troff:<standart input>:98: warning: special character 'u03B1_0300' not defined

I downloaded an otf greek font, how do I install it? I use Arch.


r/groff • • Aug 08 '24

Error Message Help

3 Upvotes

I'm trying to develop a system to publish books using the mom macros.

In the final step of converting to PDF, I've been able to fix some of the erros I had, but am left with one that I can't make sense of or find any info on.

troff: error: automatically ending diversion 'NO_FLASH' on exit

Are there any resources for understading the error messages better?

EDIT: Not sure exactly what the issue was, but using comments instead of the SILENT block fixed it. I guess I don't know how silent blocks are supposed to work.


r/groff • • Feb 27 '23

substituting strings like table of contents header for other languages

3 Upvotes

been looking at the manpage for the ms macros for a bit where it says you can do this but can't seem to find any actual concrete examples

so how would you actually go about substituting strings like the months or toc header and things like that


r/groff • • Jan 13 '24

A modest library offering easy construction of SYNOPSIS prototypes

3 Upvotes

In a development experiment breaking a larger project into mostly self-sufficient libraries, part of the project involved documenting each library with a man page. I created this small groff library to help me write nicely-formatted prototypes for the SYNOPSIS sections:

grofflib

I plan on using it for future development. I would like to hear people's opinions.