Is there a ruler symbol in some LaTeX package?
I would like something similar to the clock symbol in the wasysym
package.
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It only takes a minute to sign up.
Sign up to join this communityYou can make one yourself. An example from the answer to this question can be tweaked as you like.
\documentclass[tikz,border=1cm]{standalone}
\begin{document}
\begin{tikzpicture}
\draw (-0.2,0) rectangle (15.5,1);
%% lower divisions
\foreach \x in {0,1,...,15}{
\draw (\x,0) -- (\x,0.2)node[above,scale=0.4]{\x};
}
\foreach \x in {0.1,0.2,...,14.9}{
\draw (\x,0) -- (\x,0.075);
}
\foreach \x in {0.5,1,...,14.5}{
\draw (\x,0) -- (\x,0.15);
}
% Upper divisions
\foreach \x in {0,1,...,6}{
\draw (\x in,1) -- (\x in,0.8)node[below,scale=0.4]{\x};
}
\foreach \x in {0.1,0.2,...,5.9}{
\draw (\x in,1) -- (\x in,0.925);
}
\foreach \x in {0.5,1,...,5.5}{
\draw (\x in,1) -- (\x in,0.85);
}
\end{tikzpicture}
\end{document}
Find a good ruler image on the web, such as http://etc.usf.edu/clipart/36400/36459/ruler1_36459_lg.gif. Save it to your system, and convert it to a jpeg image (I used Paint to do so). Then, just \includegraphics
it into your document, using scalerel
to make it the height of a capital "X". It will auto-adjust to the current font size.
[As Ethan notes in a comment, one must pay attention to the terms of use. For this particular image, use is limited to educational, but not commercial purposes]
\documentclass{article}
\usepackage{scalerel,graphicx}
\newcommand\ruler{\scalerel*{\includegraphics{ruler1_36459_lg}}{X}}
\begin{document}
Here is my ruler: \ruler
\LARGE or large: \ruler
\end{document}
Perhaps, if one desires something a bit more compact and lo-resolution, there is http://www.clipartbest.com/cliparts/yio/g8b/yiog8b5oT.png, which can be used directly without format conversion:
\documentclass{article}
\usepackage{scalerel,graphicx}
\newcommand\ruler{\scalerel*{\includegraphics{yiog8b5oT}}{X}}
\begin{document}
Here is my ruler: \ruler
\LARGE or large: \ruler
\end{document}
It is possible I misunderstood the OP's implication of "ruler". It was compared with the wasysym
clock symbol. We know a broken clock is right twice a day. As to this broken ruler, maybe not so much.
\documentclass{article}
\usepackage{scalerel,stackengine,graphicx,simpsons}
\newcommand\ruler{\scalerel*{\stackon[-12pt]{\Homer}{%
\rotatebox{12}{%
\includegraphics[scale=.035]{Gold_Crown_with_Red_Diamonds_PNG_Clipart}%
}\kern11pt}}{X}}
\begin{document}
Here is my ruler: \ruler
\LARGE or large: \ruler
\end{document}
In case you have no TikZ packages installed on your machine. I just draw the centimeter part as any other units (inch, etc) can be drawn with almost the same way.
\documentclass[pstricks,margin=1mm]{standalone}
\begin{document}
\begin{pspicture}(-.2,1.5)(10.2,3)
\psframe[linecolor=lightgray](-.2,1.5)(10.2,3)
\multips(0,3)(0.1,0){101}{\psline(0,-.1)}
\multips(0,3)(0.5,0){21}{\psline(0,-.2)}
\foreach \x in {0,...,10}{\rput(\x,3){\psline(0,-.3)}\uput{4mm}[-90](\x,3){\scriptsize$\x$}}
\rput[r](10,1.8){\scriptsize Made in Japan}
\end{pspicture}
\end{document}