MathHubInfo / Legacy-localmh

DEPRECATED - A cross-repository administration tool for the local authoring in MathHub.info
1 stars 0 forks source link

lmh should use MathHub-specific profiles (by repository type) #226

Open kohlhase opened 9 years ago

kohlhase commented 9 years ago

@jucovschi introduced new profiles in the KWARC branch of LaTeXML to optimize preloading, they can be found at `LaTeXML/lib/LaTeXML/resources/Profiles``

I will make the changes to the profiles (thus assigning this issue to Tom), but we should also use them in the LaTeXML invocation. For that we probably need a configuration switch (which should be initialized with lmh init as well) with values slides, smglom, and problems (more to come probably) which configures which type of repos this is and then choose the options accordingly.

Alternatively we could have files in the lib directory of a repository which contain pieces of invocation script. E.g. the file lib/latexml-invocation.incl could have

--preload tikz --preload listings ...

and that could be included into the LaTeXML invocation. This may be the more general mechanism, and we could just continue to use stex-module.opt and augment it as needed for the repos. The lib/latexml-invocation.incl file would mirror the lib/preamble.tex file.

Alternatively (or additionally), we could have a file lib/latexml-profile.incl that states which profile should be used.

And finally, we could have a file lib/local.opt that is an extension to the stex-module.opt, if @dginev please confirm LaTeXML accepts two --profile options (and accepts absolute paths for profile files).

@dginev, I would love to hear your opinion on this.

kohlhase commented 9 years ago

hmmm, it seems that the profiles only exist on pine at /var/data/localmh/ext/perl5lib/lib/perl5/LaTeXML/resources/Profiles and not in the LaTeXML repository. So we would have to commit them there. But we should find the best extension mechanism for lmh before I do that.

dginev commented 9 years ago

if @dginev please confirm LaTeXML accepts two --profile options (and accepts absolute paths for profile files).

Actually, it doesn't do either of those. But you can give a --path=/absolute/path to the profile directory and it will then find your custom profile. (That's pretty new btw). Multiple profiles are something we agreed we want, but I haven't added yet (there is an issue about that somewhere in the LaTeXML tracker)

tkw1536 commented 9 years ago

@KWARC/mmt will do building in the future.

@kohlhase is this still up-to-date?

kohlhase commented 9 years ago

I would really like to make progress on this, ... to speed up LaTeXML processing in MathHub.

Christian tells me that the MMT building works now. So we need to do two things:

kohlhase commented 9 years ago

@cmaeder this is the issue I was talking about.

tkw1536 commented 9 years ago

@kohlhase I could implement using MMT for building now, but AFAIK we are currently in the progress of changing the build.msl syntax to something sbt-like (see KWARC/MMT#24). Since I expect this will come with new command line arguments as well (for building individual files), I would rather want to wait to implement anything until that is completly finished.

kohlhase commented 9 years ago

I do not think that the new syntax will change much in the call patterns. @cmaeder what do you think? In any case, it would be good to expose the new mechanism to being used to flush out bugs and generally make progress.

cmaeder commented 9 years ago

Currently the used profile can be overwritten by setting environment variable LATEXMLPROFILE (which is maybe inconvenient).

Based on the git group, MMT could use a default profile containing the group name as is the case for stex-smglom-module. (This means stex-slides-module.opt should be renamed to stex-MiKoMH-module.opt.)

Currently, the only difference between those two are basically the .cls files to preload (smglom.cls versus mikoslides.cls). (I'm not sure if it is a problem if several profiles may be given. Can both classes be preloaded without causing too much overhead?)

Additional preloads (like tikz) can also be given via the LATEXMLPRELOADS variable.

MMT could look up for profiles under ext/LaTeXML/blib/lib/LaTeXML/resources/Profiles if it finds a suitable one for a given group or repo (but it is a pain). Profiles are mere text files and it should be possible to pick them up from any (user) directory. (Adjusting a profile by editing ext/LaTeXML/lib/LaTeXML/resources/Profiles and re-installing LaTeXML to move the profiles to blib is also a pain.)

tkw1536 commented 9 years ago

How about having a property in META-INF/MANIFEST.MF that describes the default profile?

On Thu, Sep 10, 2015, 10:53 cmaeder notifications@github.com wrote:

Currently the used profile can be overwritten by setting environment variable LATEXMLPROFILE (which is maybe inconvenient).

Based on the git group, MMT could use a default profile containing the group name as is the case for stex-smglom-module. (This means stex-slides-module.opt should be renamed to stex-MiKoMH-module.opt.)

Currently, the only difference between those two are basically the .cls files to preload (smglom.cls versus mikoslides.cls). (I'm not sure if it is a problem if several profiles may be given. Can both classes be preloaded without causing too much overhead?)

Additional preloads (like tikz) can also be given via the LATEXMLPRELOADS variable.

MMT could look up for profiles under ext/LaTeXML/blib/lib/LaTeXML/resources/Profiles if it finds a suitable one for a given group or repo (but it is a pain). Profiles are mere text files and it should be possible to pick them up from any (user) directory. (Adjusting a profile by editing ext/LaTeXML/lib/LaTeXML/resources/Profiles and re-installing LaTeXML to move the profiles to blib is also a pain.)

— Reply to this email directly or view it on GitHub https://github.com/KWARC/localmh/issues/226#issuecomment-139173553.

cmaeder commented 9 years ago

Yes, I could do this, too. The question is if we need different profiles for individual repos or just groups.

cmaeder commented 9 years ago

@kohlhase It would be easy for me to take a profile from META-INF/MANIFEST.MF (and use a default one if none is given).

It would make sense to give a default profile for a whole group (like stex-smglom-module for the group smglom and stex-slides-module for MiKoMH). One place for this would be a meta repository within a group.

Furthermore, it looks as if the profile should match the \documentclass given in the lib/pre.tex file of a repo. It may be possible to also generate these (even language-specific) pre- and postamble files.

kohlhase commented 9 years ago

@kohlhase It would be easy for me to take a profile from META-INF/MANIFEST.MF (and use a default one if none is given).

yes, that would be helpful.

One place for this would be a meta repository within a group.

there is already a meta-inf repository per group (or there should be one at least). We should use that.

It may be possible to also generate these (even language-specific) pre- and postamble files.

yes please.

cmaeder commented 9 years ago

Ok, I use the file meta-inf/MANIFEST.MF (missing for BaseMH and KwarcMH). What should be the property key? profile documentclass? The names for profiles and .cls files should be unified (slides versus mikoslides). I'm not sure how additional \documentclass arguments would be passed. I suggest to only generate pre[.<lang>].tex and post.tex files (one per repo) if there are none (as done for localpaths.tex - per folder).