HI! Tried to make a checklist in an interactive document. The problem seems to be that all checks/uncecks in same click, not each individually. Is there something wrong with my code? See attached below \setupinteraction[state=start] \setupexternalfigures[location=global] \usemodule[fields] \definesymbol [yes] [{\externalfigure[check-mark-svgrepo-com.svg][conversion=mp]}] \definesymbol [no] [] \setupfield [setup 3] [width=0.5cm, height=0.5cm, rulethickness=1pt, corner=round, framecolor=red] \definefield [check-me] [check] [setup 3] [yes,no] [no] \define\chk{\field[check-me]} \starttext \chk \blank[3cm] \chk \stoptext
On 5/23/22 13:11, Jan-Erik Hägglöf via ntg-context wrote:
HI!
Tried to make a checklist in an interactive document.
The problem seems to be that all checks/uncecks in same click, not each individually.
Is there something wrong with my code?
Hi Jan-Erik, you basically put the same field twice. Add something like: \definefield [check-you] [check] [setup 3] [yes,no] [no] \define\chka{\field[check-you]} \chka Checks will be different then. I hope it helps, Pablo
Thank you, unfortunately it has no effect. Even if I make a macro, still it is the same field.
23 maj 2022 kl. 21:59 skrev Pablo Rodriguez via ntg-context
: On 5/23/22 13:11, Jan-Erik Hägglöf via ntg-context wrote:
HI!
Tried to make a checklist in an interactive document.
The problem seems to be that all checks/uncecks in same click, not each individually.
Is there something wrong with my code?
Hi Jan-Erik,
you basically put the same field twice.
Add something like:
\definefield [check-you] [check] [setup 3] [yes,no] [no]
\define\chka{\field[check-you]}
\chka
Checks will be different then.
I hope it helps,
Pablo ___________________________________________________________________________________ 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://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___________________________________________________________________________________
I’ve tried this \setupinteraction[state=start] \definesymbol[yes][{\externalfigure[check-mark-svgrepo-com.svg][conversion=mp]}] \definesymbol[no][] \newcount\chk \def\chk{% \global \advance \chk by 1 \setupfield[setup1][width=0.5cm, height=0.5cm,rulethickness=1pt, corner=round, framecolor=red]% \definefield[checkme\the\chk][check][setup1][yes,no][no]% \field[checkme\the\chk]% } \starttext \chk \chk \chk \stoptext But it gives the error ” You can’t use \global after \advance” But this example works fine \setupinteraction[state=start] \newcount\clozecount \def\mycloze{% \global \advance \clozecount by 1 \definefield[uniqcloze\the\clozecount][line]% \field[uniqcloze\the\clozecount]% } \starttext Frogs have four \mycloze\ and two eyes. Frogs have four \mycloze\ and two eyes. Frogs have four \mycloze\ and two eyes. Frogs have four \mycloze\ and two eyes. \stoptext From https://tex.stackexchange.com/questions/560042/how-to-create-unique-clozes-i...
24 maj 2022 kl. 07:44 skrev Jan-Erik Hägglöf
: Thank you, unfortunately it has no effect. Even if I make a macro, still it is the same field.
23 maj 2022 kl. 21:59 skrev Pablo Rodriguez via ntg-context
: On 5/23/22 13:11, Jan-Erik Hägglöf via ntg-context wrote:
HI!
Tried to make a checklist in an interactive document.
The problem seems to be that all checks/uncecks in same click, not each individually.
Is there something wrong with my code?
Hi Jan-Erik,
you basically put the same field twice.
Add something like:
\definefield [check-you] [check] [setup 3] [yes,no] [no]
\define\chka{\field[check-you]}
\chka
Checks will be different then.
I hope it helps,
Pablo ___________________________________________________________________________________ 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://context.aanhet.net archive : https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net ___________________________________________________________________________________
HI Again! I discovered what went wrong, such a silly syntax error, here comes a working code: \setupinteraction[state=start] \definesymbol[yes][{\externalfigure[check-mark-svgrepo-com.svg][conversion=mp]}] \definesymbol[no][] \newcount\chk \def\checkmark{% \global\advance\chk by 1 \setupfield[setup1][width=0.5cm, height=0.5cm,rulethickness=1pt, corner=round, framecolor=red]% \definefield[checkme\the\chk][check][setup1][yes,no][no]% \field[checkme\the\chk]% } \starttext \checkmark\ \checkmark\ \checkmark\ \stoptext Sorry to bother the list but maybe it is helpful for someone. Regards /Jan-Erik
24 maj 2022 kl. 08:08 skrev Jan-Erik Hägglöf
: I’ve tried this
\setupinteraction[state=start]
\definesymbol[yes][{\externalfigure[check-mark-svgrepo-com.svg][conversion=mp]}] \definesymbol[no][]
\newcount\chk \def\chk{% \global \advance \chk by 1 \setupfield[setup1][width=0.5cm, height=0.5cm,rulethickness=1pt, corner=round, framecolor=red]% \definefield[checkme\the\chk][check][setup1][yes,no][no]% \field[checkme\the\chk]% }
\starttext
\chk
\chk
\chk
\stoptext
But it gives the error ” You can’t use \global after \advance”
But this example works fine
\setupinteraction[state=start]
\newcount\clozecount \def\mycloze{% \global \advance \clozecount by 1 \definefield[uniqcloze\the\clozecount][line]% \field[uniqcloze\the\clozecount]% }
\starttext
Frogs have four \mycloze\ and two eyes. Frogs have four \mycloze\ and two eyes. Frogs have four \mycloze\ and two eyes. Frogs have four \mycloze\ and two eyes.
\stoptext
From
https://tex.stackexchange.com/questions/560042/how-to-create-unique-clozes-i... https://tex.stackexchange.com/questions/560042/how-to-create-unique-clozes-i...
24 maj 2022 kl. 07:44 skrev Jan-Erik Hägglöf
mailto:skrantajanneman@gmail.com>: Thank you, unfortunately it has no effect. Even if I make a macro, still it is the same field.
23 maj 2022 kl. 21:59 skrev Pablo Rodriguez via ntg-context
mailto:ntg-context@ntg.nl>: On 5/23/22 13:11, Jan-Erik Hägglöf via ntg-context wrote:
HI!
Tried to make a checklist in an interactive document.
The problem seems to be that all checks/uncecks in same click, not each individually.
Is there something wrong with my code?
Hi Jan-Erik,
you basically put the same field twice.
Add something like:
\definefield [check-you] [check] [setup 3] [yes,no] [no]
\define\chka{\field[check-you]}
\chka
Checks will be different then.
I hope it helps,
Pablo ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl mailto:ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl http://www.pragma-ade.nl/ / http://context.aanhet.net http://context.aanhet.net/ archive : https://bitbucket.org/phg/context-mirror/commits/ https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net http://contextgarden.net/ ___________________________________________________________________________________
On 5/24/22 10:18, Jan-Erik Hägglöf via ntg-context wrote:
HI Again!
I discovered what went wrong, such a silly syntax error, here comes a working code:
Hi Jan-Erik, this will also make it: \setupinteraction[state=start] \definesymbol [yes] [{\externalfigure[on.svg][conversion=mp]}] \definesymbol [no] [{\externalfigure[off.svg][conversion=mp]}] \setupfield[setup3][width=2ex, height=2ex] \dorecurse{3} {\definefield [check-\recurselevel] [check] [setup3] [yes,no] [no]} \setupbodyfont[sans, 30pt] \starttext \startTEXpage[offset=1em, foregroundstyle=\ssbf] \dorecurse{3} {\field[check-\recurselevel]\ option \recurselevel\blank[1ex]} \stopTEXpage \stoptext But what I experienced in Acrobat Reader DC (on a borrowed computer) is that you get the standard image (only when field is enabled) when you click elsewhere in the document. I guess that this may be related to a missing implementation, but first I would like to confirm you are experiencing the same. Best, Pablo
Am 24.05.22 um 18:43 schrieb Pablo Rodriguez via ntg-context:
But what I experienced in Acrobat Reader DC (on a borrowed computer) is that you get the standard image (only when field is enabled) when you click elsewhere in the document.
I guess that this may be related to a missing implementation, but first I would like to confirm you are experiencing the same.
Custom checkboxes and radiobuttons used to work many years ago, but they’re broken for years – Hans blames Adobe for that. Your example works well in Apple Preview, Acrobat Pro 9 (2010), Skim, TeXshop, Safari, File Viewer. All of these use Apple’s PDF library, except the old Acrobat. Foxit Reader, Master PDF Editor, Opera, Firefox never show the custom icons but the default checkmark (Firefox a cross). PDF Studio 2019 doesn’t even that but shows a "4". PDF.js in Atom doesn’t support forms (but show the red icon). (I tested on MacOS 10.14.) Hraban
On 5/24/22 19:58, Henning Hraban Ramm via ntg-context wrote:
Am 24.05.22 um 18:43 schrieb Pablo Rodriguez via ntg-context:
But what I experienced in Acrobat Reader DC (on a borrowed computer) is that you get the standard image (only when field is enabled) when you click elsewhere in the document.
I guess that this may be related to a missing implementation, but first I would like to confirm you are experiencing the same.
Custom checkboxes and radiobuttons used to work many years ago, but they’re broken for years – Hans blames Adobe for that.
Many thanks for your reply and your extensive testing, Hraban. [Sorry for the late reply, but I have to do this on my free time.] I have the impression that this issue might be more complex than Acrobat misbehaving (in my opinion). /Annot /Widget may be missing /MK /CA which contains this description (https://opensource.adobe.com/dc-acrobat-sdk-docs/standards/pdfstandards/pdf/...): The widget annotation’s normal caption, which shall be displayed when it is not interacting with the user. But since this value is a text string, I wonder whether its value may be /T from the parent (/FT /Btn). Again, I don’t really know what is going on here. But adding the /T from parent, by manually editing it: /MK << /CA <FEFF0063006800650063006B002D0033> >> This makes the mark different and permanent in Acrobat (although I don’t get the right image). You may click on other area and the check mark doesn’t vanish. Maybe the issue is that check boxes don’t work exactly the way the rest of us might have expected. Sorry, but I’m again in a hurry. Many thanks for your help, Pablo
I’ve tested on my Mac OS Monterey 12.3.1 and the same phenomena as firefox it also is on google chrome.
24 maj 2022 kl. 10:18 skrev Jan-Erik Hägglöf
: HI Again!
I discovered what went wrong, such a silly syntax error, here comes a working code:
\setupinteraction[state=start]
\definesymbol[yes][{\externalfigure[check-mark-svgrepo-com.svg][conversion=mp]}] \definesymbol[no][]
\newcount\chk \def\checkmark{% \global\advance\chk by 1 \setupfield[setup1][width=0.5cm, height=0.5cm,rulethickness=1pt, corner=round, framecolor=red]% \definefield[checkme\the\chk][check][setup1][yes,no][no]% \field[checkme\the\chk]% }
\starttext
\checkmark\
\checkmark\
\checkmark\
\stoptext
Sorry to bother the list but maybe it is helpful for someone.
Regards
/Jan-Erik
24 maj 2022 kl. 08:08 skrev Jan-Erik Hägglöf
mailto:skrantajanneman@gmail.com>: I’ve tried this
\setupinteraction[state=start]
\definesymbol[yes][{\externalfigure[check-mark-svgrepo-com.svg][conversion=mp]}] \definesymbol[no][]
\newcount\chk \def\chk{% \global \advance \chk by 1 \setupfield[setup1][width=0.5cm, height=0.5cm,rulethickness=1pt, corner=round, framecolor=red]% \definefield[checkme\the\chk][check][setup1][yes,no][no]% \field[checkme\the\chk]% }
\starttext
\chk
\chk
\chk
\stoptext
But it gives the error ” You can’t use \global after \advance”
But this example works fine
\setupinteraction[state=start]
\newcount\clozecount \def\mycloze{% \global \advance \clozecount by 1 \definefield[uniqcloze\the\clozecount][line]% \field[uniqcloze\the\clozecount]% }
\starttext
Frogs have four \mycloze\ and two eyes. Frogs have four \mycloze\ and two eyes. Frogs have four \mycloze\ and two eyes. Frogs have four \mycloze\ and two eyes.
\stoptext
From
https://tex.stackexchange.com/questions/560042/how-to-create-unique-clozes-i... https://tex.stackexchange.com/questions/560042/how-to-create-unique-clozes-i...
24 maj 2022 kl. 07:44 skrev Jan-Erik Hägglöf
mailto:skrantajanneman@gmail.com>: Thank you, unfortunately it has no effect. Even if I make a macro, still it is the same field.
23 maj 2022 kl. 21:59 skrev Pablo Rodriguez via ntg-context
mailto:ntg-context@ntg.nl>: On 5/23/22 13:11, Jan-Erik Hägglöf via ntg-context wrote:
HI!
Tried to make a checklist in an interactive document.
The problem seems to be that all checks/uncecks in same click, not each individually.
Is there something wrong with my code?
Hi Jan-Erik,
you basically put the same field twice.
Add something like:
\definefield [check-you] [check] [setup 3] [yes,no] [no]
\define\chka{\field[check-you]}
\chka
Checks will be different then.
I hope it helps,
Pablo ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki!
maillist : ntg-context@ntg.nl mailto:ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl http://www.pragma-ade.nl/ / http://context.aanhet.net http://context.aanhet.net/ archive : https://bitbucket.org/phg/context-mirror/commits/ https://bitbucket.org/phg/context-mirror/commits/ wiki : http://contextgarden.net http://contextgarden.net/ ___________________________________________________________________________________
participants (3)
-
Henning Hraban Ramm
-
Jan-Erik Hägglöf
-
Pablo Rodriguez