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'd like to reproduce the chemmacros logo style, as seen in chemmacros documentation

I checked the source .tex file, but the logo is loaded from another pdf "chemmacros-logo.pdf" that is nowhere to be found into TeX Live.

Since I'm assuming the logo is drawn with TikZ or something, is its code available somewhere?

share|improve this question
1  
Why not asking @cgnieder? He can often be found in the chat room? –  percusse Aug 15 at 13:41
1  
@percusse Yes, I could, but maybe this may also be of general interest? If not I'll ask him in chat. –  RbW Aug 15 at 13:42
    
Can you be a bit more precise on what you define as logo style? All i see is the name written in bold and a dark red. –  Johannes_B Aug 15 at 13:44
    
@Johannes_B I mean the style of the formula below the email. That formula is the "chemmacros-logo" according to the .tex file. –  RbW Aug 15 at 13:46
    
Just noted it myself, good question ;-) –  Johannes_B Aug 15 at 13:47

1 Answer 1

up vote 18 down vote accepted

enter image description here

Here's the code I used to produce the “logo”. The font is Augie, the redox arrows are drawn with chemmacros' own macros, the lines are decorated with @percusse's pencilline decoration (compile two times with xelatex):

% arara: xelatex
% arara: xelatex
\documentclass[margin=1cm]{standalone}
\usepackage{fontspec}
\usepackage{chemmacros}
\usetikzlibrary{calc,positioning,decorations.pathmorphing,patterns}

% credits:
% http://tex.stackexchange.com/a/49961/
\pgfdeclaredecoration{pencilline}{initial}{
  \state{initial}[
    width=+\pgfdecoratedinputsegmentremainingdistance,
    auto corner on length=1mm
  ]{
    \pgfpathcurveto%
      {% From
        \pgfqpoint
          {\pgfdecoratedinputsegmentremainingdistance}
          {\pgfdecorationsegmentamplitude}
      }
      {%  Control 1
        \pgfmathrand
        \pgfpointadd
          {\pgfqpoint{\pgfdecoratedinputsegmentremainingdistance}{0pt}}
          {%
            \pgfqpoint
              {-\pgfdecorationsegmentaspect\pgfdecoratedinputsegmentremainingdistance}%
              {\pgfmathresult\pgfdecorationsegmentamplitude}
          }
      }
      {%TO 
        \pgfpointadd
          {\pgfpointdecoratedinputsegmentlast}
          {\pgfpoint{1pt}{1pt}}
      }
  }
  \state{final}{}
}
\tikzset{pencil/.style={decorate,decoration=pencilline}}
\begin{document}
   \ch[font-spec={Augie}]{
     2 "\OX{o1,\ox{0,Na}}" + "\OX{r1,\ox{0,Cl}}" {}2
     ->
     2 "\OX{o2,\ox{+1,Na}}" {}+ + 2 "\OX{r2,\ox{-1,Cl}}" {}-
   }
   \redox(o1,o2)[red,pencil,-cf]{%
     \small\ch[font-spec={[Color=red]Augie},math-space=.3em]{$-$ 2 e-}}
   \redox(r1,r2)[blue,pencil,-cf][-1]{%
     \small\ch[font-spec={[Color=blue]Augie},math-space=.3em]{$+$ 2 e-}}
\end{document}

A possible improvement: adding

\setchemformula{ arrow-style = pencil }

will also draw the reaction arrow with the pencilline decoration. I might add this to the next version.

enter image description here

share|improve this answer
1  
OK, that does it. I gotta polish this thing. It's poisoning even very sound packages :P –  percusse Aug 15 at 20:09
    
@percusse: sir I read penicillin instead of pencilline. :P –  Paulo Cereda Aug 15 at 21:59
    
@Paulo me too :) not completely unfitting for a chemical picture... –  cgnieder Aug 16 at 5:20

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.