Convert TikZ code to beautiful diagrams that can be shown in AI chat or created manually through a form interface.
You need to have LaTeX installed with the TikZ package. On macOS, you can install either:
Option 1: MacTeX (Full, ~4GB)
brew install --cask mactex
Option 2: BasicTeX (Minimal, ~100MB) - Recommended
brew install --cask basictex
After installing BasicTeX, add it to your PATH and install required packages:
# Add to PATH (add this to your ~/.zshrc or ~/.bash_profile)
export PATH="/Library/TeX/texbin:$PATH"
# Reload your shell or run:
source ~/.zshrc
# Install required packages
sudo tlmgr update --self
sudo tlmgr install standalone tikz pgf
Verify Installation:
pdflatex --version
kpsewhich standalone.cls # Should return a path
When you ask Raycast AI to create a TikZ diagram:
pdflatexImportant Notes:
~/Library/Application Support/com.raycast.macos/extensions/tikz/tikz-diagrams/The AI can use the Generate TikZ Diagram tool to create diagrams during a conversation. Simply describe what you want to draw, and the AI will generate the appropriate TikZ code and compile it.
Example AI prompts:
The tool will:
Use the Create TikZ command to manually create diagrams:
\begin{tikzpicture} wrapper)Example TikZ Code:
\draw (0,0) circle (1cm);
\draw (0,0) -- (1,1);
\node at (0,-1.5) {My Circle};
\node[circle,draw] (a) at (0,0) {A};
\node[circle,draw] (b) at (2,0) {B};
\node[circle,draw] (c) at (1,-1.5) {C};
\draw[->] (a) -- (b);
\draw[->] (b) -- (c);
\draw[->] (c) -- (a);
\draw[->] (-3,0) -- (3,0) node[right] {$x$};
\draw[->] (0,-2) -- (0,2) node[above] {$y$};
\draw[domain=-3:3,smooth,variable=\x,blue] plot ({\x},{sin(\x r)});
~/Library/Application Support/com.raycast.macos/extensions/tikz/tikz-diagrams/~/Documents/TikZ-Diagrams/The tool automatically includes commonly used TikZ libraries:
arrows - Arrow tips and stylesautomata - State diagrams and automatapositioning - Advanced node positioningshapes - Various geometric shapescalc - Coordinate calculationsdecorations.pathreplacing - Path decorationsdecorations.markings - Path markingspatterns - Fill patternsIf you get an error about pdflatex not being found:
/Library/TeX/texbin is in your PATH:
echo $PATH | grep texbin
If not found, add to your ~/.zshrc:
export PATH="/Library/TeX/texbin:$PATH"
which pdflatexIf the tool succeeds but Gemini generates its own diagram instead:
Check the returned path in the AI logs - it should be an absolute path like:
/Users/.../Library/Application Support/.../tikz-diagrams/diagram_123456.pdf
Verify the PDF exists:
ls -lh ~/Library/Application\ Support/com.raycast.macos/extensions/tikz/tikz-diagrams/
Open it manually to verify it's correct:
open ~/Library/Application\ Support/com.raycast.macos/extensions/tikz/tikz-diagrams/diagram_*.pdf
If PDF is correct but not displayed: This is a Raycast AI limitation. The tool is working correctly, but the AI may choose to generate its own diagram instead of using the file.
If you get this error even though pdflatex is installed:
If you passed a complete LaTeX document: The tool now automatically handles this! You can pass either:
\draw (0,0) circle (2);\documentclass, \usepackage, etc.The tool will automatically strip the document structure and add its own wrapper.
If the error persists:
.log file in the output directory for detailed errorskpsewhich standalone.cls
kpsewhich tikz.sty
sudo tlmgr install standalone tikz pgf
TESTING.md:
cd /tmp
cat > test.tex << 'EOF'
\documentclass[border=2pt]{standalone}
\usepackage{tikz}
\begin{document}
\begin{tikzpicture}
\draw (0,0) circle (2);
\end{tikzpicture}
\end{document}
EOF
pdflatex test.tex
open test.pdf
If your TikZ code fails to compile:
Check for missing packages: If you see "File `standalone.cls' not found":
sudo tlmgr install standalone
Check your TikZ syntax - make sure commands end with semicolons
The tool accepts both:
\draw (0,0) circle (1cm);Verify packages are installed:
kpsewhich standalone.cls
kpsewhich tikz.sty
Try compiling manually to see detailed errors:
cd ~/Documents/TikZ-Diagrams
pdflatex your-file.tex
cat your-file.log
If the PDF is generated but doesn't open:
\draw[fill=blue!20] (0,0) rectangle (2,2);
\draw[fill=red!20] (3,0) circle (1);
\draw[fill=green!20] (6,0) -- (7,0) -- (6.5,1.5) -- cycle;
\node[rectangle,draw] (start) at (0,0) {Start};
\node[rectangle,draw] (process) at (0,-2) {Process};
\node[diamond,draw,aspect=2] (decision) at (0,-4) {Decision?};
\node[rectangle,draw] (end) at (0,-6) {End};
\draw[->] (start) -- (process);
\draw[->] (process) -- (decision);
\draw[->] (decision) -- node[right] {Yes} (end);
\draw[->] (decision) -| node[above] {No} (2,-4) |- (process);
\draw[->] (0,0) -- (5,0) node[right] {$x$};
\draw[->] (0,0) -- (0,4) node[above] {$y$};
\draw[domain=0:4.5,smooth,variable=\x,blue,thick] plot ({\x},{0.5*\x*\x});
\node[blue] at (2.5,3.5) {$y = \frac{1}{2}x^2$};
If you get "Failed to compile TikZ diagram" errors even though pdflatex works in your terminal, it's likely a PATH issue.
The Problem:
Raycast extensions run in a restricted environment where the PATH doesn't automatically include /Library/TeX/texbin. Even though you can run pdflatex in your terminal, the extension can't find it.
The Solution:
The extension now automatically searches for pdflatex in these locations (in order):
/Library/TeX/texbin/pdflatex (standard MacTeX/BasicTeX location)/usr/local/texlive/2025basic/bin/universal-darwin/pdflatex/usr/local/texlive/2024/bin/universal-darwin/pdflatex/usr/local/bin/pdflatex/opt/homebrew/bin/pdflatexwhich pdflatex using the system PATHTo verify pdflatex is found:
# Check if pdflatex is executable
test -x /Library/TeX/texbin/pdflatex && echo "Found!"
# Or check with which
which pdflatex
Manual test to verify compilation works:
cd ~/Library/Application\ Support/com.raycast.macos/extensions/tikz/tikz-diagrams/
# Find a .tex file that was created
ls -lt *.tex | head -1
# Compile it manually
pdflatex -interaction=nonstopmode <filename>.tex
# Check if PDF was created
ls -lt *.pdf | head -1
If manual compilation works but the extension still fails, check the Raycast console logs (Cmd+Shift+D in development mode) for detailed error messages.
MIT
Visual-Studio-Coder