13

I need to represent symmetries of a a rectangle as a set, and in my text book they do so by using the following notation

S(SYMBOL-THAT-LOOKS-LIKE-A-RECTANGLE)

I searched everywhere, tried http://detexify.kirelabs.org/classify.html and no luck. So, I came to terms with there not being any rectangle, and the closest I have been able to get is

$s\sqsubset\sqsupset$

Is there any way I can reduce the spacing between them so they make a better rectangle?

Martin Thoma
  • 18,799
JustDanyul
  • 5,037

6 Answers6

17

This is U+25AD (▭) and available as \hrectangle in unicode-math (if using xelatex or lualatex) or stix if using pdflatex (and will be available in other font packages that cover the Unicode math blocks)

enter image description here

\documentclass{article}

\usepackage{stix}

\begin{document}

$a \hrectangle b $

\end{document}
David Carlisle
  • 757,742
15

A good occasion for \ooalign, one of the best tricks in my toolbox:

\documentclass{article}
\usepackage{amssymb}

\newcommand{\rectangle}{{%
  \ooalign{$\sqsubset\mkern3mu$\cr$\mkern3mu\sqsupset$\cr}%
}}

\begin{document}
$S(\rectangle)$
\end{document}

enter image description here

Experiment changing 3mu for different ratios between width and height.

egreg
  • 1,121,712
9
\documentclass[12pt]{report}
\usepackage{amsmath,amssymb}
\newcommand{\rectangle}{\fboxsep0pt\fbox{\rule{1em}{0pt}\rule{0pt}{1ex}}}
\begin{document}
  $s\rectangle$

\end{document}

enter image description here

1

Try this:

Output

\documentclass{article}
\usepackage{amsmath,amssymb}
\begin{document}
  A$\sqsubset \! \sqsupset$B
\end{document}
M. Al Jumaily
  • 4,035
  • 2
  • 11
  • 26
maho
  • 11
0

One simple method would be to use tikzpackage. You can draw each line of the rectangle. It may be tedious at first to use tikz, but it is so much more convenient when you need to modify your image. \usepackage{tikz} \begin{document}

\maketitle


S
\begin{tikzpicture}[font=\small\sffamily\bfseries, node distance = 0.5cm]
\tikzset{
    mynode/.style={rectangle,rounded corners,draw=black, top color=white, bottom     color=yellow!50,very thick, inner sep=1em, minimum size=3em, text centered},
    myarrow/.style={->, >=latex', shorten >=1pt, thick},
    mylabel/.style={text width=7em, text centered} 
}  
\tikzstyle{block} = [rectangle, draw,  
    text width=11em, text centered]

\tikzstyle{decision} = [diamond, draw, text width=4em, text badly centered, inner     sep=0pt]

\node[block] (rectangle) [text width=13em] {text_inside_rectangle};  
\end{tikzpicture}

Here, I draw a node. you can specify the dimensions of the rectangle accordingly. And if you want more such rectangles you just have to repeat the '\node[block] (rectangle) [text width=13em] {text_inside_rectangle}; ' statement. Hope this helps.

  • 1
    As it is, this is more of a comment rather than an answer. If you actually include the code to draw the rectangle then this would make a good answer. – Peter Grill Dec 11 '14 at 07:37
0

A minimal solution using TikZ will be

\newcommand{\rectangle}{\tikz[\draw (0,0) rectangle (3.2mm,2mm);}}

A slightly enhanced version is

\newcommand{\rectangle}{
    \tikz[line width = 0.52pt, line join = round]{
        \draw (0,0) rectangle (3.2mm,2mm);
    }
}

where the first option indicate the line width and the second one makes the borders rounded, which in my opinion, looks better. Hope it helps.