From: Xan <DXpublica@telefonica.net>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: Some questions about context
Date: Mon, 05 Mar 2007 21:12:42 +0100 [thread overview]
Message-ID: <45EC79BA.2000509@telefonica.net> (raw)
In-Reply-To: <20070305144429.a3878c60.schuster.wolfgang@googlemail.com>
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 <DXpublica@telefonica.net> 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
next prev parent reply other threads:[~2007-03-05 20:12 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-03-05 12:43 Xan
2007-03-05 13:44 ` Wolfgang Schuster
2007-03-05 14:44 ` Aditya Mahajan
2007-03-05 16:45 ` Mojca Miklavec
2007-03-05 17:35 ` Aditya Mahajan
2007-03-05 20:12 ` Xan [this message]
2007-03-05 20:21 ` Xan
2007-03-06 0:37 ` Aditya Mahajan
2007-03-06 9:26 ` Xan
2007-03-06 10:19 ` Oliver Buerschaper
2007-03-06 16:16 ` Aditya Mahajan
2007-03-06 22:07 ` Oliver Buerschaper
2007-03-06 11:48 ` Wolfgang Schuster
2007-03-07 11:47 ` Xan
2007-03-06 16:14 ` Aditya Mahajan
2007-03-06 1:46 ` luigi scarso
2007-03-06 9:09 ` Xan
2007-03-06 16:20 ` Aditya Mahajan
2007-03-06 23:01 ` luigi scarso
[not found] <mailman.0.1173178801.22858.ntg-context@ntg.nl>
2007-03-06 13:00 ` Robin Kirkham
2007-03-10 7:45 ` Wolfgang Schuster
[not found] <mailman.3024.1173519750.17432.ntg-context@ntg.nl>
2007-03-11 3:15 ` Robin Kirkham
2007-03-11 12:18 ` Wolfgang Schuster
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=45EC79BA.2000509@telefonica.net \
--to=dxpublica@telefonica.net \
--cc=ntg-context@ntg.nl \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).