Closed davidcarlisle closed 4 years ago
ideally for people with accounts it ought to open a writeable version unique to them, if that is possible
For https://texnique.fr code blocks have a link to open as new projects for people logged-in into overleaf. Just wondering, maybe something in the source of texnique.fr could help with this problem.
I plan to ask the Overleaf people about how they do their own templates at the point we have agreed content to be 'activated'
Yes that's why I just put a placeholder in for overleaf, I figure they will let us know what they want. Mainly I was working to get the texlive link working well enough to see if people think it is a good idea. One thing I didn't mention is that it doesn't (currently) include xetex or luatex (although I have seen projects that have compiled xetex to javascript)
The current code is using latexonline.cc so running the examples in a hosted docker container which is noticeably faster than texlive.js and gives the possibility of using xetex and luatex also bibtex.
In the current draft buttons for edit/compile are just added if the code includes \documentclass
it would be easy to take fragments and add a standard preamble if that is required, just needs some way to distinguish those from really small framents where it does not make sense, could be a majic comment, or perhaps use
```tex
instead of
```latex
to distinguish fragments which should not be compiled.
The current code also has a disabled link to OverLeaf There is (apparently simple) code at
https://texnique.fr/osqa/m/default/media/js/writelatex.js
But adding a similar form and submit code here produces
There was an error creating your project The link to open this content on Overleaf was missing some required parameters.
I plan to ask Overleaf themselves to suggest how best to do this: we'll want the same set up as their own tutorial pages.
@josephwright Overleaf is using project-templates for their help articles and the links are setup such that the template is copied as a new project with some preferences (iirc).
I plan to ask the Overleaf people about how they do their own templates at the point we have agreed content to be 'activated'
agreed they should say how final linking should work but I have fixed the code mentioned above so the overlink button now works, for testing anyway.
Code examples will need links to an online TeX system.
A rough draft is being worked on at
https://davidcarlisle.github.io/texlive.js/test2
(can be moved under this learnlatex organisation if there is general agreement to the approach)
The test currently has lots of inline script which could be moved to the page template once it works, so basically shows a possible way to have just markdown documents with active links for the examples.
The overleaf link currently goes to a read-only instance under my account (ideally for people with accounts it ought to open a writeable version unique to them, if that is possible)
The texlive.js link runs tex in the browser using a site-hosted instance of texlive.js it currently only works in firefox (some known chrome and edge issues to avoid)
This issue is opened to track the general issue linking to online systems not specifically the test above.