ORMCbox fix

This commit is contained in:
Mark 2024-01-31 09:28:49 -08:00
parent 4dd9645738
commit 36a5556804
Signed by: Mark
GPG Key ID: C6D63995FE72FD80
2 changed files with 54 additions and 44 deletions

View File

@ -47,7 +47,7 @@ However, \texttt{0} and \texttt{1} aren't the only states a qubit may have.
We'll make sense of quantum bits by extending the \say{vectored} bit representation we developed in the previous section. We'll make sense of quantum bits by extending the \say{vectored} bit representation we developed in the previous section.
First, let's look at a diagram we drew a few pages ago: First, let's look at a diagram we drew a few pages ago:
\begin{timetravel} \begin{ORMCbox}{Time Travel (Page 2)}{black!10!white}{black!65!white}
A classical bit takes states in $\{\texttt{0}, \texttt{1}\}$, picking one at a time. \par A classical bit takes states in $\{\texttt{0}, \texttt{1}\}$, picking one at a time. \par
We'll represent \texttt{0} and \texttt{1} as perpendicular unit vectors $\ket{0}$ and $\ket{1}$, We'll represent \texttt{0} and \texttt{1} as perpendicular unit vectors $\ket{0}$ and $\ket{1}$,
show below. show below.
@ -72,7 +72,7 @@ First, let's look at a diagram we drew a few pages ago:
The point marked $1$ is at $[0, 1]$. It is no parts $\ket{0}$, and all parts $\ket{1}$. \par The point marked $1$ is at $[0, 1]$. It is no parts $\ket{0}$, and all parts $\ket{1}$. \par
Of course, we can say something similar about the point marked $0$: \par Of course, we can say something similar about the point marked $0$: \par
It is at $[1, 0] = (1 \times \ket{0}) + (0 \times \ket{1})$, and is thus all $\ket{0}$ and no $\ket{1}$. \par It is at $[1, 0] = (1 \times \ket{0}) + (0 \times \ket{1})$, and is thus all $\ket{0}$ and no $\ket{1}$. \par
\end{timetravel} \end{ORMCbox}
The diagram in the box above can also be used to describe the state of a qubit. \par The diagram in the box above can also be used to describe the state of a qubit. \par
Like classical bits, qubits have the \textit{basis states} $\ket{0}$ and $\ket{1}$. \par Like classical bits, qubits have the \textit{basis states} $\ket{0}$ and $\ket{1}$. \par

View File

@ -643,9 +643,8 @@
% Make a box environment. % Make a box environment.
% These can safely be nested. % These can safely be nested.
% Args: name, title, back color, frame color. % Args: title, back color, frame color.
\newcommand{\@makeORMCbox}[4]{ \newenvironment{ORMCbox}[3]{
\newenvironment{#1}{
% \linehack draws a line across a tcolorbox. % \linehack draws a line across a tcolorbox.
% tcolorbox only supports two sections, but % tcolorbox only supports two sections, but
% this hack allows us to have more. % this hack allows us to have more.
@ -655,7 +654,7 @@
(0, 0) -- (0, 0) --
(\linewidth, 0); (\linewidth, 0);
\draw[color=#4, dashed, dash phase=1mm] \draw[color=#3, dashed, dash phase=1mm]
(0 - \kvtcb@leftlower-\kvtcb@boxsep, 0) -- (0 - \kvtcb@leftlower-\kvtcb@boxsep, 0) --
(\linewidth + \kvtcb@rightlower + \kvtcb@boxsep, 0); (\linewidth + \kvtcb@rightlower + \kvtcb@boxsep, 0);
\end{tikzpicture} \par \end{tikzpicture} \par
@ -664,33 +663,44 @@
% Keep track of the current background color. % Keep track of the current background color.
% Useful for transparent tikz drawings. % Useful for transparent tikz drawings.
\def\ORMCbgcolor{#3} \def\ORMCbgcolor{#2}
\begin{tcolorbox}[ \begin{tcolorbox}[
enhanced, enhanced,
breakable, breakable,
colback=#3, colback=#2,
colframe=#4, colframe=#3,
colbacktitle=#4, colbacktitle=#3,
titlerule=0.6mm, titlerule=0.6mm,
title={\textbf{#2}}, title={\textbf{#1}},
title after break={\textbf{#2 (continued)}}, title after break={\textbf{#1 (continued)}},
frame style={draw=none,fill=none}, frame style={draw=none,fill=none},
boxrule=0mm, % We need this even with hidden borders for correct spacing boxrule=0mm, % We need this even with hidden borders for correct spacing
arc=0mm, arc=0mm,
outer arc=0mm outer arc=0mm
] ]
\raggedright \raggedright
} { } {
\end{tcolorbox} \end{tcolorbox}
}
} }
\@makeORMCbox{examplesolution}{Example Solution}{black!10!white}{black!65!white} \newenvironment{examplesolution}{
\begin{ORMCbox}{Example Solution}{black!10!white}{black!65!white}
} {
\end{ORMCbox}
}
\if@solutions \if@solutions
\@makeORMCbox{solution}{Solution}{ored!10!white}{ored} \newenvironment{solution}{
\@makeORMCbox{instructornote}{Note for Instructors}{ocyan!10!white}{ocyan} \begin{ORMCbox}{Solution}{ored!10!white}{ored}
} {
\end{ORMCbox}
}
\newenvironment{instructornote}{
\begin{ORMCbox}{Note for Instructors}{ocyan!10!white}{ocyan}
} {
\end{ORMCbox}
}
\else \else
\excludecomment{solution} \excludecomment{solution}
\excludecomment{instructornote} \excludecomment{instructornote}