LaTeX forum ⇒ Theses, Books, Title pageslegrand-orange-book: make textbook exercise answer key

Classicthesis, Bachelor and Master thesis, PhD, Doctoral degree
Posts: 9
Joined: Mon Feb 05, 2018 5:11 am

legrand-orange-book: make textbook exercise answer key

Postby kinseikun » Thu Feb 08, 2018 11:38 pm


It's me again.

I am almost finished creating a 300 page textbook, and I should probably make an answer key. Most of the exercises throughout the book use a (I believe) special code for exercises that is specific to this template. I am using \begin{exercise} blah blah \end{exercise} from the template.

So this question is for anyone familiar with this specific template--would it be possible to create a corresponding "answer" function where I can type the answer, but it will not show in the student textbook, but create a new answer key containing only the exercises and their answers that I could print out / distribute separately? Possibly into another .tex file?

I know there is an "exercise" package, but I believe it would clash with the already existing exercise environment made in the template. Also...please don't make me redo 300 pages worth of document...please...

I am a mere English teacher and I don't even know how I survived the LaTeX that I did to create this monster. Please help! Thanks :)


User avatar
Site Moderator
Posts: 458
Joined: Fri Jun 29, 2012 1:20 am

Postby Vel » Sun Feb 11, 2018 8:10 am


You could always make a new document using the template which contains just the exercises and answers. If you'd like the answers to be styled differently, find where the exercise style is defined, clone it and modify it to look how you'd like.

Founder and administrator of and

User avatar
Site Moderator
Posts: 1993
Joined: Sat Apr 16, 2011 7:27 pm

Postby cgnieder » Wed Feb 14, 2018 6:33 pm

Why not copy all exercises
Code: [Select all] [Expand/Collapse] [Download] ({untitled.tex})
  1. \begin{exercise}
  2. This is a good place to ask a question to test learning progress or further cement ideas into students' minds.
  3. \end{exercise}

from your main document into a new document where you can use exercise or xsim or whatever to print the exercises and their solutions with a different document class?

It is possible to make the legrand orange book work with the xsim package (albeit it requires some work) which would enable you to use its power for the book. But this still wouldn't solve the problem of having an exercise/solution-only document and possible require the same work again.

One could imagine some kind of “database” of exercises in a separate file where both the book and the exercise document include the exercises from but given that you have a finished book I'm not sure this is worth the effort…
site moderator & package author

Return to “Theses, Books, Title pages”

Who is online

Users browsing this forum: No registered users and 2 guests