Re: [NTG-context] Is it possible to automatically determine font size to fit text to a given space?

2005-12-03 Thread Daniel Pittman
Hans Hagen [EMAIL PROTECTED] writes:
 Daniel Pittman wrote:

G'day Hans.

Hints about that, or a native TeX method[1], would be very much
appreciated.  At the moment it is a relatively slow process of manual
trial and error.

 this is something tex is pretty good at and it runs as fast as normal

 how does your current code look? (the solution depends a bit it); think
 of something

Sorry, I should have included that.  The cut down version follows; I
have a few more comments and so forth so I can revisit it if I wish.

I didn't make any attempt to automate the process at this stage, but
will have a play with all the suggestion and see if I can get it to
work.


For reference, this is aimed at printing multiple identical labels in
each batch, rather than distinct content on each label, so I don't worry
about the font size changing between the individual labels in the run or
anything.

Regards,
Daniel


\loadmapfile[ec-bitstream-vera.map]
\usetypescriptfile[type-bitstream-vera]
\usetypescript[fiee][bitstream-vera]
\setupbodyfont[bitstream-vera, ss, 10pt]

% Avery Slide labels (L7656) layout.
\definepapersize[L7656][width=46.0mm,height=11.1mm]

\setuppapersize [XY][A4]
\setuppaper [topspace=15.9mm,backspace=6.0mm,dx=4.7mm,dy=1.6mm,nx=4,ny=21]
\setuplayout[page] [topspace=15.9mm,backspace=6.0mm]
\setuplayout[page]
\setuplayout[location=middle]
\setuparranging [XY]

% The layout within the label
\setuplayout[
width=fit,height=fit,
header=1mm,footer=0mm,leftmargin=0mm,rightmargin=0mm,
topspace=1mm,backspace=1mm,
]

\setuppagenumbering[state=stop]

\startbuffer[label]
\vbox{20051112 \crlf Black Rock Cider}
\stopbuffer

\starttext
% skip already printed labels
\dorecurse{30}{~~\page}%
% print a number of labels.
\dorecurse{129}{%
\bf\setupinterlinespace[line=2ex]%
\startalignment[middle]%
\getbuffer[label]%
\stopalignment%
\page}
\stoptext

___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] Re: installing tetex on ubuntu : basics log

