Skip to content

Instantly share code, notes, and snippets.

@chentz78
Last active July 26, 2020 13:50
Show Gist options
  • Save chentz78/a6b085baa07e44d6e717523bce13e3cb to your computer and use it in GitHub Desktop.
Save chentz78/a6b085baa07e44d6e717523bce13e3cb to your computer and use it in GitHub Desktop.
Shooting target model with 3 small parts to print in A4 paper and using Tikz and Latex. Preview https://chentz78.github.io/files/target3xSmallA4.pdf
%Based on
%* http://www.texample.net/tikz/examples/polar-coordinates-template/
%* https://michaelgoerz.net/notes/printable-paper-with-latex-and-tikz.html
\documentclass[a4paper, 10pt]{article}
\usepackage{euler}
\usepackage{tikz}
\usepackage{qrcode}
\begin{document}
\pagestyle{empty}
\tikzset{pics/target/.style={
code={%
%Circles
\foreach \r [count=\i] in {1.0,1.5,...,5.0} {
\draw[black] (0,0) circle (\r);
%Radius labels (background filled white)
\draw (0.40+\r,0) node[inner sep=1pt,below=3pt,rectangle,fill=white,xshift=-19pt] {\i};
};
%Main Rays
\foreach \a in {0, 90,...,359}
\draw[dashed,thick] (0,0) -- (\a:5.5);
%Central point
\draw[fill=gray] (0,0) circle (6mm);
%Central point
\draw[fill=white] (0,0) circle (2.2mm);
\draw (5.28, 0.27) node {\LARGE\bf #1}; %Label
}}}
\begin{tikzpicture}[remember picture, overlay]
\tikzset{normal lines/.style={gray, very thin}}
\tikzset{margin lines/.style={gray, thick}}
\tikzset{mm lines/.style={gray, ultra thin}}
\tikzset{strong lines/.style={black, very thin}}
\tikzset{master lines/.style={black, very thick}}
\tikzset{dashed master lines/.style={loosely dashed, black, very thick}}
%A4 Paper = 210mm,297mm
\node at (current page.south west){
\begin{tikzpicture}[remember picture, overlay]
\draw[style=normal lines,step=10mm] (10mm,10mm) grid +(190mm,280mm);
%\draw[style=margin lines] (25mm,0)--(25mm,297mm);
%\draw[style=margin lines] (180mm,0)--(180mm,297mm);
\end{tikzpicture}
};
\node at (current page.north west){
\begin{tikzpicture}[remember picture, overlay]
%Marks
\draw (205mm, -147mm) node {\small\em 148.5mm}; %Vert
\draw (105mm, -4mm) node {\small\em 105mm}; %Horz
%Mark Lines x Cols
\foreach \v [count=\i] in {12,22,32,...,282}
\draw (5mm, -\v mm) node {\i};
\foreach \v [count=\i] in {15,25,...,195}
\draw (\v mm, -291mm) node {\i};
%Version Info
\draw (175mm,-4mm) node {\small\em Cleverton Hentz, Version 1.0, MIT Licence};
\end{tikzpicture}
};
\node at (current page.south east) [xshift=-85pt,yshift=85pt] {
\qrcode[version=2,height=4cm]{https://gist.github.com/chentz78/a6b085baa07e44d6e717523bce13e3cb}
};
\pic at (1.5,-1.5) {target=A};
\pic at (9.5,-9.9) {target=B};
\pic at (1.5,-18.5) {target=C};
\end{tikzpicture}
\end{document}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment