5

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?

  • 1
    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
6

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

enter image description here

Try instead: pattern: ^\s*%\s+.

araraconfig.yaml:

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

Running arara succeds:

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

Processing 'test.tikz' (size: 205 bytes, last modified:
02/09/2019 21:57:14), please wait.

(LuaLaTeX) LuaLaTeX engine .............................. SUCCESS
(LuaLaTeX) LuaLaTeX engine .............................. SUCCESS

Total: 2.31 seconds

Result (zoomed in a bit):

enter image description here

  • 1
    Aha! Thank you! I totally missed that warning – anthsts Feb 9 at 22:23
  • 2
    Well, this applies here too – DG' Feb 9 at 22:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.