2005-12-03 Thread VnPenguin
On 12/2/05, olivier Turlier [EMAIL PROTECTED] wrote:

 The command # gzip -dc tetex-texmf.tar.gz \| (umask 0; cd 
 /usr/local/teTeX/share/texmf-dist;tar xvf -)

 was impossible : bash: syntax error near unexpected token `('

 I've tried , as a blind experiment : remove parenthesis, umask 022,
 remove \, but still same kind of syntax error.


With GNU tar :

# cd /usr/local/teTeX/share/texmf-dist
# tar xvzf /path/to/tetex-texmf.tar.gz

--
http://vnoss.org
Vietnamese Open Source Software Community
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] IPA/TIPA support in Context?

2005-12-03 Thread Henning Hraban Ramm

I think the answer is zero or nearly zero. If you have a bit of
patience, I can do a port of tipa.sty (quite easy), but it will
take some time before I can start on it.
in the process taco and i can discuss low level support issues as  
well; it's all a matter of demand and time; of course after a  
port, taco would mildly force you to write an article for the MAPS -)
I had done some basics with the font/encoding parts before. I  
solicited feedback on what next parts/features were important to  
tackle next, and I got nowhere. I'll try to dig this up and send it  
to you guys in the next few days. (Remind me if you don't hear from  
me!)


Perhaps this is a stupid question, but do we need more than some  
definitions in the Unicode encoding vectors and typescripts for some  
fonts?

Is (T)IPA support about more than using some phonetic chars?
Please enlighten me.


Grüßlis vom Hraban!
---
http://www.fiee.net/texnique/
http://contextgarden.net
http://www.cacert.org (I'm an assurer)

___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] Re: ConTeXt live

2005-12-03 Thread Taco Hoekwater

Patrick Gundlach wrote:

Hi,



In my account, ConTeXt works no prob, I got a perfect PDF.
My problem occurs when I run ConTeXt via web, under Apache's user of course.
How to trace ConTeXt run under web server ?


Reversing the order will hopefully give a clue on how to proceed:
make ConTeXt create mpgraph.mp first, then the other one. If that
gets you past the error (and into a similar error: test-mpgraph.mp),
then it is probably a  number of open files limit problem. Here is
the relevant macro, with the order already adjusted :

\def\initializeMPgraphics
  {\bgroup
   \ifx\bufferprefix\empty\else
 \let\bufferprefix\empty
 \initializeMPgraphicfile
   \fi
   \egroup
   \initializeMPgraphicfile }


I'd guess it is pretty much impossible to trace under a webserver. Can
you install the same environment on a local computer? Then you could
strace any process.


You can try to add --passon='-kpathsea-debug=4' in the texexec
call. All the kpathsea debug output should end up in your apache
error_log (the number 4 is for fopen/fclose traces).


Perhaps this is a problem with php? Did you try running this via cgi?


If you are lucky, there may be some hint in your global or local
apache error file.


Good luck,

Taco
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] IPA/TIPA support in Context?

2005-12-03 Thread Taco Hoekwater

Henning Hraban Ramm wrote:


Perhaps this is a stupid question, but do we need more than some  
definitions in the Unicode encoding vectors and typescripts for some  
fonts?

Is (T)IPA support about more than using some phonetic chars?
Please enlighten me.


AFAICT, there are:

  - 2 new font encodings needed (T3 and T3S), with associated
named characters
  - a set of font definitions
  - unicode tables (for utf input) need extension
  - there are some macros in IPA for special input

That's about it for the basic TIPA font support, I guess.

For proper linguistic work, you need a large set of extra macros,
but those are not in the LaTeX tipa.sty either.

Greetings, Taco
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


[NTG-context] Re: Re: installing tetex on ubuntu : basics log

2005-12-03 Thread olivier Turlier
Le Sat, 03 Dec 2005 11:12:39 +0100, VnPenguin a écrit :

 On 12/2/05, olivier Turlier [EMAIL PROTECTED] wrote:

 The command # gzip -dc tetex-texmf.tar.gz \| (umask 0; cd 
 /usr/local/teTeX/share/texmf-dist;tar xvf -)

 was impossible : bash: syntax error near unexpected token `('

 I've tried , as a blind experiment : remove parenthesis, umask 022,
 remove \, but still same kind of syntax error.

 
 With GNU tar :
 
 # cd /usr/local/teTeX/share/texmf-dist
 # tar xvzf /path/to/tetex-texmf.tar.gz

It's what I've done (see begin of thread, after shit happens ...)

Thanks


-- 
olivier TURLIER


___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] GNU Emacs/ AucTeX configuration for ConTeXt

2005-12-03 Thread Johan Sandblom
2005/12/2, Renaud AUBIN [EMAIL PROTECTED]:

 Hi all,

 Is there someone using GNU Emacs with ConTeXt. After some googlelyzing, I've
 learnt :
 1. ConTeXt mode from Berend de Boer is now included in AucTeX
 2. Some people use Emacs with ConTeXt and METAPOST, but with special .el
 files that seems not really up-to-date

 I didn't found usefull information to configure properly AucTeX in order to
 work well with ConTeXt and METAPOST, even in the auctex mailing list.
 It's ok for the menu (apparently managed by site) but I don't have syntax
 highlighting except for comment and indenting doesn't work well.
 So, my questions are:
 1. Since there is a ConTeXt mode, I suppose there is some advanced features
 like syntax highlighting and indentation rules. Am I right ?

Yes, although the highlighting is rather sparse, mainly it seems to
color anything after \ in gray, and the indentation rules somewhat
finicky, requiring you to adhere to a structure it can parse.

 2. If I'm right, how to configure it ?

Some of the things are available as defcustoms but most of it I think
requires hacking the functions.

 3. I will use METAPOST in my .tex files, how to manage this within Emacs ?

There is a metapost.el that is distributed with GNU Emacs (but not
with XEmacs, works there too though). I sometimes just change to that
major mode in the middle of the file, and this should be possible to
automate using mmm, but I never tried.

 4. You know advanded features I must know ? ;-)

There is TeX debugging just as for LaTeX, automatically locating the
error in the source and explaining it.

