Skip to content

Commit

Permalink
Reference table in text
Browse files Browse the repository at this point in the history
  • Loading branch information
henrikt-ma committed Oct 19, 2020
1 parent 677fa89 commit 10f165e
Showing 1 changed file with 12 additions and 14 deletions.
26 changes: 12 additions & 14 deletions chapters/annotations.tex
Expand Up @@ -228,23 +228,11 @@ \subsubsection{Escape sequences}\label{text-markup-escape-sequences}

\subsubsection{Variable Replacements}\label{variable-replacements}

In most places where text for display is defined the final value of a result
variable can be embedded by refering to the variable as
\lstinline!%{inertia1.w}!. This is similar to the \lstinline!Text! graphical primitive
in \cref{text}.

In \lstinline!%{$\mathit{variable}$}!, text markup escape sequences don't apply inside the $\mathit{variable}$, which has the form of \lstinline[language=grammar]!component-reference! in the grammar (\cref{expressions1}). This means that a complete \lstinline[language=grammar]!component-reference! shall be scanned before looking for the terminating closing brace.

\begin{example}
The variable replacement \lstinline!%{'%%'}! references the variable \lstinline!'%%'!, not the variable \lstinline!'%'!.
\end{example}

\begin{example}
The variable replacement \lstinline!%{foo . '}bar{'}! makes a valid reference to the variable\linebreak[4] \lstinline!foo.'}bar{'!.
\end{example}
In the places listed in \cref{attributes-with-variable-replacements} where text for display is defined, the final value of a result variable can be embedded by refering to the variable as \lstinline!%{inertia1.w}!. This is similar to the \lstinline!Text! graphical primitive in \cref{text}.

\begin{table}[H]
\caption{Attributes that can use variable replacements.}
\label{attributes-with-variable-replacements}
\begin{center}
\begin{tabular}{l l}
\hline
Expand All @@ -260,6 +248,16 @@ \subsubsection{Variable Replacements}\label{variable-replacements}
\end{center}
\end{table}

In \lstinline!%{$\mathit{variable}$}!, text markup escape sequences don't apply inside the $\mathit{variable}$, which has the form of \lstinline[language=grammar]!component-reference! in the grammar (\cref{expressions1}). This means that a complete \lstinline[language=grammar]!component-reference! shall be scanned before looking for the terminating closing brace.

\begin{example}
The variable replacement \lstinline!%{'%%'}! references the variable \lstinline!'%%'!, not the variable \lstinline!'%'!.
\end{example}

\begin{example}
The variable replacement \lstinline!%{foo . '}bar{'}! makes a valid reference to the variable\linebreak[4] \lstinline!foo.'}bar{'!.
\end{example}

Note that expansion to the final value means that expansion is not restricted to
parameters and constants, so that values to be shown in a caption can be
determined during simulation.
Expand Down

0 comments on commit 10f165e

Please sign in to comment.