Scientific Word/WorkplaceFormula in colored Frame and filled Box

Information and discussion about Scientific Word and Scientific Workplace, two commercial WYSIWYG-like editors for Windows
Post Reply
vphc
Posts: 2
Joined: Thu Mar 15, 2012 4:49 pm

Formula in colored Frame and filled Box

Post by vphc »

Hello everybody!

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.
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.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Formula in colored Frame and filled Box

Post by localghost »

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.

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}
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.

Code: Select all

texdoc empheq

Best regards and welcome to the board
Thorsten
vphc
Posts: 2
Joined: Thu Mar 15, 2012 4:49 pm

Re: Formula in colored Frame and filled Box

Post by vphc »

Thank you for reply
Is your tex code latex? Have scientific workplace tools to do frame and fill color?
Thanks
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Formula in colored Frame and filled Box

Post by localghost »

vphc wrote:[…] Is your tex code latex? […]
This code is LaTeX. Must have missed that you posted in the SWP forum.
vphc wrote:[…] Have scientific workplace tools to do frame and fill color? […]
I have absolutely no experience with SWP. Doesn't it manage to import LaTeX code? Or allow usage of LaTeX packages?
Hoed
Posts: 28
Joined: Sat Jan 07, 2012 12:46 pm

Formula in colored Frame and filled Box

Post by Hoed »

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):

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}
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.
Hoed
Posts: 28
Joined: Sat Jan 07, 2012 12:46 pm

Re: Formula in colored Frame and filled Box

Post by Hoed »

... 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.
Post Reply