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

Specify required packages in each question #36

Closed
dbosk opened this issue Oct 23, 2018 · 2 comments
Closed

Specify required packages in each question #36

dbosk opened this issue Oct 23, 2018 · 2 comments
Labels

Comments

@dbosk
Copy link
Owner

dbosk commented Oct 23, 2018

Some questions use "exotic" packages, it would be nice to extract them and put them in the preamble automatically. Lennart's exam generator uses the following format:

\usepackage{enumitem}
\usepackge{listings}

\question[3]\label{q:typomvandling}
Utifrån de typomvandlingar som sker i programmet nedan. 

But this restricts the format to only one question per .tex-file and ones the question is incorporated in an exam, this information is lost --- so the exam cannot be used as an input database to examgen.

However, questions formatted like this can be used with examgen, simply add the following filter to the Makefile:

.PHONY: filter-usepackage
filter-usepackage: questions.tex
    cat questions.tex | grep "usepackage" | sort | uniq >> preamble.tex
    sed -i "/^\\\\usepackage/d" questions.tex

exam.pdf: filter-usepackage

One must still manually resolve option conflicts though.

@dbosk
Copy link
Owner Author

dbosk commented Oct 23, 2018

Well, one could simply merge the preamble.tex from every exam:

cat preamble0.tex ... preambleN.tex | sort | uniq >> preamble.tex

It should be possible to sort based on package name, that would make the required manual editing easier.

@dbosk
Copy link
Owner Author

dbosk commented May 20, 2019

Not necessary when there is a template for the exam.

@dbosk dbosk closed this as completed May 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant