From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/53188 Path: news.gmane.org!not-for-mail From: Matthijs Kooijman Newsgroups: gmane.comp.tex.context Subject: Passing variables into context Date: Wed, 30 Sep 2009 13:27:28 +0200 Message-ID: <20090930112727.GS4289@katherina.student.utwente.nl> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============2039570710==" X-Trace: ger.gmane.org 1254310089 9213 80.91.229.12 (30 Sep 2009 11:28:09 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 30 Sep 2009 11:28:09 +0000 (UTC) To: Mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Wed Sep 30 13:28:00 2009 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.50) id 1MsxLi-0006kx-Uh for gctc-ntg-context-518@m.gmane.org; Wed, 30 Sep 2009 13:27:59 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id A0051C9AC1; Wed, 30 Sep 2009 13:27:53 +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 NNpBfrKlC5V2; Wed, 30 Sep 2009 13:27:40 +0200 (CEST) Original-Received: from balder.ntg.nl (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 28CC7C9AAF; Wed, 30 Sep 2009 13:27:40 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 6AF09C9AAF for ; Wed, 30 Sep 2009 13:27:32 +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 I2-JMjHmDsO8 for ; Wed, 30 Sep 2009 13:27:28 +0200 (CEST) Original-Received: from katherina.student.utwente.nl (katherina.student.utwente.nl [130.89.168.160]) by balder.ntg.nl (Postfix) with ESMTP id 6B057C9A90 for ; Wed, 30 Sep 2009 13:27:28 +0200 (CEST) Original-Received: from matthijs by katherina.student.utwente.nl with local (Exim 4.69) (envelope-from ) id 1MsxLE-0006ZL-53 for ntg-context@ntg.nl; Wed, 30 Sep 2009 13:27:28 +0200 Mail-Followup-To: Mailing list for ConTeXt users X-PGP-Fingerprint: 7F6A 9F44 2820 18E2 18DE 24AA CF49 D0E6 8A2F AFBC X-PGP-Key: http://katherina.student.utwente.nl/~matthijs/gpg_pubkey.asc User-Agent: Mutt/1.5.20 (2009-06-14) 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:53188 Archived-At: --===============2039570710== Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="HqPpMaT+a6TeY/Q4" Content-Disposition: inline --HqPpMaT+a6TeY/Q4 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi all, I've been trying to make a metapost graphic, based on the \textwidth. Howev= er, it seems I can't just pass in \textwidth as an option. For example, the following breaks: \startuniqueMPgraphic{HLine} draw origin -- (\MPvar{width}, 0mm);=20 \stopuniqueMPgraphic \starttext \setupMPvariables[HLine][width=3D\textwidth] \uniqueMPgraphic{HLine} \stoptext with the following error: mplib | mp terminal: >> textwidth ! Undefined x coordinate has been replaced by 0. ; <*> ...d:=3D3441; draw origin -- (\textwidth , 0mm); It seems that the \textwidth option is not expanded before being passed to = MP. Is there any way to force this expansion? I've tried \expandafter (without really understanding what that does), but that didn't help. I've tried putting this graphic as an overlay under an \framed, which allows me to use the \overlaywidth macro in metapost (which I assume is expanded specially by context?). This worked, but is not very elegant. Is there something more straightforward possible? Gr. Matthijs --HqPpMaT+a6TeY/Q4 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) iEYEARECAAYFAkrDQJ8ACgkQz0nQ5oovr7yXaACgp/j8d1x/NurQaK8Gx2+Fy01l bXQAoKMQJ0uTHq0DKwHvkMoRVQ20WsyF =TFg/ -----END PGP SIGNATURE----- --HqPpMaT+a6TeY/Q4-- --===============2039570710== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline ___________________________________________________________________________________ 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 : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________ --===============2039570710==--