2

Is this possible to change \bclampe color to Black color? My tags are follows:

\documentclass{book}
\usepackage{environ} %fancy boxes
\usepackage{tikz}
\usetikzlibrary{patterns,shapes,arrows,calc,decorations.pathmorphing,backgrounds,graphs,positioning,fit,petri}
\tikzstyle{cuadricula}=[gray ,thick,dashed] %style for tike grids
\usetikzlibrary{decorations}
\usepackage{pgfplots} \pgfplotsset{compat=1.7}
\usepackage[tikz]{bclogo}

\NewEnviron{myidea}[1]
  {\par\medskip\noindent
  \begin{tikzpicture}
    \node[inner sep=0pt] (box) {\parbox[t]{.99\textwidth}{%
      \begin{minipage}{.3\textwidth}
      \centering\tikz[scale=5]\node[scale=2,rotate=30]{\bclampe};
      \end{minipage}%
      \begin{minipage}{.65\textwidth}
      \textbf{#1}\par\smallskip
      \BODY
      \end{minipage}\hfill}%
    };
    \draw[black,line width=3pt]
      ( $ (box.north east) + (-5pt,3pt) $ ) -- ( $ (box.north east) + (0,3pt) $ ) -- ( $ (box.south east) + (0,-3pt) $ ) -- + (-5pt,0);
    \draw[black,line width=3pt]
      ( $ (box.north west) + (5pt,3pt) $ ) -- ( $ (box.north west) + (0,3pt) $ ) -- ( $ (box.south west) + (0,-3pt) $ ) -- + (5pt,0);
  \end{tikzpicture}\par\medskip%
}

\begin{document}

\begin{myidea}{Title}
This is for test. This is for test. This is for test. This is for test. This is for test. This is for test. 
This is for test. This is for test. This is for test. This is for test. This is for test. This is for test. 
This is for test. This is for test. This is for test. This is for test. This is for test. This is for test. 
This is for test. This is for test. This is for test. This is for test. This is for test. This is for test. 
\end{myidea}

\end{document}

PS: I need to get all logos in Black color only...

Henri Menke
  • 109,596
MadyYuvi
  • 13,693
  • @schtandard It's not a duplicate, there is a real answer. – AndréC Aug 02 '19 at 09:01
  • @AndréC Well, it's not impossible to answer duplicate questions. The answer is the same, as well: "LaTeX can't do that for you, you need to change the image with an external editor." – schtandard Aug 02 '19 at 09:05
  • @schtandard The difference here is that the logos provided in the package can be modified with metapost. This has nothing to do with includegraphics. – AndréC Aug 02 '19 at 09:24

1 Answers1

2

The logos in bclogo are drawn with Metapost.

Find bc-lampe.mp on your system. Copy it to your working directory as bc-lampe-bw.mp.

Open the file and change

drawoptions (withcolor (1.000000,1.000000,0.000000));

into

drawoptions (withcolor (1.000000,1.000000,1.000000));

This is where yellow is used, changed into white.

Run Metapost on the file.

In your document, add

\newcommand{\bclampebw}{\includegraphics[width=\logowidth]{bc-lampe-bw}}

and in your code change \bclampe to \bclampebw.

enter image description here

This is the file bc-lampe-bw.mp (already with the change)

prologues:=1;
outputtemplate:="%j.mps";
beginfig(1);
linecap := butt;
fill (7.386720,3.144530)--(9.726560,3.144530)--(9.726560,5.484380)
    --(7.386720,5.484380)--cycle;
pickup pencircle scaled 0.600000bp;
draw (7.386720,3.144530)--(9.726560,3.144530)--(9.726560,5.484380)
    --(7.386720,5.484380)--cycle;
drawoptions (withcolor (1.000000,1.000000,1.000000));
pickup pencircle scaled 0.000000bp;
fill (9.726560,5.484380)--(9.726560,6.261720)..controls (9.726560,8.601560) and (10.894500,8.992190)..(11.675800,10.160200)
    ..controls (12.843800,12.109400) and (12.066400,15.621100)..(8.558590,15.621100)
    ..controls (5.046880,15.621100) and (4.269530,12.109400)..(5.437500,10.160200)
    ..controls (6.218750,8.992190) and (7.386720,8.601560)..(7.386720,6.261720)
    --(7.386720,5.484380)--cycle;
drawoptions (withcolor (0.000000,0.000000,0.000000));
pickup pencircle scaled 0.600000bp;
draw (9.726560,5.484380)--(9.726560,6.261720)..controls (9.726560,8.601560) and (10.894500,8.992190)..(11.675800,10.160200)
    ..controls (12.843800,12.109400) and (12.066400,15.621100)..(8.558590,15.621100)
    ..controls (5.046880,15.621100) and (4.269530,12.109400)..(5.437500,10.160200)
    ..controls (6.218750,8.992190) and (7.386720,8.601560)..(7.386720,6.261720)
    --(7.386720,5.484380);
draw (6.609380,4.312500)--(10.507800,4.312500);
pickup pencircle scaled 0.200000bp;
draw (8.558590,3.535160)..controls (8.945310,7.042970) and (8.167970,10.160200)..(10.117200,11.722700)
    ..controls (9.335940,12.890600) and (7.386720,12.500000)..(6.996090,11.722700)
    ..controls (8.945310,10.160200) and (8.167970,7.042970)..(8.558590,3.535160);
pickup pencircle scaled 0.600000bp;
draw (4.660160,16.007799)--(2.320310,18.347700);
draw (8.558590,17.570299)--(8.558590,20.296900);
draw (12.457000,15.621100)--(14.882800,17.660200);
draw (13.625000,12.890600)--(15.964800,12.890600);
draw (3.488280,12.890600)--(0.761719,12.890600);
r:=17pt/(xpart(urcorner(currentpicture))-xpart(ulcorner(currentpicture)));
picture pic;
pic:=currentpicture;
currentpicture:=nullpicture;
drawoptions();
draw pic scaled(r);
z0=.5*urcorner(currentpicture)+.5*ulcorner(currentpicture);
z1=.5*lrcorner(currentpicture)+.5*llcorner(currentpicture);
draw (z0+(10.5,2));
draw (z1-(10.5,2));
clip currentpicture to ((z0-(8.5pt,0))--(z0+(8.5pt,0))--(z1+(8.5pt,-2pt))--(z1-(8.5pt,2pt))--cycle);
endfig;
end

As far as I can see, bclogo is released under LLPL 1.3, so changing a file is allowed (also changing the name, which is not required, but preferred).

egreg
  • 1,121,712
  • On MikTeX there is only the file bc-lampe.mps on the folder \MiKTeX 2.9\tex\latex\bclogo. It dont have the line drawoptions (withcolor (1.000000,1.000000,0.000000)); – AndréC Aug 02 '19 at 08:37
  • @AndréC You could download it from CTAN, but I spared you the business. – egreg Aug 02 '19 at 08:43
  • @AndréC on my system they are in metapost/bclogo (but I'm using TeXLive which comes with everything) – daleif Aug 02 '19 at 08:44
  • 1
    @egreg Great thanks you :) – AndréC Aug 02 '19 at 08:47
  • 1
    @egreg Thanks, it's working fantastically, I need to convert all tikz logos (e.g., \bcdanger, etc.) into Black color, is there any global possibilities avaliable? advise.. – MadyYuvi Aug 02 '19 at 09:13
  • @MadyYuvi I don't think there is another method other than modifying the colors in all the sources. – egreg Aug 02 '19 at 09:16
  • 1
    @egreg Thanks a lot for your valuable support.... – MadyYuvi Aug 02 '19 at 09:18
  • @MadyYuvi this is not TikZ, but Metapost logos... – AndréC Aug 02 '19 at 09:35
  • 1
    @AndréC Thanks for your notification... – MadyYuvi Aug 02 '19 at 10:00
  • @egreg I have modified all the logos as per your instruction, now got the Black color visually, but in Pitstop professional shows that Black color as combination of RGB/CMYK, is it possible to fix pure Black? Sorry for giving more trouble. Note that I'm using PDFLaTeX in MikTeX V2.9 – MadyYuvi Aug 07 '19 at 07:20