Bugs in linenumbering ?
Hello, Here is an example that highlights a few problems I have with linenumbering. When the line numbers are located in the margin, everything is fine. But when the number is located in the text: 1) Text overflows in the right margin. 2) Paragraph indenting does not work. We can even see a kind of right indentation appear. 1+2 => First line of the paragraph is too short, netx ones are too long. 3) linenumbering does not work within footnotes (neither with line numbers in margin nor in text). Perhaps (3) is not implemented, but I suppose (1) and (2) are not the expected behaviour. ============================== \setuppapersize[A4] \setupindenting[yes,first,medium] \definelinenumbering[lnbasic] \definelinenumbering[lntext] \definelinenumbering[lntextandnullwidth] \definelinenumbering[lntextandwidth] \setuplinenumbering[lnbasic][] \setuplinenumbering[lntext][location=text] \setuplinenumbering[lntextandnullwidth][location=text,width=0pt] \setuplinenumbering[lntextandwidth][location=text,width=.75em] \starttext {\bf A normal paragraph for reference}. \input tufte \startlinenumbering[lnbasic] {\bf Numbers in margin : correct right margin, paragraph indentation.} \input tufte \stoplinenumbering \startlinenumbering[lntext] {\bf Numbers in text, default width : overflow, no indentation of the first line but some kind of right indentation!} \input tufte \stoplinenumbering \startlinenumbering[lntextandnullwidth] {\bf Numbers in text, 0 width : no overflow but overtype on numbers, same problem with indentation.} \input tufte \stoplinenumbering \startlinenumbering[lntextandwidth] {\bf Numbers in text, average width : average overflow, same problem with indentation.} \input tufte \stoplinenumbering It also affects the previous lines when {em line numbering} starts from the middle of the line and not on a new paragraph. \startlinenumbering[lntext] {\bf Numbers in text, default width : overflow, no indentation of the first line but some kind of right indentation!} \input tufte \stoplinenumbering Line numbering does not work in footnotes\footnote{ \startlinenumbering[lnbasic] {\bf Numbers in margins.} \input tufte \stoplinenumbering } \footnote{ \startlinenumbering[lntext] {\bf Numbers in text.} \input tufte \stoplinenumbering }. \stoptext ============================== Goodbye, Stéphane.
On 4/2/2014 3:17 PM, Stéphane Goujet wrote:
Hello,
Here is an example that highlights a few problems I have with linenumbering.
When the line numbers are located in the margin, everything is fine.
But when the number is located in the text: 1) Text overflows in the right margin. 2) Paragraph indenting does not work. We can even see a kind of right indentation appear.
1+2 => First line of the paragraph is too short, netx ones are too long.
3) linenumbering does not work within footnotes (neither with line numbers in margin nor in text).
Perhaps (3) is not implemented, but I suppose (1) and (2) are not the expected behaviour.
==============================
\setuppapersize[A4] \setupindenting[yes,first,medium]
\definelinenumbering[lnbasic] \definelinenumbering[lntext] \definelinenumbering[lntextandnullwidth] \definelinenumbering[lntextandwidth]
\setuplinenumbering[lnbasic][] \setuplinenumbering[lntext][location=text] \setuplinenumbering[lntextandnullwidth][location=text,width=0pt] \setuplinenumbering[lntextandwidth][location=text,width=.75em]
\starttext
{\bf A normal paragraph for reference}. \input tufte
\startlinenumbering[lnbasic] {\bf Numbers in margin : correct right margin, paragraph indentation.} \input tufte \stoplinenumbering
\startlinenumbering[lntext] {\bf Numbers in text, default width : overflow, no indentation of the first line but some kind of right indentation!} \input tufte \stoplinenumbering
\startlinenumbering[lntextandnullwidth] {\bf Numbers in text, 0 width : no overflow but overtype on numbers, same problem with indentation.} \input tufte \stoplinenumbering
\startlinenumbering[lntextandwidth] {\bf Numbers in text, average width : average overflow, same problem with indentation.} \input tufte \stoplinenumbering
It also affects the previous lines when {em line numbering} starts from the middle of the line and not on a new paragraph. \startlinenumbering[lntext] {\bf Numbers in text, default width : overflow, no indentation of the first line but some kind of right indentation!} \input tufte \stoplinenumbering
Line numbering does not work in footnotes\footnote{ \startlinenumbering[lnbasic] {\bf Numbers in margins.} \input tufte \stoplinenumbering } \footnote{ \startlinenumbering[lntext] {\bf Numbers in text.} \input tufte \stoplinenumbering }.
\stoptext
you probably didn't test with the beta because most looks ok i've added support for notes (somewhat tricky) \starttext Here we have a footnote \footnote{% \startlinenumbering \input tufte \par % somehow needed \stoplinenumbering } \stoptext with respect to text: you need to go narrower or set the distance to (e.g.) -1cm ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
On 04/03/2014 04:19 PM, Hans Hagen wrote:
On 4/2/2014 3:17 PM, Stéphane Goujet wrote:
3) linenumbering does not work within footnotes (neither with line numbers in margin nor in text).
i've added support for notes (somewhat tricky)
Sorry, but I cannot refrain from asking: how about having line numbers in \setupnote and being optional to have different or the same counting than the rest of the page? Pablo -- http://www.ousia.tk
Le Thu, 03 Apr 2014 16:19:18 +0200,
Hans Hagen
you probably didn't test with the beta because most looks ok
Dammit, you are right. And yet I was using fairly recent versions (25/03 and 27/03).
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 Thanks !
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
Thank you again. To annoy you one more time, still one thing : the font size of the line numbers is the one of the main text, no the smaller one that numbers should have in the footnote part (just add a few numbers in the footnote text to compare easily). Faithfully yours, Stéphane.
On 2014-04-03 13:16, Stéphane Goujet wrote:
Le Thu, 03 Apr 2014 16:19:18 +0200, Hans Hagen
a écrit : you probably didn't test with the beta because most looks ok Dammit, you are right. And yet I was using fairly recent versions (25/03 and 27/03).
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
Thanks !
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 Thank you again. To annoy you one more time, still one thing : the font size of the line numbers is the one of the main text, no the smaller one that numbers should have in the footnote part (just add a few numbers in the footnote text to compare easily).
As to the size in footnotes, try: \definelinenumbering[fntext] \setuplinenumbering[fntext][style=\ssxx] or similar. 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. Thus, it cannot be used to reproduce the form of quotation we are trying to replicate (from Thomas Bowdler, /The Family Shakespeare/, 1807):
Le Thu, 03 Apr 2014 13:01:04 -0400,
Rik Kabel
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.
Have you tried \startnarrower[before=] ? I haven't yet, but I will go back to it soon.
Le Thu, 03 Apr 2014 13:01:04 -0400,
Rik Kabel
On 2014-04-03 13:16, Stéphane Goujet wrote:
Le Thu, 03 Apr 2014 16:19:18 +0200, Hans Hagen
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.
On 2014-04-03 20:15, Stéphane Goujet wrote: ...
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.
That is the big one for me. As the example png I posted shows, I need to have support for multiple quoted sections and unquoted text at the end.
and 2 minor ones: -- no paragraph indentation in footnotes.
I have some very long footnotes and have moved to endnotes. The same issues present themselves, and many others related to commands that do not work in margins, footnotes, and other floating environments, but I think the solution is to write them as a separate chapter and manage the cross-references (footnote marks) myself.
-- 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.
The opening and repetition guillemot in paragraphs started by \startbloccite and \bloccitepar align correctly. The difference in alignment of the first text character in those paragraphs appears to be about 0.45pt, which can be handled by the \hskip at the end of the definition of \bloccitepar. That value is absolute, so may need adjusting for other fonts and sizes. Perhaps an hskip of 0.375em might be more flexible. Another problem occurs when protrusion is enabled. A guillemot in running text that happens to be placed at the beginning of a line will protrude into the left margin channel, but the guillemots that are generated by this mechanism will not protrude. When these are on the same page it is ugly. ...
Goodbye, Stéphane.
-- Rik
Le Thu, 03 Apr 2014 23:02:41 -0400,
Rik Kabel
On 2014-04-03 20:15, Stéphane Goujet wrote:
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. That is the big one for me. As the example png I posted shows, I need to have support for multiple quoted sections and unquoted text at the end.
Same for me. I understand that it makes little sense (or perhaps no sense at all) for line numbering to deal with such situations; this is why in first post concerning our quotation matter, I was asking whether linenumbering would be the way to go or not. Goodbye, Stéphane.
participants (4)
-
Hans Hagen
-
Pablo Rodriguez
-
Rik Kabel
-
Stéphane Goujet