to wrap to the next line.
.br
And a second line.
-.HP -4n
+.HP -0.36i
Each hanged paragraph gets a sufficient amount of text
to wrap to the next line.
.br
to wrap to the next line.
.br
And a second line.
-.HP 8n
+.HP .76i
Each hanged paragraph gets a sufficient amount of text
to wrap to the next line.
.br
indented
.br
text
-.IP tag -4n
+.IP tag -0.36i
indented
.br
text
.IP tag 2n
indented
text
-.IP tag 3n
+.IP tag 0.26i
indented
text
.IP tag 4n
.RE
regular
text
-.RS -4n
+.RS -0.36i
indented
text
.RE
regular
text
-.RS 4n
+.RS 0.36i
indented
text
.RE
indented
.br
text
-.TP -4n
+.TP -0.36i
tag
indented
.br
indented
.br
text
-.TP 2n
+.TP 0.16i
tag
indented
.br
.PP
Literal mode:
.nf
-.TP -10n
+.TP -0.96i
tag
indented
text
tag
indented
text
-.TP 3n
+.TP 0.26i
tag
indented
text
.Nd indenting display blocks
.Sh DESCRIPTION
regular text
-.Bd -ragged -offset 8n
+.Bd -ragged -offset 0.76i
outer display
-.Bd -ragged -offset -5n
+.Bd -ragged -offset -0.46i
inner display
.Ed
outer display
.It tag
Bl tag width Ds offset indent-two
.El
-.Bl -tag -width Ds -offset 4n
+.Bl -tag -width Ds -offset 0.36i
.It tag
-Bl tag width Ds offset 4n
+Bl tag width Ds offset 0.36i
.El
.Bl -tag -width Ds -offset mystring
.It tag
.It tag
Bl tag width Ds offset 78n
.El
-.Bl -tag -width Ds -offset -3n
+.Bl -tag -width Ds -offset -0.26i
.It tag
-Bl tag width Ds offset -3n
+Bl tag width Ds offset -0.26i
.El
tag Bl tag width Ds offset indent-two
- tag Bl tag width Ds offset 4n
+ tag Bl tag width Ds offset 0.36i
tag Bl tag width Ds offset mystring
offset
78n
- tag Bl tag width Ds offset -3n
+ tag Bl tag width Ds offset -0.26i
OpenBSD December 25, 2014 OpenBSD
tag
-> Bl tag width Ds offset 4n
+> Bl tag width Ds offset 0.36i
tag
tag
-> Bl tag width Ds offset -3n
+> Bl tag width Ds offset -0.26i
OpenBSD - December 25, 2014
.It tag
x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x
.El
-.Bl -tag -width -3n
+.Bl -tag -width -0.26i
.It tag
x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x
.El
.It quint
x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x
.El
-.Bl -tag -width 5n
+.Bl -tag -width 0.46i
.It indent
x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x x
.El
.Sh DESCRIPTION
simple: >\h'0'<
.br
+rounding: >\h'0.16i'<
+.br
escape only: >\h'\w'\&'M'<
.br
escape at the end: >\h'0+\w'\&''<
D\bDE\bES\bSC\bCR\bRI\bIP\bPT\bTI\bIO\bON\bN
simple: ><
+ rounding: > <
escape only: ><
escape at the end: ><
escape at the beginning: ><
-mandoc: h.in:18:21: WARNING: invalid escape sequence: \h-
+mandoc: h.in:20:21: WARNING: invalid escape sequence: \h-
mandoc: h.in:1:5: STYLE: Mdocdate missing: Dd May
default unit:
.ta 3 +4 12
1 2 3 4
+rounding:
+.ta 0.26i T 1c
+1 2 3 4 5 6 7 8 9
1 2 3 4 5 6 7 8 9
default unit:
1 2 3 4
+ rounding:
+ 1 2 3 4 5 6 7 8 9
ti-basic-man \- temporary indentation in man(7)
.SH DESCRIPTION
initial text
-.ti 10n
+.ti 0.96i
This text is indented.
However, the indent is temporary,
so as soon as the line wraps, it is gone.
.ti +10n
The temporary indent can be relative.
All the same, it will expire in the usual way.
-.ti -3n
+.ti -0.26i
It is also possible to temporarily reduce the indentation,
but that will also last until the next line break only.
.ti -10n
normal text
.TS
box tab(:);
-lw2 | lw(2n) | lw(0.2i) | lw2 .
+lw2 | lw(2n) | lw(0.16i) | lw2 .
a:abcd:T{
a
T}:T{
-/* $OpenBSD: man_term.c,v 1.157 2017/06/08 12:54:40 schwarze Exp $ */
+/* $OpenBSD: man_term.c,v 1.158 2017/06/14 17:50:43 schwarze Exp $ */
/*
* Copyright (c) 2008-2012 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010-2015, 2017 Ingo Schwarze <schwarze@openbsd.org>
if (a2roffsu(++cp, &su, SCALE_EN) == NULL)
return 0;
- v = (term_hspan(p, &su) + 11) / 24;
+ v = term_hen(p, &su);
if (less < 0)
p->tcol->offset -= p->tcol->offset > v ? v : p->tcol->offset;
if ((nn = n->parent->head->child) != NULL &&
a2roffsu(nn->string, &su, SCALE_EN) != NULL) {
- len = term_hspan(p, &su) / 24;
+ len = term_hen(p, &su);
if (len < 0 && (size_t)(-len) > mt->offset)
len = -mt->offset;
else if (len > SHRT_MAX)
if ((nn = n->parent->head->child) != NULL &&
(nn = nn->next) != NULL &&
a2roffsu(nn->string, &su, SCALE_EN) != NULL) {
- len = term_hspan(p, &su) / 24;
+ len = term_hen(p, &su);
if (len < 0 && (size_t)(-len) > mt->offset)
len = -mt->offset;
else if (len > SHRT_MAX)
if ((nn = n->parent->head->child) != NULL &&
nn->string != NULL && ! (NODE_LINE & nn->flags) &&
a2roffsu(nn->string, &su, SCALE_EN) != NULL) {
- len = term_hspan(p, &su) / 24;
+ len = term_hen(p, &su);
if (len < 0 && (size_t)(-len) > mt->offset)
len = -mt->offset;
else if (len > SHRT_MAX)
if (n->child == NULL)
n->aux = mt->lmargin[mt->lmargincur];
else if (a2roffsu(n->child->string, &su, SCALE_EN) != NULL)
- n->aux = term_hspan(p, &su) / 24;
+ n->aux = term_hen(p, &su);
if (n->aux < 0 && (size_t)(-n->aux) > mt->offset)
n->aux = -mt->offset;
else if (n->aux > SHRT_MAX)
-/* $OpenBSD: mdoc_term.c,v 1.262 2017/06/08 12:54:40 schwarze Exp $ */
+/* $OpenBSD: mdoc_term.c,v 1.263 2017/06/14 17:50:43 schwarze Exp $ */
/*
* Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010, 2012-2017 Ingo Schwarze <schwarze@openbsd.org>
SCALE_HS_INIT(&su, term_strlen(p, v));
su.scale /= term_strlen(p, "0");
}
- return term_hspan(p, &su) / 24;
+ return term_hen(p, &su);
}
/*
SCALE_HS_INIT(&su,
term_strlen(p, bl->norm->Bl.cols[i]));
su.scale /= term_strlen(p, "0");
- offset += term_hspan(p, &su) / 24 + dcol;
+ offset += term_hen(p, &su) + dcol;
}
/*
*/
SCALE_HS_INIT(&su, term_strlen(p, bl->norm->Bl.cols[i]));
su.scale /= term_strlen(p, "0");
- width = term_hspan(p, &su) / 24 + dcol;
+ width = term_hen(p, &su) + dcol;
break;
default:
if (NULL == bl->norm->Bl.width)
-/* $OpenBSD: roff_term.c,v 1.11 2017/06/14 13:00:13 schwarze Exp $ */
+/* $OpenBSD: roff_term.c,v 1.12 2017/06/14 17:50:43 schwarze Exp $ */
/*
* Copyright (c) 2010, 2014, 2015, 2017 Ingo Schwarze <schwarze@openbsd.org>
*
if (a2roffsu(cp, &su, SCALE_EM) == NULL)
return;
- len = term_hspan(p, &su) / 24;
+ len = term_hen(p, &su);
if (sign == 0) {
p->ti = len - p->tcol->offset;
-/* $OpenBSD: tbl_term.c,v 1.39 2017/06/13 14:38:38 schwarze Exp $ */
+/* $OpenBSD: tbl_term.c,v 1.40 2017/06/14 17:50:43 schwarze Exp $ */
/*
* Copyright (c) 2009, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2011,2012,2014,2015,2017 Ingo Schwarze <schwarze@openbsd.org>
static size_t
term_tbl_sulen(const struct roffsu *su, void *arg)
{
- return term_hspan((const struct termp *)arg, su) / 24;
+ return term_hen((const struct termp *)arg, su);
}
static size_t
-/* $OpenBSD: term.c,v 1.130 2017/06/14 01:31:19 schwarze Exp $ */
+/* $OpenBSD: term.c,v 1.131 2017/06/14 17:50:43 schwarze Exp $ */
/*
* Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010-2017 Ingo Schwarze <schwarze@openbsd.org>
case ESCAPE_HORIZ:
if (a2roffsu(seq, &su, SCALE_EM) == NULL)
continue;
- uc = term_hspan(p, &su) / 24;
+ uc = term_hen(p, &su);
if (uc > 0)
while (uc-- > 0)
bufferc(p, ASCII_NBRSP);
case ESCAPE_HLINE:
if ((seq = a2roffsu(seq, &su, SCALE_EM)) == NULL)
continue;
- uc = term_hspan(p, &su) / 24;
+ uc = term_hen(p, &su);
if (uc <= 0) {
if (p->tcol->rmargin <= p->tcol->offset)
continue;
}
/*
- * Convert a scaling width to basic units, rounding down.
+ * Convert a scaling width to basic units, rounding towards 0.
*/
int
term_hspan(const struct termp *p, const struct roffsu *su)
return (*p->hspan)(p, su);
}
+
+/*
+ * Convert a scaling width to basic units, rounding to closest.
+ */
+int
+term_hen(const struct termp *p, const struct roffsu *su)
+{
+ int bu;
+
+ if ((bu = (*p->hspan)(p, su)) >= 0)
+ return (bu + 11) / 24;
+ else
+ return -((-bu + 11) / 24);
+}
-/* $OpenBSD: term.h,v 1.71 2017/06/12 18:55:42 schwarze Exp $ */
+/* $OpenBSD: term.h,v 1.72 2017/06/14 17:50:43 schwarze Exp $ */
/*
* Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2011-2015, 2017 Ingo Schwarze <schwarze@openbsd.org>
void term_setwidth(struct termp *, const char *);
int term_hspan(const struct termp *, const struct roffsu *);
+int term_hen(const struct termp *, const struct roffsu *);
int term_vspan(const struct termp *, const struct roffsu *);
size_t term_strlen(const struct termp *, const char *);
size_t term_len(const struct termp *, size_t);
-/* $OpenBSD: term_tab.c,v 1.2 2017/06/08 12:54:40 schwarze Exp $ */
+/* $OpenBSD: term_tab.c,v 1.3 2017/06/14 17:50:43 schwarze Exp $ */
/*
* Copyright (c) 2017 Ingo Schwarze <schwarze@openbsd.org>
*
recording_period = 0;
if (tabs.d == 0) {
a2roffsu(".8i", &su, SCALE_IN);
- tabs.d = term_hspan(p, &su) / 24;
+ tabs.d = term_hen(p, &su);
}
return;
}
/* Append the new position. */
- pos = term_hspan(p, &su);
+ pos = term_hen(p, &su);
tl->t[tl->n] = pos;
if (add && tl->n)
tl->t[tl->n] += tl->t[tl->n - 1];
if (i == tabs.a.n) {
if (tabs.p.n == 0)
return prev;
-/*
- return i ? prev :
- (prev / tabs.d + 1) * tabs.d;
- */
tabs.a.n += tabs.p.n;
if (tabs.a.s < tabs.a.n) {
tabs.a.s = tabs.a.n;
tabs.a.t[i + j] = tabs.p.t[j] +
(i ? tabs.a.t[i - 1] : 0);
}
- if (prev < tabs.a.t[i] / 24)
- return tabs.a.t[i] / 24;
+ if (prev < tabs.a.t[i])
+ return tabs.a.t[i];
}
}