GithubHelp home page GithubHelp logo

xsim and synctex about xsim HOT 12 OPEN

thorstengrothe avatar thorstengrothe commented on May 20, 2024
xsim and synctex

from xsim.

Comments (12)

thorstengrothe avatar thorstengrothe commented on May 20, 2024 1

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.

from xsim.

cgnieder avatar cgnieder commented on May 20, 2024 1

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!

from xsim.

cgnieder avatar cgnieder commented on May 20, 2024

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

from xsim.

cgnieder avatar cgnieder commented on May 20, 2024

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

from xsim.

thorstengrothe avatar thorstengrothe commented on May 20, 2024

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

from xsim.

dave-doty avatar dave-doty commented on May 20, 2024

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.

from xsim.

cgnieder avatar cgnieder commented on May 20, 2024

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.

from xsim.

joostkremers avatar joostkremers commented on May 20, 2024

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?

from xsim.

cgnieder avatar cgnieder commented on May 20, 2024

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))

from xsim.

pitkling avatar pitkling commented on May 20, 2024

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 :).

from xsim.

dave-doty avatar dave-doty commented on May 20, 2024

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)?

from xsim.

cgnieder avatar cgnieder commented on May 20, 2024

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

from xsim.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.