1

The command \Subset produces an inclusion symbol "inside of" another inclusion symbol.

How can I do something similar with the ceiling and floor functions (\lceil, \rceil, \lfloor, \rfloor)? (See the picture below for an idea).

Thank you!

enter image description here

1
  • What is the use of such symbols?
    – projetmbc
    Jan 19, 2023 at 22:12

2 Answers 2

3

The comprehensive symbol list (see comprehensive) at least lists similar symbols with two vertical lines provided by package nath.

\documentclass{article}
\usepackage{nath}
\begin{document}
\[ \lceil a \rceil \lfloor a \rfloor \]
\[ \lCeil a \rCeil \lFloor a \rFloor \] % nath
\end{document}

Result:

enter image description here

2

Here are two macros \Ceil{<contents>} and \Floor{<contents>} that will create the paired delimiters and adjust to the height of <contents>.

enter image description here

It's hard to build this out of existing symbols because the floor and ceiling symbols have subtle differences at different sizes. Notably, they have round line caps when small but square (butt) line caps when Big.

So these are built from scratch using TikZ. By default all line caps and line joins are round, but you can change these with an optional argument:

\Floor[line cap=butt, line join=miter]{A}

You can also use the optional argument for a variety of TikZ options including color, line style, thickness, etc. For example,

\Ceil[blue, densely dotted, text=red, line width=.9pt]{A}

would work.

enter image description here

Here is the code:

\documentclass{article}

\usepackage{tikz, amsmath}

\newcommand{\Ceil}[2][]{{}\mathrel{\tikz[baseline, anchor=base, line join=round, line cap=round, #1]{
    \node[inner sep=2pt] at (0,0)(a){$#2\mathstrut$};
    \draw([shift={(0,2.8pt)}]a.south west)--([shift={(0,-2pt)}]a.north west)--++(2pt,0);
    \draw([shift={(-1.5pt,2.8pt)}]a.south west)--([shift={(-1.5pt,-.5pt)}]a.north west)--++(3.5pt,0);
    \draw([shift={(0,2.8pt)}]a.south east)--([shift={(0,-2pt)}]a.north east)--++(-2pt,0);
    \draw([shift={(1.5pt,2.8pt)}]a.south east)--([shift={(1.5pt,-.5pt)}]a.north east)--++(-3.5pt,0);
}}{}}
\newcommand{\Floor}[2][]{{}\mathrel{\tikz[baseline, anchor=base, line join=round, line cap=round, #1]{
    \node[inner sep=2pt] at (0,0)(a){$#2\mathstrut$};
    \draw([shift={(0,-2pt)}]a.north west)--([shift={(0,2.8pt)}]a.south west)--++(2pt,0);
    \draw([shift={(-1.5pt,-2pt)}]a.north west)--([shift={(-1.5pt,1.3pt)}]a.south west)--++(3.5pt,0);
    \draw([shift={(0,-2pt)}]a.north east)--([shift={(0,2.8pt)}]a.south east)--++(-2pt,0);
    \draw([shift={(1.5pt,-2pt)}]a.north east)--([shift={(1.5pt,1.3pt)}]a.south east)--++(-3.5pt,0);
}}{}}

\begin{document}

\[
\lfloor a\rfloor\lfloor A\rfloor \left\lfloor\frac{a}{b}\right\rfloor\lceil a\rceil\lceil A\rceil\left\lceil\frac{a}{b}\right\rceil\qquad
\Floor{a}\Floor{A}\Floor{\dfrac{a}{b}}\Ceil{a}\Ceil{A}\Ceil{\dfrac{a}{b}}
\]

\end{document}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .