Hi Marco,
Thanks for your answer: indeed I was wrong about the issue I reported about doublesided page numbering. The reason is that I use TeXShop (on a Mac) and the PDF produced is shown in a single page layout (it is however possible to have doublesided layout as well: that's what I tested after your answer.
Also after applying your patch everything works as expected. I tested your file with some maths formulas and changed even the language to French with:
\unprotect
\setuplabeltext
[\s!fr]
[\v!atpage=page\nobreakspace, %% “at page” sounds weird
\v!previouspage=à la page précédente,
\v!nextpage=à la page suivante]
\protect
\mainlanguage[fr]
without any problem. So your macro is just wonderful!
However maybe it would be better to have some setup options like:
\setuplabeltext[smartref][atpage={page},
previouspage={à la page précédente}, %or {page précédente}
nextpage={à la page suivante}] %or {page suivante}
In case Hans is willing to add such capabilities to the cross referencing, it would be great if one could setup the cross references in the same way by saying for instance
\setupreferencing[alternative=smartref]
and then have \smartref be defined automatically.
A final remark concerns the possibility to visualize the reference points when one is in the process of proof reading: at least in maths, it is usual to have dozens of reference points to formulas, lemmas, theorems, etc, and it is quite useful to be able to visualize such things. For instance I use a quick and dirty macro to print in the margin « eq:Fermat » to the right of the following formula
\placeformula[eq:Fermat]
\startformula
a,b,c \in {\Bbb N}^*, \quad n \geq 3, \quad a^n + b^n = c^n \imply abc = 0.
\stopformula
when I am preparing a paper. I do the same with references to lemmas and theorems, but I print them in the margin to the left of the reference point. For now, mkiv does not support such things and it's a pity.
Best regards: OK
On 25 sept. 2013, at 09:29, Marco Patzer
On 2013–09–25 Otared Kavian wrote:
I have not yet tried it with references to maths formulas, theorems, lemmas and such,
Me neither.
\ifsinglesided \strc_references_do_relative_else\plusone {\def\strc_references_smart_string{\labeltext\v!nextpage}} {\strc_references_do_relative_else\minusone
The issues I noticed are the following: 1. Typesetting the file gives an error message when there is no \setuppagenumbering[alternative=doublesided]
A typo:
\ifsinglesided \strc_references_do_relative_else\plusone {\def\strc_references_smart_string{\labeltext\v!nextpage}} - {\strc_references_do_relative\minusone + {\strc_references_do_relative_else\minusone
2. In the above minimal example, when stating \setuppagenumbering[alternative=doublesided] then Test 2 and Test 3 do not result in the smart references expected (they both result in « See figure 1 and figure 3. » while Test 2 should give « See figure 1 and figure 3 on next page. », and Test 3 should result in « See figure 1 on previous page and figure 3. »).
That's on purpose. If the graphic appears on the same double page, it is visible and no further reference is printed. In traditional typesetting a single page is rather insignificant. The reader is always faced with double pages, never single pages.
Thanks again for sharing your module.
Well, it wasn't meant to be a module. I rather intended to start a discussion and threw some code in to start with. If there's interest I can make it a module.
Thanks for the feedback.
Marco ___________________________________________________________________________________ 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 ___________________________________________________________________________________