I'm wanting to adapt the following macro(s) to provide three different options of style heading. At the moment, if offers two, one if the section is normal (numbered) and another for section* (un-numbered). I want a second un-numbered option (which will have an margin image (with a second, different icon to people.pdf) instead).

I've remarked-out (%) the two lines with ssection in them (i.e. the inadequate definition and the corresponding line in the sample document), because that produces an error. I understand that it can't be done simply by adding a third definition, because there's an ifstar statement with only two options, not three. Thus I'm unsure how to proceed.

Existing macro outputs thus: http://cl.ly/082k1i2w0e2t/sidebar-images.pdf

(I'd also be interested to know if there is a way of adapting a subsequent titlebar@@@ definitions by building on one of the other ones…but perhaps that warrants a separate question?)



%   number section bar      
\tikz[baseline,trim left=3.1cm,trim right=3.0cm] {
    \fill [black!15] (2.5cm,-1ex) rectangle (\textwidth+3.1cm,2.5ex);
    \node [
        anchor= base east,
        rounded rectangle,
        minimum height=3.75ex] at (3cm,0.01) {

%   section bar, icon 1 
\tikz[baseline,trim left=3.1cm,trim right=3.15cm] {
    \fill [black!15] (2.5cm,-1ex) rectangle (\textwidth+3.1cm,2.5ex);
{people.pdf}    }

%   section bar, icon 2 
\tikz[baseline,trim left=3.1cm,trim right=3.15cm] {
    \fill [black!15] (2.5cm,-1ex) rectangle (\textwidth+3.1cm,2.5ex);

%   make title commands
%   \newcommand{\ssection}[1]{\section*{\titlebar*#1}}


You make this in a wrong way Define 3 command


moreother if you are using consécutively the same title bar style you can call the custom command only once and call \section for the other times.

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.