0

QUESTION: Can anyone show me how to specify the width of a bclogo box? I have not found an answer to this nor have I been able to figure out how to do it.

Consider, for example,

 \documentclass[article]{book}
\usepackage{xcolor}
\usepackage[tikz]{bclogo}
\usepackage{lipsum}

    \begin{document}
    \thispagestyle{empty}
    
    \lipsum[1]
    
    \vskip 20pt
    
    \begin{center} 
    \begin{bclogo}[
    couleur=red!10,         % background color
    marge=10,               % margin in pt
    epBord=2.5,             % border width
    arrondi=0,              % corner radius
    ombre=true,             % shadow
    blur,                   % blur
    couleurBord=blue!14,    % border color
    logo=,                  % no built-in logo
    barre=none,            % border style
    tailleOndu=1.5          % border amplitude (zigzag)
    ]
    {\vskip -11pt {\color{black} This is a sentence. This is another sentence. This is another sentence. This is another sentence. This is another sentence. This is another sentence. This is another sentence. This is another sentence. This is another sentence. \vspace*{-15pt}}}
    \end{bclogo}
    \end{center}
    \end{document}

The output is:

enter image description here

I would like to be able to specify the width of the displayed box so that I may either increase it or decrease it accordingly. I do not know what the default is---using bclogo always seems to produce a box that is close in width to the textwidth.

Thank you.

2
  • Not related with the question, but you have written the box contents as title. The use of bclogo environment is: \begin{bclogo}[optional options]{title} text inside the box \end{bclogo}.
    – Ignasi
    Commented Apr 13, 2021 at 14:33
  • @Ignasi I do not recall having tried that; but thank you for your posted answer. it works quite nicely.
    – DDS
    Commented Apr 13, 2021 at 16:53

1 Answer 1

3

According bclogo documentation, it defines margeG and margeD as external margins, but they didn't work for me.

If you want to keep using bclogo a possible solution would be to insert it inside a \minipage with desired width:

\documentclass[article]{book}
\usepackage{xcolor}
\usepackage[tikz]{bclogo}
\usepackage{lipsum}

    \begin{document}
    \thispagestyle{empty}
    
    \lipsum[1]
    
    \begin{bclogo}[
    couleur=red!10,         % background color
    marge=10,               % margin in pt
    epBord=2.5,             % border width
    arrondi=0,              % corner radius
    ombre=true,             % shadow
    blur,                   % blur
    couleurBord=blue!14,    % border color
    logo=,                  % no built-in logo
    barre=none,            % border style
    tailleOndu=1.5          % border amplitude (zigzag)
    ]{}
    This is a sentence. This is another sentence. This is another sentence. This is another sentence. This is another sentence. This is another sentence. This is another sentence. This is another sentence. This is another sentence.
    \end{bclogo}

{\par\centering
\begin{minipage}{.75\linewidth}
    \begin{bclogo}[
    couleur=red!10,         % background color
    marge=10,               % margin in pt
    epBord=2.5,             % border width
    arrondi=0,              % corner radius
    ombre=true,             % shadow
    blur,                   % blur
    couleurBord=blue!14,    % border color
    logo=,                  % no built-in logo
    barre=none,            % border style
    tailleOndu=1.5          % border amplitude (zigzag)
    ]{}
    This is a sentence. This is another sentence. This is another sentence. This is another sentence. This is another sentence. This is another sentence. This is another sentence. This is another sentence. This is another sentence.
    \end{bclogo}
\end{minipage}
\par}

\end{document}

enter image description here

As an alternative, you could try with tcolorbox (It's not difficult to simulate a bclogo box with tcolorbox):

\documentclass{article}
\usepackage{lipsum}
\usepackage[most]{tcolorbox}

\newtcolorbox{mybox}[1][]{
enhanced, colback=red!10, colframe=blue!14, boxrule=2.5pt, sharp corners, drop fuzzy shadow, #1
}


\begin{document}
\thispagestyle{empty}
    
\lipsum[2]
   
\begin{mybox}
\lipsum[2]
\end{mybox}  

\begin{mybox}[width=.75\linewidth, center]
\lipsum[2]
\end{mybox}  
  
\end{document}

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .