tech@mandoc.bsd.lv
 help / color / mirror / Atom feed
* roff conditionals inside .Bd
@ 2010-06-01 10:10 Ulrich Spörlein
  2010-06-01 12:03 ` Kristaps Dzonsons
  0 siblings, 1 reply; 3+ messages in thread
From: Ulrich Spörlein @ 2010-06-01 10:10 UTC (permalink / raw)
  To: tech

Hi guys,

the .if n/t support is really nice, but I have one mdoc page that still
barfs, as the .if is used inside .Bd. Markup looks like this:

The
.Fn erf
and the
.Fn erff
functions calculate the error function of x; where
.Bd -ragged -offset indent
.if n \{\
erf(x) = 2/sqrt(pi)\(**\|integral from 0 to x of exp(\-t\(**t) dt.
\}
.if t \{\
erf\|(x) :=
(2/\(sr\(*p)\|\(is\d\s8\z0\s10\u\u\s8x\s10\d\|exp(\-t\u\s82\s10\d)\|dt.
\}
.Ed
.Pp

% mandoc lib/msun/man/erf.3
lib/msun/man/erf.3:61:2: scope broken, syntax violated

mandoc will render it just fine, if
- the .Bd/.Ed is removed
- the conditional is removed (duh)
- the conditional is put on one line, like this:

.Bd -ragged -offset indent
.if n erf(x) = 2/sqrt(pi)\(**\|integral from 0 to x of exp(\-t\(**t) dt.
.if t erf\|(x) := (2/\(sr\(*p)\|\(is\d\s8\z0\s10\u\u\s8x\s10\d\|exp(\-t\u\s82\s10\d)\|dt.
.Ed


Ideas?
Uli
--
 To unsubscribe send an email to tech+unsubscribe@mdocml.bsd.lv

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: roff conditionals inside .Bd
  2010-06-01 10:10 roff conditionals inside .Bd Ulrich Spörlein
@ 2010-06-01 12:03 ` Kristaps Dzonsons
  2010-06-01 12:09   ` Ulrich Spörlein
  0 siblings, 1 reply; 3+ messages in thread
From: Kristaps Dzonsons @ 2010-06-01 12:03 UTC (permalink / raw)
  To: tech

> the .if n/t support is really nice, but I have one mdoc page that still
> barfs, as the .if is used inside .Bd. Markup looks like this:
> 
> The
> .Fn erf
> and the
> .Fn erff
> functions calculate the error function of x; where
> .Bd -ragged -offset indent
> .if n \{\
> erf(x) = 2/sqrt(pi)\(**\|integral from 0 to x of exp(\-t\(**t) dt.
> \}
> .if t \{\
> erf\|(x) :=
> (2/\(sr\(*p)\|\(is\d\s8\z0\s10\u\u\s8x\s10\d\|exp(\-t\u\s82\s10\d)\|dt.
> \}
> .Ed
> .Pp
> 
> % mandoc lib/msun/man/erf.3
> lib/msun/man/erf.3:61:2: scope broken, syntax violated
> 
> mandoc will render it just fine, if
> - the .Bd/.Ed is removed
> - the conditional is removed (duh)
> - the conditional is put on one line, like this:
> 
> .Bd -ragged -offset indent
> .if n erf(x) = 2/sqrt(pi)\(**\|integral from 0 to x of exp(\-t\(**t) dt.
> .if t erf\|(x) := (2/\(sr\(*p)\|\(is\d\s8\z0\s10\u\u\s8x\s10\d\|exp(\-t\u\s82\s10\d)\|dt.
> .Ed
> 
> 
> Ideas?

Ulrich,

Yes: I should fix this.  And it's done.  This flushed out another bug
such that statements closing a conditional, e.g.,

  hello \} there

should be passed verbatim to the front-ends (if allowed by the
conditional), which would ignore the \}.  This has also been fixed,
hence the added escape in chars.{c,in} and mandoc.c update.  A
regression test has been added to this effect.

Thanks!

Kristaps
--
 To unsubscribe send an email to tech+unsubscribe@mdocml.bsd.lv

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: roff conditionals inside .Bd
  2010-06-01 12:03 ` Kristaps Dzonsons
@ 2010-06-01 12:09   ` Ulrich Spörlein
  0 siblings, 0 replies; 3+ messages in thread
From: Ulrich Spörlein @ 2010-06-01 12:09 UTC (permalink / raw)
  To: tech

On Tue, 01.06.2010 at 14:03:35 +0200, Kristaps Džonsons wrote:
> > the .if n/t support is really nice, but I have one mdoc page that still
> > barfs, as the .if is used inside .Bd. Markup looks like this:
> > 
> > The
> > .Fn erf
> > and the
> > .Fn erff
> > functions calculate the error function of x; where
> > .Bd -ragged -offset indent
> > .if n \{\
> > erf(x) = 2/sqrt(pi)\(**\|integral from 0 to x of exp(\-t\(**t) dt.
> > \}
> > .if t \{\
> > erf\|(x) :=
> > (2/\(sr\(*p)\|\(is\d\s8\z0\s10\u\u\s8x\s10\d\|exp(\-t\u\s82\s10\d)\|dt.
> > \}
> > .Ed
> > .Pp
> > 
> > % mandoc lib/msun/man/erf.3
> > lib/msun/man/erf.3:61:2: scope broken, syntax violated
> > 
> > mandoc will render it just fine, if
> > - the .Bd/.Ed is removed
> > - the conditional is removed (duh)
> > - the conditional is put on one line, like this:
> > 
> > .Bd -ragged -offset indent
> > .if n erf(x) = 2/sqrt(pi)\(**\|integral from 0 to x of exp(\-t\(**t) dt.
> > .if t erf\|(x) := (2/\(sr\(*p)\|\(is\d\s8\z0\s10\u\u\s8x\s10\d\|exp(\-t\u\s82\s10\d)\|dt.
> > .Ed
> > 
> > 
> > Ideas?
> 
> Ulrich,
> 
> Yes: I should fix this.  And it's done.  This flushed out another bug
> such that statements closing a conditional, e.g.,
> 
>   hello \} there
> 
> should be passed verbatim to the front-ends (if allowed by the
> conditional), which would ignore the \}.  This has also been fixed,
> hence the added escape in chars.{c,in} and mandoc.c update.  A
> regression test has been added to this effect.

I saw the commit, thanks for the quick fix!

Uli
--
 To unsubscribe send an email to tech+unsubscribe@mdocml.bsd.lv

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-06-01 12:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-06-01 10:10 roff conditionals inside .Bd Ulrich Spörlein
2010-06-01 12:03 ` Kristaps Dzonsons
2010-06-01 12:09   ` Ulrich Spörlein

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).