slatex / sTeX

A semantic Extension of TeX/LaTeX
49 stars 9 forks source link

mockstex.sty #396

Open kohlhase opened 11 months ago

kohlhase commented 11 months ago

I sometimes find myself in the situation that I am writing a paper together with a co-author (currently Andrea) who does not have sTeX set up or does not even want to (and I want to later annotate the paper into sTeX myself).

Therefore I would like to make some of the sTeX annotations already, but they should be non-intrusive or a non-sTeX-based workflow. I am currently using the ad-hoc macros:

% mock sTeX for partial preloading
\def\defemph#1{\textbf{#1}}
\def\sn#1{#1}
\def\sns#1{#1s}
\def\sr#1#2{#2}
\newcommand\importmodule[2][]{}
\newcommand\usemodule[2][]{}
\newenvironment{smodule}[1][]{}{}
\newenvironment{smodule}[1][]{}{}
\newenvironment{sdefinition}[1][]{}{}
\newcommand\definame[2][1]{#2}
\newenvironment{sexample}[1][]{}{}

We could make an "official" package mockstex.sty that does a better job on this. It would only have to cover the basics of sTeX. Then I could use \usepackage{mockstex} while collaborating with Andrea and later replace it wiht a \usepackage{stex} (and pick up all the broken bits and pieces) which I want to move it to mathhub/papers

Having such a package might also lower the barrier to sTeX adoption.

Jazzpirate commented 11 months ago

Or a package option, rather? That could make sure that all macros are present, but don't do anything semantic...

kohlhase commented 11 months ago

indeed, that is even (much) better.

Jazzpirate commented 11 months ago

or better yet: don't do anything semantic iff dependencies are missing, except maybe highlighting. That would enable the workflow: Put annotations everywhere you think they should go and don't worry about dependencies, but feel free to declare new symbols etc. at any point, check later what's missing and add them (or let someone else take care of it)

kohlhase commented 11 months ago

yes, that is even better. Then the paper could be locally semantic but we would not need to set up a context (which is quite cumbersome to the co-authors). But then we should take care to make sure that we do not need to be in an archive (i.e. no reading MANIFEST.MF) in mockup mode.

kohlhase commented 11 months ago

If you want to implement this mockstex mode anytime soon, I can give you access to the paper Andrea and I are writing, it could be a good test case.

Jazzpirate commented 11 months ago

Don't hold your breath - that will require very carefully going over all macros that do semantic things and modifying them, so a larger refactoring effort. The next one will certainly come soon anyway though, so I think it's better to wait for that and then do multiple things at once.

kohlhase commented 11 months ago

That was what I suspected