From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/100061 Path: news.gmane.org!.POSTED!not-for-mail From: Wolfgang Schuster Newsgroups: gmane.comp.tex.context Subject: Re: Unexpected emergency stop Date: Sat, 10 Feb 2018 13:45:29 +0100 Message-ID: <5A7EE969.9060105@gmail.com> References: Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============2181109508877080148==" X-Trace: blaine.gmane.org 1518266698 27769 195.159.176.226 (10 Feb 2018 12:44:58 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sat, 10 Feb 2018 12:44:58 +0000 (UTC) User-Agent: Postbox 5.0.22 (Macintosh/20171208) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Sat Feb 10 13:44:53 2018 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from zapf.boekplan.nl ([5.39.185.232] helo=zapf.ntg.nl) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ekUVv-0004xI-7q for gctc-ntg-context-518@m.gmane.org; Sat, 10 Feb 2018 13:44:19 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 2BB3E423EA2; Sat, 10 Feb 2018 13:46:13 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at zapf.boekplan.nl Original-Received: from zapf.ntg.nl ([127.0.0.1]) by localhost (zapf.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id G57Y_yvjtY-n; Sat, 10 Feb 2018 13:45:58 +0100 (CET) Original-Received: from zapf.ntg.nl (localhost [IPv6:::1]) by zapf.ntg.nl (Postfix) with ESMTP id 11664422C6E; Sat, 10 Feb 2018 13:45:58 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 12BED422C6E for ; Sat, 10 Feb 2018 13:45:57 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at zapf.boekplan.nl Original-Received: from zapf.ntg.nl ([127.0.0.1]) by localhost (zapf.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id J1DhBRQdzJhe for ; Sat, 10 Feb 2018 13:45:42 +0100 (CET) Original-Received: from mail-wm0-f46.google.com (mail-wm0-f46.google.com [74.125.82.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by zapf.ntg.nl (Postfix) with ESMTPS id 9DC0B420264 for ; Sat, 10 Feb 2018 13:45:32 +0100 (CET) Original-Received: by mail-wm0-f46.google.com with SMTP id x4so2266197wmc.0 for ; Sat, 10 Feb 2018 04:45:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to; bh=BL2zpfmgeInUyCK469aOnJEFaluT9L9BbB2NOdo4vlI=; b=TQbXYPOK2/Dbt6+0JrmeegwOwB5oMDImAh+Kl9xXzjT+/0faR2Bm3nSMuglWVGgOPy 2yKHCybGRT5ndkG1/0egPMD1yoPn6sSozWuo0vMmPv6Sg81F9NcFYjkNiwspfaTLr0zc jK6NZe1OtADpM+DAd6su3JzFcQTdYt5t1BD0lCZ/CK3rQrNAfjsDF1nX82+ulug6wXB4 497TnCt/J4c9wRP8Crx+jIK/8fHdl3MSXUua3OYIsYComNGdxS38mz+Z+POMbRoZKRFs ghhlUMfXprDLF33fkgGOwQ/1gojGjP8f5hoSbw7j8+nLvq7lgfot5etjpWLKgaQfM7Jp 1frw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :subject:references:in-reply-to; bh=BL2zpfmgeInUyCK469aOnJEFaluT9L9BbB2NOdo4vlI=; b=iOFq8aby4UEfbL+dbEFvc1BIhWUh2tXRw3/P1te7PQMUXSr0K2kXeNeXb1XbUfBTqi EK206UmyuGdrExKz8S2oS4D0Vr74ysLY+n8tFx2lXxWr0Cv/IX4m6rAtS0yXudLlagYU DZkKxJUDwi+GeIunCInSqiDj14He561g3APPbVsgEe57a+mW0Pn806mTqT14zQ0ueC8v aGnhanhn4JhY58Gm/zg1PronhP4fah+ndhT4sVpvyx8jrhANbWmBGTgD74tSn0TmuraT 0CfmbJqApaomsG/u0DzQZIOa9lOPGRJCsw4PBW/f6otYdHmNbuygcAGInAov/8/P8PDo MSFQ== X-Gm-Message-State: APf1xPCM9T93ieRygKg5WVsQPa1cYLrnEYWpVuLmmfBeB2BTVEJw6Jor 5q8UugBslsAM37UCbzoPMMQoxopS X-Google-Smtp-Source: AH8x224K6lh7il4qpROnQniDH4U5fXICMvhlda5Jac8nPTeORzAnfDGdbHgt6rP7vSVUl3yoXK5WIg== X-Received: by 10.28.237.5 with SMTP id l5mr4131562wmh.154.1518266731896; Sat, 10 Feb 2018 04:45:31 -0800 (PST) Original-Received: from [192.168.1.11] (x5ce2e6fc.dyn.telefonica.de. [92.226.230.252]) by smtp.gmail.com with ESMTPSA id p21sm806391wmc.45.2018.02.10.04.45.30 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 10 Feb 2018 04:45:31 -0800 (PST) In-Reply-To: X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.16 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ntg-context-bounces@ntg.nl Original-Sender: "ntg-context" Xref: news.gmane.org gmane.comp.tex.context:100061 Archived-At: This is a multi-part message in MIME format. --===============2181109508877080148== Content-Type: multipart/alternative; boundary="------------000907060802090803070507" This is a multi-part message in MIME format. --------------000907060802090803070507 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit > Tim Steenvoorden > 10. Februar 2018 um 12:44 > Thanks Otared! Works like a charm! > > Out of curiosity, could you explain the mechanics behind this? I know > it is a commonly used trick in TeX macro definitions, but I don’t know > how it changes TeX’s understanding of the tokes it parses. When you create a new commands like this \def\mycommand[#1]{...} the brackets are delimiters for the argument of the command, i.e. when TeX sees \mycommand it looks for [ and grabs everything intill ] as as argument. When you out now a space (or start a new line) after ] in your definition of the command, e.g. \def\mycommand[#1] {...} TeX looks now for “] ” (right bracket followed by a space) as delimiter for the argument of your command. Wolfgang --------------000907060802090803070507 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit
10. Februar 2018 um 12:44
Thanks Otared! Works like a charm!

Out of curiosity, could you explain the mechanics behind this? I know it is a commonly used trick in TeX macro definitions, but I don’t know how it changes TeX’s understanding of the tokes it parses.

When you create a new commands like this

    \def\mycommand[#1]{...}

the brackets are delimiters for the argument of the command, i.e. when TeX sees
\mycommand it looks for [ and grabs everything intill ] as as argument. When you
out now a space (or start a new line) after ] in your definition of the command, e.g.

    \def\mycommand[#1] {...}

TeX looks now for “] ” (right bracket followed by a space) as delimiter for
the argument of your command.

Wolfgang
--------------000907060802090803070507-- --===============2181109508877080148== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX18KSWYgeW91ciBxdWVzdGlvbiBpcyBvZiBpbnRlcmVz dCB0byBvdGhlcnMgYXMgd2VsbCwgcGxlYXNlIGFkZCBhbiBlbnRyeSB0byB0aGUgV2lraSEKCm1h aWxsaXN0IDogbnRnLWNvbnRleHRAbnRnLm5sIC8gaHR0cDovL3d3dy5udGcubmwvbWFpbG1hbi9s aXN0aW5mby9udGctY29udGV4dAp3ZWJwYWdlICA6IGh0dHA6Ly93d3cucHJhZ21hLWFkZS5ubCAv IGh0dHA6Ly9jb250ZXh0LmFhbmhldC5uZXQKYXJjaGl2ZSAgOiBodHRwczovL2JpdGJ1Y2tldC5v cmcvcGhnL2NvbnRleHQtbWlycm9yL2NvbW1pdHMvCndpa2kgICAgIDogaHR0cDovL2NvbnRleHRn YXJkZW4ubmV0Cl9fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f --===============2181109508877080148==--