Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

9.6.3 infobox code #393

Open
jdambroise opened this issue Aug 12, 2023 · 4 comments
Open

9.6.3 infobox code #393

jdambroise opened this issue Aug 12, 2023 · 4 comments

Comments

@jdambroise
Copy link

jdambroise commented Aug 12, 2023

In 9.6.3 it appears there is an error in the following code. The image appears outside of the blackbox not inside. Although I'm playing around to find a solution myself, I wonder if someone can provide a correction quicker than I can figure it.

 \newenvironment{infobox}[1]
   {
   \begin{itemize}
   \renewcommand{\labelitemi}{
     \raisebox{-.7\height}[0pt][0pt]{
       {\setkeys{Gin}{width=3em,keepaspectratio}
         \includegraphics{images/#1}}
     }
   }
   \setlength{\fboxsep}{1em}
   \begin{blackbox}
   \item
   }
   {
   \end{blackbox}
   \end{itemize}
   }
@jdambroise jdambroise changed the title 9.6.3 parenthesis 9.6.3 infobox code Aug 12, 2023
@jdambroise
Copy link
Author

Got it. Here is the solution.

 \newenvironment{infobox}[1]
   {
   \begin{blackbox}
   \begin{itemize}
   \renewcommand{\labelitemi}{
     \raisebox{-.7\height}[0pt][0pt]{
       {\setkeys{Gin}{width=3em,keepaspectratio}
         \includegraphics{images/#1}}
     }
   }
   \setlength{\fboxsep}{1em}
   \item
   }
   {
   \end{itemize}
   \end{blackbox}
   }

@cderv
Copy link
Collaborator

cderv commented Aug 22, 2023

This is how it looks like in current PDF book I believe
image

I believe this is expected for us that the icon is not inside the blackbox... @yihui I don't have the printed version with me, but is there any change ?

You could indeed put inside the blackbox, and glad you found the solution BTW.

@dambroisej
Copy link

oh that looks nice too, thanks ! i will do another comparison and make a choice

@yihui
Copy link
Member

yihui commented Aug 22, 2023

I believe this is expected for us that the icon is not inside the blackbox... @yihui I don't have the printed version with me, but is there any change ?

@cderv That's what we have in the printed version. The icons are not inside the boxes.

@jdambroise Thanks for sharing the solution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants