diff --git a/chapters/arrays.tex b/chapters/arrays.tex index 87959228c..dccce5718 100644 --- a/chapters/arrays.tex +++ b/chapters/arrays.tex @@ -789,7 +789,7 @@ \section{Array Indexing}\doublelabel{array-indexing} dimension index bounds (\autoref{array-dimension-lower-and-upper-index-bounds}). The indexing operator takes two or more operands, where the first operand is the array to be indexed and the rest of the operands are index expressions: -\lstinline!$\mathit{arrayname}$[$\mathit{indexexpr}_{1}$, $\mathit{indexexpr}_{2}$, $\ldots$]! +\lstinline[mathescape=true]!$\mathit{arrayname}$[$\mathit{indexexpr}_{1}$, $\mathit{indexexpr}_{2}$, $\ldots$]! A colon is used to denote all indices of one dimension. A vector expression can be used to pick out selected rows, columns and elements diff --git a/chapters/functions.tex b/chapters/functions.tex index a303b840d..1d0a945a4 100644 --- a/chapters/functions.tex +++ b/chapters/functions.tex @@ -890,7 +890,7 @@ \subsection{Scalar Functions Applied to Array Arguments}\doublelabel{scalar-func If the argument is not a foreach argument, it is used as-is. \item If the argument is a foreach argument, the element at index - \lstinline![i, $\ldots$, j]! is used. + \lstinline[mathescape=true]![i, $\ldots$, j]! is used. \end{itemize} \end{enumerate} @@ -1620,8 +1620,8 @@ \section{Declaring Inverses of Functions}\doublelabel{declaring-inverses-of-func Several inverses are separated by commas. \begin{nonnormative} -The inverse requires that for all valid values of the input arguments of \lstinline!$f_2$(..., y, ...)! and $u_k$ being calculated as \lstinline!$u_k$ := $f_2$(..., y, ...)! implies -the equality \lstinline!y = $f_1$(..., $u_k$, ...,)! up to a certain precision. +The inverse requires that for all valid values of the input arguments of \lstinline[mathescape=true]!$f_2$(..., y, ...)! and $u_k$ being calculated as \lstinline[mathescape=true]!$u_k$ := $f_2$(..., y, ...)! implies +the equality \lstinline[mathescape=true]!y = $f_1$(..., $u_k$, ...,)! up to a certain precision. \end{nonnormative} Function $f_1$ can have any number and types of formal @@ -1885,14 +1885,14 @@ \subsubsection{Arrays}\doublelabel{arrays-1} \tablehead{Modelica} & \tablehead{C}\\ \hline & \tablehead{Input and Output}\\ \hline \endhead -\lstinline!T[$\textit{dim}_{1}$]! & -\lstinline[language=C]!T' *, size_t $\textit{dim}_{1}$! +\lstinline[mathescape=true]!T[$\textit{dim}_{1}$]! & +\lstinline[mathescape=true,language=C]!T' *, size_t $\textit{dim}_{1}$! \\ \hline -\lstinline!T[$\textit{dim}_{1}$, $\textit{dim}_{2}$]! & -\lstinline[language=C]!T' *, size_t $\textit{dim}_{1}$, size_t$\textit{dim}_{2}$! +\lstinline[mathescape=true]!T[$\textit{dim}_{1}$, $\textit{dim}_{2}$]! & +\lstinline[mathescape=true,language=C]!T' *, size_t $\textit{dim}_{1}$, size_t$\textit{dim}_{2}$! \\ \hline -\lstinline!T[$\textit{dim}_{1}$, $\ldots$, $\textit{dim}_{n}$]! & -\lstinline[language=C]!T' *, size_t $\textit{dim}_{1}$, $\ldots$, size_t $\textit{dim}_{n}$! +\lstinline[mathescape=true]!T[$\textit{dim}_{1}$, $\ldots$, $\textit{dim}_{n}$]! & +\lstinline[mathescape=true,language=C]!T' *, size_t $\textit{dim}_{1}$, $\ldots$, size_t $\textit{dim}_{n}$! \\ \hline \end{longtable} @@ -1909,14 +1909,14 @@ \subsubsection{Arrays}\doublelabel{arrays-1} \tablehead{Modelica} & \tablehead{FORTRAN~77}\\ \hline & \tablehead{Input and Output}\\ \hline \endhead -\lstinline!T[$\textit{dim}_{1}$]! & -\lstinline[language=FORTRAN77]!T', INTEGER $\textit{dim}_{1}$! +\lstinline[mathescape=true]!T[$\textit{dim}_{1}$]! & +\lstinline[mathescape=true,language=FORTRAN77]!T', INTEGER $\textit{dim}_{1}$! \\ \hline -\lstinline!T[$\textit{dim}_{1}$, $\textit{dim}_{2}$]! & -\lstinline[language=FORTRAN77]!T', INTEGER $\textit{dim}_{1}$, INTEGER $\textit{dim}_{2}$! +\lstinline[mathescape=true]!T[$\textit{dim}_{1}$, $\textit{dim}_{2}$]! & +\lstinline[mathescape=true,language=FORTRAN77]!T', INTEGER $\textit{dim}_{1}$, INTEGER $\textit{dim}_{2}$! \\ \hline -\lstinline!T[$\textit{dim}_{1}$, $\ldots$, $\textit{dim}_{n}$]! & -\lstinline[language=FORTRAN77]!T', INTEGER $\textit{dim}_{1}$, $\ldots$, INTEGER $\textit{dim}_{n}$! +\lstinline[mathescape=true]!T[$\textit{dim}_{1}$, $\ldots$, $\textit{dim}_{n}$]! & +\lstinline[mathescape=true,language=FORTRAN77]!T', INTEGER $\textit{dim}_{1}$, $\ldots$, INTEGER $\textit{dim}_{n}$! \\ \hline \end{longtable} diff --git a/chapters/operatorsandexpressions.tex b/chapters/operatorsandexpressions.tex index cc8f0b0b5..f384f11cd 100644 --- a/chapters/operatorsandexpressions.tex +++ b/chapters/operatorsandexpressions.tex @@ -55,11 +55,11 @@ \section{Operator Precedence and Associativity}\doublelabel{operator-precedence- \tablehead{Operator Group} & \tablehead{Operator Syntax} & \tablehead{Examples}\\ \hline postfix array index operator & \lstinline![]! & \lstinline!arr[index]! \\ \hline postfix access operator & \lstinline!.! & \lstinline!a.b! \\ \hline -postfix function call & \lstinline!$\mathit{funcName}$($\mathit{functionArguments}$)! & \lstinline!sin(4.36)! \\ \hline +postfix function call & \lstinline[mathescape=true]!$\mathit{funcName}$($\mathit{functionArguments}$)! & \lstinline!sin(4.36)! \\ \hline array construct/concat & \begin{tabular}{@{}p{5cm}@{}} -\lstinline!{$\mathit{expressions}$}!\\ -\lstinline![$\mathit{expressions}$]!\\ -\lstinline![$\mathit{expressions}$; $\mathit{expressions}$...]! +\lstinline[mathescape=true]!{$\mathit{expressions}$}!\\ +\lstinline[mathescape=true]![$\mathit{expressions}$]!\\ +\lstinline[mathescape=true]![$\mathit{expressions}$; $\mathit{expressions}$...]! \end{tabular} & \begin{tabular}{@{}p{5cm}@{}} \lstinline!{2,3}! \\ \lstinline![5,6]! \\ @@ -70,21 +70,21 @@ \section{Operator Precedence and Associativity}\doublelabel{operator-precedence- \lstinline!2*3!, \lstinline!2/3! \\ \lstinline![1,2;3,4].*[2,3;5,6]! \end{tabular} \\ \hline -additive and array elementwise additive & \lstinline!+ - +$\mathit{expr}$ -$\mathit{expr}$ .+ .-! & \lstinline![1,2;3,4].+[2,3;5,6]!\\ \hline +additive and array elementwise additive & \lstinline[mathescape=true]!+ - +$\mathit{expr}$ -$\mathit{expr}$ .+ .-! & \lstinline![1,2;3,4].+[2,3;5,6]!\\ \hline relational & \lstinline!< <= > >= == <>! & \lstinline!ab!, \ldots\\ \hline -unary negation & \lstinline!not $\mathit{expr}$! & \lstinline!not b1! \\ \hline +unary negation & \lstinline[mathescape=true]!not $\mathit{expr}$! & \lstinline!not b1! \\ \hline logical and & \lstinline!and! & \lstinline!b1 and b2! \\ \hline logical or & \lstinline!or! & \lstinline!b1 or b2!\\ \hline array range & \begin{tabular}{@{}p{5cm}@{}} -\lstinline!$\mathit{expr}$ : $\mathit{expr}$! \\ -\lstinline!$\mathit{expr}$ : $\mathit{expr}$ : $\mathit{expr}$! +\lstinline[mathescape=true]!$\mathit{expr}$ : $\mathit{expr}$! \\ +\lstinline[mathescape=true]!$\mathit{expr}$ : $\mathit{expr}$ : $\mathit{expr}$! \end{tabular} & \begin{tabular}{@{}p{5cm}@{}} \lstinline!1:5! \\ \lstinline!start:step:stop! \end{tabular} \\ \hline -conditional & \lstinline!if $\mathit{expr}$ then $\mathit{expr}$ else $\mathit{expr}$! & \lstinline!if b then 3 else x!\\ \hline -named argument & \lstinline!$\mathit{ident}$ = $\mathit{expr}$! & \lstinline!x = 2.26!\\ \hline +conditional & \lstinline[mathescape=true]!if $\mathit{expr}$ then $\mathit{expr}$ else $\mathit{expr}$! & \lstinline!if b then 3 else x!\\ \hline +named argument & \lstinline[mathescape=true]!$\mathit{ident}$ = $\mathit{expr}$! & \lstinline!x = 2.26!\\ \hline \end{tabular} \end{table} @@ -274,11 +274,11 @@ \subsection{String Concatenation}\doublelabel{string-concatenation} \subsection{Array Constructor Operator}\doublelabel{array-constructor-operator} -The array constructor operator \lstinline!{ $\ldots$ }! is described in \autoref{vector-matrix-and-array-constructors}. +The array constructor operator \lstinline[mathescape=true]!{ $\ldots$ }! is described in \autoref{vector-matrix-and-array-constructors}. \subsection{Array Concatenation Operator}\doublelabel{array-concatenation-operator} -The array concatenation operator \lstinline![ $\ldots$ ]! is described in \autoref{array-concatenation}. +The array concatenation operator \lstinline[mathescape=true]![ $\ldots$ ]! is described in \autoref{array-concatenation}. \subsection{Array Range Operator}\doublelabel{array-range-operator} diff --git a/chapters/overloaded.tex b/chapters/overloaded.tex index 3cdf70d57..7efb1fa46 100644 --- a/chapters/overloaded.tex +++ b/chapters/overloaded.tex @@ -180,7 +180,7 @@ \section{Overloaded Constructors}\doublelabel{overloaded-constructors} \section{Overloaded String Conversions}\doublelabel{overloaded-string-conversions} -Consider an expression \lstinline!String($A_1$, $a_{2}$, $\ldots$, $a_{k}$, $b_{1}$=$w_{1}$, $\ldots$, $b_{p}$=$w_{p}$)!, +Consider an expression \lstinline[mathescape=true]!String($A_1$, $a_{2}$, $\ldots$, $a_{k}$, $b_{1}$=$w_{1}$, $\ldots$, $b_{p}$=$w_{p}$)!, $k \ge 1$ where $A_1$ is an element of class \lstinline!A!. \begin{enumerate} @@ -191,11 +191,11 @@ \section{Overloaded String Conversions}\doublelabel{overloaded-string-conversion \item If \lstinline!A! is an operator record class and there exists a unique function $f$ in \lstinline!A.'String'! such that - \lstinline!A.'String'.$f$($A_1$, $a_{2}$, $\ldots$, $a_{k}$, $b_{1}$=$w_{1}$, $\ldots$, $b_{p}$=$w_{p}$)! + \lstinline[mathescape=true]!A.'String'.$f$($A_1$, $a_{2}$, $\ldots$, $a_{k}$, $b_{1}$=$w_{1}$, $\ldots$, $b_{p}$=$w_{p}$)! is a valid match for $f$, then - \lstinline!String($A_1$, $a_{2}$, $\ldots$, $a_{k}$, $b_{1}$=$w_{1}$, $\ldots$, $b_{p}$=$w_{p}$)! + \lstinline[mathescape=true]!String($A_1$, $a_{2}$, $\ldots$, $a_{k}$, $b_{1}$=$w_{1}$, $\ldots$, $b_{p}$=$w_{p}$)! is evaluated to\\ - \lstinline!A.'String'.$f$($A_1$, $a_{2}$, $\ldots$, $a_{k}$, $b_{1}$=$w_{1}$, $\ldots$, $b_{p}$=$w_{p}$)!. + \lstinline[mathescape=true]!A.'String'.$f$($A_1$, $a_{2}$, $\ldots$, $a_{k}$, $b_{1}$=$w_{1}$, $\ldots$, $b_{p}$=$w_{p}$)!. \item Otherwise the expression is erroneous. \end{enumerate} @@ -217,7 +217,7 @@ \section{Overloaded String Conversions}\doublelabel{overloaded-string-conversion \section{Overloaded Binary Operations}\doublelabel{overloaded-binary-operations} Let $\mathit{op}$ denote a binary operator and consider an expression -\lstinline!a $\mathit{op}$ b! where \lstinline!a! is an instance or array of instances of +\lstinline[mathescape=true]!a $\mathit{op}$ b! where \lstinline!a! is an instance or array of instances of class \lstinline!A! and \lstinline!b! is an instance or array of instances of class \lstinline!B!. @@ -247,7 +247,7 @@ \section{Overloaded Binary Operations}\doublelabel{overloaded-binary-operations} gives the unique match. If the sum of the sizes is larger than one it is an error. \begin{nonnormative} - Informally, this means: If there is no direct match of \lstinline!a $\mathit{op}$ b!, then it is tried to find a direct match by automatic type casts + Informally, this means: If there is no direct match of \lstinline[mathescape=true]!a $\mathit{op}$ b!, then it is tried to find a direct match by automatic type casts of \lstinline!a! or \lstinline!b!, by converting either \lstinline!a! or \lstinline!b! to the needed type using an appropriate constructor function from one of the operator record classes used as arguments of the overloaded \lstinline!op! @@ -310,8 +310,8 @@ \section{Overloaded Binary Operations}\doublelabel{overloaded-binary-operations} \section{Overloaded Unary Operations}\doublelabel{overloaded-unary-operations} Let $\mathit{op}$ denote a unary operator and consider an expression -\lstinline!$\mathit{op}$ a! where \lstinline!a! is an instance or array of instances of class -\lstinline!A!. Then \lstinline!$\mathit{op}$ a! is evaluated in the following way. +\lstinline[mathescape=true]!$\mathit{op}$ a! where \lstinline!a! is an instance or array of instances of class +\lstinline!A!. Then \lstinline[mathescape=true]!$\mathit{op}$ a! is evaluated in the following way. \begin{enumerate} \item diff --git a/chapters/packages.tex b/chapters/packages.tex index 6054a18c7..24c8752d9 100644 --- a/chapters/packages.tex +++ b/chapters/packages.tex @@ -63,15 +63,15 @@ \subsection{Importing Definitions from a Package}\doublelabel{importing-definiti %TODO-FORMAT Should be formatted using tabs or tabular? An \lstinline!import!-clause can occur in one of the following five syntactic forms: -\lstinline!import $\mathit{packagename}$;! (qualified import) +\lstinline[mathescape=true]!import $\mathit{packagename}$;! (qualified import) \lstinline!import ${[}\mathit{packagename}$.${]}\mathit{definitionname}$;! (single definition import) \lstinline!import ${[}\mathit{packagename}$.${]}${$\mathit{def}_{1}$, $\mathit{def}_{2}$, $\ldots$, $\mathit{def}_{n}$};! (multiple definition import) -\lstinline!import $\mathit{packagename}$.*;! (unqualified import) +\lstinline[mathescape=true]!import $\mathit{packagename}$.*;! (unqualified import) -\lstinline!import $\mathit{shortpackagename}$ = $\mathit{packagename}$;! (renaming import) +\lstinline[mathescape=true]!import $\mathit{shortpackagename}$ = $\mathit{packagename}$;! (renaming import) \lstinline!import $\mathit{shortpackagename}$ = ${[}\mathit{packagename}$.${]}\mathit{definitionname}$;! (renaming single def. import) diff --git a/chapters/statemachines.tex b/chapters/statemachines.tex index 4f42cd2b9..4d7a74a5d 100644 --- a/chapters/statemachines.tex +++ b/chapters/statemachines.tex @@ -158,8 +158,8 @@ \section{State Machine Graphics}\doublelabel{state-machine-graphics} \end{nonnormative} The annotation for graphics of \lstinline!transition()! has the following -structure: \lstinline!annotation(Line($\ldots$), Text($\ldots$))!; and for -\lstinline!initialState()!: \emph{graphical-primitives}\lstinline!(Line($\ldots$))!; with \lstinline!Line! +structure: \lstinline[mathescape=true]!annotation(Line($\ldots$), Text($\ldots$))!; and for +\lstinline!initialState()!: \emph{graphical-primitives}\lstinline[mathescape=true]!(Line($\ldots$))!; with \lstinline!Line! and \lstinline!Text! annotations defined in \autoref{annotations}. \begin{example} diff --git a/chapters/stream.tex b/chapters/stream.tex index e3836fd2c..b7f81eb69 100644 --- a/chapters/stream.tex +++ b/chapters/stream.tex @@ -217,8 +217,8 @@ \section{Stream Operator inStream and Connection Equations}\doublelabel{stream-o \end{lstlisting} \begin{nonnormative} -Note, that \lstinline!inStream($c_{k}$.h_outflow)! is computed from the connection set that is present one hierarchical level above. At this higher level -\lstinline!$c_{k}$.h_outflow! is no longer an outside connector, but an inside connector and then the formula from above for inside connectors can be used +Note, that \lstinline[mathescape=true]!inStream($c_{k}$.h_outflow)! is computed from the connection set that is present one hierarchical level above. At this higher level +\lstinline[mathescape=true]!$c_{k}$.h_outflow! is no longer an outside connector, but an inside connector and then the formula from above for inside connectors can be used to compute it. \end{nonnormative} @@ -232,7 +232,7 @@ \section{Stream Operator inStream and Connection Equations}\doublelabel{stream-o approximate the solution in an open neighbourhood of that point. \begin{nonnormative} -For example, assume that \lstinline!$m_{j}$.c.m_flow = $c_{k}$.m_flow = 0!, then all equations above are identically fulfilled and \lstinline!inStream(..)! can have any value. +For example, assume that \lstinline[mathescape=true]!$m_{j}$.c.m_flow = $c_{k}$.m_flow = 0!, then all equations above are identically fulfilled and \lstinline!inStream(..)! can have any value. \end{nonnormative} However, specific optimizations may be applied to avoid the regularization if the @@ -242,8 +242,8 @@ \section{Stream Operator inStream and Connection Equations}\doublelabel{stream-o fulfill the following requirements: \begin{enumerate} \item - \lstinline!inStream($m_{i}$.c.h_outflow)! and - \lstinline!inStream($c_{k}$.h_outflow)! must be unique with + \lstinline[mathescape=true]!inStream($m_{i}$.c.h_outflow)! and + \lstinline[mathescape=true]!inStream($c_{k}$.h_outflow)! must be unique with respect to all values of the flow and stream variables in the connection set, and must have a continuous dependency on them. \item