Skip to content

Commit

Permalink
Fixed display of symbols (Labels) in LaTeX
Browse files Browse the repository at this point in the history
  • Loading branch information
samm82 committed Jul 18, 2019
1 parent 74abc73 commit 986ec35
Show file tree
Hide file tree
Showing 7 changed files with 518 additions and 518 deletions.
2 changes: 1 addition & 1 deletion code/drasil-printers/Language/Drasil/TeX/Print.hs
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ pExpr (Mtx a) = mkEnv "bmatrix" (pMatrix a)
pExpr (Row [x]) = br $ pExpr x -- FIXME: Hack needed for symbols with multiple subscripts, etc.
pExpr (Row l) = foldl1 (<>) (map pExpr l)
pExpr (Ident s) = pure . text $ s
pExpr (Label s) = pure . text $ s -- command "text" s
pExpr (Label s) = command "text" s
pExpr (Spec s) = pure . text $ unPL $ L.special s
--pExpr (Gr g) = unPL $ greek g
pExpr (Sub e) = pure unders <> br (pExpr e)
Expand Down
92 changes: 46 additions & 46 deletions code/stable/gamephys/SRS/Chipmunk_SRS.tex
Original file line number Diff line number Diff line change
Expand Up @@ -66,17 +66,17 @@ \subsection{Table of Symbols}
\endhead
$\mathbf{a}$ & Acceleration & $\frac{\text{m}}{\text{s}^{2}}$
\\
$\mathbf{a}(t)$ & Linear Acceleration & $\frac{\text{m}}{\text{s}^{2}}$
$\mathbf{a}\text{(}t\text{)}$ & Linear Acceleration & $\frac{\text{m}}{\text{s}^{2}}$
\\
${\mathbf{a}_{i}}$ & The I-Th Body's Acceleration & $\frac{\text{m}}{\text{s}^{2}}$
\\
${C_{R}}$ & Coefficient of restitution & --
\\
$\mathbf{F}$ & Force & N
\\
${\mathbf{F}_{1}}$ & Force exerted by the first body (on another body) & N
${\mathbf{F}_{\text{1}}}$ & Force exerted by the first body (on another body) & N
\\
${\mathbf{F}_{2}}$ & Force exerted by the second body (on another body) & N
${\mathbf{F}_{\text{2}}}$ & Force exerted by the second body (on another body) & N
\\
${\mathbf{F}_{i}}$ & Force Applied to the I-Th Body at Time T & N
\\
Expand All @@ -88,9 +88,9 @@ \subsection{Table of Symbols}
\\
$\mathbf{I}$ & Moment of inertia & kg$\text{m}^{2}$
\\
${\mathbf{I}_{A}}$ & Moment of Inertia Of Rigid Body A & kg$\text{m}^{2}$
${\mathbf{I}_{\text{A}}}$ & Moment of Inertia Of Rigid Body A & kg$\text{m}^{2}$
\\
${\mathbf{I}_{B}}$ & Moment of Inertia Of Rigid Body B & kg$\text{m}^{2}$
${\mathbf{I}_{\text{B}}}$ & Moment of Inertia Of Rigid Body B & kg$\text{m}^{2}$
\\
$\mathbf{J}$ & Impulse (vector) & Ns
\\
Expand All @@ -104,9 +104,9 @@ \subsection{Table of Symbols}
\\
$m$ & Mass & kg
\\
${m_{1}}$ & Mass of the first body & kg
${m_{\text{1}}}$ & Mass of the first body & kg
\\
${m_{2}}$ & Mass of the second body & kg
${m_{\text{2}}}$ & Mass of the second body & kg
\\
${m_{A}}$ & Mass Of Rigid Body A & kg
\\
Expand All @@ -120,15 +120,15 @@ \subsection{Table of Symbols}
\\
$\mathbf{p}$ & Position & m
\\
${\mathbf{p}_{CM}}$ & Center of Mass & m
${\mathbf{p}_{\text{CM}}}$ & Center of Mass & m
\\
${\mathbf{p}_{j}}$ & Position Vector of the J-Th Particle & m
\\
${r_{j}}$ & Distance Between the J-Th Particle and the Axis of Rotation & m
\\
$\mathbf{r}$ & Displacement & m
\\
$\mathbf{r}(t)$ & Linear Displacement & m
$\mathbf{r}\text{(}t\text{)}$ & Linear Displacement & m
\\
${\mathbf{r}_{OB}}$ & Displacement vector between the origin and point B & m
\\
Expand All @@ -142,15 +142,15 @@ \subsection{Table of Symbols}
\\
$Δ\mathbf{v}$ & Change in velocity & $\frac{\text{m}}{\text{s}}$
\\
$\mathbf{v}(t)$ & Linear Velocity & $\frac{\text{m}}{\text{s}}$
$\mathbf{v}\text{(}t\text{)}$ & Linear Velocity & $\frac{\text{m}}{\text{s}}$
\\
${\mathbf{v}^{AP}}$ & Velocity Of the Point of Collision P in Body A & $\frac{\text{m}}{\text{s}}$
\\
${\mathbf{v}^{BP}}$ & Velocity Of the Point of Collision P in Body B & $\frac{\text{m}}{\text{s}}$
\\
${\mathbf{v}_{1}}$ & Velocity Of the First Body & $\frac{\text{m}}{\text{s}}$
${\mathbf{v}_{\text{1}}}$ & Velocity Of the First Body & $\frac{\text{m}}{\text{s}}$
\\
${\mathbf{v}_{2}}$ & Velocity Of the Second Body & $\frac{\text{m}}{\text{s}}$
${\mathbf{v}_{\text{2}}}$ & Velocity Of the Second Body & $\frac{\text{m}}{\text{s}}$
\\
${\mathbf{v}_{A}}$ & Velocity At Point A & $\frac{\text{m}}{\text{s}}$
\\
Expand All @@ -164,15 +164,15 @@ \subsection{Table of Symbols}
\\
${\mathbf{v}_{O}}$ & Velocity At Point Origin & $\frac{\text{m}}{\text{s}}$
\\
$||\mathbf{n}||$ & Length of the Normal Vector & m
$\text{||}\mathbf{n}\text{||}$ & Length of the Normal Vector & m
\\
$||\mathbf{r}||$ & Euclidean norm of the displacement & m
$\text{||}\mathbf{r}\text{||}$ & Euclidean norm of the displacement & m
\\
$||{\mathbf{r}_{AP}}*\mathbf{n}||$ & Length of the Perpendicular Vector To the Contact Displacement Vector of Rigid Body A & m
$\text{||}{\mathbf{r}_{\text{A}P}}\text{*}\mathbf{n}\text{||}$ & Length of the Perpendicular Vector To the Contact Displacement Vector of Rigid Body A & m

This comment has been minimized.

Copy link
@JacquesCarette

JacquesCarette Jul 19, 2019

Owner

Ok, this is weird -- \text{A}P ?

This comment has been minimized.

Copy link
@samm82

samm82 Jul 19, 2019

Author Collaborator

Fixed in 24305e4 (note, there is an example of r_{\text{O}B}, since O represents the origin, and B represents some "point B").

\\
$||{\mathbf{r}_{BP}}*\mathbf{n}||$ & Length of the Perpendicular Vector To the Contact Displacement Vector of Rigid Body B & m
$\text{||}{\mathbf{r}_{\text{B}P}}\text{*}\mathbf{n}\text{||}$ & Length of the Perpendicular Vector To the Contact Displacement Vector of Rigid Body B & m
\\
${||\mathbf{r}||^{2}}$ & Squared distance & $\text{m}^{2}$
${\text{||}\mathbf{r}\text{||}^{\text{2}}}$ & Squared distance & $\text{m}^{2}$
\\
$α$ & Angular Acceleration & $\frac{\text{rad}}{\text{s}^{2}}$
\\
Expand Down Expand Up @@ -366,15 +366,15 @@ \subsubsection{Theoretical Models}
Label & Newton's third law of motion
\\ \midrule \\
Equation & \begin{displaymath}
{\mathbf{F}_{1}}=-{\mathbf{F}_{2}}
{\mathbf{F}_{\text{1}}}=-{\mathbf{F}_{\text{2}}}
\end{displaymath}
\\ \midrule \\
Description & \begin{symbDescription}
\item{${\mathbf{F}_{1}}$ is the force exerted by the first body (on another body) (N)}
\item{${\mathbf{F}_{2}}$ is the force exerted by the second body (on another body) (N)}
\item{${\mathbf{F}_{\text{1}}}$ is the force exerted by the first body (on another body) (N)}
\item{${\mathbf{F}_{\text{2}}}$ is the force exerted by the second body (on another body) (N)}
\end{symbDescription}
\\ \midrule \\
Notes & Every action has an equal and opposite reaction. In other words, the force ${\mathbf{F}_{1}}$ (N) exerted on the second rigid body by the first is equal in magnitude and in the opposite direction to the force ${\mathbf{F}_{2}}$ (N) exerted on the first rigid body by the second.
Notes & Every action has an equal and opposite reaction. In other words, the force ${\mathbf{F}_{\text{1}}}$ (N) exerted on the second rigid body by the first is equal in magnitude and in the opposite direction to the force ${\mathbf{F}_{\text{2}}}$ (N) exerted on the first rigid body by the second.
\\ \midrule \\
Source & --
\\ \midrule \\
Expand All @@ -393,20 +393,20 @@ \subsubsection{Theoretical Models}
Label & Newton's law of universal gravitation
\\ \midrule \\
Equation & \begin{displaymath}
\mathbf{F}=G \frac{{m_{1}} {m_{2}}}{||\mathbf{r}||^{2}} \mathbf{\hat{r}}=G \frac{{m_{1}} {m_{2}}}{||\mathbf{r}||^{2}} \frac{\mathbf{r}}{||\mathbf{r}||}
\mathbf{F}=G \frac{{m_{\text{1}}} {m_{\text{2}}}}{\text{||}\mathbf{r}\text{||}^{2}} \mathbf{\hat{r}}=G \frac{{m_{\text{1}}} {m_{\text{2}}}}{\text{||}\mathbf{r}\text{||}^{2}} \frac{\mathbf{r}}{\text{||}\mathbf{r}\text{||}}
\end{displaymath}
\\ \midrule \\
Description & \begin{symbDescription}
\item{$\mathbf{F}$ is the force (N)}
\item{$G$ is the gravitational constant ($\frac{\text{m}^{3}}{(\text{kg}\text{s}^{2})}$)}
\item{${m_{1}}$ is the mass of the first body (kg)}
\item{${m_{2}}$ is the mass of the second body (kg)}
\item{$||\mathbf{r}||$ is the Euclidean norm of the displacement (m)}
\item{${m_{\text{1}}}$ is the mass of the first body (kg)}
\item{${m_{\text{2}}}$ is the mass of the second body (kg)}
\item{$\text{||}\mathbf{r}\text{||}$ is the Euclidean norm of the displacement (m)}
\item{$\mathbf{\hat{r}}$ is the displacement unit vector (m)}
\item{$\mathbf{r}$ is the displacement (m)}
\end{symbDescription}
\\ \midrule \\
Notes & Two rigid bodies in the universe attract each other with a force $\mathbf{F}$ (N) that is directly proportional to the product of their masses, ${m_{1}}$ and ${m_{2}}$ (kg), and inversely proportional to the squared distance ${||\mathbf{r}||^{2}}$ ($\text{m}^{2}$) between them. The vector $\mathbf{r}$ (m) is the displacement between the centres of the rigid bodies and $||\mathbf{r}||$ (m) represents the Euclidean norm of the displacement, or absolute distance between the two. $\mathbf{\hat{r}}$ denotes the displacement unit vector, equivalent to the displacement divided by the Euclidean norm of the displacement, as shown above. Finally, $G$ is the gravitational constant (6.673 * 10E-11) ($\frac{\text{m}^{3}}{(\text{kg}\text{s}^{2})}$).
Notes & Two rigid bodies in the universe attract each other with a force $\mathbf{F}$ (N) that is directly proportional to the product of their masses, ${m_{\text{1}}}$ and ${m_{\text{2}}}$ (kg), and inversely proportional to the squared distance ${\text{||}\mathbf{r}\text{||}^{\text{2}}}$ ($\text{m}^{2}$) between them. The vector $\mathbf{r}$ (m) is the displacement between the centres of the rigid bodies and $\text{||}\mathbf{r}\text{||}$ (m) represents the Euclidean norm of the displacement, or absolute distance between the two. $\mathbf{\hat{r}}$ denotes the displacement unit vector, equivalent to the displacement divided by the Euclidean norm of the displacement, as shown above. Finally, $G$ is the gravitational constant (6.673 * 10E-11) ($\frac{\text{m}^{3}}{(\text{kg}\text{s}^{2})}$).
\\ \midrule \\
Source & --
\\ \midrule \\
Expand Down Expand Up @@ -487,16 +487,16 @@ \subsubsection{Data Definitions}
\\ \midrule \\
Label & Center of Mass
\\ \midrule \\
Symbol & ${\mathbf{p}_{CM}}$
Symbol & ${\mathbf{p}_{\text{CM}}}$
\\ \midrule \\
Units & m
\\ \midrule \\
Equation & \begin{displaymath}
{\mathbf{p}_{CM}}=\frac{\displaystyle\sum{{m_{j}} {\mathbf{p}_{j}}}}{M}
{\mathbf{p}_{\text{CM}}}=\frac{\displaystyle\sum{{m_{j}} {\mathbf{p}_{j}}}}{M}
\end{displaymath}
\\ \midrule \\
Description & \begin{symbDescription}
\item{${\mathbf{p}_{CM}}$ is the Center of Mass (m)}
\item{${\mathbf{p}_{\text{CM}}}$ is the Center of Mass (m)}
\item{${m_{j}}$ is the mass of the j-th particle (kg)}
\item{${\mathbf{p}_{j}}$ is the position vector of the j-th particle (m)}
\item{$M$ is the total mass of the rigid body (kg)}
Expand All @@ -521,16 +521,16 @@ \subsubsection{Data Definitions}
\\ \midrule \\
Label & Linear Displacement
\\ \midrule \\
Symbol & $\mathbf{r}(t)$
Symbol & $\mathbf{r}\text{(}t\text{)}$
\\ \midrule \\
Units & m
\\ \midrule \\
Equation & \begin{displaymath}
\mathbf{r}(t)=\frac{\,d\mathbf{p}\left(t\right)}{\,dt}
\mathbf{r}\text{(}t\text{)}=\frac{\,d\mathbf{p}\left(t\right)}{\,dt}
\end{displaymath}
\\ \midrule \\
Description & \begin{symbDescription}
\item{$\mathbf{r}(t)$ is the linear displacement (m)}
\item{$\mathbf{r}\text{(}t\text{)}$ is the linear displacement (m)}
\item{$t$ is the time (s)}
\item{$\mathbf{p}$ is the position (m)}
\end{symbDescription}
Expand All @@ -555,16 +555,16 @@ \subsubsection{Data Definitions}
\\ \midrule \\
Label & Linear Velocity
\\ \midrule \\
Symbol & $\mathbf{v}(t)$
Symbol & $\mathbf{v}\text{(}t\text{)}$
\\ \midrule \\
Units & $\frac{\text{m}}{\text{s}}$
\\ \midrule \\
Equation & \begin{displaymath}
\mathbf{v}(t)=\frac{\,d\mathbf{r}\left(t\right)}{\,dt}
\mathbf{v}\text{(}t\text{)}=\frac{\,d\mathbf{r}\left(t\right)}{\,dt}
\end{displaymath}
\\ \midrule \\
Description & \begin{symbDescription}
\item{$\mathbf{v}(t)$ is the linear velocity ($\frac{\text{m}}{\text{s}}$)}
\item{$\mathbf{v}\text{(}t\text{)}$ is the linear velocity ($\frac{\text{m}}{\text{s}}$)}
\item{$t$ is the time (s)}
\item{$\mathbf{r}$ is the displacement (m)}
\end{symbDescription}
Expand All @@ -589,16 +589,16 @@ \subsubsection{Data Definitions}
\\ \midrule \\
Label & Linear Acceleration
\\ \midrule \\
Symbol & $\mathbf{a}(t)$
Symbol & $\mathbf{a}\text{(}t\text{)}$
\\ \midrule \\
Units & $\frac{\text{m}}{\text{s}^{2}}$
\\ \midrule \\
Equation & \begin{displaymath}
\mathbf{a}(t)=\frac{\,d\mathbf{v}\left(t\right)}{\,dt}
\mathbf{a}\text{(}t\text{)}=\frac{\,d\mathbf{v}\left(t\right)}{\,dt}
\end{displaymath}
\\ \midrule \\
Description & \begin{symbDescription}
\item{$\mathbf{a}(t)$ is the linear acceleration ($\frac{\text{m}}{\text{s}^{2}}$)}
\item{$\mathbf{a}\text{(}t\text{)}$ is the linear acceleration ($\frac{\text{m}}{\text{s}^{2}}$)}
\item{$t$ is the time (s)}
\item{$\mathbf{v}$ is the velocity ($\frac{\text{m}}{\text{s}}$)}
\end{symbDescription}
Expand Down Expand Up @@ -730,7 +730,7 @@ \subsubsection{Data Definitions}
Units & Ns
\\ \midrule \\
Equation & \begin{displaymath}
j=\frac{-\left(1+{C_{R}}\right) {{\mathbf{v}_{i}}^{AB}}\cdot{}\mathbf{n}}{\left(\frac{1}{{m_{A}}}+\frac{1}{{m_{B}}}\right) ||\mathbf{n}||^{2}+\frac{||{\mathbf{r}_{AP}}*\mathbf{n}||^{2}}{{\mathbf{I}_{A}}}+\frac{||{\mathbf{r}_{BP}}*\mathbf{n}||^{2}}{{\mathbf{I}_{B}}}}
j=\frac{-\left(1+{C_{R}}\right) {{\mathbf{v}_{i}}^{AB}}\cdot{}\mathbf{n}}{\left(\frac{1}{{m_{A}}}+\frac{1}{{m_{B}}}\right) \text{||}\mathbf{n}\text{||}^{2}+\frac{\text{||}{\mathbf{r}_{\text{A}P}}\text{*}\mathbf{n}\text{||}^{2}}{{\mathbf{I}_{\text{A}}}}+\frac{\text{||}{\mathbf{r}_{\text{B}P}}\text{*}\mathbf{n}\text{||}^{2}}{{\mathbf{I}_{\text{B}}}}}
\end{displaymath}
\\ \midrule \\
Description & \begin{symbDescription}
Expand All @@ -740,11 +740,11 @@ \subsubsection{Data Definitions}
\item{$\mathbf{n}$ is the collision normal vector (m)}
\item{${m_{A}}$ is the mass of rigid body A (kg)}
\item{${m_{B}}$ is the mass of rigid body B (kg)}
\item{$||\mathbf{n}||$ is the length of the normal vector (m)}
\item{$||{\mathbf{r}_{AP}}*\mathbf{n}||$ is the length of the perpendicular vector to the contact displacement vector of rigid body A (m)}
\item{${\mathbf{I}_{A}}$ is the moment of inertia of rigid body A (kg$\text{m}^{2}$)}
\item{$||{\mathbf{r}_{BP}}*\mathbf{n}||$ is the length of the perpendicular vector to the contact displacement vector of rigid body B (m)}
\item{${\mathbf{I}_{B}}$ is the moment of inertia of rigid body B (kg$\text{m}^{2}$)}
\item{$\text{||}\mathbf{n}\text{||}$ is the length of the normal vector (m)}
\item{$\text{||}{\mathbf{r}_{\text{A}P}}\text{*}\mathbf{n}\text{||}$ is the length of the perpendicular vector to the contact displacement vector of rigid body A (m)}
\item{${\mathbf{I}_{\text{A}}}$ is the moment of inertia of rigid body A (kg$\text{m}^{2}$)}
\item{$\text{||}{\mathbf{r}_{\text{B}P}}\text{*}\mathbf{n}\text{||}$ is the length of the perpendicular vector to the contact displacement vector of rigid body B (m)}
\item{${\mathbf{I}_{\text{B}}}$ is the moment of inertia of rigid body B (kg$\text{m}^{2}$)}
\end{symbDescription}
\\ \midrule \\
Notes & \hyperref[assumpOT]{A: objectTy}
Expand Down Expand Up @@ -967,11 +967,11 @@ \subsubsection{Data Definitions}
\end{displaymath}
Rearranging :
\begin{displaymath}
\int_{{t_{1}}}^{{t_{2}}}{\mathbf{F}}\,dt=m \left(\int_{{\mathbf{v}_{1}}}^{{\mathbf{v}_{2}}}{1}\,d\mathbf{v}\right)
\int_{{t_{\text{1}}}}^{{t_{\text{2}}}}{\mathbf{F}}\,dt=m \left(\int_{{\mathbf{v}_{\text{1}}}}^{{\mathbf{v}_{\text{2}}}}{1}\,d\mathbf{v}\right)
\end{displaymath}
Integrating the right hand side :
\begin{displaymath}
\int_{{t_{1}}}^{{t_{2}}}{\mathbf{F}}\,dt=m {\mathbf{v}_{2}}-m {\mathbf{v}_{1}}=m Δ\mathbf{v}
\int_{{t_{\text{1}}}}^{{t_{\text{2}}}}{\mathbf{F}}\,dt=m {\mathbf{v}_{\text{2}}}-m {\mathbf{v}_{\text{1}}}=m Δ\mathbf{v}
\end{displaymath}
\par~

Expand Down
Loading

1 comment on commit 986ec35

@JacquesCarette
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I only spotted one thing that seemed weird (the hack is a different issue), otherwise this looks great.

Please sign in to comment.