Picture with grey box as backgroundGrey box code and listsMake picture background transparent in...

Which communication protocol is used in AdLib sound card?

How can I get my players to come to the game session after agreeing to a date?

Am I a Rude Number?

Alien invasion to probe us, why?

What is the purpose of easy combat scenarios that don't need resource expenditure?

Has any human ever had the choice to leave Earth permanently?

Citing paywalled articles accessed via illegal web sharing

Why did Luke use his left hand to shoot?

A starship is travelling at 0.9c and collides with a small rock. Will it leave a clean hole through, or will more happen?

Play Zip, Zap, Zop

How to tell if a BJT is PNP or NPN by looking at the circuit?

Move fast ...... Or you will lose

It took me a lot of time to make this, pls like. (YouTube Comments #1)

Is it possible to grant users sftp access without shell access? If yes, how is it implemented?

New package vs new version?

How does Leonard in "Memento" remember reading and writing?

What is the wife of a henpecked husband called?

How to not let the Identify spell spoil everything?

When do I have to declare that I want to twin my spell?

Why did Democrats in the Senate oppose the Born-Alive Abortion Survivors Protection Act (2019 S.130)?

Does dispel magic end a master's control over their undead?

What sets the resolution of an analog resistive sensor?

Why publish a research paper when a blog post or a lecture slide can have more citation count than a journal paper?

Can you tell from a blurry photo if focus was too close or too far?



Picture with grey box as background


Grey box code and listsMake picture background transparent in beamerGetting verbatim with soft grey background, as in tex.stackexchangeProblem with the background image?background framed box with newenvironment “encadre”Lstlisting: width of background boxTwo images with background packageProblem with Background PictureHow to make a background picture transparent?Background Image/picture with margin spacestikzpicture and background package, page bolder not black only grey













5















Does anyone know how I can set up a grey box as background for my images like in this example in the picture below?



Picture with grey box as bg



I had found a good example in Grey box code and lists but it doesn't work with a picture inside.



documentclass{article}

usepackage{color}
definecolor{lightgray}{gray}{0.75}
newcommandgreybox[1]{%
vskipbaselineskip%
parnoindentcolorbox{lightgray}{%
begin{minipage}{textwidth}#1end{minipage}%
}%
vskipbaselineskip%
}

begin{document}
greybox{Content of Grey Box}
...

// but it doesn't work with picture inside:

...
greybox{
begin{figure}[ht]
footnotesize
centering
includegraphics[width=1.0textwidth]{illustrationen/mygraphic.png}
begin{flushright}
Some Reference
end{flushright}
caption{Title}
label{fig:label}
end{figure}
}

end{document}


Anyone a simple idea for that?










share|improve this question









New contributor




user182410 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

























    5















    Does anyone know how I can set up a grey box as background for my images like in this example in the picture below?



    Picture with grey box as bg



    I had found a good example in Grey box code and lists but it doesn't work with a picture inside.



    documentclass{article}

    usepackage{color}
    definecolor{lightgray}{gray}{0.75}
    newcommandgreybox[1]{%
    vskipbaselineskip%
    parnoindentcolorbox{lightgray}{%
    begin{minipage}{textwidth}#1end{minipage}%
    }%
    vskipbaselineskip%
    }

    begin{document}
    greybox{Content of Grey Box}
    ...

    // but it doesn't work with picture inside:

    ...
    greybox{
    begin{figure}[ht]
    footnotesize
    centering
    includegraphics[width=1.0textwidth]{illustrationen/mygraphic.png}
    begin{flushright}
    Some Reference
    end{flushright}
    caption{Title}
    label{fig:label}
    end{figure}
    }

    end{document}


    Anyone a simple idea for that?










    share|improve this question









    New contributor




    user182410 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.























      5












      5








      5








      Does anyone know how I can set up a grey box as background for my images like in this example in the picture below?



      Picture with grey box as bg



      I had found a good example in Grey box code and lists but it doesn't work with a picture inside.



      documentclass{article}

      usepackage{color}
      definecolor{lightgray}{gray}{0.75}
      newcommandgreybox[1]{%
      vskipbaselineskip%
      parnoindentcolorbox{lightgray}{%
      begin{minipage}{textwidth}#1end{minipage}%
      }%
      vskipbaselineskip%
      }

      begin{document}
      greybox{Content of Grey Box}
      ...

      // but it doesn't work with picture inside:

      ...
      greybox{
      begin{figure}[ht]
      footnotesize
      centering
      includegraphics[width=1.0textwidth]{illustrationen/mygraphic.png}
      begin{flushright}
      Some Reference
      end{flushright}
      caption{Title}
      label{fig:label}
      end{figure}
      }

      end{document}


      Anyone a simple idea for that?










      share|improve this question









      New contributor




      user182410 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.












      Does anyone know how I can set up a grey box as background for my images like in this example in the picture below?



      Picture with grey box as bg



      I had found a good example in Grey box code and lists but it doesn't work with a picture inside.



      documentclass{article}

      usepackage{color}
      definecolor{lightgray}{gray}{0.75}
      newcommandgreybox[1]{%
      vskipbaselineskip%
      parnoindentcolorbox{lightgray}{%
      begin{minipage}{textwidth}#1end{minipage}%
      }%
      vskipbaselineskip%
      }

      begin{document}
      greybox{Content of Grey Box}
      ...

      // but it doesn't work with picture inside:

      ...
      greybox{
      begin{figure}[ht]
      footnotesize
      centering
      includegraphics[width=1.0textwidth]{illustrationen/mygraphic.png}
      begin{flushright}
      Some Reference
      end{flushright}
      caption{Title}
      label{fig:label}
      end{figure}
      }

      end{document}


      Anyone a simple idea for that?







      graphics backgrounds






      share|improve this question









      New contributor




      user182410 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.











      share|improve this question









      New contributor




      user182410 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      share|improve this question




      share|improve this question








      edited 4 hours ago









      Martin Scharrer

      202k47645821




      202k47645821






      New contributor




      user182410 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      asked 6 hours ago









      user182410user182410

      283




      283




      New contributor




      user182410 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.





      New contributor





      user182410 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






      user182410 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






















          2 Answers
          2






          active

          oldest

          votes


















          4














          You cannot enclose the figure environment within the argument to greybox. Rather, enclose the contents of the figure environment within the argument to greybox.



          documentclass{article}

          usepackage{color,graphicx}
          definecolor{lightgray}{gray}{0.75}
          newcommandgreybox[1]{%
          vskipbaselineskip%
          parnoindentcolorbox{lightgray}{%
          begin{minipage}{textwidth}#1end{minipage}%
          }%
          vskipbaselineskip%
          }

          begin{document}
          greybox{Content of Grey Box}
          ...

          // but it doesn't work with picture inside:

          ...
          begin{figure}[ht]
          greybox{
          footnotesize
          centering
          includegraphics[width=1.0textwidth]{example-image}
          begin{flushright}
          Some Reference
          end{flushright}
          caption{Title}
          label{fig:label}
          }
          end{figure}

          end{document}


          enter image description here






          share|improve this answer































            2














            You can do this easily using the adjustbox package. It gives you a bgcolor key for the background color. For multi-line content you need to use the minipage key first. You can also easily select the margin around the image by using the margin key.
            If all is textwidth wide then you don't need to center the content, otherwise add the center key at the very end.



            Forthermore, e.g. a frame could be easily added by using e.g. the frame key, in which case you should substract 2fboxrule from the either the minipage width or the margin.



            documentclass{article}

            usepackage{xcolor}
            usepackage{adjustbox}

            usepackage{mwe}% just for example text and images

            begin{document}
            lipsum[0-1]

            begin{figure}[ht]
            footnotesize
            begin{adjustbox}{minipage=textwidth-6pt,margin=3pt,bgcolor=black!40}
            includegraphics[width=1.0textwidth]{example-image}
            adjustbox{right}{Some Reference}% add `minipage=<width>` before `right` if reference has multiple lines
            caption{Title}
            label{fig:label}
            end{adjustbox}
            end{figure}

            lipsum

            end{document}


            enter image description here






            share|improve this answer























              Your Answer








              StackExchange.ready(function() {
              var channelOptions = {
              tags: "".split(" "),
              id: "85"
              };
              initTagRenderer("".split(" "), "".split(" "), channelOptions);

              StackExchange.using("externalEditor", function() {
              // Have to fire editor after snippets, if snippets enabled
              if (StackExchange.settings.snippets.snippetsEnabled) {
              StackExchange.using("snippets", function() {
              createEditor();
              });
              }
              else {
              createEditor();
              }
              });

              function createEditor() {
              StackExchange.prepareEditor({
              heartbeatType: 'answer',
              autoActivateHeartbeat: false,
              convertImagesToLinks: false,
              noModals: true,
              showLowRepImageUploadWarning: true,
              reputationToPostImages: null,
              bindNavPrevention: true,
              postfix: "",
              imageUploader: {
              brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
              contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
              allowUrls: true
              },
              onDemand: true,
              discardSelector: ".discard-answer"
              ,immediatelyShowMarkdownHelp:true
              });


              }
              });






              user182410 is a new contributor. Be nice, and check out our Code of Conduct.










              draft saved

              draft discarded


















              StackExchange.ready(
              function () {
              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f476921%2fpicture-with-grey-box-as-background%23new-answer', 'question_page');
              }
              );

              Post as a guest















              Required, but never shown

























              2 Answers
              2






              active

              oldest

              votes








              2 Answers
              2






              active

              oldest

              votes









              active

              oldest

              votes






              active

              oldest

              votes









              4














              You cannot enclose the figure environment within the argument to greybox. Rather, enclose the contents of the figure environment within the argument to greybox.



              documentclass{article}

              usepackage{color,graphicx}
              definecolor{lightgray}{gray}{0.75}
              newcommandgreybox[1]{%
              vskipbaselineskip%
              parnoindentcolorbox{lightgray}{%
              begin{minipage}{textwidth}#1end{minipage}%
              }%
              vskipbaselineskip%
              }

              begin{document}
              greybox{Content of Grey Box}
              ...

              // but it doesn't work with picture inside:

              ...
              begin{figure}[ht]
              greybox{
              footnotesize
              centering
              includegraphics[width=1.0textwidth]{example-image}
              begin{flushright}
              Some Reference
              end{flushright}
              caption{Title}
              label{fig:label}
              }
              end{figure}

              end{document}


              enter image description here






              share|improve this answer




























                4














                You cannot enclose the figure environment within the argument to greybox. Rather, enclose the contents of the figure environment within the argument to greybox.



                documentclass{article}

                usepackage{color,graphicx}
                definecolor{lightgray}{gray}{0.75}
                newcommandgreybox[1]{%
                vskipbaselineskip%
                parnoindentcolorbox{lightgray}{%
                begin{minipage}{textwidth}#1end{minipage}%
                }%
                vskipbaselineskip%
                }

                begin{document}
                greybox{Content of Grey Box}
                ...

                // but it doesn't work with picture inside:

                ...
                begin{figure}[ht]
                greybox{
                footnotesize
                centering
                includegraphics[width=1.0textwidth]{example-image}
                begin{flushright}
                Some Reference
                end{flushright}
                caption{Title}
                label{fig:label}
                }
                end{figure}

                end{document}


                enter image description here






                share|improve this answer


























                  4












                  4








                  4







                  You cannot enclose the figure environment within the argument to greybox. Rather, enclose the contents of the figure environment within the argument to greybox.



                  documentclass{article}

                  usepackage{color,graphicx}
                  definecolor{lightgray}{gray}{0.75}
                  newcommandgreybox[1]{%
                  vskipbaselineskip%
                  parnoindentcolorbox{lightgray}{%
                  begin{minipage}{textwidth}#1end{minipage}%
                  }%
                  vskipbaselineskip%
                  }

                  begin{document}
                  greybox{Content of Grey Box}
                  ...

                  // but it doesn't work with picture inside:

                  ...
                  begin{figure}[ht]
                  greybox{
                  footnotesize
                  centering
                  includegraphics[width=1.0textwidth]{example-image}
                  begin{flushright}
                  Some Reference
                  end{flushright}
                  caption{Title}
                  label{fig:label}
                  }
                  end{figure}

                  end{document}


                  enter image description here






                  share|improve this answer













                  You cannot enclose the figure environment within the argument to greybox. Rather, enclose the contents of the figure environment within the argument to greybox.



                  documentclass{article}

                  usepackage{color,graphicx}
                  definecolor{lightgray}{gray}{0.75}
                  newcommandgreybox[1]{%
                  vskipbaselineskip%
                  parnoindentcolorbox{lightgray}{%
                  begin{minipage}{textwidth}#1end{minipage}%
                  }%
                  vskipbaselineskip%
                  }

                  begin{document}
                  greybox{Content of Grey Box}
                  ...

                  // but it doesn't work with picture inside:

                  ...
                  begin{figure}[ht]
                  greybox{
                  footnotesize
                  centering
                  includegraphics[width=1.0textwidth]{example-image}
                  begin{flushright}
                  Some Reference
                  end{flushright}
                  caption{Title}
                  label{fig:label}
                  }
                  end{figure}

                  end{document}


                  enter image description here







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered 5 hours ago









                  Steven B. SegletesSteven B. Segletes

                  157k9202411




                  157k9202411























                      2














                      You can do this easily using the adjustbox package. It gives you a bgcolor key for the background color. For multi-line content you need to use the minipage key first. You can also easily select the margin around the image by using the margin key.
                      If all is textwidth wide then you don't need to center the content, otherwise add the center key at the very end.



                      Forthermore, e.g. a frame could be easily added by using e.g. the frame key, in which case you should substract 2fboxrule from the either the minipage width or the margin.



                      documentclass{article}

                      usepackage{xcolor}
                      usepackage{adjustbox}

                      usepackage{mwe}% just for example text and images

                      begin{document}
                      lipsum[0-1]

                      begin{figure}[ht]
                      footnotesize
                      begin{adjustbox}{minipage=textwidth-6pt,margin=3pt,bgcolor=black!40}
                      includegraphics[width=1.0textwidth]{example-image}
                      adjustbox{right}{Some Reference}% add `minipage=<width>` before `right` if reference has multiple lines
                      caption{Title}
                      label{fig:label}
                      end{adjustbox}
                      end{figure}

                      lipsum

                      end{document}


                      enter image description here






                      share|improve this answer




























                        2














                        You can do this easily using the adjustbox package. It gives you a bgcolor key for the background color. For multi-line content you need to use the minipage key first. You can also easily select the margin around the image by using the margin key.
                        If all is textwidth wide then you don't need to center the content, otherwise add the center key at the very end.



                        Forthermore, e.g. a frame could be easily added by using e.g. the frame key, in which case you should substract 2fboxrule from the either the minipage width or the margin.



                        documentclass{article}

                        usepackage{xcolor}
                        usepackage{adjustbox}

                        usepackage{mwe}% just for example text and images

                        begin{document}
                        lipsum[0-1]

                        begin{figure}[ht]
                        footnotesize
                        begin{adjustbox}{minipage=textwidth-6pt,margin=3pt,bgcolor=black!40}
                        includegraphics[width=1.0textwidth]{example-image}
                        adjustbox{right}{Some Reference}% add `minipage=<width>` before `right` if reference has multiple lines
                        caption{Title}
                        label{fig:label}
                        end{adjustbox}
                        end{figure}

                        lipsum

                        end{document}


                        enter image description here






                        share|improve this answer


























                          2












                          2








                          2







                          You can do this easily using the adjustbox package. It gives you a bgcolor key for the background color. For multi-line content you need to use the minipage key first. You can also easily select the margin around the image by using the margin key.
                          If all is textwidth wide then you don't need to center the content, otherwise add the center key at the very end.



                          Forthermore, e.g. a frame could be easily added by using e.g. the frame key, in which case you should substract 2fboxrule from the either the minipage width or the margin.



                          documentclass{article}

                          usepackage{xcolor}
                          usepackage{adjustbox}

                          usepackage{mwe}% just for example text and images

                          begin{document}
                          lipsum[0-1]

                          begin{figure}[ht]
                          footnotesize
                          begin{adjustbox}{minipage=textwidth-6pt,margin=3pt,bgcolor=black!40}
                          includegraphics[width=1.0textwidth]{example-image}
                          adjustbox{right}{Some Reference}% add `minipage=<width>` before `right` if reference has multiple lines
                          caption{Title}
                          label{fig:label}
                          end{adjustbox}
                          end{figure}

                          lipsum

                          end{document}


                          enter image description here






                          share|improve this answer













                          You can do this easily using the adjustbox package. It gives you a bgcolor key for the background color. For multi-line content you need to use the minipage key first. You can also easily select the margin around the image by using the margin key.
                          If all is textwidth wide then you don't need to center the content, otherwise add the center key at the very end.



                          Forthermore, e.g. a frame could be easily added by using e.g. the frame key, in which case you should substract 2fboxrule from the either the minipage width or the margin.



                          documentclass{article}

                          usepackage{xcolor}
                          usepackage{adjustbox}

                          usepackage{mwe}% just for example text and images

                          begin{document}
                          lipsum[0-1]

                          begin{figure}[ht]
                          footnotesize
                          begin{adjustbox}{minipage=textwidth-6pt,margin=3pt,bgcolor=black!40}
                          includegraphics[width=1.0textwidth]{example-image}
                          adjustbox{right}{Some Reference}% add `minipage=<width>` before `right` if reference has multiple lines
                          caption{Title}
                          label{fig:label}
                          end{adjustbox}
                          end{figure}

                          lipsum

                          end{document}


                          enter image description here







                          share|improve this answer












                          share|improve this answer



                          share|improve this answer










                          answered 4 hours ago









                          Martin ScharrerMartin Scharrer

                          202k47645821




                          202k47645821






















                              user182410 is a new contributor. Be nice, and check out our Code of Conduct.










                              draft saved

                              draft discarded


















                              user182410 is a new contributor. Be nice, and check out our Code of Conduct.













                              user182410 is a new contributor. Be nice, and check out our Code of Conduct.












                              user182410 is a new contributor. Be nice, and check out our Code of Conduct.
















                              Thanks for contributing an answer to TeX - LaTeX Stack Exchange!


                              • Please be sure to answer the question. Provide details and share your research!

                              But avoid



                              • Asking for help, clarification, or responding to other answers.

                              • Making statements based on opinion; back them up with references or personal experience.


                              To learn more, see our tips on writing great answers.




                              draft saved


                              draft discarded














                              StackExchange.ready(
                              function () {
                              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f476921%2fpicture-with-grey-box-as-background%23new-answer', 'question_page');
                              }
                              );

                              Post as a guest















                              Required, but never shown





















































                              Required, but never shown














                              Required, but never shown












                              Required, but never shown







                              Required, but never shown

































                              Required, but never shown














                              Required, but never shown












                              Required, but never shown







                              Required, but never shown







                              Popular posts from this blog

                              Benedict Cumberbatch Contingut Inicis Debut professional Premis Filmografia bàsica Premis i...

                              Monticle de plataforma Contingut Est de Nord Amèrica Interpretacions Altres cultures Vegeu...

                              Escacs Janus Enllaços externs Menú de navegacióEscacs JanusJanusschachBrainKing.comChessV