Skip to content

Commit

Permalink
Partially revert "Tentatively remove all mathescape=true used with \l…
Browse files Browse the repository at this point in the history
…stinline"

This reverts parts of commit c2996d8 that don't break the LaTeXML build.
  • Loading branch information
henrikt-ma committed May 5, 2020
1 parent d5c2b2f commit 4998b08
Show file tree
Hide file tree
Showing 7 changed files with 46 additions and 46 deletions.
2 changes: 1 addition & 1 deletion chapters/arrays.tex
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
30 changes: 15 additions & 15 deletions chapters/functions.tex
Original file line number Diff line number Diff line change
Expand Up @@ -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}

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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}

Expand All @@ -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}

Expand Down
24 changes: 12 additions & 12 deletions chapters/operatorsandexpressions.tex
Original file line number Diff line number Diff line change
Expand Up @@ -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]! \\
Expand All @@ -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!a<b!, \lstinline!a<=b!, \lstinline!a>b!, \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}

Expand Down Expand Up @@ -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}

Expand Down
16 changes: 8 additions & 8 deletions chapters/overloaded.tex
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand All @@ -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}
Expand All @@ -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!.

Expand Down Expand Up @@ -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!
Expand Down Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions chapters/packages.tex
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
4 changes: 2 additions & 2 deletions chapters/statemachines.tex
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
10 changes: 5 additions & 5 deletions chapters/stream.tex
Original file line number Diff line number Diff line change
Expand Up @@ -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}

Expand All @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 4998b08

Please sign in to comment.