I am interested in creating a symbol-sized tikz drawing with a rectangle half the width of the symbol (and the height of a symbol) and an arrow coming out from the middle right side of the rectangle pointing to the right (the arrow head should be rather small). I tried to do something like that here (the A symbol is for comparison in size), but it didn't quite work right:





  node distance = 0mm,
box/.style = {% definition of rectangle as node
    draw, line width=0.35mm,
  text width=11pt, minimum height=11pt, align=left,
  inner sep=1mm, outer sep=0pt}
\node (box1) [label=above:{}] {};
\node (B) [draw, right=of box1] {};
\draw [->] (box1) -- (B);



  1. How do I make the width of the square half its size?

  2. How do I make the arrow leave the right side of the rectangle?

  3. How do I make an "empty" node to the right of the rectangle so I can draw an arrow to it?

  4. How do I make the arrow head smaller?

enter image description here

  • Could you post a (hand-made) sketch of what you want? Compiling your code is not very explicit about it.
    – Bernard
    Commented Feb 22, 2016 at 23:54

4 Answers 4


Perhaps like this...

\def\abx{\tikz[x=0.75em,y=0.75em,baseline=0]\fill[even odd rule]
\foreach \f in {\scriptsize,\footnotesize,\small,\normalsize,\large,\huge}{%
\noindent\hbox to1.125in{\texttt{\expandafter\string\f:}} 
\f xX \abx\ yY \\[.5ex]}

enter image description here

  • thanks! How would you make the arrow point to the other direction, meaning still on the right side, only pointing towards the rectangle instead of outside of it?
    – tikzUser
    Commented Feb 23, 2016 at 11:04
  • @tikzUser Try using (0,0)--(.5,0)--(.5,.5)--(.75,.25)--(.75,.45)--(1,.45)--(1,.55)--(.75,.55)--(.75,.75)--(.5,.5)--(.5,1)--(0,1)--cycle (.1,.1)rectangle(.4,.9); Commented Feb 23, 2016 at 12:02

I don't fully understand your question, what symbol are you talking about? Here I've addressed your questions, if the size does not suit your need simply scale or re-size the objects:

  1. \draw (0,0) rectangle (1,2);
  2. \draw [->] (1,1)--+(1,0);
  3. Empty node is bad practice, rather use \coordinate (name) at (1,1); that leads to \draw [->] (name)--+(1,0);
  4. Using the library arrows.meta (have a look at this link) you can scale the size of the arrow in this way \draw [-{>[scale=0.7]}] (name)--+(1,0);

It could be useful to define a pic that allows you to place a predefined shape like a "stamp". I've defined a pic named mybox:

\draw (-0.5,-1) rectangle (.5,1);
\draw [-{>[scale=0.5]}] (0.5,0)--+(0.5,0);
\pic at (0,0) {mybox};
\draw (1,1) arc (135:45:3) pic [red,pos=0.3,scale=0.5,sloped] {mybox}; 

The result would be: mybox pic and its usage


I'm not sure why you wish to use TikZ for this. However, since you do, here is one way you might go about it:

  pics/my box/.style={%
        outer sep=0pt,
        every node/.append style={draw},
        make my box/.cd,
        make my box/my box look,
      \node (box\themybox) [make my box/my box look, label=above:{\myboxlabel}, inner sep=\myboxisep, minimum height=\myboxminht-\myboxlinewidth, minimum width=.5*\myboxminht-.5*\myboxlinewidth] at (0,0) {};
      \draw [->, make my box/my box look, line width=\myboxlinewidth,] (box\themybox.east) -- +(\myboxextarrow,0);
  make my box/.search also={/tikz},
  make my box/.cd,
  line width/.store in=\myboxlinewidth,
  minimum height/.store in=\myboxminht,
  inner sep/.store in=\myboxisep,
  label/.store in=\myboxlabel,
  extend arrow/.store in=\myboxextarrow,
  look/.code={\tikzset{make my box/my box look/.append style={#1}}},
  line width=.35mm,
  minimum height=\myboxminheight,
  inner sep=0pt,
  extend arrow=5pt,
  my box look/.style={draw, line width=\myboxlinewidth},
  \tikz{\pic {my box={#1}};}}
  X \mybox{} \mybox[label={My Box}] \mybox[look={text=red, draw=blue}, extend arrow=25pt, minimum height=20pt, inner sep=2mm, line width=2.5pt, label={My Other Box}, >/.tip={Stealth[]}]


Note that the box of a glyph may include space above the drawn letter and that not all capital letters look of equal height close up. Hence, you'll need to tweak this according to your preferences, font configuration and needs.

  • Note that if you zoom the first box aligns with the top and base of the X. But it looks smaller due, probably, to the shapes and line widths. Hence, you might want to remove -\myboxlinewidth from the value passed to minimum height in the node options.
    – cfr
    Commented Feb 23, 2016 at 2:54

Here is a solution with pstricks:


\usepackage{auto-pst-pdf} \newcommand\mysymbol{\begin{pspicture}%
\fnode[linewidth=0.4pt, linecolor=blue, framesize=3.5pt 7pt, dimen=middle](0,3pt){R}
\uput{2.5ex}[r](R){\pnode{W}}\ncline[arrows=->, linecolor = red, linewidth=0.6pt, linejoin=1, nodesepA=0.5pt, arrowinset=0.15,arrowsize=2pt]{R}{W} \end{pspicture}}%




enter image description here

You must log in to answer this question.

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