Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change the writing of external files by scantokens #30

Closed
pablgonz opened this issue Apr 21, 2018 · 5 comments
Closed

Change the writing of external files by scantokens #30

pablgonz opened this issue Apr 21, 2018 · 5 comments
Assignees
Labels
duplicate this has been reported earlier suggestion suggestions and feature requests

Comments

@pablgonz
Copy link

pablgonz commented Apr 21, 2018

Hello, first of all, grateful for the great work with xsim, I have a suggestion (or idea) that I can maybe implement in xsim, I know that writing external files is necessary because of verbatim can not be used as an argument in macros, but, in some replies on tex.sx:

and pythontex package, they manage not to use external files and save verbatim material using scantokens. Could you implement this in xsim ?
Saludos

@cgnieder
Copy link
Owner

cgnieder commented Jun 9, 2018

I am planning to add a solution as an alternative to the current behavior. I do not have as much time as I used to for (La)TeX currently.
This will come one time…

@cgnieder cgnieder self-assigned this Jun 9, 2018
@cgnieder cgnieder added the suggestion suggestions and feature requests label Jun 9, 2018
cgnieder added a commit that referenced this issue Oct 3, 2019
@cgnieder cgnieder added the duplicate this has been reported earlier label Oct 6, 2019
@cgnieder
Copy link
Owner

cgnieder commented Oct 6, 2019

I close this as a duplicate of issue #9

@cgnieder cgnieder closed this as completed Oct 6, 2019
@pablgonz
Copy link
Author

pablgonz commented Oct 6, 2019

Hooo, I hadn't read (#9) when I wrote this. I wrote a comment on the previous commit 5ccf34d . Waiting for the new version :). Thank you for everything.
The best.
Pablo

@cgnieder
Copy link
Owner

cgnieder commented Oct 6, 2019

I have seen the comment and I've noticed the scontents package. For the time being the switching-off of the external files will disable using verbatim material, though… scontents does

\NewDocumentCommand { \__scontents_verb_arg:w } { +v }

which is a little bit of cheating ;) \NewDocumentCommand is meant to define user commands while \__scontents_verb_arg:w clearly is an internal command for the package… I've misused \NewDocumentCommand, too, but not in xsim where I want to keep the code as clean as I can.

I might find another way, though :)

@pablgonz
Copy link
Author

pablgonz commented Oct 6, 2019

Yes, the truth is that \scontents_verb_arg:w is a bit misleading ... there was no other way out since \tl_rescan does not work properly with verbatim material, only the old \scantokens has that ability :) (for now) .

The code of xsim is pure and clear, we appreciate the comments you leave in source codes, otherwise I would never have understood how xsimverb worked.

The comment left it for the scontents environment rather than for the \Scontents command, basically it is the same idea as xsimverb, but, saving the content in \tl and modifying the blessed end of line ^^M :) (a headache) and stored this in a sequence.

With your new version I think I can move (at last) from exsheets to xsim.

Maybe an idea of the "star" type in environments not to write in external files?
I see something like that in my mind:

\usepackage[no-files]{xsim}
\begin{exercise*}[...]
\scantokens{body} and save in prop list
\end{exercise*}
\begin{solution*}[...]
\scantokens{body} and save in prop list
\end{solution*}

and for xparse, solution of solution* are different (I don't mean the s argument) . maybe you could try something, I repeat, it's just an idea, and it's not that this against writing external files, it's just that, one of the things I liked most about exsheets was that.
Saludos

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate this has been reported earlier suggestion suggestions and feature requests
Projects
None yet
Development

No branches or pull requests

2 participants