I think possibly that the reason for the sparse syntax highlighting is
the higher frequency of inline definitions in ConTeXt, making it
impossible to keep up with it. I think it should be parsable, but
requires emacs-lisp skills way beyond mine.


 I'm sorry but I'm addicted to Emacs and don't want to use Scite even if it
 seems ConTeXt-friendly. I'm aware of the fact that this mail is more
 Emacs/AucTeX related but since I didn't succeed in finding answers yet I
 submit this issue to the ConTeXt community.

 Best regards,


 ___
 ntg-context mailing list
 ntg-context@ntg.nl
 http://www.ntg.nl/mailman/listinfo/ntg-context




Regards,

--
Johan Sandblom  N8, MRC, Karolinska sjh
t +46851776108  17176 Stockholm
m +46735521477  Sweden
What is wanted is not the will to believe, but the
will to find out, which is the exact opposite
- Bertrand Russell
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


[NTG-context] fontvariants

2005-12-03 Thread Hans van der Meer

I was probing into the font variant mechanism.

This did not work, th Light font could not be made to typeset:

\starttypescript [calligraphy] [mathtimeyy] [name]
\definefontsynonym [CalligraphyRegular] [Calligraphy]
\definefontsynonym [Calligraphy] [MathTimes-Calligraphy]
\definefontsynonym [CalligraphyBold][MathTimes-CalligraphyBold]

\definefontvariant [Calligraphy] [light] [-Light]
\definefontsynonym [CalligraphyRegular-Light][MathTimes- 
CalligraphyLight]
\definefontsynonym [CalligraphyBold-Light][MathTimes- 
CalligraphyLightBold]

\stoptypescript

But changing Calligraphy into Serif in the last three lines

\definefontvariant [Serif] [light] [-Light]
\definefontsynonym [SerifRegular-Light][MathTimes- 
CalligraphyLight]
\definefontsynonym [SerifBold-Light][MathTimes- 
CalligraphyLightBold]


it seems to work.

QUESTION: Is the variant mechanism exclusively tied to the series  
Serif (\rm) and Sans (\ss)?

If otherwise, what am I doing wrong then?

yours sincerely,
dr. H. van der Meer



___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] lot of newbie questions

2005-12-03 Thread toto

Quoting Adam Lindsay [EMAIL PROTECTED]:

Hans Hagen wrote:

[EMAIL PROTECTED] wrote:

For information: I've tried to type them directly on my keybord. 
They apear on my screen but the final pdf document output black 
rectangles. (I'm sure that all what I use is configured to use and 
produce utf8)

But the workaround with \leftguillemot and \rightguillemot is fine for me.


hm, this normally means that there is no correspondence between the 
utf vector's slot and a glyph ... meybe we need a fix?


Just tried it with default LM, ec, and texnansi. No problem that I 
can see.  Question to toto:

What's your font setup for the document?


No font selecting command. It seems to be cm. I use two commands into 
my document without knowing beeing sure of what they do:

\useencoding[utf8] and \enableregime[utf]

