Posts

Showing posts with the label Backgrounds

Changing Background Color Of Text In Latex

Image
Answer : I know this question has been answered very extensively. But not what I wanted or thought was the question based on the title. Therefore if others get in here looking for a possibility for colouring behind a word than this snippet is much easier: \colorbox{blue!30}{blue} or \textcolor{blue!30}{blue} resulting in: This is possible by only adding \usepackage{xcolor} . Just some extra info :) Colour Several Lines It is correct that the above methods does not work for several lines, if you to be more than one line you can do: {\color{green} the text you want to write} This can however also be wrapped in a function so it is easier to use several places during edits, e.g., for colouring new text or whatever: \newcommand{\added}[1]{{\color{green}[added]:#1}} I prefer using tcolorbox thinking that in future you may want the background to be fashionable. I have given many options (which are not needed for this particular case) in the tcbset so that you can p...

Change The Background Color Of A Frame In Beamer

Image
Answer : Modify the background canvas before you begin the frame, not within the frame. To keep the effect of the color change local, you could use curly braces around the frame and that command, or \begingroup ... \endgroup . { \setbeamercolor{background canvas}{bg=violet} \begin{frame} % frame contents here \end{frame} } Put the \setbeamercolor command outside the frame. This will change the background colour for every subsequent frame. If you want to just change that slide, you can surround the frame and the command in {} Here's a complete example: \documentclass{beamer} \begin{document} \begin{frame}{A white frame} \end{frame} % Change all subsequent frames to violet \setbeamercolor{background canvas}{bg=violet!20} \begin{frame}{A violet frame} \end{frame} \begin{frame}{This frame is also violet} \end{frame} % But this frame only will be yellow: note { ... } around % the \setbeamercolor and the frame to limit the scope {\setbeamercolor{background canvas}{bg=ye...