Hello everybody!
I am newbie. How do i want to border formula have created as word? And how is it fill color?
Thanks!
Scientific Word/Workplace ⇒ Formula in colored Frame and filled Box
Formula in colored Frame and filled Box
- Attachments
-
- The desired result.
- formula-bordered.png (2.49 KiB) Viewed 41877 times
Last edited by localghost on Thu Mar 15, 2012 5:45 pm, edited 1 time in total.
Reason: Preferably no external links (see Board Rules). Attachments go onto the forum server where possible.
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.
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
Formula in colored Frame and filled Box
The desired output can be done with the empheq package from the mh bundle in combination with the xcolor package. The example below generates an emphasized equation.
For details please refer to the manuals of the involved packages. Provided that they are already installed on your system, you have instant access on the command line.
Best regards and welcome to the board
Thorsten
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
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Re: Formula in colored Frame and filled Box
Thank you for reply
Is your tex code latex? Have scientific workplace tools to do frame and fill color?
Thanks
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? […]
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Formula in colored Frame and filled Box
Hi,
@ 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):
Two things on this: You must write that in an encapsulated Tex-Field and you have to use the color package in your document as well as the amsmath package. If the sorting order of the bundles is arbitrary: I haven't testet. The example in SWP uses amsmath right before color, you may therefore want to stick with that.
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.
@ 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
... ah well...
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.
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.