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

xsim and synctex #9

Open
thorstengrothe opened this issue Jun 23, 2017 · 12 comments
Open

xsim and synctex #9

thorstengrothe opened this issue Jun 23, 2017 · 12 comments
Assignees
Labels
help wanted this is a tricky issue; any insights welcome suggestion suggestions and feature requests

Comments

@thorstengrothe
Copy link

Hello,

I'm converting all my exsheets exercises to xsim, so far it works really well. I found out that if the document is compiled with synctex one can only jump to the files named:

*-exercise-body.tex

Is there a way to jump directly to the source code and not to the *-body.tex files?
synctex is a very very convinent way to work with - especially for long documents...

Regards
Thorsten

@cgnieder
Copy link
Owner

I don't know much about synctex but I am quite certain there is nothing a package author can do about it.

@cgnieder cgnieder added the help wanted this is a tricky issue; any insights welcome label Jun 23, 2017
@cgnieder
Copy link
Owner

This is the same problem: https://tex.stackexchange.com/questions/163951/ – no solution, though

@thorstengrothe
Copy link
Author

Ok, thanks for your research, maybe the problem will be fixed some day...until now I will live with it :-)

@dave-doty
Copy link

dave-doty commented Mar 5, 2018

I wonder if there is a way to make an xsim option to put only the verbatim environments in their own separate source document, rather than doing this unconditionally on the entire text of every exercise and solution. Then, outside of the verbatim environment, the source links would link back to the original source.

I'll bet the problem could be solved in this way: give an option, disabled by default, to turn off the "separate exercise/solution *.tex files". Then, introduce a new environment, xsimverbatim, which, if this option is enabled, would be required to surround any verbatim environment used. For example:

Here is some verbatim text:
\begin{xsimverbatim}
\begin{verbatim}
def f(x):
    return x+1
\end{verbatim}
\end{xsimverbatim}
Here is some code in another verbatim environment:
\begin{xsimverbatim}
\begin{lstlisting}[language=Python]
def f(x):
    return x+1
\end{lstlisting}
\end{xsimverbatim}

Then xsim could pull the content out of each xsimverbatim environment and put it into a separate file, similarly to what is currently done with the exercise and solution environments. Similarly, there could be a new command \xsimverb for inline verbatim text: \xsimverb{\verb!x++;!}

The idea is that xsim wouldn't have to do much special processing or know anything about the verbatim text. One could use xsimverbatim and \xsimverb anywhere, without having to have a verbatim environment inside of it. It's just an instruction to put the contents in a separate file before running pdflatex.

Update: I read the documentation more carefully and saw there already is something like this in the xsimverb package, although it seems to require some boilerplate compared to simply having a new environment. So it seems that the above could be fairly simply implemented with an option to disable the writing of exercise/solution-body.tex files.

@cgnieder
Copy link
Owner

I have thought about this and not yet dismissed it completely. There is a good chance I will implement it when I find the time. The default behaviour will stay the same, though, I think.

@thorstengrothe
Copy link
Author

I can only speak for me. At the moment I'm using exsheets because synctex is working fine with it. Synctex is essential for my workflow, so I would appreciate this feature very much.

@cgnieder cgnieder reopened this Mar 23, 2018
@cgnieder cgnieder added the suggestion suggestions and feature requests label Mar 23, 2018
@joostkremers
Copy link

I'd like to second this request, not only because synctex takes me to the wrong file, but also because in AUCTeX (I don't know about other LaTeX environments), jumping to an error also takes me to the temp file, rather than to my main document. I'm actually trying out exsheets right now for these very reasons, even though I know it's deprecated.

BTW, doesn't issue #30 address the same issue?

@cgnieder cgnieder self-assigned this Jun 9, 2018
@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…
(#30 (comment))

@pitkling
Copy link

pitkling commented Apr 4, 2019

I'd also welcome a fix for this. I recently switched from exsheets to xsim (found out that the former is deprecated because it seemingly became incompatible with a change in the newest texlive). However, not having proper synctex support is really annoying. Actually I don't care at all about verbatim environments in my exercise sheets, so even an option to disable external files while sacrificing verbatim support would be fine for me.

In any case, thanks for the work on both exsheets and xsim :).

@cgnieder
Copy link
Owner

cgnieder commented Oct 3, 2019

I have implemented the experimental package option no-files (official update to CTAN will come in the next days…). For the time being this does not allow verbatim material when used.

\usepackage[no-files]{xsim}

Feedback (problems? ... ) very welcome!

@dave-doty
Copy link

Is there any way to make this more granular so that verbatim material is allowed, and it will generate extra files (with their associated source link problems), but any exercise not using verbatim environments could be given the option [no-file] and would remain inline (and have working source links)?

@cgnieder
Copy link
Owner

cgnieder commented Oct 3, 2019

Probably, yes. But I don't expect this to be happening soon. It would require significant (!) changes to existing code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted this is a tricky issue; any insights welcome suggestion suggestions and feature requests
Projects
None yet
Development

No branches or pull requests

5 participants