7

This is a follow-up to this question.

I use the standalone documentclass to externalize my tikzpictures. Now, I want to include it in a beamer presentation with its color theme set to, say, default. I'd like that the colors I use in the standalone tikzpicture match those defined in the presentation (structure, normal text.fg, example text.fg, etc). How can I do?

Ideally, I'd like something like

\documentclass{standalone}
\usepackage{tikz}
\ImportColorDefinitionsFromBeamerColorTheme{default}
\begin{document}
\begin{tikzpicture}
  \draw[structure.fg] (0,0) -- (1,1);
  \draw[palette primary.fg] (0,1) -- (1,0);
\end{tikzpicture}
\end{document}

(notice that palette primary.fg won't work in beamer either, one need to use \usebeamercolor[fg]{palette primary} and I don't know how to do it with tikz).

7
\documentclass[tikz,beamer]{standalone}
\begin{document}
\begin{tikzpicture}
  \draw[structure.fg] (0,0) -- (1,1);
  \usebeamercolor{palette primary}
  \draw[fg] (0,1) -- (1,0);
\end{tikzpicture}
\end{document}
  • 2
    Minor issue though: the resulting bounding box fits the frame (IIUC) and no more the tikzpicture. – cjorssen Jan 8 '14 at 11:39

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.