groff
[Top][All Lists]
Advanced

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

Re: using .so in a macro


From: Oliver Marti
Subject: Re: using .so in a macro
Date: Thu, 16 Feb 2023 19:41:47 +0100

Hy Riza

Soelim is just like cat but it "eliminates" the .so, which can cause utf-8
malfunctions (it basically puts the whole file together as one without
ignoring e.g. preconv or other piping functions).

I think you can just use soelim main.ms | ... | groff -ms -Tps > output.ps.
cat seems to be redundant here.

Or even put pic and tbl directly to the groff line (soelim main.ms | groff
-ms -pic -tb -Tps > output).

Greetings,
Oliver
(non-expert)



Riza Dindir <riza.dindir@gmail.com> schrieb am Do., 16. Feb. 2023, 15:31:

> Hello Ralph,
>
> I was using soelim in my pipeline (cat main.ms | soelim | pic | tbl |
> groff -ms > main.ps). The problem was with soelim. I did not realize
> that. I first had it with double slashes, but then tried with four
> slashes... Removing soelim from the pipeline resolved the problem.
>
> What is soelim used for? Since troff has the .so command, it must be
> used for a special purpose.
>
> Thanks.
>
> On Thu, Feb 16, 2023 at 1:05 PM Ralph Corderoy <ralph@inputplus.co.uk>
> wrote:
> >
> > Hello Riza,
> >
> > > Is it possible to use the ".so" command in a macro, and pass in an
> > > argument from the macro.
> > >
> > > .de MC
> > > .so \\\\$1
> > > ..
> > >
> > > .MC file.txt
> >
> > Yes.
> >
> >     $ cat >foo
> >     .de source
> >     .so \\$1
> >     ..
> >     foo
> >     .source bar
> >     foo
> >     ^D
> >     $
> >     $ cat >bar
> >     bar
> >     ^D
> >     $
> >     $ nroff foo | grep .
> >     foo bar foo
> >     $
> >
> > You're escaping the ‘$’ too much.  You're seeing:
> >
> >     $ nroff foo | grep .
> >     troff: foo:5: can't open '\$1': No such file or directory
> >     foo foo
> >     $
> >
> > --
> > Cheers, Ralph.
>
>


reply via email to

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