ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* LaTeX \newcommands in ConTeXt.
@ 2005-07-25  6:15 Brooks Moses
  2005-07-25 23:28 ` Hans Hagen
  2005-09-23 17:01 ` Patrick Gundlach
  0 siblings, 2 replies; 5+ messages in thread
From: Brooks Moses @ 2005-07-25  6:15 UTC (permalink / raw)


I've recently been doing a little work on implementing a few LaTeX kernel 
bits in ConTeXt, to simplify porting LaTeX code over.  It's now at a point 
where a few of the pieces might actually be useful, and certainly to a 
point where some comments would be welcomed, so I've put up a version of it 
online, in this directory:

     http://dpdx.net/context/latex-compat/

What you'll find there is a fair number of module files, along with a 
couple of "latextest" files that I've been using to try out the 
results.  latextext.tex is to be compiled in ConTeXt; latextext-latex.tex 
is to be compiled in LaTeX for purposes of comparison.

In any case, I think the implementation of \newcommand (and its relatives) 
is about up to "beta" level.  Ditto with LaTeX lengths.  And there's a 
working LaTeX-like counter implementation, based on ConTeXt counters 
underneath.  (It's not yet hooked into ConTeXt's counters for footnotes and 
equations and pages, though; I'm not really sure how to do that.)

Also, environments are working, in a sort of hackish way.  The "array" 
environment works, but again a bit hackish; I'm planning to clean that up 
soon, so both of those will get major revisions.

I'd particularly appreciate any comments on the \newcommand and counters 
implementations -- those are in the t-ltcmds and t-ltcnts modules, though 
\newcommand also depends on t-lterrs and t-ltbase.

- Brooks

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: LaTeX \newcommands in ConTeXt.
  2005-07-25  6:15 LaTeX \newcommands in ConTeXt Brooks Moses
@ 2005-07-25 23:28 ` Hans Hagen
  2005-07-26  1:03   ` Brooks Moses
  2005-09-23 17:01 ` Patrick Gundlach
  1 sibling, 1 reply; 5+ messages in thread
From: Hans Hagen @ 2005-07-25 23:28 UTC (permalink / raw)


Brooks Moses wrote:

> I've recently been doing a little work on implementing a few LaTeX 
> kernel bits in ConTeXt, to simplify porting LaTeX code over.  It's now 
> at a point where a few of the pieces might actually be useful, and 
> certainly to a point where some comments would be welcomed, so I've 
> put up a version of it online, in this directory:
>
>     http://dpdx.net/context/latex-compat/
>
> What you'll find there is a fair number of module files, along with a 
> couple of "latextest" files that I've been using to try out the 
> results.  latextext.tex is to be compiled in ConTeXt; 
> latextext-latex.tex is to be compiled in LaTeX for purposes of 
> comparison.
>
> In any case, I think the implementation of \newcommand (and its 
> relatives) is about up to "beta" level.  Ditto with LaTeX lengths.  
> And there's a working LaTeX-like counter implementation, based on 
> ConTeXt counters underneath.  (It's not yet hooked into ConTeXt's 
> counters for footnotes and equations and pages, though; I'm not really 
> sure how to do that.)
>
> Also, environments are working, in a sort of hackish way.  The "array" 
> environment works, but again a bit hackish; I'm planning to clean that 
> up soon, so both of those will get major revisions.
>
> I'd particularly appreciate any comments on the \newcommand and 
> counters implementations -- those are in the t-ltcmds and t-ltcnts 
> modules, though \newcommand also depends on t-lterrs and t-ltbase.

i just took a quick look at the code; if you run into tricky definitions, let me know, often there are either already low level macros that do the job, or i can add some stuff; 

btw, i renamed the internal \end macro so that you can get away from stoptext refinitions (too messy) 

Hans 

 

-----------------------------------------------------------------
                                          Hans Hagen | PRAGMA ADE
              Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
                                             | www.pragma-pod.nl
-----------------------------------------------------------------

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: LaTeX \newcommands in ConTeXt.
  2005-07-25 23:28 ` Hans Hagen
@ 2005-07-26  1:03   ` Brooks Moses
  2005-07-26  7:08     ` Hans Hagen
  0 siblings, 1 reply; 5+ messages in thread
From: Brooks Moses @ 2005-07-26  1:03 UTC (permalink / raw)


At 04:28 PM 7/25/2005, you wrote:
>Brooks Moses wrote:
>>I'd particularly appreciate any comments on the \newcommand and counters 
>>implementations -- those are in the t-ltcmds and t-ltcnts modules, though 
>>\newcommand also depends on t-lterrs and t-ltbase.
>
>i just took a quick look at the code; if you run into tricky definitions, 
>let me know, often there are either already low level macros that do the 
>job, or i can add some stuff;

Thanks!  I'll probably have lots of questions as I go along -- this is 
certainly becoming a tour of the internals of both systems.

>btw, i renamed the internal \end macro so that you can get away from 
>stoptext refinitions (too messy)

Yeah, the \stoptext redefinition was one of the first pieces I wrote, 
nearly a year ago.  The reason I was doing the \stoptext redefinition 
wasn't the internal \end macro (which didn't exist then, I think) -- it was 
that the ConTeXt version I used then didn't have an \everystoptext 
hook.  But now that it exists, I can just use it.

