From: "Stéphane Goujet" <stephane.goujet@wanadoo.fr>
To: ntg-context@ntg.nl
Subject: Re: Bugs in linenumbering ?
Date: Fri, 4 Apr 2014 00:15:54 +0000 [thread overview]
Message-ID: <20140404001554.2a32b388@cuisine.seix> (raw)
In-Reply-To: <533D93D0.8060806@rik.users.panix.com>
Le Thu, 03 Apr 2014 13:01:04 -0400,
Rik Kabel <context@rik.users.panix.com> a écrit :
> On 2014-04-03 13:16, Stéphane Goujet wrote:
> > Le Thu, 03 Apr 2014 16:19:18 +0200,
> > Hans Hagen <pragma@wxs.nl> a écrit :
> >
> >> with respect to text: you need to go narrower or set the distance
> >> to (e.g.) -1cm
> > It seems I can indeed get nice results with
> >
> > \setuplinenumbering[location=text]
> > \startnarrower[left]
> > \startlinenumbering
> >
> >> i've added support for notes (somewhat tricky)
> >>
> >> \starttext
> >> Here we have a footnote \footnote{%
> >> \startlinenumbering
> >> \input tufte
> > A few numbers : 012345679.
> >> \par % somehow needed
> >> \stoplinenumbering
> >> }
> >> \stoptext
> As to the size in footnotes, try:
>
> \definelinenumbering[fntext]
> \setuplinenumbering[fntext][style=\ssxx]
If I could avoid defining another set of different macros, I would
prefer... (For I have already 2 start macros, 2 stop macros, and 1
intermediate macro: it already lacks a bit of automatising).
> However, for the general case, there is still an issue with
> linenumbering that begins after the beginning of a paragraph. The
> work-around of \startnarrower cannot help in this case, since it
> appears to always start a new paragraph.
So, with the [before=] (and [after=] for continuing text after
\stopnarrower), it is possible.
Here is what I have done so far. Not too bad a result, but there are
still 2 main problems:
-- when the quotation begins after the beginning of the paragraph, the
whole paragraph is affected by *narrower*;
-- when the text continues after the end of the quotation, it is
impossible to insert the *\par* that, as Hans noticed and told us, is
needed to have *narrower* work, so it is as if there was no *narrower*
and the whole line numbering of the paragraph is messed up.
and 2 minor ones:
-- no paragraph indentation in footnotes.
-- Alignment of the first quoted paragraph in respect to the following
quoted paragraphs is not perfect (because I use different symbols for
the quotation opening («) and the quotation repetition (»), I guess).
But this point is good enough for me.
==========================
\setuppapersize[A4]
\enableregime[utf-8]
\mainlanguage[fr]
\language[fr]
\setcharacterspacing[frenchpunctuation]
\setupindenting[first,yes,medium]
\setupnotation[footnote][location=margin]
\define\repsym{»}
\newdimen\repshift
\repshift=.75em
\definelinenumbering[repcite]
\setuplinenumbering[repcite][location=text,command=\repmark,before=,after=]
\definelinenumbering[repcitel]
\setuplinenumbering[repcitel][location=text,command={\repsym\gobbleoneargument}]
\defineexpandable[1]\repmark{\doifnot{#1}{1}{\repsym}}
\definenarrower[narcite][left=\repshift,before=,after=]
\define\startbloccite{\startnarcite[left]\setupindenting[first,yes,\dimexpr\parindent-\repshift]\startlinenumbering[repcite]«}
\define\startbloccitel{\startnarcite[left]\setupindenting[first,yes,\dimexpr\parindent-\repshift]\startlinenumbering[repcitel]«}
\define\stopbloccite{»\par\stoplinenumbering\stopnarrower}
\define\stopbloccitel{»\stoplinenumbering\stopnarrower}
\define\bloccitepar{\stoplinenumbering
\par
\startlinenumbering[repcite]\leavevmode\hbox to\repshift{\repsym}\hskip0pt
}
\starttext
First check: «normal spacing of guillemets».
Second check: a normal paragraph, to show {\bf normal right margin limit}.
\input tufte
«Third check : paragraph starting with guillemets.»
Let's start with a quote block on a {\bf new line} :
\startbloccite
%First paragraph ({\bf quote repetition symbol is really not wanted here}): \input tufte (\the\hsize)
Second paragraph ({\bf indenting and margins are correct}): \input tufte
\bloccitepar
Second paragraph ({\bf indenting and margins are correct}): \input tufte
\bloccitepar
Third paragraph ({\bf now I put a different sentence here to check hyphenation.
Weird, it looks OK now, I cannot reproduce the overflow.}): \input tufte
\stopbloccite
Now, a quote block starting just there, {\bf in the middle of a line}
({\bf the problem is that \char`\\startnarrower affects the whole paragraph :
every lines are narrowed, even the ones before the environment starts}):\startbloccitel\input tufte
\bloccitepar
\input tufte
\stopbloccitel . This a bit of text at the end of the quotation.
{\bf The whole paragraph is wrong because I could not end it with a \char`\\par}.
And let's call a {\bf footnote}\footnote{\startbloccite\input tufte
\bloccitepar
\input tufte
\stopbloccite}. {\bf Fine : quote repetition symbols do now appear
in it. But there is no paragraph indentation.}.
\stoptext
==========================
Goodbye,
Stéphane.
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage : http://www.pragma-ade.nl / http://tex.aanhet.net
archive : http://foundry.supelec.fr/projects/contextrev/
wiki : http://contextgarden.net
___________________________________________________________________________________
next prev parent reply other threads:[~2014-04-04 0:15 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-02 13:17 Stéphane Goujet
2014-04-03 14:19 ` Hans Hagen
2014-04-03 15:08 ` Pablo Rodriguez
2014-04-03 17:16 ` Stéphane Goujet
2014-04-03 17:01 ` Rik Kabel
2014-04-03 22:15 ` Stéphane Goujet
2014-04-04 0:15 ` Stéphane Goujet [this message]
2014-04-04 3:02 ` Rik Kabel
2014-04-05 14:05 ` Stéphane Goujet
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20140404001554.2a32b388@cuisine.seix \
--to=stephane.goujet@wanadoo.fr \
--cc=ntg-context@ntg.nl \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).