On 23 Sep 2013, at 09:57 , Marco Patzer
Subject: [NTG-context] Conditional float references
a couple of times the question came up??? how to create more intelligent referencing. [….] I don't know if there's interest in integrating such functionality into the core. I attached some code, a new macro \smartref, which takes the same arguments as \in.
Hi Marco, I would be very interested in being able to use this macro, integrated or not, since in my project there are numerous figures with lots of references to them throughout the entire text, and \at{page}[] is not satisfactory for me. I tried the code you supplied by pasting the whole lot into a TeXShop-file, and, when that did not work, in Alphax, processing the latter from Terminal, but in both cases I received an error message that I do not know what to do with. Strangely enough it complains about an error in line 1 even if that contains a commented out comment. I reproduce the error message here, hoping that you, or somebody elsm, can see what I did wrong. (I apologize on behalf of TeXShop and Alhax for the length of this message.) Thanks in advance for any help. Robert Blackstone Error message: ------------------------------------------------------------------------------------------------------------ Last login: Tue Sep 24 09:02:03 on ttys000 sh: /Users/robertblackstone/context/tex/setuptex: No such file or directory iMac-Bergen-R-5:context-minimal-24-09 robertblackstone$ . /Users/robertblackstone/context-minimal-24-09/tex/setuptex Setting "/Users/robertblackstone/context-minimal-24-09/tex" as ConTeXt root. iMac-Bergen-R-5:context-minimal-24-09 robertblackstone$ context /Users/robertblackstone/Dropbox/C-tests/Referencing-Smart_referencing/Referencing-Smart_referencing-test1.tex mtx-context | run 1: luatex --fmt="/Users/robertblackstone/context-minimal-24-09/tex/texmf-cache/luatex-cache/context/5fe67e0bfe781ce0dde776fb1556f32e/formats/luatex/cont-en" --jobname="Referencing-Smart_referencing-test1" --lua="/Users/robertblackstone/context-minimal-24-09/tex/texmf-cache/luatex-cache/context/5fe67e0bfe781ce0dde776fb1556f32e/formats/luatex/cont-en.lui" --no-parse-first-line --c:currentrun=1 --c:fulljobname="/Users/robertblackstone/Dropbox/C-tests/Referencing-Smart_referencing/Referencing-Smart_referencing-test1.tex" --c:input="/Users/robertblackstone/Dropbox/C-tests/Referencing-Smart_referencing/Referencing-Smart_referencing-test1.tex" --c:kindofrun=1 --c:maxnofruns=8 "cont-yes.mkiv" This is LuaTeX, Version beta-0.76.0-2013040508 (rev 4627) \write18 enabled. (/Users/robertblackstone/context-minimal-24-09/tex/texmf-context/tex/context/base/cont-yes.mkiv ConTeXt ver: 2013.09.21 13:53 MKIV beta fmt: 2013.9.24 int: english/english system > 'cont-new.mkiv' loaded (/Users/robertblackstone/context-minimal-24-09/tex/texmf-context/tex/context/base/cont-new.mkiv) system > files > jobname 'Referencing-Smart_referencing-test1', input '/Users/robertblackstone/Dropbox/C-tests/Referencing-Smart_referencing/Referencing-Smart_referencing-test1', result 'Referencing-Smart_referencing-test1' fonts > latin modern fonts are not preloaded languages > language 'en' is active (/Users/robertblackstone/Dropbox/C-tests/Referencing-Smart_referencing/Referencing-Smart_referencing-test1.tex ! Parameters must be numbered consecutively. system > tex > error on line 1 in file /Users/robertblackstone/Dropbox/C-tests/Referencing-Smart_referencing/Referencing-Smart_referencing-test1.tex: Parameters must be numbered consecutively ... 1 >> \unprotect 2 \unexpanded\def\strc_references_smart 3 {\strc_references_start_goto 4 \let\currentreferencecontent\currentreferencedefault 5 \strc_references_pickup_smart_goto} 6 \def\strc_references_pickup_smart_goto 7 {\dodoublegroupempty\strc_references_pickup_goto_smart_indeed} 8 \starttexdefinition strc_references_pickup_goto_smart_indeed #left#right#dummy[#label] 9 \leftreferencetoks 10 \iffirstargument 11 {#left} <to be read again> l l.1 ...ferences_pickup_goto_smart_indeed\endcsname#l eft#right#dummy[#label] \ctxcommand #1i-\directlua {commands.#1} \syst_helpers_start_tex_definition_two ...n("#1")} {#2} l.32 \stoptexdefinition ? ------------------------------------------------------------------------------------------------------------