I would like to define a style (e. g. style=techDraw) that gives me the possibility to define the behavior of all technical drawings made by tikz or imported as pdf_tex a. s. o. when the style techDraw is set for this graphic.
It should enable a standardized font (in my case DIN EN ISO 3098 approximated by osifont.ttf), a font size that varies by the paper format (e. g. 7 mm height for DIN A4) and proper parsing of all appearing numbers by siuntix
For example a drawing like this shall be taken. And also a graphic I exported from inkscape with pdf and text separated. I would like to get settings like this:
%The following commands are invented and not serving as an MWE
\documentclass[tikz]{standalone}
\usepackage{siunitx}
\usepackage{ifthen}
\defineGraphicsStyle{techDraw/.style=
{\sisetup{mode=text, parse-numbers=true},
\setmainfont{osifont},
% some if-else routine to change fontsize (if papersize = A4 set fontsize = 7mm else...)
%maybe some function telling latex, that all text should be treated as math input.
%Include "$ $" to all text fields.
\tikzset{font=osifont}}}
\begin{document}
\begin[style=techDraw]{tikzpicture}
%some nodes with input such as dimensions "15000", angles "\ang{90}",
%symbols "\alpha" or units "\SI{5}{\kilogram}"
\end{tikzpicture}
%
\begin[style=techDraw]{figure}
\input{someInkscapeDrawing.pdf_tex}
%it would be easier not to write "$ $" and "\num" when constructing the original svg.
%Therefore same settings as above would be useful.
\end{figure}
\end{document}
I'm very sorry for such ugly code. I just want to give some ideas of what I imagine and don't know how to implement. The idea for that is to get a template for ISO-conform drawings in each thesis.
While trying around (for a single graphic as I don't know how to set it globally without affecting other fonts) I got a problem with siunitx. The included MWE shows, that the "dot" and "comma" symbol of my font is not used by the \num{} operation.
\documentclass{scrreprt}
\usepackage[ngerman]{babel}
\usepackage[]{siunitx}
\usepackage{xltxtra,fontspec,xunicode}
\setmainfont{osifont}
%
\begin{document}
%
\noindent 123456789.0\\
\num{123456789.0}\\
123456789,0\\
\sisetup{locale=DE}
\num{123456789,0}
%
\end{document}
osifont. Regarding your problem, thetextmode ofsiunitxhelps with the font issue:\num[mode=text]{123456789,0}– Qrrbrbirlbel Jul 02 '13 at 15:33siuntix-commands and let the numbers be parsed automatically. – LaRiFaRi Jul 02 '13 at 15:45modeismathwhich means that it uses the math font. For some reason,siunitxchooses the text font for digits (even in math-mode itself). Themodeoption (which should be applied consistently with\sisetup) forces always text-mode. You need to go in more detail what you mean by “style template”. What (or who) should parse your numbers automatically? I am also missing the connection to TikZ here. Can you extend your question? – Qrrbrbirlbel Jul 02 '13 at 16:14