(Someone asked what encoding, you answered UTF-8, which in ConTeXt 
parlance is the input regime. We're also asking about the font's 
output encoding.  More at:

 http://wiki.contextgarden.net/Encodings_and_Regimes   )


I have no \usetypescript or \setupbodyfont commands.

Cheers
-AJ
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


[NTG-context] cal calligraphic

2005-12-03 Thread Hans van der Meer

I am confused about the behaviour of \cal and calligraphic.
In a font where the calligraphic letters are in MathItalic all goes  
well.
But, in a font where the calligraphic letters come from another font  
I get:


  \definefontsynonym [Calligraphic] [FONT_OTHER_THAN_MathSymbol]

in text: \calligraphic{ABC} is ok
in text: {\cal ABC} is ok
in math: $\calligraphic{ABC}$ is ok
in text: ${\cal ABC}$ IS NOT OK, SYMBOLS KEEP COMING FROM MATHSYMBOL

I would the font redefinition also being obeyed in math {\cal} ?
Why is this the only exception?

yours sincerely,
dr. H. van der Meer



___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


[NTG-context] Re: Some $\mframed{math}$ questions

2005-12-03 Thread Aditya Mahajan

--- On Dec 2, Mojca Miklavec wrote ---


1. What's the best way to frame a formula like here:

\placeformula
\startformula
\mframed{x^2+y^2=z^2}
\stopformula

The problem is that:
- formula number is shifted downwards in comparison to the formula
without a number
- I don't know how to do the settings (frame color, frame offset)
globally. There's no \setupmframed[...] command. It's probably
possible to use a sort of
\setupframed[whatever_setting_influencing_only_mframed],
but I don't know how.


Sorry, no idea on how to do this.



2. What's the general strategy when doing evel stuff with formula
numbering? I would like to use \eqalign and then number formulas like
on the following example:

z^2=x^2+y^2(1)
  =(x'-x_0)^2+(y'-y_0)^2 % no number
  =R^2\cos^2(\phi)(2)



The following works.  I still find the amsmath way of doing this much 
easier, but equation numbering has not been ported to amsl module


\starttext
\placeformula
\startformula
\eqalignno{
z^2 =x^2+y^2  \formulanumber\cr
=(x'-x_0)^2+(y'-y_0)^2  \cr% no number
=R^2\cos^2(\phi) \formulanumber\cr
}
\stopformula

\stoptext




Can I somehow number the formulas (1), (2), (3.a), (3.b), (3.c), (4),
(5.1), (5.2)? I would like to manually provide where to start and stop
numbering with x.a or x.1, x.2.


Have a look at the wiki http://wiki.contextgarden.net/Math for the manual 
way to number each subformula. I think one can define a 
\start(stop)subformula[format = ??] to put a \place(sub)formula 
automatically. But I do not know how to define such an environment 
properly.




3. How can I put more than one equation in a row and number all of
them (as if they were placed in three columns)?


One way to cheat can be to start a three column mode

\starttext

\startcolumns[n=3,tolerance=verytolerant]
\placeformula
\startformula
 E = mc^2
\stopformula
\column
\placeformula
\startformula
 E = mc^2
\stopformula
\column
\placeformula
\startformula
 E = mc^2
\stopformula
\stopcolumns
\stoptext

Again, one could define a start-stop environment for this.


4. How can I move the formula number one row lower in case that the
formula is too long and if it would overlap with the formula number
otherwise?


Not sure what you mean here. Context (rather tex, I think) does this by 
default


\starttext

\placeformula
\startformula
a =  ddd ccc 
ee f ggg

\stopformula
\stoptext

HTH,
Aditya
___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] fontvariants

2005-12-03 Thread Adam Lindsay

Hans van der Meer wrote:

I was probing into the font variant mechanism.

QUESTION: Is the variant mechanism exclusively tied to the series  Serif 
(\rm) and Sans (\ss)?


Yes, pretty much, in the implementation's design.


If otherwise, what am I doing wrong then?


Nothing. Except, is that Math Calligraphy font really suited to setting 
text? :)


adam
--
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 Adam T. Lindsay, Computing Dept. [EMAIL PROTECTED]
 Lancaster University, InfoLab21+44(0)1524/510.514
 Lancaster, LA1 4WA, UK Fax:+44(0)1524/510.492
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

___
ntg-context mailing list
ntg-context@ntg.nl
http://www.ntg.nl/mailman/listinfo/ntg-context


Re: [NTG-context] An idea

