4

Considering that some of my students, especially first year students (14 years old) are not able to simplify units of measure and find the final unit of measure, is it possible to create an automatic tool simplification with siunitx package (with animation bar, forward, backward, pause, etc.)?

For example:

kg × N/kg = kg ; W × s = J

I have not any idea.

Sebastiano
  • 54,118

1 Answers1

2

First Version


This is just quick and dirty, sorry, I am too busy today. I hope a real pro can take it from here. View in Adobe Reader!

\documentclass{article}

\usepackage{animate}

\begin{document}

\begin{animateinline}[controls]{2} % The "2" controls the speed. Othe options are "autoplay" or "loop".
  % First frame
  \makebox[20mm][l]{kg x N/kg} % makebox to reserve space
\newframe   
  % Second Frame
  \makebox[20mm][l]{kg}                   
\end{animateinline}

\end{document}

enter image description here enter image description here

Update 1


Hi! I added some more examples, again, view in Adobe Reader! An "issue" is that you have to make sure that the first frame reserves the right amount of space. Therefore I use \strut but this is not always enough. Alternatively, you can use \vphantom, see the linked question/answer in the code for a more detailed explanation.

As you can tell from my code, I do not hold a CS degree :). This is a rather manual approach (hence my first name: Manuel :)).

\documentclass{article}

\usepackage{animate} \usepackage{cancel} \usepackage{xfrac} \usepackage{siunitx}

% See https://tex.stackexchange.com/questions/81835 for more details. \begin{document}

\section*{Example 1} \begin{animateinline}[controls, step]{2} \makebox[40mm][l]{\strut Step 1: kg x N/kg} \newframe
\makebox[40mm][l]{\strut Step 2: \bcancel{kg} x N/\bcancel{kg} = N}
\newframe
\makebox[40mm][l]{\strut Step 3: N}
\end{animateinline}

\section*{Example 2} \begin{animateinline}[controls, step]{2} \makebox[40mm][l]{\strut Step 1: W x s} \newframe
\makebox[40mm][l]{\strut Step 2: W x s = J}
\end{animateinline}

\section*{Example 3 (\texttt{siunitx} and \texttt{xfrac, sfrac})} \begin{animateinline}[controls, step]{2} \makebox[40mm][l]{\strut Step 1: $\si{kg}\times \sfrac{\si{\newton}}{\si{\kilo\gram}}$} \newframe
\makebox[40mm][l]{\strut Step 2: $\bcancel{\si{\kilo\gram}}\times \sfrac{\si{\newton}}{\bcancel{\si{\kilo\gram}}}$} \newframe
\makebox[40mm][l]{\strut Step 3: $\si{\newton}$}
\end{animateinline}

\end{document}

enter image description here