LaTeX forum ⇒ 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
vphc
Posts: 2
Joined: Thu Mar 15, 2012 4:49 pm

Formula in colored Frame and filled Box

Postby vphc » Thu Mar 15, 2012 5:20 pm

Hello everybody!

I am newbie. How do i want to border formula have created as word? And how is it fill color?

Thanks!
Attachments
formula-bordered.png
The desired result.
formula-bordered.png (2.49 KiB) Viewed 6570 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.

User avatar
localghost
Site Moderator
Posts: 9206
Joined: Fri Feb 02, 2007 12:06 pm
Location: Braunschweig, Germany

Postby localghost » Thu Mar 15, 2012 5:54 pm

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.
  1. % !TeX program = pdflatex
  2. \documentclass[11pt]{article}
  3. \usepackage[T1]{fontenc}
  4. \usepackage{mathtools} % loads »amsmath«
  5. \usepackage{empheq}
  6. \usepackage[dvipsnames]{xcolor}
  7.  
  8. \begin{document}
  9. \begin{empheq}[box=\fcolorbox{blue!40!black!60}{yellow!20}]{equation}
  10. (a+b)^2 = a^2+2ab+b^2
  11. \end{empheq}
  12. \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.
  1. texdoc empheq



Best regards and welcome to the board
Thorsten
LaTeX Community Moderator
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes


¹ System: openSUSE 42.2 (Linux 4.4.52), TeX Live 2016 (vanilla), TeXworks 0.6.1

vphc
Posts: 2
Joined: Thu Mar 15, 2012 4:49 pm

Postby vphc » Fri Mar 16, 2012 3:27 pm

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: 9206
Joined: Fri Feb 02, 2007 12:06 pm
Location: Braunschweig, Germany

Postby localghost » Fri Mar 16, 2012 7:06 pm

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?
LaTeX Community Moderator
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes


¹ System: openSUSE 42.2 (Linux 4.4.52), TeX Live 2016 (vanilla), TeXworks 0.6.1

Hoed
Posts: 28
Joined: Sat Jan 07, 2012 12:46 pm

Postby Hoed » Thu Mar 22, 2012 11:51 am

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

  1. \definecolor{light-blue}{rgb}{0.80,0.85,1.00}
  2. \color{light-blue}
  3. \begin{equation}
  4. a=b*c
  5. \end{equation}
  6. \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

Postby Hoed » Thu Mar 22, 2012 3:01 pm

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


Return to “Scientific Word/Workplace”

Who is online

Users browsing this forum: No registered users and 1 guest