I want to denote the quantile regression loss, close to the notation in the IQN-paper https://arxiv.org/pdf/1806.06923.pdf (pdf page 3)
I have this code:
\documentclass{book}
\usepackage[utf8]{inputenc}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{bbm}
\newcommand{\norm}[1]{\left\lVert #1 \right\rVert}
\newcommand{\abs}[1]{\left\lvert #1 \right\rvert}
\newcommand{\Idf}{\mathbbm{1}} % indicator function
\begin{document}
\begin{align}
\rho^\kappa_\tau(\delta_{ij}) &= \abs{\tau - \I(\delta_{ij}<0)} \frac{H_\kappa(\delta_{ij})}{\kappa}, \qquad \text{with} \\
\H_\kappa(\delta_{ij}) &=
\begin{cases}
\frac{1}{2}\delta_{ij}^2 & \text{if} \; \abs{\delta_{ij}} \leq \kappa \\
\kappa (\abs{\delta_{ij}}-\frac{1}{2}\kappa) & \text{otherwise}
\end{cases}
\end{align}
\end{document}
Which produces this output:
As can be seen, part of the equations falls of the screen. and the first line of the equation is also placed weirdly, not in the centre of the screen. I tried to remove the \begin{cases} \end{cases} to something simpler and stuff still did not align well so I have the feeling it is due to the align function and not the cases.
! Undefined control sequence. <argument> \tau - \I
after any error the pdf output is at best usable for debugging it is not intended to have usable layoutH
as well as\H
, and\H
causes another error.\I
to\Idf
then you get the error! Missing $ inserted.