Commit 56c7427d authored by Ronny Bergmann's avatar Ronny Bergmann 🎧

unifies round brackets for arguments of functions like logarithm, exponential, proj and prox.

parent 5cebb8a0
......@@ -40,7 +40,7 @@ This document provides a comprehensive overview of all packages and commands def
Packages are meant to used hierarchically, i.e, \file{numapde-manifolds.sty} builds upon and hence loads \file{numapde-semantic.sty}, which in turn builds upon and loads \file{numapde-packages.sty} and \file{numapde-syntax.sty}.
Additional commands and document specific settings should generally be defined locally initially in \file{numapde-local.sty} (\cref{sec:local-definitions}) and can make their way into the general collection later.
\textbf{Note:} Any changes to files in this repository need to be reflected in this file, \file{documentation.tex}, as well.
\textbf{Note.} Any changes to files in this repository need to be reflected in this file, \file{documentation.tex}, as well.
\section{Packages: \texorpdfstring{\file{numapde-packages.sty}}{numapde-packages.sty}}\label{sec:packages}
......@@ -372,25 +372,29 @@ a notion for an inner product.
\item[projOp] the mathematical operator denoting the projection \mathCodeExample{\projOp}
\par\mathCodeExample{\projOp}
\item[proj] projection onto a set.
Its syntax is \codeCommand{\proj[#1]{#2}{#3}} or \codeCommand{\proj[#1]{#2}}.
Its syntax is \codeCommand{\proj[#1]{#2}(#3)} or \codeCommand{\proj[#1]{#2}}.
The first (optional) argument is used to scale the parantheses enclosing the argument to the standard amsmath sizes.\cref{footnote:amsmath_sizes}
The second argument denotes the set.
The second argument denotes the set and can also be left out.
The third argument denotes the point; it can be omitted.
The command \codeCommand{\projOp} is used to typeset the operator.
\par\mathCodeExample{\proj[Big]{\CC}{\dfrac{x}{2}}}
\par\mathCodeExample{\proj[Big]{\CC}}
\par\mathCodeExample{\proj}
\par\mathCodeExample{\proj(x)}
\par\mathCodeExample{\proj{\CC}}
\par\mathCodeExample{\proj{\CC}(x)}
\par\mathCodeExample{\proj[Big](\dfrac{x}{2})}
\par\mathCodeExample{\proj[Big]{\CC}(\dfrac{x}{2})}
\item[proxOp] the mathematical operator denoting the proximal map
\par\mathCodeExample{\proxOp}
\item[prox] the proximal operator of a function.
Its syntax is \codeCommand{\prox[#1]{#2}{#3}} or \codeCommand{\prox[#1]{#2}}.
Its syntax is \codeCommand{\prox[#1]{#2}(#3)} or \codeCommand{\prox[#1]{#2}}.
The first (optional) argument is used to scale the parantheses enclosing the argument to the standard amsmath sizes.\cref{footnote:amsmath_sizes}
The second argument denotes the set.
The third argument denotes the point; it can be omitted.
The command \codeCommand{\proxOp} is used to typeset the operator.
\par\mathCodeExample{\prox[big]{\lambda F}{\dfrac{x}{2}}} %chktex 1
\par\mathCodeExample{\prox{\lambda F}} % chktex 1
\par\mathCodeExample{\prox}
\par\mathCodeExample{\prox{\lambda F}} % chktex 1
\par\mathCodeExample{\prox{\lambda F}(x)} % chktex 1
\par\mathCodeExample{\prox[big]{\lambda F}(\dfrac{x}{2})} %chktex 1
\item[rank] rank (of a matrix) \mathCodeExample{\rank}
\item[range] range of some operator \mathCodeExample{\range}
\item[restr] restriction/evaluation.
......@@ -470,22 +474,20 @@ The semantic file \file{numapde-manifolds.sty} collects definitions and notation
\par\mathCodeExample{\cotangentBundle[\NN]}
\item[cotangentSpaceSymbol] the symbol used within \codeCommand{\cotangent}.
\par\mathCodeExample{\cotangentSpaceSymbol}
\item[expOp] the symbol used within the \codeCommand{\exponential}.
\par\mathCodeExample{\expOp}
\item[exponential] the exponential map.
Its syntax is \codeCommand{\exponential[#1]{#2}{#3}}.
The first argument can be used to scale the third.
The second argument denotes the base point and is optional.
The third argument denotes the tangent vector, which is optional, but
if provided, the argument is put in brackets. The third following example
if provided, the argument is put in brackets. The first following example
illustrates the case, where no brackets are put. Note that the space is
mandatory.
\par\mathCodeExample{\exponential}
\par\mathCodeExample{\exponential{p}}
\par\mathCodeExample{\exponential{p} X}
\par\mathCodeExample{\exponential{p}{X}}
\par\mathCodeExample{\exponential[Big]{p}{\frac{X}{2}}}
\item[expOp] the symbol used within the \codeCommand{\exponential}.
\par\mathCodeExample{\expOp}
\item[geodesic] a geodesic.
\par\mathCodeExample{\exponential{p}X}
\par\mathCodeExample{\exponential{p}(X)}
\par\mathCodeExample{\exponential[Big]{p}(\frac{X}{2})}
\item[geodesic] a geodesic.
Its syntax is \codeCommand{\geodesic<#1>[#2]{#3}{#4}(#5)}.% chktex 6
The first (optional) argument is used to modify the style of the geodesic (\codeCommand{s}ymbol, \codeCommand{l}ong, \codeCommand{a}rc or \codeCommand{p}lain, where the last is the default)
The second (optional) argument is used to scale the parantheses enclosing the argument to the standard amsmath sizes.\cref{footnote:amsmath_sizes}
......@@ -514,24 +516,22 @@ The semantic file \file{numapde-manifolds.sty} collects definitions and notation
\item[geodesicSymbol] symbol to use for the geodesic in \codeCommand{\geodesic}
\par\mathCodeExample{\geodesicSymbol}
\item[inverseRetract] use an inverse retraction, the arguments are similar to \codeCommand{\logarithm} but use the \codeCommand{\retractionSymbol}
\par\mathCodeExample{\inverseRetract{p} q}
\par\mathCodeExample{\inverseRetract{p}{q}}
\par\mathCodeExample{\inverseRetract[Big]{p}{q}}
\par\mathCodeExample{\inverseRetract{p}q}
\par\mathCodeExample{\inverseRetract{p}(q)}
\par\mathCodeExample{\inverseRetract[Big]{p}(q)}
\item[logOp] the symbol used within the \codeCommand{\logarithm}.
\par\mathCodeExample{\logOp}
\item[logarithm] the logarithmic map.
Its syntax is \codeCommand{\logarithm[#1]{#2}{#3}}.
The first argument can be used to scale the third.
The second argument denotes the base point and is optional.
The second argument denotes the base point.
The third argument denotes another point, which is optional, but
if provided, the argument is put in brackets. The third following example
if provided, the argument is put in brackets. The first following example
illustrates the case, where no brackets are put. Note that the space is
mandatory.
\par\mathCodeExample{\logarithm}
\par\mathCodeExample{\logarithm{p}}
\par\mathCodeExample{\logarithm{p} q}
\par\mathCodeExample{\logarithm{p}{q}}
\par\mathCodeExample{\logarithm[Big]{p}{q}}
\item[logOp] the symbol used within the \codeCommand{\logarithm}.
\par\mathCodeExample{\logOp}
\par\mathCodeExample{\logarithm{p}q}
\par\mathCodeExample{\logarithm{p}(q)}
\par\mathCodeExample{\logarithm[Big]{p}(q)}
\item[parallelTransport]\hspace{1em} the parallel transport.\\
Its syntax is \codeCommand{\parallelTransport[#1]{#2}{#3}(#4)}.
The first (optional) argument is used to scale the parantheses enclosing the argument \# 4.\cref{footnote:amsmath_sizes}
......@@ -558,9 +558,9 @@ The semantic file \file{numapde-manifolds.sty} collects definitions and notation
if provided, the argument is put in brackets. The first following example
illustrates the case, where no brackets are put. Note that the space is
mandatory.
\par\mathCodeExample{\retract{p} X}
\par\mathCodeExample{\retract{p}{X}}
\par\mathCodeExample{\retract[Big]{p}{\frac{X}{2}}}
\par\mathCodeExample{\retract{p}X}
\par\mathCodeExample{\retract{p}(X)}
\par\mathCodeExample{\retract[Big]{p}(\frac{X}{2})}
\item[retractionSymbol] symbol to use for a retraction and an inverse retraction,
see \codeCommand{\retract} and \codeCommand{\inverseRetract}.
\par\mathCodeExample{\retractionSymbol}
......
......@@ -43,14 +43,14 @@
% The optimal argument (#2) denotes the tensor field being differentiated
\NewDocumentCommand{\covariantDerivative}{ m O{} }{\covariantDerivativeSymbol_{#1}#2}
\DeclareMathOperator{\expOp}{exp}
% Define a command for the exponential map
% Argument {#1} is used to scale the brackets around #3
% Argument {#2} is the source base point
% Argument {#3} is a corresponding tangent vector
% all are optional, i.e. without #3 you refer to the function exp_p and without #2 to just exp
\DeclareMathOperator{\expOp}{exp}
\NewDocumentCommand{\exponential}{ O{} g g }{\IfNoValueTF{#3}{\IfNoValueTF{#2}{\expOp}{\expOp_{#2}}}{\expOp_{#2}\enclose[#1]{(}{#3}{)}}}
\NewDocumentCommand{\exponential}{ O{} m d() }{%
\expOp_{#2}\IfNoValueF{#3}{\enclose[#1]{(}{#3}{)}}%
}
% Define a command for various versions of geodesic curves
% The optional argument <#1> defines the type: [s]symbol, [l]ong, [a]rc, or [p]lain (the default)
......@@ -81,55 +81,48 @@
}%
}
\DeclareMathOperator{\logOp}{exp}
% Define a command for the logarithmic map
% Argument {#1} is used to scale the brackets around #3
% Argument {#2} is the source base point
% Argument {#3} is a second point
% all are optional, i.e. without #3 you refer to the function log_p and without #2 to just log
\DeclareMathOperator{\logOp}{log}
\NewDocumentCommand{\logarithm}{ O{} g g }{\IfNoValueTF{#3}{\IfNoValueTF{#2}{\logOp}{\logOp_{#2}}}{\logOp_{#2}\enclose[#1]{(}{#3}{)}}}
\NewDocumentCommand{\logarithm}{ O{} m d() }{%
\logOp_{#2}\IfNoValueF{#3}{\enclose[#1]{(}{#3}{)}}%
}
% Define a command for the logarithmic map
% Argument {#1} is used to scale the brackets around #3
% Argument {#2} is the source base point
% Argument {#3} is a second point
\NewDocumentCommand{\inverseRetract}{ O{} m g }{%
\retractionSymbol^{-1}_{#2}\IfNoValueF{#3}{\enclose[#1]{(}{#3}{)}}%
\NewDocumentCommand{\inverseRetract}{ O{} m d() }{%
\retractionSymbol^{-1}_{#2}\IfNoValueF{#3}{\enclose[#1]{(}{#3}{)}}%
}
% Define a command for the Lie bracket (of two vector fields)
% The optional argument [#1] scales the delimiters
% Argument {#2} is the first vector field
% Argument {#3} is the second vector field
\NewDocumentCommand{\lie}{ O{} m m }{\enclose[#1]{[}{#2,#3}{]}}
% Define a command for the parallel transport, where
% Argument {#1} (optional) is used to scale the brackets around #4
% Argument {#2} is the source base point
% Argument {#3} is the destination base point
% Argument {#4} is a tangent vector from the source base point's tangent space
% Argument {#4} is a tangent vector from the source base points tangent space
\NewDocumentCommand{\parallelTransport}{ O{} m m d()}{%
\parallelTransportSymbol_{#3\leftarrow#2}%
\IfNoValueF{#4}{\enclose[#1]{(}{#4}{)}}%
\parallelTransportSymbol_{#3\leftarrow#2}%
\IfNoValueF{#4}{\enclose[#1]{(}{#4}{)}}%
}
% Define a command for the parallel transport with direction, where
% Argument {#1} (optional) is used to scale the brackets around #4
% Argument {#2} is the source base point
% Argument {#3} is the direction to transport into
% Argument {#4} is a tangent vector from the source base point's tangent space
% Argument {#4} is a tangent vector from the source base points tangent space
\NewDocumentCommand{\parallelTransportDir}{ O{} m m d()}{%
\parallelTransportSymbol_{#2,#3}%
\IfNoValueF{#4}{\enclose[#1]{(}{#4}{)}}%
\parallelTransportSymbol_{#2,#3}%
\IfNoValueF{#4}{\enclose[#1]{(}{#4}{)}}%
}
% Define a command for a retraction map
% Argument {#1} (optional) is used to scale the brackets around #3
% Argument {#1} is used to scale the brackets around #3
% Argument {#2} is the source base point
% Argument {#3} is a corresponding tangent vector
\NewDocumentCommand{\retract}{ O{} m g }{%
\retractionSymbol_{#2}\IfNoValueF{#3}{\enclose[#1]{(}{#3}{)}}%
\NewDocumentCommand{\retract}{ O{} m d() }{%
\retractionSymbol_{#2}\IfNoValueF{#3}{\enclose[#1]{(}{#3}{)}}%
}
% Define a command for the Riemannian metric (inner product in the tangent space)
......@@ -145,7 +138,7 @@
% The optional argument [#3] can be used to denote the base point or to specify the metric
\NewDocumentCommand{\riemanniannorm}{ O{} m O{} }{\norm[#1]{#2}_{#3}}
% Define a command for the second covariant derivative
% Define a command for the second covariant derivative
% Argument {#1} is the vector (field) which determines the first direction of differentiation
% Argument {#2} is the vector (field) which determines the second direction of differentiation
% The optimal argument (#3) denotes the tensor field being differentiated
......
......@@ -32,14 +32,18 @@
% Argument #2 is the set to be projected onto
% Argument #3 is the quantity to be projected
\DeclareMathOperator{\projOp}{proj}
\NewDocumentCommand{\proj}{ O{} g g }{\IfNoValueTF{#3}{\IfNoValueTF{#2}{\projOp}{\projOp_{#2}}}{\projOp_{#2}\enclose[#1]{(}{#3}{)}}}
\NewDocumentCommand{\proj}{ O{} g d() }{%
\IfNoValueTF{#2}{\projOp}{\projOp_{#2}}\IfNoValueF{#3}{\enclose[#1]{(}{#3}{)}}%
}
% Define the prox operator
% The optional argument #1 scales the delimiters
% Argument #2 is the function whose prox map we are taking
% Argument #3 is the argument of the prox map
\DeclareMathOperator{\proxOp}{prox}
\NewDocumentCommand{\prox}{ O{} g g }{\IfNoValueTF{#3}{\IfNoValueTF{#2}{\proxOp}{\proxOp_{#2}}}{\proxOp_{#2}\enclose[#1]{(}{#3}{)}}}
\NewDocumentCommand{\prox}{ O{} g d() }{%
\IfNoValueTF{#2}{\proxOp}{\proxOp_{#2}}\IfNoValueF{#3}{\enclose[#1]{(}{#3}{)}}%
}
% Define some mathematical and other operators
\DeclareMathOperator{\aff}{aff}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment