beginner's hazzles with backgrounds and definitions.
Hi, I am new to context, migrating from latex for the purpose of writing an online book. I would like to set up a few definitions in the environment file that would replace latex's \begin{definition} ... \end{definition} environments. I realize that this can be done conveniently with \defineenumeration, but I want of course a few more features in it then in latex's setup. For example, I'd like to have the definition typeset in some color against some background. I tried the following in the environment file: \setupcolors[state=start] \definetextbackground [defbackground] [backgroundcolor=blue, backgroundoffset=.25cm, offset=.25cm, frame=off, location=paragraph, color=green] \defineenumeration [definition] [text=Definition, location=left, before={\starttextbackground[defbackground]}, after={\stoptextbackground}, letter=it] Then, in the text, when I use \startdefinition This is my definition. \stopdefinition the text comes out green all right, but the blue background is smeared all over two pages. I have tried a few modifications to no avail, so I fear I am doing it all wrong. Curiously, when I typeset the above th first time, I only get the green text (no blue), and the mess shows only up when typesetting the second time. Any help? Thanks, Matthias
At 20:07 26/07/2003 -0500, you wrote:
the text comes out green all right, but the blue background is smeared all over two pages. I have tried a few modifications to no avail, so I fear I am doing it all wrong.
What version do you use? (take the latest) looks ok here, that is, when you add: before=\blank, after=\blank, to the deifnition of the background [of play with the offsets]
Curiously, when I typeset the above th first time, I only get the green text (no blue), and the mess shows only up when typesetting the second time.
normally texexec should handle that for you (multiple runs are needed to sort out the background) Hans ------------------------------------------------------------------------- Hans Hagen | PRAGMA ADE | pragma@wxs.nl Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: +31 (0)38 477 53 69 | fax: +31 (0)38 477 53 74 | www.pragma-ade.com ------------------------------------------------------------------------- information: http://www.pragma-ade.com/roadmap.pdf documentation: http://www.pragma-ade.com/showcase.pdf -------------------------------------------------------------------------
Thanks for the answer. I am using context version 2003.1.31, and I have changed the code a little according to your suggestion. However, everything remains blue. The problem seems to appear when the text to be highlighted gets a bit more inolved. Below is a complete sample that shows the effect 'nicely' -- the second page has blue-gray background except the page numbers, but the text is highligthed in red correctly. I still fear that I am missing the crucial point. Matthias \setupcolors[state=start] \setupcolors[rgb] \definecolor[myc] [r=.8,g=.9,b=.9] \definetextbackground [defbackground] [backgroundcolor=myc, backgroundoffset=.05cm, offset=.05cm, frame=off, location=paragraph, before=\blank, after=\blank, color=darkred] \defineenumeration [theorem] [before={\starttextbackground[defbackground]}, after={\stoptextbackground}, text=Theorem, location=left, corner=round, letter=rm] \def\emph#1{{\it #1}} \def\R{\text{\bf R}} \def\Q{\text{\bf Q}} \def\Z{\text{\bf Z}} \def\H{\text{\bf H}} \starttext \section{Introduction} A blurp is a set together with an operation which allows to mirps two blurp elements in a familiar fashion. \starttheorem A blurp $B$ is given by a set $B$, a distingished element $1 \in B$, called the fidelity element, and a mirpication $\cdot:B \times B \to B$ which satisfy the following axioms: \startitemize[n] \item For all $a\in B$, $a \cdot 1 1\cdot a = a$. \item For all $a \in B$ there is an element $a^{-1}\in B$ (called the surverse of $a$) such that $a \cdot a^{-1} = a^{-1}\cdot a =1$. \item For all $a,b,c\in B$ one has $a\cdot(b\cdot c) = (a\cdot b)\cdot c$. \stopitemize \stoptheorem We will now verify a few simple properties of blurps: \starttheorem The surverse element is unique. \stoptheorem Given $a\in B$, suppose there are $b,c\in B$ which satisfy both $a b = b a = 1$ and $a c = c a = 1$. Then $b=b1=b(ac)=(ba)c=c$. \starttheorem Here are a few blurps: \startitemize[n] \item $(\R^+,1,\cdot)$ or $(\Q^+,1,\cdot)$ or $(\Q -\{0\},1,\cdot)$ \item $\R,0,+)$ or $(\Z,0,+)$ \item Let $B$ be the set of polynomials of degree $n$, and $1$ the constant polynomial with value $0$, and the multiplication given by polynomial addition. \item Let $S$ be a set, and $B$ be the set of selfmaps of $S$ which are one-to-one. If the set $S$ is finite, these are called permutations. Let $1$ be the the identity map, and $\cdot$ be the composition of the maps. \stopitemize \stoptheorem And another little theorem: \starttheorem Let $B$ be a group and $C$ a subset of $B$ such that \startitemize[n] \item $1\in C$. \item For all $a\in C$ also $a^{-1}\in C$. \item For all $a,b\in C$ also $a b$ and $b a \in C$. \stopitemize Then $C$ is also a blurps, and it is called a subblurps of $B$. \stoptheorem We have to check that $C$ satisfies all the axioms of a blurp. But this is clear, as the existence of the fidelity element and the surverse elements are guaranteed by the theorem, and all identities are already true in $B$. \starttheorem Let $B$ be a group and $C$ a subset of $B$ such that \startitemize[n] \item $1\in C$. \item For all $a\in C$ also $a^{-1}\in C$. \item For all $a,b\in C$ also $a b$ and $b a \in C$. \stopitemize Then $C$ is also a blurps, and it is called a subblurps of $B$. \stoptheorem \stoptext On Tuesday, July 29, 2003, at 12:02 PM, Hans Hagen wrote:
At 20:07 26/07/2003 -0500, you wrote:
the text comes out green all right, but the blue background is smeared all over two pages. I have tried a few modifications to no avail, so I fear I am doing it all wrong.
What version do you use? (take the latest)
looks ok here, that is, when you add:
before=\blank, after=\blank,
to the deifnition of the background
[of play with the offsets]
Curiously, when I typeset the above th first time, I only get the green text (no blue), and the mess shows only up when typesetting the second time.
normally texexec should handle that for you (multiple runs are needed to sort out the background)
Hans ----------------------------------------------------------------------- -- Hans Hagen | PRAGMA ADE | pragma@wxs.nl Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: +31 (0)38 477 53 69 | fax: +31 (0)38 477 53 74 | www.pragma-ade.com ----------------------------------------------------------------------- -- information: http://www.pragma-ade.com/roadmap.pdf documentation: http://www.pragma-ade.com/showcase.pdf ----------------------------------------------------------------------- --
_______________________________________________ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
Matthias Weber
Thanks for the answer. I am using context version 2003.1.31, and I have changed the code a little according to your suggestion. However, everything remains blue. The problem seems to appear when the text to be highlighted gets a bit more inolved. Below is a complete sample that shows the effect 'nicely' -- the second page has blue-gray background except the page numbers, but the text is highligthed in red correctly.
Your file looks fine here. I have put my result on http://levana.de/tmp/test.pdf for a short time. Perhaps you could comment on it? Patrick -- Silent is the goldfish in its bowl
Thanks Patrick, your version looks indeed as I intended. My second page is very different. This most likely means that Hans' question about the version I am using was to the point. I go and see that I get my TeX installation updated (does somebody know how to do that most efficiently in Mac OS X? ). Thanks again, this is most helpful. Matthias On Wednesday, July 30, 2003, at 03:49 AM, Patrick Gundlach wrote:
Matthias Weber
writes: Hello Matthias,
Thanks for the answer. I am using context version 2003.1.31, and I have changed the code a little according to your suggestion. However, everything remains blue. The problem seems to appear when the text to be highlighted gets a bit more inolved. Below is a complete sample that shows the effect 'nicely' -- the second page has blue-gray background except the page numbers, but the text is highligthed in red correctly.
Your file looks fine here. I have put my result on http://levana.de/tmp/test.pdf for a short time. Perhaps you could comment on it?
Patrick -- Silent is the goldfish in its bowl _______________________________________________ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
At 07:31 30/07/2003 -0500, you wrote:
Thanks Patrick,
your version looks indeed as I intended. My second page is very different. This most likely means that Hans' question about the version I am using was to the point.
I go and see that I get my TeX installation updated (does somebody know how to do that most efficiently in Mac OS X? ).
dunno, maybe we have to make a simple apple script: fetch cont-tmf and regenerate format [btw, the next version of texshop will have context specific menus] Hans ------------------------------------------------------------------------- Hans Hagen | PRAGMA ADE | pragma@wxs.nl Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: +31 (0)38 477 53 69 | fax: +31 (0)38 477 53 74 | www.pragma-ade.com ------------------------------------------------------------------------- information: http://www.pragma-ade.com/roadmap.pdf documentation: http://www.pragma-ade.com/showcase.pdf -------------------------------------------------------------------------
Am Mittwoch, 30.07.03, um 18:58 Uhr (Europe/Zurich) schrieb Hans Hagen:
I go and see that I get my TeX installation updated (does somebody know how to do that most efficiently in Mac OS X? ). dunno, maybe we have to make a simple apple script: fetch cont-tmf and regenerate format
Not needed. MacOS X can run Perl, shell and Ruby scripts, too.
[btw, the next version of texshop will have context specific menus]
Nice; I'm looking forward to. Grütze vom Südsee! Hraban -- GCA/O d+ H+ s+:+ g+ p? !au a w+ v+ C+(++) ULB++(++++) P+++$ L+(++) !3 !V W-(+$) M++ E--- N- K- po+- Y+ t(+) !5 !j R++ G' tv- !D B? e++ u** h--- f+? r+++ n+ z+++ MacOS X -- das schönste Terminal der Welt ;-)
As a little update: I tried to install the context package from
http://www.pragma-ade.com/context/cont-tmf.zip
into /sw/share/ of the fink distribution both by replacing the
corresponding directories and by adding the files
into the corresponding directories. Both approaches break the context
installation. For those interested, the log file
is below.
I give up for today .
Matthias
btw: Somebody with first name Helmut sent me a direct reply, asking
about rounded corners. Tried that too
without luck. I can't reply to Helmut directly, as his email has my own
address as the only return address.
Scary.
/bin/tcsh...
if (-e /usr/share/init/tcsh/login) source /usr/share/init/tcsh/login
source "/Applications/Text/iTeXMac
1.3-RC2/iTeXMac.app/Contents/MacOS/pathMaker"
# this line is commented out
texexec --pdf test
exit
# Making Paths...
# Paths OK
TeXExec 3.2 - ConTeXt / PRAGMA ADE 1997-2003
executable : pdfetex
format : cont-en
inputfile : test
output : pdftex
interface : en
current mode : none
TeX run : 1
This is pdfeTeX, Version 3.14159-1.10b-2.1 (Web2C 7.4.5)
entering extended mode
(./test.tex{/sw/share/texmf/pdftex/config/pdftex.cfg}
ConTeXt ver: 2003.1.31 fmt: 2003.7.30 int: english mes: english
language : language en is active
At 15:47 30/07/2003 -0500, you wrote:
As a little update: I tried to install the context package from http://www.pragma-ade.com/context/cont-tmf.ziphttp://www.pragma-ade.com/context/cont-tmf.zip
into /sw/share/ of the fink distribution both by replacing the corresponding directories and by adding the files into the corresponding directories. Both approaches break the context installation. For those interested, the log file is below.
I give up for today . Matthias
btw: Somebody with first name Helmut sent me a direct reply, asking about rounded corners. Tried that too without luck. I can't reply to Helmut directly, as his email has my own address as the only return address. Scary.
did you (1) run mktexlsr (2) run texexec --make --alone (1) -> tells tex where to find files (2) -> makes a new format file currently you have a conflicting system i.e. format file does not match some run time files Hans ------------------------------------------------------------------------- Hans Hagen | PRAGMA ADE | pragma@wxs.nl Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: +31 (0)38 477 53 69 | fax: +31 (0)38 477 53 74 | www.pragma-ade.com ------------------------------------------------------------------------- information: http://www.pragma-ade.com/roadmap.pdf documentation: http://www.pragma-ade.com/showcase.pdf -------------------------------------------------------------------------
Hello out there,
did you
(1) run mktexlsr (2) run texexec --make --alone
(1) -> tells tex where to find files (2) -> makes a new format file
After doing (2), you (well, not exactly you...) need to copy the resulting format file into tex's searchpath and perhaps you need to run mktexlsr again, so the format file will be found. Patrick
On Wednesday, Jul 30, 2003, at 18:58 Europe/Amsterdam, Hans Hagen wrote:
At 07:31 30/07/2003 -0500, you wrote:
Thanks Patrick,
your version looks indeed as I intended. My second page is very different. This most likely means that Hans' question about the version I am using was to the point.
I go and see that I get my TeX installation updated (does somebody know how to do that most efficiently in Mac OS X? ).
dunno, maybe we have to make a simple apple script: fetch cont-tmf and regenerate format
I have been thinking about (and have had requests for) a ConTeXt-update i-Package, given that I am going to use ConTeXt and that ConTeXt changes rather frequently compared to teTeX's texmf tree. Hans, can you mail me off list what actions are needed to install the current ConTeXt in th eteTeX texmf tree? G -- "To be or not to be, that is the question" -- Parmenides
Gerben, that would be wonderful. I always shy away from upgrading because it might break things and takes time. If your i-installer does the job, that would be a major advance. So please, go for it! Thomas -- Thomas A. Schmitz Philologisches Seminar Universitaet Bonn Am Hof 1 e 53113 Bonn Tel.: 0228/73-7747 Fax: 0228/73-7748
On Thursday, July 31, 2003, at 04:44 PM, Thomas A.Schmitz wrote:
Gerben, that would be wonderful. I always shy away from upgrading because it might break things and takes time. If your i-installer does the job, that would be a major advance. So please, go for it!
Thomas
I can only agree - please! Matthias
Hello again, this is presumably only for the the Mac people on the list.
Below is what I tried to update Gerden's i-installed teTex with the most
recent context:
(I remove all directories that occur in the context distribution, and
then copy them. There is most likely a one liner for all of this in some
shell, but my unix knowledge is from days when nobody new how to
spell copyright)
(everything w/ sudo)
rm -R /usr/local/teTeX/share/texmf.tetex/context
cp -R /cont-tmf\ Folder/context /usr/local/teTeX/share/texmf.tetex
rm -R /usr/local/teTeX/share/texmf.tetex/doc/context
cp -R /cont-tmf\ Folder/doc/context
/usr/local/teTeX/share/texmf.tetex/doc
rm /usr/local/teTeX/share/texmf.tetex/dvips/config/context.map
cp /cont-tmf\ Folder/dvips/config/context.map
/usr/local/teTeX/share/texmf.tetex/dvips/config
rm -R /usr/local/teTeX/share/texmf.tetex/fonts/tfm/hoekwater/context
cp -R /cont-tmf\ Folder/fonts/tfm/hoekwater/context
/usr/local/teTeX/share/texmf.tetex/fonts/tfm/hoekwater
rm -R /usr/local/teTeX/share/texmf.tetex/fonts/type1/hoekwater/context
cp -R /cont-tmf\ Folder/fonts/type1/hoekwater/context
/usr/local/teTeX/share/texmf.tetex/fonts/type1/hoekwater
rm -R /usr/local/teTeX/share/texmf.tetex/metapost/context
cp -R /cont-tmf\ Folder/metapost/context
/usr/local/teTeX/share/texmf.tetex/metapost
rm -R /usr/local/teTeX/share/texmf.tetex/pdftex/config/context
cp -R /cont-tmf\ Folder/pdftex/config/context
/usr/local/teTeX/share/texmf.tetex/pdftex/config
rm -R /usr/local/teTeX/share/texmf.tetex/tex/context
cp -R /cont-tmf\ Folder/tex/context
/usr/local/teTeX/share/texmf.tetex/tex
rm -R /usr/local/teTeX/share/texmf.tetex/tex/generic/context
cp -R /cont-tmf\ Folder/tex/generic/context
/usr/local/teTeX/share/texmf.tetex/tex/generic
rm -R /usr/local/teTeX/share/texmf.tetex/tex/latex/context
cp -R /cont-tmf\ Folder/tex/latex/context
/usr/local/teTeX/share/texmf.tetex/tex/latex
mktexlsr
texexec --make --alone
(Thanks to Hans once more for pointing out politely that I had no clue
that the last two lines are important).
They produce reasonable output that makes me believe that they are
working with the
TeX installation I updated and not the other one (fink). It would be
nice to know how to
modify that one, too, but before I will try that: It still doesn't
work. I get the same
error message as before (see below), indicating that I have messed up
the TeX installation.
Is it maybe necessary to tell either of the last two commands where the
files
are it should update?
Matthias
/bin/tcsh...
if (-e /usr/share/init/tcsh/login) source /usr/share/init/tcsh/login
source "/Applications/Text/iTeXMac
1.3-RC2/iTeXMac.app/Contents/MacOS/pathMaker"
# this line is commented out
texexec --pdf test
exit
# Making Paths...
# Paths OK
TeXExec 3.2 - ConTeXt / PRAGMA ADE 1997-2003
executable : pdfetex
format : cont-en
inputfile : test
output : pdftex
interface : en
current mode : none
TeX run : 1
This is pdfeTeX, Version 3.14159-1.10b-2.1 (Web2C 7.4.5)
entering extended mode
(./test.tex{/usr/local/teTeX/share/texmf.local/pdftex/config/pdftex.cfg}
ConTeXt ver: 2003.1.31 fmt: 2003.7.30 int: english mes: english
language : language en is active
On Wednesday, Jul 30, 2003, at 14:31 Europe/Amsterdam, Matthias Weber wrote:
Thanks Patrick,
your version looks indeed as I intended. My second page is very different. This most likely means that Hans' question about the version I am using was to the point.
I go and see that I get my TeX installation updated (does somebody know how to do that most efficiently in Mac OS X? ).
Start i-Installer, open the ConTeXt updater i-Package from Known Packages. Hit configure. G -- "To be or not to be, that is the question" -- Parmenides
participants (6)
-
Gerben Wierda
-
Hans Hagen
-
Henning Hraban Ramm
-
Matthias Weber
-
Patrick Gundlach
-
Thomas A.Schmitz