One other question I have right now: what's a good way to duplicate LaTeX's 
\vspace macro (which is effectively a \vskip inside), without causing the 
problems that the ConTeXt manual warns about if we use \vskip?

- Brooks

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: LaTeX \newcommands in ConTeXt.
  2005-07-26  1:03   ` Brooks Moses
@ 2005-07-26  7:08     ` Hans Hagen
  0 siblings, 0 replies; 5+ messages in thread
From: Hans Hagen @ 2005-07-26  7:08 UTC (permalink / raw)


Brooks Moses wrote:

> At 04:28 PM 7/25/2005, you wrote:
>
>> Brooks Moses wrote:
>>
>>> I'd particularly appreciate any comments on the \newcommand and 
>>> counters implementations -- those are in the t-ltcmds and t-ltcnts 
>>> modules, though \newcommand also depends on t-lterrs and t-ltbase.
>>
>>
>> i just took a quick look at the code; if you run into tricky 
>> definitions, let me know, often there are either already low level 
>> macros that do the job, or i can add some stuff;
>
>
> Thanks!  I'll probably have lots of questions as I go along -- this is 
> certainly becoming a tour of the internals of both systems.
>
>> btw, i renamed the internal \end macro so that you can get away from 
>> stoptext refinitions (too messy)
>
>
> Yeah, the \stoptext redefinition was one of the first pieces I wrote, 
> nearly a year ago.  The reason I was doing the \stoptext redefinition 
> wasn't the internal \end macro (which didn't exist then, I think) -- 
> it was that the ConTeXt version I used then didn't have an 
> \everystoptext hook.  But now that it exists, I can just use it.
>
> One other question I have right now: what's a good way to duplicate 
> LaTeX's \vspace macro (which is effectively a \vskip inside), without 
> causing the problems that the ConTeXt manual warns about if we use 
> \vskip?


maybe (a patched version of \godown):

\def\godown[#1]%
  {\ifhmode\endgraf\fi
   \ifvmode\nointerlineskip\vskip#1\relax}

test 

\godown[10cm]

test 

is \vspace accumulating? 

Hans 

-----------------------------------------------------------------
                                          Hans Hagen | PRAGMA ADE
              Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
                                             | www.pragma-pod.nl
-----------------------------------------------------------------

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: LaTeX \newcommands in ConTeXt.
  2005-07-25  6:15 LaTeX \newcommands in ConTeXt Brooks Moses
  2005-07-25 23:28 ` Hans Hagen
@ 2005-09-23 17:01 ` Patrick Gundlach
  1 sibling, 0 replies; 5+ messages in thread
From: Patrick Gundlach @ 2005-09-23 17:01 UTC (permalink / raw)


Hello Brooks,


> I've recently been doing a little work on implementing a few LaTeX
> kernel bits in ConTeXt, to simplify porting LaTeX code over.  It's now
> at a point where a few of the pieces might actually be useful, and
> certainly to a point where some comments would be welcomed, so I've
> put up a version of it online, in this directory:
>
>      http://dpdx.net/context/latex-compat/

Perhaps it would make sense to create a module and (co-)host this on
contextgarden/CTAN?

Patrick
-- 
ConTeXt wiki and more: http://contextgarden.net

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2005-09-23 17:01 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-07-25  6:15 LaTeX \newcommands in ConTeXt Brooks Moses
2005-07-25 23:28 ` Hans Hagen
2005-07-26  1:03   ` Brooks Moses
2005-07-26  7:08     ` Hans Hagen
2005-09-23 17:01 ` Patrick Gundlach

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