Scientific Word/Workplace ⇒ Formula in colored Frame and filled Box
Formula in colored Frame and filled Box
I am newbie. How do i want to border formula have created as word? And how is it fill color?
Thanks!
- Attachments
-
- The desired result.
- formula-bordered.png (2.49 KiB) Viewed 42299 times
Reason: Preferably no external links (see Board Rules). Attachments go onto the forum server where possible.
NEW: TikZ book now 40% off at Amazon.com for a short time.
And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
Formula in colored Frame and filled Box
Code: Select all
% !TeX program = pdflatex\documentclass[11pt]{article}\usepackage[T1]{fontenc}\usepackage{mathtools} % loads »amsmath«\usepackage{empheq}\usepackage[dvipsnames]{xcolor}\begin{document}\begin{empheq}[box=\fcolorbox{blue!40!black!60}{yellow!20}]{equation}(a+b)^2 = a^2+2ab+b^2\end{empheq}\end{document}
Code: Select all
texdoc empheq
Best regards and welcome to the board
Thorsten
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Re: Formula in colored Frame and filled Box
Is your tex code latex? Have scientific workplace tools to do frame and fill color?
Thanks
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
Formula in colored Frame and filled Box
This code is LaTeX. Must have missed that you posted in the SWP forum.vphc wrote:[…] Is your tex code latex? […]
I have absolutely no experience with SWP. Doesn't it manage to import LaTeX code? Or allow usage of LaTeX packages?vphc wrote:[…] Have scientific workplace tools to do frame and fill color? […]
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Formula in colored Frame and filled Box
@ localghost: Scientific Workplace does have a possibility to
a) include non-pre-installed Latex-bundles (i.e. empheq)
b) to use them as you would do in Latex.
However, the editor SWP uses by default seems to be quite outdated, as - as far I am informed - it doesn't use Latex 2.0. Therefore, some serious problems can occur, when using bundles written to be used with Latex 2.0. Additionally are some serious problems know even when using the same document on two different computers with the same version of SWP installed (i.e. my thesis Tex-File can't be read by my prof, although using exactly the same installation on exactly the same environment). The latter doesn't really change for better when defining another editor in SWP (as there are more than one), even if it is MikTex indeed although the first problem vanishs.
Second, the installing procedure of a new package is quite annoying, so you might be better of in trying to use what comes along with SWP.
@ topic.
It's quite simple to change the color of your formula-background. For instruction just read the color-package description (and then the documentation). In the last line of the description you are provided with a link to a sample file. Just click it and typeset the tex-file.
Thing is, you won't find a way to do it without encapsulating a latex field in your SWP document.
A coding example [hope it works and helps] (C&P from the help of SWP):
Code: Select all
\definecolor{light-blue}{rgb}{0.80,0.85,1.00}\color{light-blue}\begin{equation}a=b*c\end{equation}\color{black}
The last \color just says, that what-ever-you-type-next is in black again. Don't forget it or the following parts of your document will be in the same colour your formula is.
Have a nice one.
H.
Re: Formula in colored Frame and filled Box
I see, I've forgotten to answer on your question how to get that frame around your formula. As far as I remember it's just a matter of adopting the sample file given by SWP.
Have a nice one.
H.