TransWikia.com

Need help for environment

TeX - LaTeX Asked on December 22, 2020

I wrote for a beamer this in my code:

documentclass[11pt]{beamer}
usepackage[utf8]{inputenc}
usepackage[italian]{babel}
usepackage{amsmath}
usepackage{amsfonts}
usepackage{amssymb}
usetheme{Dresden}
definecolor{studentblue}{RGB}{37,34,140}
BeforeBeginEnvironment{definition}{
    setbeamercolor{block title}{fg=white,bg=studentblue}
    setbeamercolor{block body}{fg=black, bg=studentblue!20!white}
}

AfterEndEnvironment{definition}{
    setbeamercolor{block title}{use=structure,fg=white,bg=structure.fg!75!black}
    setbeamercolor{block body}{parent=normal text,use=block title,bg=block title.bg!10!bg}
}
begin{document}
begin{frame}
begin{definition}
test
end{definition}
end{frame}
end{document}

to obtain a block with these colours and with "Definition" as title of the block. I want to change the word in the title, I thought it was sufficient to change the word after BeforeBeginEnvironment and AfterEndEnvironment between the curly brackets but it isn’t. What should I do? Thanks

One Answer

Not sure why, but it seems necessary to explicitly load Italian for translator to work.

documentclass[11pt]{beamer}
usepackage[T1]{fontenc}
usepackage[italian]{babel}

usetheme{Dresden}

uselanguage{Italian}
languagealias{italian}{Italian}

definecolor{studentblue}{RGB}{37,34,140}

BeforeBeginEnvironment{definition}{%
    setbeamercolor{block title}{fg=white,bg=studentblue}%
    setbeamercolor{block body}{fg=black, bg=studentblue!20!white}%
}
AfterEndEnvironment{definition}{%
    setbeamercolor{block title}{use=structure,fg=white,bg=structure.fg!75!black}%
    setbeamercolor{block body}{parent=normal text,use=block title,bg=block title.bg!10!bg}%
}
begin{document}
begin{frame}
begin{definition}
test
end{definition}
end{frame}
end{document}

enter image description here

Answered by egreg on December 22, 2020

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP