ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Wolfgang Schuster <wolfgang.schuster.lists@gmail.com>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: ASCII mode within \footnote
Date: Mon, 4 Nov 2019 17:34:11 +0100	[thread overview]
Message-ID: <dd2a08ea-e993-9ec2-2712-9ac9ca61fd82@gmail.com> (raw)
In-Reply-To: <nycvar.YAK.7.76.1911040904530.32764@nqv-guvaxcnq>

Aditya Mahajan schrieb am 04.11.2019 um 15:05:
> On Mon, 4 Nov 2019, Aditya Mahajan wrote:
>
> That should have been:
>
>> As Hans' mentioned, use:
>>
>> \startasciimode
>> \footnote{\type{%APPDATA%\file.txt}}
>> \stopasciimode

In a longer document setting \asciimode at the begin can be the better 
solution.

The reason why setting \asciimode in the \footnote doesn't work is that 
TeX uses
uses the meaning of a special character it had when it read the 
argument, i.e.
when TeX reads the text "%APPDATA%\file.txt" the percent sign acts as 
begin of
a comment and everything after it is ignored. As a result the asciimode 
command
can't work because the text has already disappeared.

Other characters like $ are less problematic because there are ways to 
change
their meaning afterwards (# can be tricky) but not comments because 
nothing remains.

\setupbuffer
   [before=\blank,
    after=\blank]

\starttext

Normal comment:

\startbuffer
     % comment
\stopbuffer

\typebuffer \getbuffer

Comment in \type{asciimode} environment:

\startbuffer
     \startasciimode
         % comment
     \stopasciimode
\stopbuffer

\typebuffer \getbuffer

Comment in the argument of a command:

\startbuffer
     \firstofoneargument
         {
             % comment
         }
\stopbuffer

\typebuffer \getbuffer

Comment in the argument of a command + \type{asciimode} in the argument:

\startbuffer
     \firstofoneargument
         {
             \startasciimode
                 % comment
             \stopasciimode
         }
\stopbuffer

\typebuffer \getbuffer

Comment in a argument after \type{asciimode} was enabled:

\startbuffer
     \startasciimode
     \firstofoneargument
         {
             % comment
         }
     \stopasciimode
\stopbuffer

\typebuffer \getbuffer

\stoptext

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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

  reply	other threads:[~2019-11-04 16:34 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-01 13:23 context
2019-11-01 13:36 ` Hans Hagen
     [not found]   ` <0e3fc588e96d00f1f235e1f3b9499335@vivaldi.net>
2019-11-02  9:45     ` context
2019-11-02 15:35       ` Aditya Mahajan
2019-11-04 11:36         ` context
2019-11-04 13:36           ` Aditya Mahajan
2019-11-04 14:05             ` Aditya Mahajan
2019-11-04 16:34               ` Wolfgang Schuster [this message]
2019-11-07 22:04                 ` Wolfgang Schuster
2019-11-07 23:11                   ` Aditya Mahajan
2019-11-08  8:52                     ` Hans Hagen
2019-11-08  9:45                       ` context
2019-11-05 13:43               ` context

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=dd2a08ea-e993-9ec2-2712-9ac9ca61fd82@gmail.com \
    --to=wolfgang.schuster.lists@gmail.com \
    --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).