Some questions about context
Hi, I'm new user of context. I gone from latex, which I use in the last 5 years intensively I read your wiki but I don't find some answers to my wishes. Basically I want to know what are the equivalent of latex commands/packages in context. Can you help me in thay?. Thanks in advance.... so let's go: 1) The first question is about landscape mode and xdvi. In latex, if we want landscape, we put: \documentclass[a4paper,10ptt,landscape]{article} but when we see .dvi in xdvi, xdvi does not detects automatically that it's in landscape mode. For that, we have to put: \usepackage[dvips,...]{geometry} now the xdvi show .dvi in landscape mode The question is, how we get the same in context?. If we put: \setuppapersize[A4,landscape][A4,landscape] the xdvi program does not detect that .dvi is in landscape mode. Is there an equivalent command of geometry that allow that? 2) In latex there is the fancyhdr package that allows to put lines at bottom and at top of the page and put right and left headings and footers like: \rhead{Hello} .... What is the equivalent in context? 3) Is there an equivalent to the package lastpage in context? So can we put [number of page]/[total number of pages] at the bottom of the page? 4) How can we create new counters in context? Like latex \newcounter{mycount} 5) In mathematics, in context there are three modules: "nath", "amsl", "new math", according to http://wiki.contextgarden.net/Math What are these features and limitations? What is the "best"? 6) Is there an equivalent module of xyfig? 7) Is there an equivalence of amssymbols?. How can I display for example $x \leadsto \int_a^b \arcsin (x+\cos \alhpa)$? 8) How can we do a "minipage" in context? 9) Can you tell me some link about babel and hipernation? Thank you very much, Xan.
On Mon, 05 Mar 2007 13:43:51 +0100
Xan
Hi,
Hi Xan,
I'm new user of context. I gone from latex, which I use in the last 5 years intensively
I read your wiki but I don't find some answers to my wishes. Basically I want to know what are the equivalent of latex commands/packages in context. Can you help me in thay?. Thanks in advance.... so let's go:
1) The first question is about landscape mode and xdvi. In latex, if we want landscape, we put:
\documentclass[a4paper,10ptt,landscape]{article}
but when we see .dvi in xdvi, xdvi does not detects automatically that it's in landscape mode.
For that, we have to put:
\usepackage[dvips,...]{geometry}
now the xdvi show .dvi in landscape mode
The question is, how we get the same in context?. If we put:
\setuppapersize[A4,landscape][A4,landscape]
the xdvi program does not detect that .dvi is in landscape mode. Is there an equivalent command of geometry that allow that?
ConTeXt use PDF as default output format. A short test with the dvips way show a rotated content but the page is not roatated, this seems to be not suported
2) In latex there is the fancyhdr package that allows to put lines at bottom and at top of the page and put right and left headings and footers like: \rhead{Hello} ....
What is the equivalent in context?
The ConTeXt method for headers is: \setupheadertexts[centered on odd and even page] \setupheadertexts[left on odd and even page][right on odd and even page] \setupheadertexts[left on even page][right on even page] [left on odd page][right on odd page] The same methos id used for footer with \setupfootertexts instead of \setupheadertexts. I attached a file that provides another way to set the headers and footers in your document. You can use it with the command \usemodule[wolf-txt]. A few examples can be found in the source.
3) Is there an equivalent to the package lastpage in context? So can we put [number of page]/[total number of pages] at the bottom of the page?
\setupfootertexts[\pagenumber/\lastpage]
4) How can we create new counters in context? Like latex \newcounter{mycount}
You can use the plain TeX command \newcount\mycount or the ConTeXt command \newcounter\mycount to create a counter. The ConTeXt methos provides also the two commands \increment\mycount to increase your own counter by one and the command \decrement\mycount to reduce your own counter by one.
5) In mathematics, in context there are three modules: "nath", "amsl", "new math", according to http://wiki.contextgarden.net/Math
What are these features and limitations? What is the "best"?
ConTeXt provides now many functions from these modules by default. Aditya wrote a few articles about the new option for maths in his My Ways and at the wiki. Please take a look at the following articles http://dl.contextgarden.net/myway/mathalign.pdf http://dl.contextgarden.net/myway/matharrows.pdf
6) Is there an equivalent module of xyfig?
Do you mean xypic? Take a look at Tikz/Pgf: http://sourceforge.net/projects/pgf/ or MetaPost/MetaFun: http://wiki.contextgarden.net/MetaPost http://wiki.contextgarden.net/MetaFun bot come with their own manuals.
7) Is there an equivalence of amssymbols?. How can I display for example $x \leadsto \int_a^b \arcsin (x+\cos \alhpa)$?
This should work by default. AFAIK the AMS symbols are enabled by default in ConTeXT. A short test worked without problems.
8) How can we do a "minipage" in context?
You can use the more powerful frame environemnt. \starttext \framed[width=6cm,align=right]{\readfile{knuth}\donothing\donothing} \stoptext
9) Can you tell me some link about babel and hipernation?
You set the language for your document with the \mainlanguage[xx] and the \language[xx] commands where "xx" stands for your language id as "en" for english.
Thank you very much, Xan.
Wolfgang
On Mon, 5 Mar 2007, Wolfgang Schuster wrote:
On Mon, 05 Mar 2007 13:43:51 +0100 Xan
wrote: Hi Xan,
I'm new user of context. I gone from latex, which I use in the last 5 years intensively
Welcome to ConTeXt :)
I read your wiki but I don't find some answers to my wishes. Basically I want to know what are the equivalent of latex commands/packages in context. Can you help me in thay?. Thanks in advance.... so let's go:
1) The first question is about landscape mode and xdvi. In latex, if we want landscape, we put:
\documentclass[a4paper,10ptt,landscape]{article}
but when we see .dvi in xdvi, xdvi does not detects automatically that it's in landscape mode.
For that, we have to put:
\usepackage[dvips,...]{geometry}
now the xdvi show .dvi in landscape mode
The question is, how we get the same in context?. If we put:
\setuppapersize[A4,landscape][A4,landscape]
the xdvi program does not detect that .dvi is in landscape mode. Is there an equivalent command of geometry that allow that?
ConTeXt use PDF as default output format. A short test with the dvips way show a rotated content but the page is not roatated, this seems to be not suported
I do not use dvi route, but the page should be rotated in the ps file. AFAIU, dvi has no option for specifying the page size or page orientation. The viewers that honor ps code for page orientation and size rely on the manner that latex puts in those commands in the dvi file. I do not know if ConTeXt follows that route or not.
2) In latex there is the fancyhdr package that allows to put lines at bottom and at top of the page and put right and left headings and footers like: \rhead{Hello} ....
What is the equivalent in context?
The ConTeXt method for headers is:
\setupheadertexts[centered on odd and even page] \setupheadertexts[left on odd and even page][right on odd and even page] \setupheadertexts[left on even page][right on even page] [left on odd page][right on odd page]
The same methos id used for footer with \setupfootertexts instead of \setupheadertexts.
I attached a file that provides another way to set the headers and footers in your document. You can use it with the command \usemodule[wolf-txt]. A few examples can be found in the source.
3) Is there an equivalent to the package lastpage in context? So can we put [number of page]/[total number of pages] at the bottom of the page?
\setupfootertexts[\pagenumber/\lastpage]
A lot of Latex packages are built into ConTeXt. See http://wiki.contextgarden.net/Latex_Packages
4) How can we create new counters in context? Like latex \newcounter{mycount}
You can use the plain TeX command \newcount\mycount or the ConTeXt command \newcounter\mycount to create a counter. The ConTeXt methos provides also the two commands \increment\mycount to increase your own counter by one and the command \decrement\mycount to reduce your own counter by one.
There are also numbers, which I find easier to use. See http://wiki.contextgarden.net/Counters
5) In mathematics, in context there are three modules: "nath", "amsl", "new math", according to http://wiki.contextgarden.net/Math
What are these features and limitations? What is the "best"?
I would suggest always use \usemodule[newmat] in your documents. For inline math, ConTeXt can do everything that LaTeX (and amsmath) do. For multi-line display, I would consider nath and amsl obsolete. Almost all of the functionality is available in the core. I wrote an article in Maps last year showing how to do the common multiline displays using ConTeXt. I do not think that article is available online to non-members of ntg right now.
ConTeXt provides now many functions from these modules by default. Aditya wrote a few articles about the new option for maths in his My Ways and at the wiki.
Please take a look at the following articles
http://dl.contextgarden.net/myway/mathalign.pdf http://dl.contextgarden.net/myway/matharrows.pdf
The matharrows My Way is a slightly out of date. For matharrows, documentation is also provided in math-ext.tex. And a to be written My Way on subformula numbering.
6) Is there an equivalent module of xyfig?
Do you mean xypic?
Take a look at Tikz/Pgf:
http://sourceforge.net/projects/pgf/
or MetaPost/MetaFun:
http://wiki.contextgarden.net/MetaPost http://wiki.contextgarden.net/MetaFun
bot come with their own manuals.
7) Is there an equivalence of amssymbols?. How can I display for example $x \leadsto \int_a^b \arcsin (x+\cos \alhpa)$?
This should work by default. AFAIK the AMS symbols are enabled by default in ConTeXT. A short test worked without problems.
You do need to correct the spelling ;) \alpha. Also see http://wiki.contextgarden.net/Math/basic I am working on explaining the whole math thing at http://wiki.contextgarden.net/Math_new but progress has been slow.
8) How can we do a "minipage" in context?
You can use the more powerful frame environemnt.
\starttext
\framed[width=6cm,align=right]{\readfile{knuth}\donothing\donothing}
\stoptext
Also read the documentation for \defineframedtext, and text backgrounds (which can also split across pages).
9) Can you tell me some link about babel and hipernation?
You set the language for your document with the \mainlanguage[xx] and the \language[xx] commands where "xx" stands for your language id as "en" for english.
Also \enableregime[utf] for utf input encoding (same as \usepackage[utf-8]{inputenc}). Aditya
On 3/5/07, Aditya Mahajan wrote:
On Mon, 5 Mar 2007, Wolfgang Schuster wrote:
On Mon, 05 Mar 2007 13:43:51 +0100 Xan
wrote: 1) The first question is about landscape mode and xdvi. In latex, if we want landscape, we put:
\documentclass[a4paper,10ptt,landscape]{article}
but when we see .dvi in xdvi, xdvi does not detects automatically that it's in landscape mode.
For that, we have to put:
\usepackage[dvips,...]{geometry}
now the xdvi show .dvi in landscape mode
The question is, how we get the same in context?. If we put:
\setuppapersize[A4,landscape][A4,landscape]
the xdvi program does not detect that .dvi is in landscape mode. Is there an equivalent command of geometry that allow that?
ConTeXt use PDF as default output format. A short test with the dvips way show a rotated content but the page is not roatated, this seems to be not suported
I do not use dvi route, but the page should be rotated in the ps file. AFAIU, dvi has no option for specifying the page size or page orientation. The viewers that honor ps code for page orientation and size rely on the manner that latex puts in those commands in the dvi file. I do not know if ConTeXt follows that route or not.
Also note that dvi mode is not really supported any more. How old is your ConTeXt/TeX distribution? (texexec --version or ctxtools --contextversion) New versions should give you pdf output by default. Yes, dvi is indeed faster, but ...
9) Can you tell me some link about babel and hipernation?
You set the language for your document with the \mainlanguage[xx] and the \language[xx] commands where "xx" stands for your language id as "en" for english.
Also \enableregime[utf] for utf input encoding (same as \usepackage[utf-8]{inputenc}).
or \enableregime[utf-8] ;) Which language do you want to use? Mojca
On Mon, 5 Mar 2007, Mojca Miklavec wrote:
On 3/5/07, Aditya Mahajan wrote:
On Mon, 5 Mar 2007, Wolfgang Schuster wrote:
On Mon, 05 Mar 2007 13:43:51 +0100 Xan
wrote: 1) The first question is about landscape mode and xdvi. In latex, if we want landscape, we put:
\documentclass[a4paper,10ptt,landscape]{article}
but when we see .dvi in xdvi, xdvi does not detects automatically that it's in landscape mode.
For that, we have to put:
\usepackage[dvips,...]{geometry}
now the xdvi show .dvi in landscape mode
The question is, how we get the same in context?. If we put:
\setuppapersize[A4,landscape][A4,landscape]
the xdvi program does not detect that .dvi is in landscape mode. Is there an equivalent command of geometry that allow that?
ConTeXt use PDF as default output format. A short test with the dvips way show a rotated content but the page is not roatated, this seems to be not suported
I do not use dvi route, but the page should be rotated in the ps file. AFAIU, dvi has no option for specifying the page size or page orientation. The viewers that honor ps code for page orientation and size rely on the manner that latex puts in those commands in the dvi file. I do not know if ConTeXt follows that route or not.
Also note that dvi mode is not really supported any more. How old is your ConTeXt/TeX distribution? (texexec --version or ctxtools --contextversion) New versions should give you pdf output by default.
What do you mean by "not supported any more". ConTeXt defaults to pdf, but texexec --dvi --nobackends will give you a dvi file.
Yes, dvi is indeed faster, but ...
and allows source specials for forward and backward search. Occasionally, that is really handy. Aditya
Well, thank you very much to all of you: Wolfgang, Aditya and Mojca. First of all thank you for answering to what I want (in latex groups people use to answer "this can't be done" or "do you really want that?") And secondly, wow!! you provided very amount of information: examples and code. Good!!! More than ever I imagine I will study all of that Thanks, Xan. PS: Yes, I refer to xyfig. And my version is texexec --version TeXExec 5.2.4 - ConTeXt / PRAGMA ADE 1997-2005 texexec : TeXExec 5.2.4 - ConTeXt / PRAGMA ADE 1997-2005 texutil : TeXUtil 9.0.0 - ConTeXt / PRAGMA ADE 1992-2004 tex : pdfeTeX, 3.141592-1.21a-2.2 (Web2C 7.5.4) context : ver: 2005.01.31 cont-en : ver: 2005.01.31 fmt: 2006.6.1 mes: english total run time : 1 seconds in ubuntu system En/na Wolfgang Schuster ha escrit:
On Mon, 05 Mar 2007 13:43:51 +0100 Xan
wrote: Hi,
Hi Xan,
I'm new user of context. I gone from latex, which I use in the last 5 years intensively
I read your wiki but I don't find some answers to my wishes. Basically I want to know what are the equivalent of latex commands/packages in context. Can you help me in thay?. Thanks in advance.... so let's go:
1) The first question is about landscape mode and xdvi. In latex, if we want landscape, we put:
\documentclass[a4paper,10ptt,landscape]{article}
but when we see .dvi in xdvi, xdvi does not detects automatically that it's in landscape mode.
For that, we have to put:
\usepackage[dvips,...]{geometry}
now the xdvi show .dvi in landscape mode
The question is, how we get the same in context?. If we put:
\setuppapersize[A4,landscape][A4,landscape]
the xdvi program does not detect that .dvi is in landscape mode. Is there an equivalent command of geometry that allow that?
ConTeXt use PDF as default output format. A short test with the dvips way show a rotated content but the page is not roatated, this seems to be not suported
2) In latex there is the fancyhdr package that allows to put lines at bottom and at top of the page and put right and left headings and footers like: \rhead{Hello} ....
What is the equivalent in context?
The ConTeXt method for headers is:
\setupheadertexts[centered on odd and even page] \setupheadertexts[left on odd and even page][right on odd and even page] \setupheadertexts[left on even page][right on even page] [left on odd page][right on odd page]
The same methos id used for footer with \setupfootertexts instead of \setupheadertexts.
I attached a file that provides another way to set the headers and footers in your document. You can use it with the command \usemodule[wolf-txt]. A few examples can be found in the source.
3) Is there an equivalent to the package lastpage in context? So can we put [number of page]/[total number of pages] at the bottom of the page?
\setupfootertexts[\pagenumber/\lastpage]
4) How can we create new counters in context? Like latex \newcounter{mycount}
You can use the plain TeX command \newcount\mycount or the ConTeXt command \newcounter\mycount to create a counter. The ConTeXt methos provides also the two commands \increment\mycount to increase your own counter by one and the command \decrement\mycount to reduce your own counter by one.
5) In mathematics, in context there are three modules: "nath", "amsl", "new math", according to http://wiki.contextgarden.net/Math
What are these features and limitations? What is the "best"?
ConTeXt provides now many functions from these modules by default. Aditya wrote a few articles about the new option for maths in his My Ways and at the wiki.
Please take a look at the following articles
http://dl.contextgarden.net/myway/mathalign.pdf http://dl.contextgarden.net/myway/matharrows.pdf
6) Is there an equivalent module of xyfig?
Do you mean xypic?
Take a look at Tikz/Pgf:
http://sourceforge.net/projects/pgf/
or MetaPost/MetaFun:
http://wiki.contextgarden.net/MetaPost http://wiki.contextgarden.net/MetaFun
bot come with their own manuals.
7) Is there an equivalence of amssymbols?. How can I display for example $x \leadsto \int_a^b \arcsin (x+\cos \alhpa)$?
This should work by default. AFAIK the AMS symbols are enabled by default in ConTeXT. A short test worked without problems.
8) How can we do a "minipage" in context?
You can use the more powerful frame environemnt.
\starttext
\framed[width=6cm,align=right]{\readfile{knuth}\donothing\donothing}
\stoptext
9) Can you tell me some link about babel and hipernation?
You set the language for your document with the \mainlanguage[xx] and the \language[xx] commands where "xx" stands for your language id as "en" for english.
Thank you very much, Xan.
Wolfgang
------------------------------------------------------------------------
%D \module %D [ file=wolf-txt, %D version=2006.10.28, %D title=\CONTEXT\ User Module, %D subtitle=Texts, %D author=Wolfgang Schuster, %D date=\currentdate, %D copyright=Wolfgang Schuster]
\writestatus{loading}{Context User Module / Texts}
\unprotect
\startnotmode[wolf]
\def\????tx{@@@@tx}
\def\useifdefined#1% {\ifcsname#1\endcsname \csname#1\endcsname \fi}
\stopnotmode
%D \macros %D {settoptexts, setheadertexts, settexttexts, %D setfootertexts, setbottomtexts} %D %D \starttyping %D \setheadertexts %D [reset] %D %D \setheadertexts %D [left=odd left,middle=odd middle,right=odd right] %D %D \setheadertexts %D [text] %D [left=odd left,middle=odd middle,right=odd right] %D %D \setheadertexts %D [left=odd left,middle=odd middle,right=odd right] %D [left=even left,middle=even middle,right=even right] %D %D \setheadertexts %D [text] %D [left=odd left,middle=odd middle,right=odd right] %D [left=even left,middle=even middle,right=even right] %D \stoptyping
\def\settoptexts {\doquadrupleempty\dosetextendedtexts[\v!top]} \def\setheadertexts {\doquadrupleempty\dosetextendedtexts[\v!header]} \def\settexttexts {\doquadrupleempty\dosetextendedtexts[\v!text]} \def\setfootertexts {\doquadrupleempty\dosetextendedtexts[\v!footer ]} \def\setbottomtexts {\doquadrupleempty\dosetextendedtexts[\v!bottom]}
%\def\dosettextcontent[#1][#2][#3][#4][#5]% header text middle text/text % {\iffifthargument % \setvalue{\??tk#1#2\executeifdefined{:\c!text:#3:}\c!middletext}% % {\dodoubletexts{\??tk#1}{#2}% % {\c!leftstyle \c!leftcolor \c!leftwidth }{#4}% % {\c!rightstyle\c!rightcolor\c!rightwidth}{#5}}% % \else\iffourthargument % \setvalue{\??tk#1#2\executeifdefined{:\c!text:#3:}\c!middletext}% % {\dodoubletexts{\??tk#1}{#2}% % {\c!leftstyle \c!leftcolor \c!leftwidth }{#4}% % {\c!rightstyle\c!rightcolor\c!rightwidth}{#4}}% % \else\ifthirdargument % \setvalue{\??tk#1#2\c!middletext}% % {\dodoubletexts{\??tk#1}{#2}% % {\c!leftstyle \c!leftcolor \c!leftwidth }{#3}% % {\c!rightstyle\c!rightcolor\c!rightwidth}{#3}}% % \fi\fi\fi}
\def\dosetextendedtexts[#1][#2][#3][#4]% {\iffourthargument \getparameters[\????tx\v!left] [#3] \getparameters[\????tx\v!right][#4] \dodosetextendedtexts{#1}{#2} \else\ifthirdargument \doifinsetelse{#2}{\v!text,\v!margin,\v!edge} {\getparameters[\????tx\v!left] [#3] \getparameters[\????tx\v!right][#3] \dodosetextendedtexts{#1}{#2}} {\getparameters[\????tx\v!left] [#2] \getparameters[\????tx\v!right][#3] \dodosetextendedtexts{#1}\v!text} \else\ifsecondargument \doifelse{#2}\v!reset {\doresetextendedtexts{#1}} {\getparameters[\????tx\v!left] [#2] \getparameters[\????tx\v!right][#2] \dodosetextendedtexts{#1}\v!text} \fi\fi\fi}
\def\dodosetextendedtexts#1#2% {\setvalue{\??tk#1#2\c!lefttext}% {\dodoubletexts@wolf{\??tk#1}{#2}% {\c!leftstyle \c!leftcolor \c!leftwidth }{\useifdefined{\????tx\v!left \v!left }}% {\c!rightstyle\c!rightcolor\c!rightwidth}{\useifdefined{\????tx\v!right\v!left }}}% \setvalue{\??tk#1#2\c!middletext}% {\dodoubletexts@wolf{\??tk#1}{#2}% {\c!leftstyle \c!leftcolor \c!leftwidth }{\useifdefined{\????tx\v!left \v!middle}}% {\c!rightstyle\c!rightcolor\c!rightwidth}{\useifdefined{\????tx\v!right\v!middle}}}% \setvalue{\??tk#1#2\c!righttext}% {\dodoubletexts@wolf{\??tk#1}{#2}% {\c!leftstyle \c!leftcolor \c!leftwidth }{\useifdefined{\????tx\v!left \v!right }}% {\c!rightstyle\c!rightcolor\c!rightwidth}{\useifdefined{\????tx\v!right\v!right }}}}
\def\doresetextendedtexts#1% {\def\docommand##1% {\letvalue{\??tk#1##1\c!lefttext }\empty \letvalue{\??tk#1##1\c!middletext}\empty \letvalue{\??tk#1##1\c!righttext }\empty} \processcommalist[text,margin,edge]\docommand}
%\def\dosingletexts#1#2#3#4#5#6% % {\bgroup % \expandafter\convertargument#6\to\ascii % \doifsomething\ascii % {\doattributes{#1#2}#3#4% % {\placetextlinestrut{#1}% here ! % %\doifdefinedelse{\??mk\ascii\c!coupling} % brrr % \doifelsemarking\ascii % {\dolimitatetexts{#1#2#5}{\getmarking[\ascii][\v!first]}} % {\ConvertConstantAfter\doifelse\v!pagenumber{#6} % \@@plaatspaginanummer % {\ConvertConstantAfter\doifelse\v!date{#6} % {\currentdate} % {% #6{}{}{} -> {} needed for macros that look % % ahead, like \uniqueMPgraphic % \opeenregel\dolimitatetexts{#1#2#5}{#6{}{}{}}}}}}}% % \egroup}
\def\dosingletexts@wolf#1#2#3#4#5#6% {\bgroup \edef\ascii@wolf{#6}% \expandafter\convertargument\ascii@wolf\to\ascii \doifsomething\ascii {\doattributes{#1#2}#3#4% {\placetextlinestrut{#1}% here ! \doifelsemarking\ascii {\dolimitatetexts{#1#2#5}{\getmarking[\ascii][\v!first]}} {\doifelse\v!pagenumber{#6} \@@plaatspaginanummer {\doifelse\v!date{#6} {\currentdate} {\opeenregel\dolimitatetexts{#1#2#5}{#6{}{}{}}}}}}}% \egroup}
%\def\dodoubletexts#1#2#3#4#5#6% % {\doifoddpageelse % {\dosingletexts{#1}{#2}#3{#4}} % #3 => provides three arguments % {\dosingletexts{#1}{#2}#5{#6}}} % #5 => provides three arguments
\def\dodoubletexts@wolf#1#2#3#4#5#6% {\doifoddpageelse {\dosingletexts@wolf{#1}{#2}#3{#4}} % #3 => provides three arguments {\dosingletexts@wolf{#1}{#2}#5{#6}}} % #5 => provides three arguments
%D \macros{presettext} %D %D The next example demonstrates how we can use this %D mechanism to provide page (event) dependent text lines. %D %D \starttyping %D \presettext[chapter][footer][middle=pagenumber] %D \setuphead[chapter][header=high,footer=chapter] %D \setheadertexts[middle=pagenumber] %D \setfootertexts[left=left,right=right] %D \chapter{eerste} \dorecurse{20}{\input tufte \relax} %D \chapter{tweede} \dorecurse{20}{\input tufte \relax} %D \stoptyping
%\def\definetext % {\doseventupleempty\dodefinetext}
\def\presettext {\doquintupleempty\dopresettext}
%\def\dodefinetext[#1][#2][#3][#4][#5][#6][#7]% % {\ifseventhargument % \setvalue{\??tk#2#3#1}{\dosixtupleempty\dosetuptexts[#2][#3][#4][#5][#6][#7]}% % \else\ifsixthargument % \setvalue{\??tk #2#1}{\dosixtupleempty\dosetuptexts[#2][#3][#4][#5][#6]}% % \else\iffifthargument % \setvalue{\??tk#2#3#1}{\dosixtupleempty\dosetuptexts[#2][#3][#4][#5]}% % \else\iffourthargument % \setvalue{\??tk #2#1}{\dosixtupleempty\dosetuptexts[#2][#3][#4]}% % \else % \setvalue{\??tk #2#1}{\dosixtupleempty\dosetuptexts[#2][#3]}% % \fi\fi\fi\fi}
\def\dopresettext[#1][#2][#3][#4][#5]% {\iffifthargument \setvalue{\??tk#2#3#1}{\doquadrupleempty\dosetextendedtexts[#2][#3][#4][#5]}% \else\iffourthargument \setvalue{\??tk #2#1}{\doquadrupleempty\dosetextendedtexts[#2][#3][#4]}% \else \setvalue{\??tk #2#1}{\doquadrupleempty\dosetextendedtexts[#2][#3]}% \fi\fi}
\protect \endinput
------------------------------------------------------------------------
_______________________________________________ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
Another question: how get the equivalent of ams theorem package? Sorry for no ask this before and another time, thanks Xan.
On Mon, 5 Mar 2007, Xan wrote:
Another question: how get the equivalent of ams theorem package? Sorry for no ask this before and another time, thanks
enumerations. This is what I ususally do \defineenumeration[theorem][style=italic,text=Theorem,location=hanging] \starttheorem This is an important theorem \stoptheorem They do almost everything on what is needed for theorems. I am working on providing missing features, so if you find something is missing, feel free to ask. Aditya
En/na Aditya Mahajan ha escrit:
On Mon, 5 Mar 2007, Xan wrote:
Another question: how get the equivalent of ams theorem package? Sorry for no ask this before and another time, thanks
enumerations. This is what I ususally do
\defineenumeration[theorem][style=italic,text=Theorem,location=hanging]
\starttheorem This is an important theorem \stoptheorem
They do almost everything on what is needed for theorems. I am working on providing missing features, so if you find something is missing, feel free to ask.
Thank you very much for give me this opportunity. Enumerations work but I need more customization: 1) How can you change the style of the text (Theorem in our example)? 2) How can you change the position of the counter: "1 Theorem" rather than "Theorem 1" 3) Is it possible to change the counter? In LaTeX, with much effort and help, I could write some code for displaying something like: Theorem [number of theorem].[numberofpageitappears]. .... If you want to see the code, I could give you 4) What about the indentation of the "body" of the theorem?. If you put: \starttheorem This is an important theorem skjdskad sda sdas dsad asdas das dsafs f dsfsdfsdf dfsdf sdf dsfsd fsdfsd fds fdsf ds fsd fds fsdfsdfs fdsfsd f \stoptheorem the text is indented a little bit after the begginning of the line. We could have a normal indentation (like AMS theorem do)? 5) Is there an equivalent to \newenvironment in latex? I think about the demostration: \newenvironment{demo}{\medskip Demostració.}{\hfill $\Box$} I'm sure all of that is possible to do with context.... And another question (in other topic): how we can do lines at header and footer like fancyheaders in latex? Thanks another time, Xan.
Aditya _______________________________________________ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
And another question (in other topic): how we can do lines at header and footer like fancyheaders in latex?
For your headers try this: --- \setupheader [text] [after=\hrule] \starttext \input tufte \stoptext --- You can change the actual content of your headers via \setupheadertexts ... Instead of the \hrule command above you could also resort to \thinrule. The global behaviour of \thinrule can then be customized via \setupthinrules ... However, this comes at the cost of introducing additional vertical space between your header text and the rule. On the contrary \hrule sticks to the text. Choose whatever suits you best. (To the experts: is this \thinrule behaviour intended?) Best wishes, Oliver
On Tue, 6 Mar 2007, Oliver Buerschaper wrote:
And another question (in other topic): how we can do lines at header and footer like fancyheaders in latex?
For your headers try this:
---
\setupheader [text] [after=\hrule]
\starttext \input tufte \stoptext
---
You can change the actual content of your headers via \setupheadertexts ...
Instead of the \hrule command above you could also resort to \thinrule. The global behaviour of \thinrule can then be customized via \setupthinrules ... However, this comes at the cost of introducing additional vertical space between your header text and the rule. On the contrary \hrule sticks to the text. Choose whatever suits you best.
(To the experts: is this \thinrule behaviour intended?)
A better way is to use \setupbackgrounds. You can specify the exact region of the page that you want, and it accepts all the parameters of framed, so you can change the rule thickness, background, etc. And for a really fancy layout, you can use a metapost background. Aditya
For your headers try this:
---
\setupheader [text] [after=\hrule]
\starttext \input tufte \stoptext
---
You can change the actual content of your headers via \setupheadertexts ...
Instead of the \hrule command above you could also resort to \thinrule. The global behaviour of \thinrule can then be customized via \setupthinrules ... However, this comes at the cost of introducing additional vertical space between your header text and the rule. On the contrary \hrule sticks to the text. Choose whatever suits you best.
(To the experts: is this \thinrule behaviour intended?)
A better way is to use \setupbackgrounds. You can specify the exact region of the page that you want, and it accepts all the parameters of framed, so you can change the rule thickness, background, etc. And for a really fancy layout, you can use a metapost background.
I didn't think of that ... however, suppressing the header on certain pages via e.g. \setuphead[chapter][header=empty] doesn't turn off the header background :-( Oliver
On Tue, 06 Mar 2007 10:26:49 +0100
Xan
En/na Aditya Mahajan ha escrit:
On Mon, 5 Mar 2007, Xan wrote:
Another question: how get the equivalent of ams theorem package? Sorry for no ask this before and another time, thanks
enumerations. This is what I ususally do
\defineenumeration[theorem][style=italic,text=Theorem,location=hanging]
\starttheorem This is an important theorem \stoptheorem
They do almost everything on what is needed for theorems. I am working on providing missing features, so if you find something is missing, feel free to ask.
Thank you very much for give me this opportunity. Enumerations work but I need more customization:
1) How can you change the style of the text (Theorem in our example)? 2) How can you change the position of the counter: "1 Theorem" rather than "Theorem 1" 3) Is it possible to change the counter? In LaTeX, with much effort and help, I could write some code for displaying something like:
Theorem [number of theorem].[numberofpageitappears]. ....
If you want to see the code, I could give you
4) What about the indentation of the "body" of the theorem?. If you put:
\starttheorem This is an important theorem skjdskad sda sdas dsad asdas das dsafs f dsfsdfsdf dfsdf sdf dsfsd fsdfsd fds fdsf ds fsd fds fsdfsdfs fdsfsd f \stoptheorem
the text is indented a little bit after the begginning of the line. We could have a normal indentation (like AMS theorem do)?
5) Is there an equivalent to \newenvironment in latex? I think about the demostration:
\newenvironment{demo}{\medskip Demostració.}{\hfill $\Box$}
\definestartstop [demo] [before={\blank[medium]Demostració.}, after=\hfill\mathematics{\Box}] \starttext \startdemo text text text \unknown \stopdemo \stoptext Wolfgang
I'm sure all of that is possible to do with context....
And another question (in other topic): how we can do lines at header and footer like fancyheaders in latex?
Thanks another time, Xan.
Aditya _______________________________________________ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
_______________________________________________ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
Well, thank you very much all of you. En/na Wolfgang Schuster ha escrit:
On Tue, 06 Mar 2007 10:26:49 +0100 Xan
wrote: En/na Aditya Mahajan ha escrit:
On Mon, 5 Mar 2007, Xan wrote:
Another question: how get the equivalent of ams theorem package? Sorry for no ask this before and another time, thanks enumerations. This is what I ususally do
\defineenumeration[theorem][style=italic,text=Theorem,location=hanging]
\starttheorem This is an important theorem \stoptheorem
They do almost everything on what is needed for theorems. I am working on providing missing features, so if you find something is missing, feel free to ask. Thank you very much for give me this opportunity. Enumerations work but I need more customization:
1) How can you change the style of the text (Theorem in our example)? 2) How can you change the position of the counter: "1 Theorem" rather than "Theorem 1" 3) Is it possible to change the counter? In LaTeX, with much effort and help, I could write some code for displaying something like:
Theorem [number of theorem].[numberofpageitappears]. ....
If you want to see the code, I could give you
4) What about the indentation of the "body" of the theorem?. If you put:
\starttheorem This is an important theorem skjdskad sda sdas dsad asdas das dsafs f dsfsdfsdf dfsdf sdf dsfsd fsdfsd fds fdsf ds fsd fds fsdfsdfs fdsfsd f \stoptheorem
the text is indented a little bit after the begginning of the line. We could have a normal indentation (like AMS theorem do)?
5) Is there an equivalent to \newenvironment in latex? I think about the demostration:
\newenvironment{demo}{\medskip Demostració.}{\hfill $\Box$}
\definestartstop [demo] [before={\blank[medium]Demostració.}, after=\hfill\mathematics{\Box}]
\starttext
\startdemo text text text \unknown \stopdemo
\stoptext
Wolfgang
I'm sure all of that is possible to do with context....
And another question (in other topic): how we can do lines at header and footer like fancyheaders in latex?
Thanks another time, Xan.
Aditya _______________________________________________ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
_______________________________________________ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
_______________________________________________ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
On Tue, 6 Mar 2007, Xan wrote:
En/na Aditya Mahajan ha escrit:
On Mon, 5 Mar 2007, Xan wrote:
Another question: how get the equivalent of ams theorem package? Sorry for no ask this before and another time, thanks
enumerations. This is what I ususally do
\defineenumeration[theorem][style=italic,text=Theorem,location=hanging]
\starttheorem This is an important theorem \stoptheorem
They do almost everything on what is needed for theorems. I am working on providing missing features, so if you find something is missing, feel free to ask.
Thank you very much for give me this opportunity. Enumerations work but I need more customization:
1) How can you change the style of the text (Theorem in our example)?
\defineenumeration[theorem][headstyle=normal|bold|italic|(any font commnad)]
2) How can you change the position of the counter: "1 Theorem" rather than "Theorem 1"
No simple way right now. It is possible to do that using left and right keys. So, something like \defineenumeration[theorem][text=,right={ Theorem}] If you do not want the dot after the number, say stopper=, above.
3) Is it possible to change the counter? In LaTeX, with much effort and help, I could write some code for displaying something like:
Theorem [number of theorem].[numberofpageitappears]. ....
If you want to see the code, I could give you
In ConTeXt this is much easier. \defineenumeration[theorem][conversion=myconversion] so, you can do something like \def\withpagenumbercommand#1{\numbers{#1}.blah\currentpage} \defineconversion [withpagenumber] [\withpagenumbercommand] \defineenumeration[test][conversion=withpagenumber] (I tested this, and this is not working. In fact conversion is not working with enumerations). This will be fixed soon. If you need it immediately, there is just a one line change as a workaround.
4) What about the indentation of the "body" of the theorem?. If you put:
\starttheorem This is an important theorem skjdskad sda sdas dsad asdas das dsafs f dsfsdfsdf dfsdf sdf dsfsd fsdfsd fds fdsf ds fsd fds fsdfsdfs fdsfsd f \stoptheorem
the text is indented a little bit after the begginning of the line. We could have a normal indentation (like AMS theorem do)?
Did I say, that is the way I like it ;) It you do not, do not say location=hanging.
5) Is there an equivalent to \newenvironment in latex? I think about the demostration:
\newenvironment{demo}{\medskip Demostració.}{\hfill $\Box$}
Wolfgang answered the equivalent way to do it in ConteXt.
And another question (in other topic): how we can do lines at header and footer like fancyheaders in latex?
\setupbackgrounds[header][text][topframe=on,rulethickness=1pt] etc. Aditya
PS: Yes, I refer to xyfig. Some time ago there was something about this. I think than xypic has very little chances to become part of context; I used it and I find it useful , but metapost is better (abd perhaps pgf too).
btw grep -i xypic in latest distro give fonts/map/pdftex/context/original-base.map:% xypic tex/context/base/s-abr-01.tex:\logo [XYPIC] {XYPIC} % wrong logo luigi
En/na luigi scarso ha escrit:
PS: Yes, I refer to xyfig.
Sorry (double): xypic!! Sorry
Some time ago there was something about this. I think than xypic has very little chances to become part of context; I used it and I find it useful , but metapost is better (abd perhaps pgf too).
btw grep -i xypic in latest distro give
fonts/map/pdftex/context/original-base.map:% xypic tex/context/base/s-abr-01.tex:\logo [XYPIC] {XYPIC} % wrong logo
Thank you very much for this links. I saw the MetaPost and MetaFun and it's incredible what we can do with these!. I'm impressed. Thanks, Xan-
luigi _______________________________________________ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
On Tue, 6 Mar 2007, luigi scarso wrote:
PS: Yes, I refer to xyfig. Some time ago there was something about this. I think than xypic has very little chances to become part of context; I used it and I find it useful , but metapost is better (abd perhaps pgf too).
I have never used xypic. I looked at its page at http://www.tug.org/applications/Xy-pic/ and it says that it works with plain tex. Then it should also work with ConTeXt. Has anyone tried using it with ConTeXt? Aditya
On 3/6/07, Aditya Mahajan
On Tue, 6 Mar 2007, luigi scarso wrote:
PS: Yes, I refer to xyfig. Some time ago there was something about this. I think than xypic has very little chances to become part of context; I used it and I find it useful , but metapost is better (abd perhaps pgf too).
I have never used xypic. I looked at its page at http://www.tug.org/applications/Xy-pic/ and it says that it works with plain tex. Then it should also work with ConTeXt. Has anyone tried using it with ConTeXt?
search in mail list for
Re: XYpic
Vit Zyka
participants (6)
-
Aditya Mahajan
-
luigi scarso
-
Mojca Miklavec
-
Oliver Buerschaper
-
Wolfgang Schuster
-
Xan