ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Strange bug with \ in footnotes
@ 2012-08-04 18:59 Aditya Mahajan
  2012-08-05  7:28 ` Otared Kavian
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Aditya Mahajan @ 2012-08-04 18:59 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Hi,

I usually use \ after abbreviations to avoid bad interword spaces. For 
example, Prof.\ ABC. However, when using this in footnotes, if there is a 
linebreak after the \, I get an error:

! Undefined control sequence.

1 >>  \starttext
2     Someone\footnote{Prof.\
3     ABC}
4     \stoptext
5

l.1 Prof.\

           ABC
\ctxcommand ...\directlua \zerocount {commands.#1}

\handlenoteitself ...text \strc_notes_inject_text
                                                  \endstrut 
\strc_constructi...
\handlenoteinsert ... {\handlenoteitself {#1}{#2}}
                                                  \egroup \the 
\everyafterno...
\195>notation:note ...rentnote \currentnotenumber
                                                  \fi \fi \endgroup \fi 
\fi ...
\strc_notations_command_nop ...handler \endcsname

\strc_constructions_finali...
l.3 ABC}

Minimal example (There should be a linebreak after \)

\starttext
Someone\footnote{Prof.\
ABC}
\stoptext

What's going on here?

Aditya
___________________________________________________________________________________
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
___________________________________________________________________________________


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

* Re: Strange bug with \ in footnotes
  2012-08-04 18:59 Strange bug with \ in footnotes Aditya Mahajan
@ 2012-08-05  7:28 ` Otared Kavian
  2012-08-05  7:45   ` Wolfgang Schuster
  2012-08-05  9:32 ` Hans Hagen
  2012-08-05 10:27 ` Hans Hagen
  2 siblings, 1 reply; 5+ messages in thread
From: Otared Kavian @ 2012-08-05  7:28 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Hi Aditya,

On 4 août 2012, at 20:59, Aditya Mahajan <aditya.mahajan@mcgill.ca> wrote:

> […]
> Minimal example (There should be a linebreak after \)

Is it not « \\ » that should give a line break? Indeed this gives a line break:
\starttext
Someone\footnote{Prof.\\ ABC}
\stoptext

However, you are right to observe that 

Someone\footnote{Prof.\
ABC}

results in an error with the latest beta, while 

Someone\footnote{Prof.\ ABC}

does not (and of course there is no line break neither, the « .\ » gives only a normal space after the dot).

Best regards: OK

> 
> \starttext
> Someone\footnote{Prof.\
> ABC}
> \stoptext
> 
> What's going on here?
> 
> Aditya
> ___________________________________________________________________________________
> 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
> ___________________________________________________________________________________

___________________________________________________________________________________
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
___________________________________________________________________________________


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

* Re: Strange bug with \ in footnotes
  2012-08-05  7:28 ` Otared Kavian
@ 2012-08-05  7:45   ` Wolfgang Schuster
  0 siblings, 0 replies; 5+ messages in thread
From: Wolfgang Schuster @ 2012-08-05  7:45 UTC (permalink / raw)
  To: mailing list for ConTeXt users


Am 05.08.2012 um 09:28 schrieb Otared Kavian <otared@gmail.com>:

> Hi Aditya,
> 
> On 4 août 2012, at 20:59, Aditya Mahajan <aditya.mahajan@mcgill.ca> wrote:
> 
>> […]
>> Minimal example (There should be a linebreak after \)
> 
> Is it not « \\ » that should give a line break? Indeed this gives a line break:
> \starttext
> Someone\footnote{Prof.\\ ABC}
> \stoptext
> 
> However, you are right to observe that 
> 
> Someone\footnote{Prof.\
> ABC}
> 
> results in an error with the latest beta, while 
> 
> Someone\footnote{Prof.\ ABC}
> 
> does not (and of course there is no line break neither, the « .\ » gives only a normal space after the dot).

The “\ ” command gives a control space which is necessary when you use \nonfrenchspacing
(which is normally set with \setuplanguage[…][spacing=broad]). What \\ produce depends
on the environment and can be a line break, a space or something different.

Wolfgang
___________________________________________________________________________________
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
___________________________________________________________________________________


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

* Re: Strange bug with \ in footnotes
  2012-08-04 18:59 Strange bug with \ in footnotes Aditya Mahajan
  2012-08-05  7:28 ` Otared Kavian
