From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/58517 Path: news.gmane.org!not-for-mail From: Michael Saunders Newsgroups: gmane.comp.tex.context Subject: Re: tooltips and glossary Date: Tue, 4 May 2010 23:36:17 -0500 Message-ID: Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1273034207 20780 80.91.229.12 (5 May 2010 04:36:47 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 5 May 2010 04:36:47 +0000 (UTC) To: ntg-context@ntg.nl Original-X-From: ntg-context-bounces@ntg.nl Wed May 05 06:36:45 2010 connect(): No such file or directory Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from balder.ntg.nl ([195.12.62.10]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1O9WLk-0006ld-UC for gctc-ntg-context-518@m.gmane.org; Wed, 05 May 2010 06:36:44 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 75CB6C9B95; Wed, 5 May 2010 06:36:44 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id sxD7+w8eMY5x; Wed, 5 May 2010 06:36:32 +0200 (CEST) Original-Received: from balder.ntg.nl (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 608E5C9AF9; Wed, 5 May 2010 06:36:32 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id A71D6C9AF9 for ; Wed, 5 May 2010 06:36:30 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id C5MzCZBBeNur for ; Wed, 5 May 2010 06:36:19 +0200 (CEST) Original-Received: from mail-gw0-f41.google.com (mail-gw0-f41.google.com [74.125.83.41]) by balder.ntg.nl (Postfix) with ESMTP id BC46FC9AF5 for ; Wed, 5 May 2010 06:36:18 +0200 (CEST) Original-Received: by gwj16 with SMTP id 16so2072989gwj.14 for ; Tue, 04 May 2010 21:36:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:date:message-id :subject:from:to:content-type; bh=uNPUTYUs5Px/JAoRDJ30h6vXRiey28geTYh8bL2f34Y=; b=Z8/7S9oLM62vKPgYgB8swLEdEbIUk+F4e8tJE1yth/oyIYJhIUxd1vpUTIGV4D9ido D/tB8TOgfrRxyw7ON/MGTy+aECwkZ911mWotQZwnhM1DnRm2eByxelvQspIJSzEJhglW ZPEQXALc3qhCrcUij+nb72hhw2NOMuOpRKBf8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=tUtL0wizwK6mKDkZIbnldDQ9qAW3Itn4zNT8wy5tOMyLOpcHg8QEvduUudjpEckd37 Yf+E+6D7RlSPCbpRqjeTTJQ1wBEbG+/5eNoIzGgtTUeNS4rScPg7yfLWqy/qi+xDHP1K oQt1JPcqmUESuPWG1Mwtss3eM78ZwVJAyAfI4= Original-Received: by 10.101.60.20 with SMTP id n20mr4790047ank.150.1273034177304; Tue, 04 May 2010 21:36:17 -0700 (PDT) Original-Received: by 10.100.197.16 with HTTP; Tue, 4 May 2010 21:36:17 -0700 (PDT) X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.12 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: ntg-context-bounces@ntg.nl Errors-To: ntg-context-bounces@ntg.nl Xref: news.gmane.org gmane.comp.tex.context:58517 Archived-At: About glossaries: Thank you, everyone. I'm not much of a TeXpert and certainly not a lua expert, but I'm trying to understand your different solutions and integrate them into a working system. There seem to be three approaches: I. Willi Egger---synonym-based II. Marius---modified index III. Philipp Gesang---lua-based I. So far, Willi's synonym-based solution looks simple and promising. I imagine something like this: \definesynonyms[gloss][glosses][\infull][\inshort]%to make short glosses available for tooltips \definesynonyms[gentry][gentries][\infull][\inshort]%to connect headwords to entries \def\gdef#1#2#3{\gloss{#1}{#2}\gentry{#1}{#3}} \def\hint#1{\tooltip[middle]{#1}{\infull{#1}}} %then you have a file of definitions like this one: \gdef{vibrato}{a periodic fluctuation in pitch}{A periodic fluctuation of pitch, typically in the range 6--12~Hz.} %within the text, where you need a tooltip on a word, you can say: ... \hint{vibrato} ... %at then end of the text, something like: Glossary: \placelistofgentries I see three problems with this: 1. I don't know how to tell \hint to refer to the "vibrato" in glosses and not in gentries. 2. There is no mechanism to refer to the page with a substantive discussion of "vibrato". 3. There is no way to handle cases where the string in the text is some variation of "vibrato" (e.g., Vibrato, vibrati, vibrato's) II. Marius's modified index solution is the only one to successfully link the entry back to a point in the text, but the resulting "glossary" really just looks like an index. III. Philipp Gesang's lua-based solution connects headwords to entries just as \definesynonyms[gentry][gentries][\infull][\inshort] does, and it produces something that looks like a glossary, but the entries have no link back to the text. Also, I don't see the point of the \usegloss{word} command unless it references the substantive discussion(s) of the word. I think that is what his "\usegloss[exp]{word}" is for, but then there should be a reference to it in the entry. Something like: {\bd headword}---entry text, p.\at[g:headword] There probably is some advantage in using the lua script for this, but I don't know what it is. About tooltips: \tooltip surprised me, and I was impressed that it appears to typeset the tooltip text with Context, but there are some problems with it: 1. It's stretched horizontally. 2. The active area begins at the baseline and stretches about 1 ex _under_ the word. 3. It appears without a border and under the cursor. I have seen tooltips in pdf files before, and they looked better than this. I suspect the reason is that, as you say, \tooltip uses Javascript, and the ones I saw use a different mechanism. I dug around and found this reference which describes how it's done with form fields and invisible buttons: http://gilbertconsulting.com/pdf/Build_tool_tips_in_InDesign.pdf (Notice how tidy the tooltips in it look.) That document describes setting them up manually in a point-and-click interface, but surely Context could automate this by putting an invisible frame around the word and creating a form field/button over it? And, correct me if I'm wrong, but that mechanism is not Javascript-based at all, is it? (by the way: I've not broken the thread again, have I?) ___________________________________________________________________________________ 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 ___________________________________________________________________________________