I am drawing a little sketch depicting an experiment (code below):
At the arrows (under % Outgoing lines in the code) to the right I would like to place little rectangles with their long side perpendicular to each arrow (what would be even better if those rectangles were more like square brackets, i.e. unfilled rectangles with thick lines and the long side closer to the arrow not drawn). The size of such a rectangle should be just big enough so that the heads of the upper two lines can "fit" into one.
Since I have defined the arrows to have the same length and just point away from a certain central point under different angles, their end points essentially lie on a circle.
Any ideas how I can achieve what I outlined above?
\documentclass[article]
\usepackage{tikz}
\usetikzlibrary[patterns]
\begin{document}
\pagestyle{empty}
\begin{tikzpicture}
% Beam, upper border
\fill[draw opacity=0,pattern color=gray,pattern=horizontal lines] (-2,0.8) rectangle (2,-0.8);
% Beam direction
\draw[->,thick] (-1.5,0) -- (1.5,0);
\draw[latex-] (1.0,0.5) -- ++(80:1.5cm) node[right]{Beam};
% Slit, uppper part
\fill[black] (-0.125,3) rectangle (0.125,0.8);
% Slit, lower part
\fill[black] (-0.125,-0.8) rectangle (0.125,-3);
% Target
\draw[pattern=north east lines] (1.9,0.7) rectangle (2.1,-0.7);
\draw[latex-] (2.0,-0.7) -- ++(260:1.5cm) node[right]{Target};
% Outgoing lines
\draw[->] (2.2,0.0) -- +(45:2cm);
\draw[->] (2.2,0.0) -- +(35:2cm);
% Area element
\draw[<->] (2.2,0.0) +(35:1.5cm) arc [start angle=35,delta angle=10,radius=1.5cm];
\draw[-latex] (2.2,0.0) ++(38:1.5cm) ++(0cm,1cm) node[above]{$d$} -- ++(0cm,-0.95cm);
\draw[->] (2.2,0.0) -- +(0:2cm);
\draw[->] (2.2,0.0) -- +(-45:2cm);
\end{tikzpicture}
\end{document}
\usepackage{tikz}
\usetikzlibrary[patterns]
\begin{document}
\pagestyle{empty}
\begin{tikzpicture}
% Beam, upper border
\fill[draw opacity=0,pattern color=gray,pattern=horizontal lines] (-2,0.8) rectangle (2,-0.8);
% Beam direction
\draw[->,thick] (-1.5,0) -- (1.5,0);
\draw[latex-] (1.0,0.5) -- ++(80:1.5cm) node[right]{Beam};
% Slit, uppper part
\fill[black] (-0.125,3) rectangle (0.125,0.8);
% Slit, lower part
\fill[black] (-0.125,-0.8) rectangle (0.125,-3);
% Target
\draw[pattern=north east lines] (1.9,0.7) rectangle (2.1,-0.7);
\draw[latex-] (2.0,-0.7) -- ++(260:1.5cm) node[right]{Target};
% Outgoing lines
\draw[->] (2.2,0.0) -- +(45:2cm);
\draw[->] (2.2,0.0) -- +(35:2cm);
% Area element
\draw[<->] (2.2,0.0) +(35:1.5cm) arc [start angle=35,delta angle=10,radius=1.5cm];
\draw[-latex] (2.2,0.0) ++(38:1.5cm) ++(0cm,1cm) node[above]{$d$} -- ++(0cm,-0.95cm);
\draw[->] (2.2,0.0) -- +(0:2cm);
\draw[->] (2.2,0.0) -- +(-45:2cm);
\end{tikzpicture}
\end{document}
Best Answer
Method 1: Square Brackets:
If you simply want to add a square bracket, you can simply add a node and rotate it:
If you want it a different size you can use
scalebox
:Method 1: Draw the Shape:
However, a better solution is to draw the desired shape with something like:
Here you can adjust the sizing of this precisely, but with the current values, this yields:
Code: Square Brackets
Code: Draw the Shape: