Code: Select all
\newenvironment{question}{\itshape}{}
\newenvironment{solution}{\\[2mm]\marginnote{-}}{}Code: Select all
\begin{question}
Question?
\end{question}\begin{solution}
Answer
\end{solution}Code: Select all
\newenvironment{question}{\itshape}{}
\newenvironment{solution}{\\[2mm]\marginnote{-}}{}Code: Select all
\begin{question}
Question?
\end{question}\begin{solution}
Answer
\end{solution}Learn LaTeX easily with newest books:
The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis
The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more
LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis
Thank you very much for your answer. I'm new to LaTeX and I'm impressed by the amount of possibilities. It seems there is a package for just about everything. However in this case, I don't think the examdesign package will solve the problem with the misaligned text in the margin (which is by the way just a small marker to assist the lecturer in quickly finding the sample solutions).localghost wrote:The examdesign class (or related packages) may be better for this purpose.
Here you are:localghost wrote:I think at this point a minimal working example (MWE) is necessary just to see what you are doing. But I won't be able to look at it until after the Xmas holidays.
Code: Select all
\documentclass[11pt,a4paper,fleqn]{article}
\usepackage[latin1]{inputenc}
\usepackage[english]{babel}
\usepackage[T1]{fontenc}
\usepackage{marginnote}
\setlength{\parindent}{0em}
\reversemarginpar
\newenvironment{question}{\itshape}{}
\newenvironment{solution}{\\\marginnote{->}}{}
\begin{document}
\begin{question}
Question
\end{question}\begin{solution}
Solution with correctly aligned marker on the left
\end{solution}\\
\begin{question}
Question
\end{question}\begin{solution}
\begin{enumerate}
\item The marker should be at the same vertical position like this text
\end{enumerate}
\end{solution}
\end{document} Learn LaTeX easily with newest books:
The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis
The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more
LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis