# Convince Arara to compile .tikz files

I have recently learned about the package tikzscale and find it to be a great solution to many issues I was having. However, using it requires the file containing the tikz code to have the extension .tikz. Previously all my tikz files would be standalone so i could compile them independently to inspect the output, but with the tikz extension I can't figure out how to compile my standalone tikz pictures using arara directives like usual.

My .tikz files looks like this

% arara: lualatex
% arara: lualatex

\documentclass[tikz]{standalone}

\begin{document}
\begin{tikzpicture}
\fill [orange] (0.1, 0.1) rectangle (0.2, 0.3);
\end{tikzpicture}
\end{document}

I have attempted to modify the araraconfig.yaml file to contain the following:

!config
filetypes:
- extension: tex
- extension: dtx
- extension: ltx
- extension: tikz
pattern: ^(\\s)*%\\s+

but arara fails, saying ...no directives were found. Is there a way to convince arara to treat a .tikz file as it would a .tex file, or do i need to add a whole new set of rules to my arara rules for the .tikz extension?

• I think the pattern is wrong (don't escape the backslashes). Try pattern: ^(\s)*%\s+ or the default pattern from the manual: ^\s*%\s+ – DG' Feb 9 at 21:06

The pattern is wrong. You don't have to escape backslashes.

araraconfig.yaml:

!config
filetypes:
- extension: tex
- extension: dtx
- extension: ltx
- extension: tikz
pattern: ^\s*%\s+

Running arara succeds:

__ _ _ __ __ _ _ __ __ _
/ _ | '__/ _ | '__/ _` |
| (_| | | | (_| | | | (_| |
\__,_|_|  \__,_|_|  \__,_|