3

I want to use brackets similar to lceil, rceil and lfoor, rfloor, but with the vertical lines on both sides at an angle. Does anything like this already exist? If not, would it be difficult to create them?

1 Answer 1

2

If you don't need them to auto-scale, here is a pdflatex solution. See ADDENDUM for scalable version.

\documentclass[12pt]{article}
\usepackage{scalerel,mathtools}
\newsavebox{\foobox}
\newcommand{\slantbox}[2][.5]
  {%
    \mbox
      {%
        \sbox{\foobox}{#2}%
        \hskip\wd\foobox
        \pdfsave
        \pdfsetmatrix{1 0 #1 1}%
        \llap{\usebox{\foobox}}%
        \pdfrestore
      }%
  }
\newcommand\lsceil{\ThisStyle{\slantbox[.2]{$\SavedStyle\lceil$}}}
\newcommand\rsceil{\ThisStyle{\slantbox[-.2]{$\,\SavedStyle\rceil$}}}
\newcommand\lsfloor{\ThisStyle{\slantbox[-.2]{$\,\SavedStyle\lfloor$}}}
\newcommand\rsfloor{\ThisStyle{\slantbox[+.2]{$\SavedStyle\rfloor\,$}}}
\usepackage{amsmath}
\DeclarePairedDelimiter{\sceils}{\lsceil}{\rsceil}
\DeclarePairedDelimiter{\sfloors}{\lsfloor}{\rsfloor}
\begin{document}
\begin{equation*}
x\sceils{A}y \quad x\sfloors{A}y 
\end{equation*}
\end{document}

enter image description here

ADDENDUM

\documentclass[12pt]{article}
\usepackage{scalerel,mathtools}
\newsavebox{\foobox}
\newcommand{\slantbox}[2][.5]
  {%
    \mbox
      {%
        \sbox{\foobox}{#2}%
        \hskip\wd\foobox
        \pdfsave
        \pdfsetmatrix{1 0 #1 1}%
        \llap{\usebox{\foobox}}%
        \pdfrestore
      }%
  }
%\newcommand\lsceil{\ThisStyle{\slantbox[.2]{$\SavedStyle\lceil$}}}
%\newcommand\rsceil{\ThisStyle{\slantbox[-.2]{$\,\SavedStyle\rceil$}}}
%\newcommand\lsfloor{\ThisStyle{\slantbox[-.2]{$\,\SavedStyle\lfloor$}}}
%\newcommand\rsfloor{\ThisStyle{\slantbox[+.2]{$\SavedStyle\rfloor\,$}}}
\newsavebox\tmpbox
\newcommand\sceils[1]{\ThisStyle{\savebox\tmpbox{$\SavedStyle\mkern-1mu#1$}%
  \slantbox[.2]{$\SavedStyle\left\lceil\vphantom{\usebox{\tmpbox}}\right.$}%
  \usebox{\tmpbox}%
  \slantbox[-.2]{$\SavedStyle\left.\vphantom{\usebox{\tmpbox}}\right\rceil$}%
}}
\newcommand\sfloors[1]{\ThisStyle{\savebox\tmpbox{$\SavedStyle#1$}\mkern1mu%
  \slantbox[-.2]{$\SavedStyle\left\lfloor\vphantom{\usebox{\tmpbox}}\right.$}%
  \usebox{\tmpbox}%
  \slantbox[.2]{$\SavedStyle\left.\vphantom{\usebox{\tmpbox}}\right\rfloor$}%
}}
\usepackage{amsmath}
\begin{document}
\begin{equation*}
x\sceils{A}y \quad x\sfloors{A}y 
\end{equation*}
\begin{equation*}
\frac{x}{y}\sceils{\frac{x}{y}}\frac{x}{y} \quad 
x\sfloors{\frac{x}{y}}y 
\end{equation*}
\end{document}

enter image description here

2
  • Thanks! thats exactly what I was looking for. Of course auto-scale will probably eventually come in handy, but this is already great.
    – Larry
    May 9, 2016 at 16:17
  • 1
    @Larry Please see my revision for a scalable variety. Hoever, they only work in pairs (a scalable \lsceil and \rsceil are not provided) May 9, 2016 at 17:05

You must log in to answer this question.

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