groff
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [groff] UTF8 characters to pdf


From: John Gardner
Subject: Re: [groff] UTF8 characters to pdf
Date: Fri, 25 Jan 2019 01:17:49 +1100

> I'm not a Mac user so I don't know which you might prefer or what the
tradeoffs are, but MacPorts has 1.22.3 and Homebrew has 1.22.4.

I recommend sticking with Homebrew instead of MacPorts. Homebrew is much
more ergonomic/user-friendly, has clearer and more accessible
documentation, and gets updates very, very frequently. MacPorts is pretty
much the opposite in each regard.

While I remember: if you want man(1) to use Homebrew's version of Groff,
you'll need to edit /etc/man.conf — the paths in that file are hardcoded to
use macOS's antique version of Groff.
You can update /etc/man.conf to use UTF-8 output and Homebrew's Groff by
running this in your terminal:

sudo sed -i.bak -E '/^NROFF|^NEQN/ s/-Tascii/-Tutf8/;

/^(J?[NT]ROFF|(J?N)?EQN|TBL|REFER|PIC)[[:blank:]]+/
s|/usr/bin/|/usr/local/bin/|' man.conf


This is important because some of Groff's manpages won't display correctly
in `man` because of the hardcoded ancient version.

Cheers,

On Fri, 25 Jan 2019 at 00:49, Colin Watson <address@hidden> wrote:

> On Thu, Jan 24, 2019 at 05:05:25AM +0000, jonathan ahumada wrote:
> > I’m trying to get into groff  with the hopes that I could print my own
> > literary drafts. However, I write in spanish and have had problems
> > with accented characters such as (á, é, ó , etc). I have been
> > searching and apparently groff doesn’t support utf-8, which is the
> > format my files are written in. I have seen some people use a
> > `preconv`command or a `-k` flag to convert their files for utf-8 into
> > latin1 within the groff command.
>
> Sort of; it preprocesses UTF-8 into ASCII plus \[uXXXX] escapes.  Using
> preprocessors to transform the input in various ways is a routine
> practice in groff.
>
> On the phrasing in your last couple of sentences, I would rather say
> that groff supports UTF-8, but only via preconv (which is part of
> groff).
>
> > But the build I have on my Mac computer doesn’t seem to have this
> > (version 1.19.2).
>
> Yeah, that is pretty prehistoric; groff 1.20 was released a full ten
> years ago, and the current release is 1.22.4.  I'd really recommend you
> try upgrading.
>
> I'm not a Mac user so I don't know which you might prefer or what the
> tradeoffs are, but MacPorts has 1.22.3 and Homebrew has 1.22.4.  Perhaps
> you might try installing a newer version of groff from one of those?
>
> > I know you can use escape sequences in order to tell the troff
> > formatter to use certain characters, but modifying my files with a
> > sort of tailored script to replace all my accents seems burdensome.
>
> You wouldn't actually modify your files, but just have the build script
> you use to render them add the -k option.
>
> --
> Colin Watson                                       address@hidden
>
>


reply via email to

[Prev in Thread] Current Thread [Next in Thread]