Re: [NTG-context] bookmarks using linebreaks in chapter titles
On Fri, 3 Nov 2006 01:08:46 -0500 (EST) Aditya Mahajan [EMAIL PROTECTED] wrote: On Thu, 2 Nov 2006, Sanjoy Mahajan wrote: I was trying out line breaks for long titles (at least, long when set in 36 or 48pt text), as well as have pdf bookmarks, so I defined a \1 shorthand local to the chapter heading: Maybe I am missing something here, but why not just use \\. Inside titles it is defined as \crlf\ignorespaces == \setupinteraction[state=start] \placebookmarks[chapter] \setupinteractionscreen[option=bookmark] \setuphead[chapter][before={\bgroup\def\1{\hfil\break}}, after={\egroup}] \starttext \chapter{Long\1 title} hello \stoptext == If I inline the \1, as in \chapter{Long\hfil\break title}, then it's mostly fine except that the bookmark has hfil penalty ... Is there's another way to avoid that problem? Perhaps a magic option that says what the bookmark should be, the way one can tell \index what to typeset in the index when it is different from the inline text. Usual way is \appendtoks\def\1{}\to\simplifiedcommands but something seems to be broken. It seems that you can not use any macro inside a chapter title, while using bookmarks. Here is a simple test file. \setupinteraction[state=start] \placebookmarks[chapter] \setupinteractionscreen[option=bookmark] \def\macro{long word} \starttext \chapter{Long\macro title} \stoptext You can also make a extra bookmarkentry by hand. \starttext \chapter{A rather long title} \bookmark{Short title} \stoptext I get same error as you (ConTeXt ver: 2006.11.01 09:59 MK II) One solution is to forbid hyphens during the \chapter (with before= and after= definitions) and also shrink the \hsize enough so that tex line You do not require before...after for this. Something like \setuphead[chapter][align={nothyphenated,stretch,tolerant}] should work. breaks where I want, but that method requires unintuitive, fontsize-dependent dimension guessing for each chapter. Putting in line breaks by hand is not too bad. Plus one might want to break the lines according to meaning, which does not always produce the same results as where breaks would go according to line length. I agree, for headings, it is better to do linebreak by hand. But meanwhile trying the hack method above, I get this error (./q.tuo) (./q.tuo) ! Undefined control sequence. argument Long\1 title \sanitizePDFdocencoding ...docencoding \edef #2{#1 } \doPDFinsertbookmark ...oding #3\to \bookmarktext \stripstring \bookmarktext.. \doplacebookmarks ...okmarkelement \flushbookmark \egroup \else \expanded {\.. to be read again \setupinteractionscreen l.3 \setupinteractionscreen [option=bookmark] It's from this line in q.tuo \listentry{chapter}{1}{1}{Long\1 title}{2--0-1-0-0-0-0-0--1}{1} and the \1 is not defined during \listentry, only during the \chapter. I didn't have a problem when the same code was part of a product (each component being chapter in a book, with the \setuphead in an environment file) -- only had it when I compiled one component, which is how I got to the test case above. [All with ConTeXt ver: 2006.10.24 13:47 MK II fmt: 2006.10.24] -Sanjoy ___ 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
Re: [NTG-context] formula, bookmarks and misc
On Wed, 01 Nov 2006 23:57:21 + Sebastian Rooks [EMAIL PROTECTED] wrote: Thank you ! Any tip for getting numbered bookmarks (question 3) ? Regards, Seb Wolfgang Schuster wrote: Hi Sebastian, 2006/10/29, Sebastian Rooks [EMAIL PROTECTED] mailto:[EMAIL PROTECTED]: Dear ConTeXters, 1/ I would like to use a named formula with a reference containing several subformulae each with a reference. The closer I can get to is to add an empty namedformula followed by subformulae (see test file below). How can I get rid of the empty line with a number in the pdf ? 2/ I'm using bookmarks but abbreviations in heads do not work properly. I've used a workaround some 3 years ago but I cannot remember which. Any suggestion ? (see test file below) \setupinteraction[state=start] \appendtoks \def\UK{UK} \to \simplifiedcommands \placebookmarks[chapter,section,subsection] \abbreviation [UK] {UK} {United Kingdom of Great Britain and Northern Ireland} \starttext \chapter{Weather in the \UK} \dorecurse {2} {\input dawkins \par} \stoptext 3/ What should I do to get the bookmarks numbered with their chapter/section/ etc. number ? (see test file below) 4/ How can I redefine the \vec command in my formulae without having a warning system : command \vec is already defined 5/ I do like a lot the minimum distribution so easy to install. It would be even better if bibtex can be added. It's only 82.8 KiB Thanks for ConTeXt (special thanks to Hans and Taco of course), it's really a pleasure to work with it. Regards, Seb test.tex %%%%% \setupinteraction[state=start] \placebookmarks[chapter,section,subsection] \abbreviation [UK] {UK}{United Kingdom of Great Britain and Northern Ireland} \starttext \placelist[formula] \chapter{Math formulae} \placenamedformula [eq:well_known] {Well known equalities} \startformula \stopformula \placesubformula[eq:first]{a} \startformula 1+0=1 \stopformula \placesubformula[eq:second]{b} \startformula 1+1=2 \stopformula \chapter{Weather in the \UK} \dorecurse {2} {\input dawkins \par} \stoptext ___ ntg-context mailing list ntg-context@ntg.nl mailto:ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context http://www.ntg.nl/mailman/listinfo/ntg-context Wolfgang Hi Sebastian, I found now solution to your problem. There was the same question on the list 1998 and Hans gave only a not working solution, dont't know if there was also working one. The original message: message Berend de Boer wrote: Is it possible (and how) to have the chapter and paragraph numbers in the bookmark (outline) for pdf output? Now I only get the text of the chapter but I would like the part.chapter.paragraph number as well. (did you ever try \tracebookmarkstrue?) \def\doinsertsomebookmark#1#2#3#4#5#6% {\global\utilitydonetrue \global\let\localbookmark=\gobbleoneargument \global\let\flushbookmark=\relax \doifinstringelse{#1}{\openbookmarklist} {\chardef\openbookmark=1} {\chardef\openbookmark=0}% \iftracebookmarks(#6: #4)\quad(\the\openbookmark)\par\fi \doinsertbookmark{#2}{#3}{#4}{#5}{\openbookmark}} Can you try: \doinsertbookmark{#2}{#3}{#6 #4}{#5}{\openbookmark}} I can add an option: sectionnumber=yes/no to a yet non existing setup command, but first I wanna make sure what way to go. Hans /message A rather old problem and no solution and no setup. Wolfgang ___ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
[NTG-context] new beta / mp
Hi, I uploaded a new beta release. This one has support for some fresh metapost features (mpprocsets). This means that mp inclusion is slightly faster in mkii (some 5-10%) and that the (not yet public) mkiv converter is now faster than the mkii one (some 10%) due to the cleaner mp output code. Around 20/11 we need to go current because of the tex live code freeze which means that serious bugs need to be fixed before that time. 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 - ___ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
Re: [NTG-context] feedback on the wiki Linux_User_Installation article
Antoine Junod [EMAIL PROTECTED] writes: [...] All goes fine till the 'texexec --make --alone' command. It says me 'the file 'texexec.rb' is not found'. I can copy it in the texmf-linux/bin directory but it trigs other errors. I can correct that error by recursively copying all the files of the texmf-local/scripts/context/ruby/ directory into the texmf-linux/bin/ one. I've found the mistake. I've forgotten to run setuptex or equivalent before running texexec --make --alone. I'll update the wiki in consequence. Bye -AJ ___ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
Re: [NTG-context] another font in the gyre collection
Aditya Mahajan wrote: On Thu, 2 Nov 2006, Hans Hagen wrote: The third font (bonum) is posted: http://www.gust.org.pl/projects/e-foundry/tex-gyre/ I assume that font definitions for this will be added to type-gyr. i still have to do that so feel free to send me the typescript -) Since pagella and termes are at version 1.00, should they always be used instead of Paladio and Nimbus Roman (for those who do not have the commercial fonts)? indeed, in due time i will make those the defaults and abandon the old ones; this will (i hope) end the everlasting font mess (changing names, places etc in tds) 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 - ___ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
Re: [NTG-context] bookmarks using linebreaks in chapter titles
Thanks Aditya and Wolfgang for the information. I've added it all to the wiki http://wiki.contextgarden.net/PDF_Bookmarks_and_Headers so let me know if you find any problems there. I noticed two possible bugs when trying out a few examples -- see below. If I inline the \1, as in \chapter{Long\hfil\break title}, then it's mostly fine except that the bookmark has hfil penalty ... Usual way is \appendtoks\def\1{}\to\simplifiedcommands Thanks, that's useful (and now I found it elsewhere in the wiki). One solution is to forbid hyphens during the \chapter (with before= and after= definitions) and also shrink the \hsize enough so that tex line You do not require before...after for this. Something like \setuphead[chapter][align={nothyphenated,stretch,tolerant}] should work. You can also make a extra bookmarkentry by hand. \starttext \chapter{A rather long title} \bookmark{Short title} \stoptext Also useful and wikified. Now for the two possible bugs. 1. An empty chapter breaks \bookmark: \setupinteraction[state=start] \placebookmarks[chapter] \setupinteractionscreen[option=bookmark] \starttext \chapter{A very long chapter\\ about splines} \bookmark{Splines} \stoptext The bookmark text is A very long chapter about splines. But adding a letter or word to the chapter body fixes that: \setupinteraction[state=start] \placebookmarks[chapter] \setupinteractionscreen[option=bookmark] \starttext \chapter{A very long chapter\\ about splines} \bookmark{Splines} hello \stoptext 2. The second problem is perhaps my misunderstanding. The wiki page said to use \placebookmarks[chapter,section,subsection][chapter] to make only chapter bookmarks visible. But I find that chapter bookmarks are open by default in the bookmark window, so I tried the following example instead: \setupinteraction[state=start] \placebookmarks[chapter,section,subsection][chapter,section] \setupinteractionscreen[option=bookmark] \starttext \chapter{The beginning} Hi! \chapter{A very, very\\ long title} Greetings! \section{Why so long} I don't know \subsection{Why not?} Good point. \chapter{The never-ending story} Oh no. \chapter{The never-ending story} \bookmark{Forever!} Oh no. \stoptext I expected chapter and section bookmarks to be open, which they were, but so were the subsection bookmarks. And \placebookmarks[chapter,section,subsection][chapter] made chapter and section bookmarks open. Is there an 'off by one' error \placebookmarks? Or have I misunderstood the purpose of the command (I'll then fix the wiki)? 3. And a third question is whether the bookmark window is open by default. I use xpdf (Ubuntu Linux) and it always opens the bookmark window, whether or not \setupinteractionscreen[option=bookmark] is given. Perhaps that's an xpdf-specific behavior but acroread acts differently? -Sanjoy `Never underestimate the evil of which men of power are capable.' --Bertrand Russell, _War Crimes in Vietnam_, chapter 1. ___ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
[NTG-context] Splitting a float that isn't a table
I define a floating block called Exhibit \definefloat[Exhibit][table] which just contains paragraphs of text. I'd like to be able to split it using the \splitfloat mechanism but that only seems to work if the content of the float is a table, not paragraphs. \definefloat[Exhibit][table] \starttext \input tufte\par \splitfloat[lines=auto]{\placeExhibit{Knuth}} {\dorecurse{4}{\input knuth \par}} \input tufte\page[yes] \stoptext This outputs there is nothing to split in the resultant PDF. Is there any way to achieve the equivalent of \definefloat[Exhibit][table] \starttext \input tufte\par \splitfloat[lines=auto]{\placeExhibit{Knuth}} {\bTABLE[frame=off]\dorecurse{4}{\bTR\bTD\input knuth \eTD\eTR} \eTABLE} \input tufte\page[yes] \stoptext without having to make every paragraph a table cell? Thanks in advance. Duncan ___ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
Re: [NTG-context] overlay page background missing
On 11/3/06, Aditya Mahajan wrote: On Thu, 2 Nov 2006, Paul Jones wrote: On 11/2/06, Mojca Miklavec wrote: % draw \sometxt{forever} withcolor red is broken at the moment, % but used to/should(?) work otherwise Thanks for the hint. I don't know anything about mp. Is there a replacement for the broken draw \sometxt? Well ... I meant broken in the sense that draw \sometxt{this} withcolor red is black instead of being red, but it should work unless your ConTeXt distribution is too old. draw \sometxt{\red{forever}} ; should work. True. Now on a question of my own, is it possible to redefine \sometxt so that \sometxt{abc} is equivalent to \sometxt{\mymacro{abc}} I find myself writing a lot of code like this label.top(\sometxt{\parbox{A long label}}, z1 ) ; This is really low priority, but something like this will be nice to have. Here's my vote as well. I would also like to have a mechanism which would enable easier definition of commands to be processed with \sometxt at the end. (I used some very dirty macros which redefined \sometxt temporary for that purpose, but that's far from ideal.) Mojca ___ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
Re: [NTG-context] overlay page background missing
Paul Jones wrote: So it looks like the problem boils down to this: The overlay with a layer inside it displays fine when used in the framed background. \framed[height=\textheight, width=\textwidth,background={WatermarkOverlay}, frame=on]{overlay frame} But it does not display anything when used in the setupbackgrounds background. \setupbackgrounds[page][background={WatermarkOverlay}] Any ideas why? hm, backgrounds should work ok; and page backgrounds are recalculated for each page 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 - ___ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
Re: [NTG-context] Splitting a float that isn't a table
Duncan Hothersall wrote: I define a floating block called Exhibit \definefloat[Exhibit][table] which just contains paragraphs of text. I'd like to be able to split it using the \splitfloat mechanism but that only seems to work if the content of the float is a table, not paragraphs. \definefloat[Exhibit][table] \starttext \input tufte\par \splitfloat[lines=auto]{\placeExhibit{Knuth}} {\dorecurse{4}{\input knuth \par}} \input tufte\page[yes] \stoptext This outputs there is nothing to split in the resultant PDF. Is there any way to achieve the equivalent of \definefloat[Exhibit][table] \starttext \input tufte\par \splitfloat[lines=auto]{\placeExhibit{Knuth}} {\bTABLE[frame=off]\dorecurse{4}{\bTR\bTD\input knuth \eTD\eTR} \eTABLE} \input tufte\page[yes] \stoptext without having to make every paragraph a table cell? for simple texts: \def\startsometext {\beginshapebox} \def\stopsometext {\endshapebox \reshapebox{\ruledhbox{\strut\box\shapebox}} \setbox\tsplitcontent\vbox{\flushshapebox} \handletsplit} \starttext \input tufte \splitfloat [lines=auto] {\placefigure{}} {\startsometext \dorecurse{4}{\input knuth \par} \stopsometext} \input tufte \showframe \splitfloat [lines=auto] {\placefigure{}} {\starttabulate[|p|] \NC \dorecurse{4}{\input knuth }\NC\NR \stoptabulate} \starttabulate[|p|] \NC \input knuth \NC\NR \stoptabulate \stoptext wikifyable (hm, could even be a nice article ...) 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 - ___ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
Re: [NTG-context] overlay page background missing
Mojca Miklavec wrote: On 11/3/06, Aditya Mahajan wrote: On Thu, 2 Nov 2006, Paul Jones wrote: On 11/2/06, Mojca Miklavec wrote: % draw \sometxt{forever} withcolor red is broken at the moment, % but used to/should(?) work otherwise Thanks for the hint. I don't know anything about mp. Is there a replacement for the broken draw \sometxt? Well ... I meant broken in the sense that draw \sometxt{this} withcolor red is black instead of being red, but it should work unless your ConTeXt distribution is too old. draw \sometxt{\red{forever}} ; should work. True. Now on a question of my own, is it possible to redefine \sometxt so that \sometxt{abc} is equivalent to \sometxt{\mymacro{abc}} I find myself writing a lot of code like this label.top(\sometxt{\parbox{A long label}}, z1 ) ; This is really low priority, but something like this will be nice to have. Here's my vote as well. I would also like to have a mechanism which would enable easier definition of commands to be processed with \sometxt at the end. (I used some very dirty macros which redefined \sometxt temporary for that purpose, but that's far from ideal.) hm, always hungry for new features ... i assume that one of you then writes a nice myway about \sometxt cum suis as well as a wiki entry next beta: % \definetextext[framed]{\framed} % % \startMPcode % draw \sometxt[framed]{black} rotated 45 ; % \stopMPcode 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 - ___ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
Re: [NTG-context] bookmarks using linebreaks in chapter titles
Sanjoy Mahajan wrote: Now for the two possible bugs. 1. An empty chapter breaks \bookmark: \setupinteraction[state=start] \placebookmarks[chapter] \setupinteractionscreen[option=bookmark] \starttext \chapter{A very long chapter\\ about splines} \bookmark{Splines} \stoptext The bookmark text is A very long chapter about splines. But adding a letter or word to the chapter body fixes that: indeed, bookmarks are flushed at the next paragraph, otherwise they would end up at undefined places 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 - ___ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context
Re: [NTG-context] bookmarks using linebreaks in chapter titles
The bookmark text is A very long chapter about splines. But adding a letter or word to the chapter body fixes that: indeed, bookmarks are flushed at the next paragraph, otherwise they would end up at undefined places Good point. Does the \bookmark then belong before the \chapter or \section, in case the section ends up as the last line on a page? -Sanjoy `Never underestimate the evil of which men of power are capable.' --Bertrand Russell, _War Crimes in Vietnam_, chapter 1. ___ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context