Is there a macro in latex to write ceil(x)
and floor(x)
in short form? The long form
\left \lceil{x}\right \rceil
is a bit lengthy to type every time it is used.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Using \DeclarePairedDelimiter from mathtools, you could define macros \ceil and \floor, which will scale the delimiters properly (if starred):
\documentclass{minimal}
\usepackage{mathtools}
\DeclarePairedDelimiter\ceil{\lceil}{\rceil}
\DeclarePairedDelimiter\floor{\lfloor}{\rfloor}
\begin{document}
\begin{equation*}
\floor*{\frac{x}{2}} < \frac{x}{2} < \ceil*{\frac{x}{2}}
\end{equation*}
\end{document}
Result:
Scaling delimiters with
\floor
and\ceil