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

Defer Solutions at the end of the exercise sheet #106

Open
Vouivre opened this issue Feb 24, 2019 · 9 comments
Open

Defer Solutions at the end of the exercise sheet #106

Vouivre opened this issue Feb 24, 2019 · 9 comments
Labels
Feature request Request new functionalities and features

Comments

@Vouivre
Copy link

Vouivre commented Feb 24, 2019

Hi,

sometimes I need to put the solution at the end of the document. Until now I used a Makefile, but it doesn't work very well. Here is what I did:

  • make sheet: create the exercise sheet without the solutions
  • make solutions: create a document with only the solutions. Basically it uses your command \SolutionsOnly

My solution is also based on the package etoolbox. I use if statements depending on the argument of the Makefile.

After I merge the two documents. The problem: the page numbering is not right. The page numbering begins with 1 on the document with solutions, it should be one more than the last page of the exercise sheet.

Perhaps it can be solved manually, but in order to work for every documents, a command like \SolutionsEnd would be interesting to put all solutions at the end of the document.

There is something similar in the package exframe. You can have a look at the documentation on page 4:

exframe.pdf

Perhaps it could be interesting to implement something like

solution=position

in exercisebanksetup, where we could have the possibilities for position

  • none : without the solutions
  • only: only the solutions
  • end: all solutions at the end of the document

Or something you can think that make more sense.

@Strauman
Copy link
Owner

I'm confused? The problem is that the pagenumbering is wrong? How do I reproduce this?

@Vouivre
Copy link
Author

Vouivre commented Feb 24, 2019

You can't with only one compilation.

My goal: to have all exercises at the begin of the exercise sheet and all solutions at the end. I don't know how I can get such a document. So I produce two documents:

  • first document: all chosen exercises without the solutions. I save the document, let's say exercise_sheet.pdf The numbering begins with 1.
  • second document: all chosen exercises with the option \SolutionOnly. Of course the page numbering begin with 1. I save under the name exercise_sheet_solutions.pdf.

Then with a utility like pdfunite I merge the two documents. Of course the page numbering is wrong.

Perhaps other similar problems could arise, but it's my only example at the moment.

There is for sure a fix: there is probably a counter somewhere where I could set the page numbering when I compile the document with only the solutions. But:

  • I have to do it manually
  • it depends on the document

So I can't automate it for every documents.

Just tell me if something is not clear.

@Strauman
Copy link
Owner

Ah. It's kinda related to #3, which I decided not to do.
Because of the comments package, one cannot send arguments to the \begin{problem} environment. The alternative would be to do something with \nextproblem{solution=SOLNAME} and then have a \nextsolution{name=SOLNAME}. However, it would be very much work and would be incredibly slow. I don't really know how to fix this. But I'll keep it in the back of my mind.

@Strauman Strauman added the Feature request Request new functionalities and features label Feb 26, 2019
@Strauman
Copy link
Owner

Did you maybe consider using some perl-script to merge the LaTeX-files perhaps?

@Vouivre
Copy link
Author

Vouivre commented Feb 26, 2019

Ok, I see the problem. So the best is: keep it in your mind and if you get a solution in the future, you could implement it.

It's not a problem to merge the two files. On linux I can use pdfunite. The problem is how I can automate it. I will find a solution and perhaps it could be added in the documentation for the moment. It could interest other users. As soon as I have something, I'll tell you.

@Strauman
Copy link
Owner

Wait. No. You mean just printing the solutions at the end? That might actually be possible...

@Vouivre
Copy link
Author

Vouivre commented Mar 1, 2019

Take a look at the document I have sent to you. I want the same with the correct page numbering. I don't know exactly what you mean by printing the solutions .

@Strauman
Copy link
Owner

Strauman commented Mar 2, 2019

Wouldn't the following work?

\begin{document}
    \buildset{setName}
    \SolutionsOnly
    \buildset{setName}
\end{document}

@Vouivre
Copy link
Author

Vouivre commented Mar 3, 2019

Yes, after a first look it seems alright! I test is more extensively tomorrow I confirm you. By the way it seems there is still a problem with the spacing. But that's for another issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature request Request new functionalities and features
Projects
None yet
Development

No branches or pull requests

2 participants