Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I would like to have a single definition of my company logo. Right now, I have it defined to just fit on a letter sized paper. It is completely defined in TikZ filled paths. As you would expect, it scales well and is legible down to sizes well below what I ever expect to need.

I have a custom document header also drawn in TikZ. I want to put the logo in the header at a scale of 0.1. I realize I could just draw the logo at that scale, taking all the points of my current definition and scaling them to the size I need. That leads to a lot of work and duplication… which feels like the wrong way to go about it.

Is there a way I can, in a separate file or in the preamble somewhere, define a TikZ picture that can them be embedded at one scale in my TikZ picture and then called again at another scale somewhere else in the document? The major objective being reuse of a single definition of the logo.

I have tried a few different tricks I found around the forums that allude to but don't directly address my problem, but I am afraid I don't grok LaTeX well enough yet to pull this off without your help.

share|improve this question
2  
Welcome to TeX.SX! A screen shot of that company logo would be very nice, as well as a MWE, see minimal working example (MWE) that illustrates your problem. It will be much easier for us to reproduce your situation and find out what the issue is when we see compilable code, starting with \documentclass{...} and ending with \end{document}. –  Christian Hupfer Aug 4 at 19:08

1 Answer 1

One suggestion: define a macro for the body of the TikZ that draws the company logo in an external file, then place it in tikzpicture environments with different scale options.

Minimal example:

Have an external file called companylogo.tex:

 \usepackage{tikz}

 \newcommand{\PPCompanyLogo}{
   \draw (0,0) rectangle (1,1);
   \draw (0,0) -- (0.5,1) -- (1,0);
 }

Then in your main file, include it as follows:

  \documentclass{article}

  \input{companylogo}

  \begin{document}

  \begin{header} % Not real, but you get the gist
    \begin{tikzpicture}[scale=0.1]
      \PPCompanyLogo
    \end{tikzpicture}
  \end{header}

  Some text goes here, and then here is our fancy company logo:

  \begin{tikzpicture}[scale=0.8]
    \PPCompanyLogo
  \end{tikzpicture}

  \end{document}

If a simple scale key doesn’t work, then you might want to look at How to scale a tikzpicture including texts? for more fine-grained options for scaling TikZ drawings.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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