From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/101110 Path: news.gmane.org!.POSTED!not-for-mail From: Wolfgang Schuster Newsgroups: gmane.comp.tex.context Subject: Re: Overriding / redefining / disabling standard commands Date: Mon, 25 Jun 2018 23:52:59 +0200 Message-ID: <5B31643B.5000601@gmail.com> References: <8ece00df-881e-09bf-1122-86b7cf48bcf6@rik.users.panix.com> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============5579528596533986381==" X-Trace: blaine.gmane.org 1529963494 13709 195.159.176.226 (25 Jun 2018 21:51:34 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 25 Jun 2018 21:51:34 +0000 (UTC) User-Agent: Postbox 5.0.25 (Macintosh/20180328) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Mon Jun 25 23:51:30 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 1fXZOS-0003SJ-N6 for gctc-ntg-context-518@m.gmane.org; Mon, 25 Jun 2018 23:51:28 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 189223A45A; Mon, 25 Jun 2018 23:53:16 +0200 (CEST) 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 mZ5brcwHNZ0c; Mon, 25 Jun 2018 23:53:15 +0200 (CEST) Original-Received: from zapf.ntg.nl (localhost [IPv6:::1]) by zapf.ntg.nl (Postfix) with ESMTP id 7C37A3A45F; Mon, 25 Jun 2018 23:53:15 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 373233A45C for ; Mon, 25 Jun 2018 23:53:14 +0200 (CEST) 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 0z-obBFqFOAU for ; Mon, 25 Jun 2018 23:53:13 +0200 (CEST) Original-Received: from mail-wm0-f43.google.com (mail-wm0-f43.google.com [74.125.82.43]) (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 AB2753A45A for ; Mon, 25 Jun 2018 23:53:03 +0200 (CEST) Original-Received: by mail-wm0-f43.google.com with SMTP id z13-v6so5382426wma.5 for ; Mon, 25 Jun 2018 14:53:03 -0700 (PDT) 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=D6HmGnr4wRDUtQKSQoqtz9dFia5axOL1aDWSmIH6GYU=; b=hu0dPdT5YAuKzhbDNcLvQPa5bgCfBq/+tFjvLMIIfd91NC6ZN6NxcWRQU3wqn4JpdW Tk9UD9RIOpEXSyZFGmdT2XDbRBPQJaJ4DmngOfycYDONeVsXrstiDMcdcbDjMD/ey57Y SO3e4n32RYq06rfDenADimsB+szNpQKxKU/FbQPTLOpgabsssc4bMyGdoDx19cLTUl6f DIXHrJRU/EAT4Hs+B9qPEm5a9oK2ya/sTcAnLxynXySCG67N7gexIZANUZkcazCPWkd5 /3y0W8WoRsPGN2ZT75vcV95+UsW8uMWalGKdQr+LseeAELzP0DuJ9cHBqpcHnBnUMAGR 5dBQ== 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=D6HmGnr4wRDUtQKSQoqtz9dFia5axOL1aDWSmIH6GYU=; b=eJBYJ4rJQctizsIhCNsX2hr2MDpPlSyE5y3OvgEGKbd6Vwgg4m6GdJsyVYw7TEABrE elI/9IoKlf/XM7V2Uqd74gQ6BImPMJobZKh1Pl69gmDEcRMr7Y66M6bL6fp8Ahac1xfu QH/yoGEajxqRYXmGADLBvuslddyDnIwAkccDcXS9UhbQmzM364TJU4Isar6OB0snLOmp V3etj5QKImOe8IYqXA4e45vpQd7GUA+32hpluE28lnM37OoubsP7fcTyR4f6WOkTZ0X0 f4ET7fCa34hdaWRaM+lIJzUPmcSYZQABCa2NjH/0RjqbnRk39KOlWgrGMyVZCPLmT6vl AoWw== X-Gm-Message-State: APt69E1Jd/zQb4hUeRFNLKAAQcrSy8nln+3IRk4JKHBmhzTP+/efRC7W 4XwM0qewpD+qTUwj6Ma1esWWJV7Q X-Google-Smtp-Source: AAOMgpf6clqtUrYe0U33biYZ8CmJ3KuscPCf4ZNREoENiEYpLFT/f83vUxF1sxWG7nk6pxPeAZdmsg== X-Received: by 2002:a1c:64c5:: with SMTP id y188-v6mr2143549wmb.45.1529963582770; Mon, 25 Jun 2018 14:53:02 -0700 (PDT) Original-Received: from [192.168.1.12] (x5ce30e85.dyn.telefonica.de. [92.227.14.133]) by smtp.gmail.com with ESMTPSA id 63-v6sm255630wmv.48.2018.06.25.14.53.01 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 25 Jun 2018 14:53:01 -0700 (PDT) In-Reply-To: <8ece00df-881e-09bf-1122-86b7cf48bcf6@rik.users.panix.com> 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:101110 Archived-At: This is a multi-part message in MIME format. --===============5579528596533986381== Content-Type: multipart/alternative; boundary="------------060604000709080702090605" This is a multi-part message in MIME format. --------------060604000709080702090605 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit > Rik Kabel > 25. Juni 2018 um 22:49 > List, > > What is the preferred way to override a standard command? > > My use case is that I am trying to produce html (and epub, but that > has a long long way to go) from the same source I use for pdf. Some > features are not needed, and I have separate environment files for > each output format to accommodate the differences. > > I would like to override the standard \index command in one of those > environment files, eliminating the generation of index references. > There may be other constructs as well that would benefit from this > simplification while allowing a common content source file. You can use the “*export” mode to disable commands when the export is enabled. \startmode[ebook] \setupbackend[export=yes] \stopmode \starttext \index{Knuth}\input knuth \index{Ward}\input ward \index{Zapf}\input zapf \startnotmode[*export] \completeregister[index] \stopnotmode \stoptext Wolfgang --------------060604000709080702090605 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit
25. Juni 2018 um 22:49
List,

What is the preferred way to override a standard command?

My use case is that I am trying to produce html (and epub, but that has a long long way to go) from the same source I use for pdf. Some features are not needed, and I have separate environment files for each output format to accommodate the differences.

I would like to override the standard \index command in one of those environment files, eliminating the generation of index references. There may be other constructs as well that would benefit from this simplification while allowing a common content source file.

You can use the “*export” mode to disable commands when the export is enabled.

\startmode[ebook]
\setupbackend[export=yes]
\stopmode

\starttext

\index{Knuth}\input knuth

\index{Ward}\input ward

\index{Zapf}\input zapf

\startnotmode[*export]
\completeregister[index]
\stopnotmode

\stoptext

Wolfgang
--------------060604000709080702090605-- --===============5579528596533986381== 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 --===============5579528596533986381==--