@ 2012-08-05  9:32 ` Hans Hagen
  2012-08-05 10:27 ` Hans Hagen
  2 siblings, 0 replies; 5+ messages in thread
From: Hans Hagen @ 2012-08-05  9:32 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: Aditya Mahajan

On 4-8-2012 20:59, Aditya Mahajan wrote:
> Hi,
>
> I usually use \ after abbreviations to avoid bad interword spaces. For
> example, Prof.\ ABC. However, when using this in footnotes, if there is a
> linebreak after the \, I get an error:
>
> ! Undefined control sequence.
>
> 1 >>  \starttext
> 2     Someone\footnote{Prof.\
> 3     ABC}
> 4     \stoptext
> 5
>
> l.1 Prof.\
>
>             ABC

interesting ... it only surfaces now because notes have been redone, but

     \section{Prof.\
      ABC}

has the same issue (something in the tex-lua-tex cycle)

Hans

-----------------------------------------------------------------
                                           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
-----------------------------------------------------------------
___________________________________________________________________________________
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
___________________________________________________________________________________


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

* Re: Strange bug with \ in footnotes
  2012-08-04 18:59 Strange bug with \ in footnotes Aditya Mahajan
  2012-08-05  7:28 ` Otared Kavian
  2012-08-05  9:32 ` Hans Hagen
@ 2012-08-05 10:27 ` Hans Hagen
  2 siblings, 0 replies; 5+ messages in thread
From: Hans Hagen @ 2012-08-05 10:27 UTC (permalink / raw)
  To: mailing list for ConTeXt users; +Cc: Taco Hoekwater, Aditya Mahajan

On 4-8-2012 20:59, Aditya Mahajan wrote:
Hi Aditya,

> I usually use \ after abbreviations to avoid bad interword spaces. For
> example, Prof.\ ABC. However, when using this in footnotes, if there is a
> linebreak after the \, I get an error:
>
> ! Undefined control sequence.
>
> 1 >>  \starttext
> 2     Someone\footnote{Prof.\
> 3     ABC}
> 4     \stoptext
> 5

Ok, the next is only for those who want to spend some time on the 
internals ...

\starttext

\def\TestA#1%
   {\writestatus{Test A}{#1}%
    \ctxlua{str = "#1" print(str) context(str) io.savedata("temp.tmp",str)}}

\def\TestB#1%
   {\writestatus{Test B}{#1}%
    \ctxlua{str = "\detokenize{#1}" print(str) context(str) 
io.savedata("temp.tmp",str)}}

\def\TestC#1%
   {\writestatus{Test C}{#1}%
    \edef\temp{#1}%
    \ctxlua{str = "\detokenize\expandafter{\temp}" print(str) 
context(str) io.savedata("temp.tmp",str)}%
    \typefile{temp.tmp}}

\TestA{Test\
A}

\TestB{Test\
B}

\TestC{Test\
C}

Test\
D

\section{Test\
E}

Test F\footnote{Note\
F}

\stoptext

I patched the helpers.title macro to deal with it but it's still 
something to look into as one might wonder why the newline end up there 
(Taco might know).

(The 'context' function takes care of newlines so this is why it don't 
get noticed in other cases. Here a more low level sprint (<catcodeid>, 
str) was used.

Hans

-----------------------------------------------------------------
                                           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
-----------------------------------------------------------------
___________________________________________________________________________________
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
___________________________________________________________________________________


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

end of thread, other threads:[~2012-08-05 10:27 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-08-04 18:59 Strange bug with \ in footnotes Aditya Mahajan
2012-08-05  7:28 ` Otared Kavian
2012-08-05  7:45   ` Wolfgang Schuster
2012-08-05  9:32 ` Hans Hagen
2012-08-05 10:27 ` Hans Hagen

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).