2005-12-03 Thread Nikolai Weibull
Nikolai Weibull wrote:

 It would require very little programming.  syntax/2html.vim, which
 converts the buffer to a HTML document with syntax highlighting, is 526
 lines in the current CVS incarnation.  A syntax/2context.vim would be
 even shorter, perhaps 150 to 200 lines.  If I find the time I’ll write
 something this weekend.  I’m catching a could though, so I might not
 :-(.

A splitting headache notwithstanding, here’s a syntax/2context.vim that
weighs in at 170 lines.  There are still things to do, like figuring out
how to complement this on the ConTeXt side (i.e., defining \highlight)
and things will depend on how this is done.  Some sort of \type
environment would be nice, as it is better to not do escaping of special
characters on the Vim side.  Someone with better knowledge of how to do
this than I have is welcome to finish it.  The \highlight command should
be defined something like this (pseudo-tex-code):

\pdef\highlight[#1]{#2}%
  {\bgroup
   \setupcolorforgroup[#1]%
   \type{#2}%
   \egroup}

#1 is a group name, such as Statement, Operator, or Comment.  #2 may
contain multiple lines, and I don’t know how well this will work on the
TeX side.  It may also contain special characters like {, #, , and so
on.  Suggestions?

nikolai

-- 
Nikolai Weibull: now available free of charge at http://bitwi.se/!
Born in Chicago, IL USA; currently residing in Gothenburg, Sweden.
main(){printf(linux[\021%six\012\0],(linux)[have]+fun-97);}
 Vim syntax support file
 Maintainer:   Nikolai Weibull [EMAIL PROTECTED]
 Latest Revision:  2005-12-03

function! s:Format(text, group)
  let formatted = strtrans(a:text)

   TODO: Replace the reserved ConTeXt characters.

  return \\highlight[ . a:group . ']{' . formatted . '}'
endfun

 Set up options.
let s:old_title = title
let s:old_icon = icon
let s:old_et = l:et
let s:old_report = report
let s:old_search = @/
set notitle noicon
setlocal et
set report=100

 Split window to create a buffer with the HTML file.
let s:org_bufnr = winbufnr(0)
if expand(%) == 
  new untitled.tex
else
  new %.tex
endif
let s:new_win = winnr()
let s:org_win = bufwinnr(s:org_bufnr)

 Set up options in the new buffer.
set modifiable
%d
let s:old_paste = paste
set paste
let s:old_magic = magic
set magic

 Set up the buffer’s “header”.
exe normal! a\\startlines\n\e

 Switch to the original window.
exe s:org_win . 'wincmd w'

 Variables to keep track of the range to convert.
let s:lnum = 1
let s:end = line('$')

 Set up stuff for handling folding.
if has('folding')  !exists('context_ignore_folding')
  let s:foldfillchar = fillchars[matchend(fillchars, 'fold:')]
  if s:foldfillchar == ''
let s:foldfillchar = '-'
  endif
endif

 Set up stuff for handling diffs.
let s:difffillchar = fillchars[matchend(fillchars, 'diff:')]
if s:difffillchar == ''
  let s:difffillchar = '-'
endif

 Now, loop over all lines in the range.
while s:lnum = s:end
   If there are filler lines for diff mode, show these above the line.
  let s:filler = diff_filler(s:lnum)
  if s:filler  0
let s:n = s:filler
while s:n  0
  let s:new = repeat(s:difffillchar, 3)

  if s:n  2  s:n  s:filler  !exists('context_whole_filler')
let s:new = s:new .   . s:filler . ' inserted lines '
let s:n = 2
  endif

  let s:new = s:new . repeat(s:difffillchar, columns - strlen(s:new))

  let s:new = s:Format(s:new, 'DiffDelete')
  exe s:new_win . 'wincmd w'
  exe 'normal! a' . s:new . \n\e
  exe s:org_win . 'wincmd w'

  let s:n -= 1
endwhile
unlet s:n
  endif
  unlet s:filler

  let s:new = 
  if has('folding')  !exists('context_ignore_folding')  foldclosed(s:lnum) 
 -1
let s:new = s:Format(s:new . foldtextresult(s:lnum), 'Folded')
let s:lnum = foldclosedend(s:lnum)
  else
let s:line = getline(s:lnum)
let s:len = strlen(s:line)
let s:diffattr = diff_hlID(s:lnum, 1)

let s:col = 1
while s:col = s:len || (s:col == 1  s:diffattr)
  let s:startcol = s:col  The start column for processing text.
  if s:diffattr
let s:id = diff_hlID(s:lnum, s:col)
let s:col += 1
while s:col = s:len  s:id == diff_hlID(s:lnum, s:col) | let s:col += 
1 | endwhile
if s:len  columns
   Add spaces at the end to mark the changed line.
  let s:line = s:line . repeat(' ', columns - s:len)
  let s:len = columns
endif
  else
let s:id = synID(s:lnum, s:col, 1)
let s:col += 1
while s:col = s:len  s:id == synID(s:lnum, s:col, 1) | let s:col += 
1 | endwhile
  endif

   Expand tabs.
  let s:expanded = strpart(s:line, s:startcol - 1, s:col - s:startcol)
  let idx = stridx(s:expanded, \t)
  while idx = 0
let i = ts - (idx + s:startcol - 1) % ts
let s:expanded = substitute(s:expanded, '\t', repeat(' ', i), '')
let idx = stridx(s:expanded, \t)
  endwhile

   Output the text with the same synID, with class set to {s:id_name}.