Skip to content

tdehaeze/OrgMode-Babel-Tikz

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

72 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tikz Pictures Maker

Org Publish Configuration

(setq org-publish-project-alist
      '(("tikz-maker"
         :base-directory "~/Cloud/thesis/latex/org/"
         :base-extension "org"
         :publishing-directory "~/Cloud/thesis/latex/docs/"
         :author "Dehaeze Thomas"
         :email "[email protected]/"
         :recursive nil
         :publishing-function org-html-publish-to-html
         :auto-preamble t
         :auto-sitemap nil
         :html-link-up "index.html"
         :html-link-home "index.html"
         :with-todo-keywords nil
         :html-wrap-src-lines nil
         :table-of-contents nil)))

Import the Tikz/PDF file into your document

You should create one .tex file for each Tikz picture with the standalone class as below.

\documentclass[10pt,tikz]{standalone}

\ifstandalone%
    \usepackage{import}
    \import{../../configuration/}{comon_packages.tex}%

    \import{../../configuration/}{conftikz.tex}%
    \import{../../configuration/}{custom_config.tex}%
\fi

\begin{document}
    \begin{tikzpicture}
        \draw[->, >=latex] (0, 0) -- (0, 1);
    \end{tikzpicture}
\end{document}

This file should be located in the ressources/tikz/ directory. This permit to compile this file on its own. Alternatively, you can use make tikz f=filename to create a this tikz file.

To include it into your document, you could use \includestandalone like below.

\begin{figure}[ht]
    \centering
    \includestandalone{filename}
    \caption{Caption}%
    \label{fig:label}
\end{figure}

But it will compile each time you make your main file and it will not work for subfiles for some reasons.

You should instead generate a pdf from this tikz file (using make pdf f=filename t=tikz). It will create the file filename.pdf in the same directory (ressources/tikz).

You can then include it using \includegraphics.

\begin{figure}[ht]
    \centering
    \includegraphics{filename}
    \caption{Caption}%
    \label{fig:label}
\end{figure}

It will produce the exact same output but with no compilation time.

About

Create Tikz Diagram using Org-Mode Babel

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages