[Tex/LaTex] How to write ceil and floor in latex?


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.

Best Answer

Using \DeclarePairedDelimiter from mathtools, you could define macros \ceil and \floor, which will scale the delimiters properly (if starred):


    \floor*{\frac{x}{2}} \leq \frac{x}{2} \leq \ceil*{\frac{x}{2}}


example of using floor and ceiling

Related Question