### Include Custom LaTeX Definitions in Paper Preambles Source: https://tikzit.github.io/index.html To make custom LaTeX macros and package definitions available in your final document, include the .tikzdefs file in your paper's preamble using \input{}. Ensure tikzit.sty and the .tikzstyles file are also included. ```latex % paper.tex \documentclass{article} \usepackage{tikzit} \input{sample.tikzstyles} \input{sample.tikzdefs} \begin{document} % ... ``` -------------------------------- ### Define Custom LaTeX Macros for TikZiT Previews Source: https://tikzit.github.io/index.html Use a .tikzdefs file to load LaTeX packages and define custom macros. This file is automatically included by TikZiT when generating previews if it shares the same name as the active .tikzstyles file and is in the same directory. ```latex % sample.tikzdefs \usepackage{bm} \newcommand{\param}[1]{\ensuremath{\vec{\bm{#1}}}} ``` -------------------------------- ### TikZ Style File Grammar Source: https://tikzit.github.io/index.html Defines the grammar for TikZ style files, which consist of \tikzstyle commands. SIMPLE_STRING allows letters, numbers, and whitespace, while DELIMITED_STRING uses curly braces and supports nesting. ```grammar ::= ("\tikzstyle" DELIMITED_STRING "=" "[" "]")* ::= "[" ("," )* "]" ::= "=" | ::= SIMPLE_STRING | DELIMITED_STRING ``` -------------------------------- ### TikZ Figure File Grammar Source: https://tikzit.github.io/index.html Specifies the grammar for TikZ figure files, including the \begin{tikzpicture} environment, node and edge commands, and properties. It covers expressions like ignore, node, edge, and boundingbox. ```grammar ::= "\begin{tikzpicture}" ? * "\end{tikzpicture}" ::= | | | ::= "\begin{pgfonlayer}" DELIMITED_STRING | "\end{pgfonlayer}" ::= "[" ("," )* "]" ::= "=" | ::= SIMPLE_STRING | DELIMITED_STRING ::= "\node" ? "at" DELIMITED_STRING ";" ::= "(" (SIMPLE_STRING) (".center")? ")" ::= "(" NUMBER "," NUMBER ")" ::= "\draw" ? "to" ? ( | "()") ";" ::= "node" ? DELIMITED_STRING ::= "\path" "[use as bounding box]" "rectangle" ";" ``` -------------------------------- ### texopen.py Script for PDF Reverse Lookup Source: https://tikzit.github.io/index.html This Python script is used to open files from a PDF viewer. It checks if the file is a .tikz file and opens it with 'tikzit', otherwise it opens the file with 'subl' (Sublime Text) at the specified line. Customize 'subl' to your preferred editor. ```python #!/usr/bin/python import sys import subprocess if len(sys.argv) >= 3: file = sys.argv[1] line = sys.argv[2] print(file) print(line) if file.endswith('.tikz'): subprocess.call(['tikzit', file]) else: subprocess.call(['subl', file + ':' + line]) ``` -------------------------------- ### Include TikZ Figures in LaTeX Source: https://tikzit.github.io/index.html Use `\tikzfig` for inline inclusion and `\ctikzfig` for centered inclusion of TikZ figures. These macros search for `.tikz` files in the current directory or a `figures` subdirectory. Ensure figures are centered on the origin for proper alignment. ```latex % paper.tex \documentclass{article} \usepackage{tikzit} \input{sample.tikzstyles} \begin{document} A tikz picture as an equation: \begin{equation} \tikzfig{fig1} \end{equation} A centered tikz picture: \ctikzfig{fig1} \end{document} ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.