Я хотел бы добавить начальные точки перед номерами страниц в регистрах ConTeXt. Как лучше всего это сделать?
Вот минимальный рабочий пример текущего поведения и поведения, которое я хотел бы получить:
\defineregister[cases][n=1,pagestyle=normal,indicator=no]
\setupcombinedlist[content][alternative=c]
\setuplist[chapter][headnumber=no]
\setuphead[chapter][number=no]
\starttext
\title{Table of Contents}
\placecontent
\chapter{Register Table}
\placecases
\chapter{Content}
This is a \cases{test}test. This is \cases{another test}another test.
\stoptext
Оглавление, использующее alternative=c
, содержит начальные точки:
Я бы хотел, cases
чтобы регистр выглядел аналогично. В нынешнем виде он выглядит следующим образом:
решение1
Я не нашел ничего, чтобы задать альтернативу списка, как для комбинированных списков, но вы можете перехватить , textcommand
чтобы вставить точки. Расстояние между текстом и точками, а также числом и точками можно настроить с помощью клавиши distance
.
\starttexdefinition unexpanded register:text #1
#1
\hskip\registerparameter{distance}\relax
\dotfill
\stoptexdefinition
\defineregister
[cases]
[
n=1,
pagestyle=normal,
indicator=no,
distance=1em,
textcommand=\getvalue{register:text},
]
\setupcombinedlist[content][alternative=c]
\setuplist[chapter][headnumber=no]
\setuphead[chapter][number=no]
\starttext
\title{Table of Contents}
\placecontent
\chapter{Register Table}
\placecases
\chapter{Content}
This is a \cases{test}test. This is \cases{another test}another test. \dorecurse{5}{\input knuth} This is a \cases{test}test. This is \cases{another test}another test.
\stoptext
Если вы хотите иметьточноте же точки, что и в альтернативном списке c
для объединенного списка, используйте следующее textcommand
в сочетании с distance=.5em
.
\starttexdefinition unexpanded register:text #1
#1
\hskip\registerparameter{distance}\relax
\gleaders\hbox to .5em{\hss.\hss}\hfill
\stoptexdefinition