From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/11594 Path: main.gmane.org!not-for-mail From: Zeljko Vrba Newsgroups: gmane.comp.tex.context Subject: some bugs and C++ typing Date: Sun, 23 Mar 2003 09:23:28 +0100 Sender: ntg-context-admin@ntg.nl Message-ID: <20030323082328.GA14757@fly.srk.fer.hr> Reply-To: ntg-context@ntg.nl NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="MGYHOYXEY6WxJCY8" X-Trace: main.gmane.org 1048407956 5666 80.91.224.249 (23 Mar 2003 08:25:56 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Sun, 23 Mar 2003 08:25:56 +0000 (UTC) Original-X-From: ntg-context-admin@ntg.nl Sun Mar 23 09:25:55 2003 Return-path: Original-Received: from ref.vet.uu.nl ([131.211.172.13] helo=ref.ntg.nl) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 18x0nj-0001TE-00 for ; Sun, 23 Mar 2003 09:25:55 +0100 Original-Received: from ref.ntg.nl (localhost.localdomain [127.0.0.1]) by ref.ntg.nl (Postfix) with ESMTP id 4F81110B3A; Sun, 23 Mar 2003 09:26:03 +0100 (MET) Original-Received: from fly.srk.fer.hr (fly.srk.fer.hr [161.53.74.66]) by ref.ntg.nl (Postfix) with ESMTP id 9F90E10AE8 for ; Sun, 23 Mar 2003 09:23:31 +0100 (MET) Original-Received: from fly.srk.fer.hr (mordor@localhost [127.0.0.1]) by fly.srk.fer.hr (8.12.8/8.12.5) with ESMTP id h2N8NSN0019496 for ; Sun, 23 Mar 2003 09:23:28 +0100 (MET) Original-Received: (from mordor@localhost) by fly.srk.fer.hr (8.12.8/8.12.2/Submit) id h2N8NSm7019495 for ntg-context@ntg.nl; Sun, 23 Mar 2003 09:23:28 +0100 (MET) Original-To: ntg-context@ntg.nl Content-Disposition: inline User-Agent: Mutt/1.4i Errors-To: ntg-context-admin@ntg.nl X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.0.13 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.comp.tex.context:11594 X-Report-Spam: http://spam.gmane.org/gmane.comp.tex.context:11594 --MGYHOYXEY6WxJCY8 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi Hans! I'm typesetting an algorithms course in C++ and I came around to few bugs and personal wishes :) 1. I've "written" a verb-cpp.tex which knows C++ keywords. However, as you'll see from the attached example, it needs a few fixes: - the missing word if it ends with & (the bar& x argument) - & coloured in green alongside y (it should be grey since it's an operator) - &, +=, -=, *=, /=, %=, >>=, <<=, ->*, .* should be coloured like operators and must be considered as single tokens - I'd like the whole comment in a single color (not red start/end and black text). dark green would be ideal :) Since I know nothing about verbatim mechanism (I just took java environment and stuffed it with C++ keywords) how hard would it be to make those changes? I put '\input verb-cpp' into verb-ini.tex to make it work in my local installation. 2. As you can see from the example, I want to typeset text next to code. However, the footnotes within are not working. (context ver. 2002.10.23) 3. Multi-column paragraphs are not automatically broken across pages. If the paragraph doesn't fit on the current page, it will be moved to the next page leaving an ugly empty box at the bottom of the previous page. How can I achieve an effect similar to the attached example, but that will automatically break across pages not leaving empty boxes at the bottom? 4. Some time ago I reported \pseudoencodedDJ macros not working in itemize environment and you posted a fix to the list. Did you integrate the fix in the latest release? Thanks for your time! --MGYHOYXEY6WxJCY8 Content-Type: application/x-tex Content-Disposition: attachment; filename="verb-cpp.tex" Content-Transfer-Encoding: quoted-printable %D \module=0A%D [ file=3Dverb-jv,=0A%D version=3D2002.2.27,= =0A%D title=3D\CONTEXT\ Verbatim Macros,=0A%D subtitle=3DPre= tty \JAVA\ Verbatim,=0A%D author=3DHans Hagen,=0A%D date= =3D\currentdate,=0A%D copyright=3D{PRAGMA / Hans Hagen \& Ton Otten}]= =0A%C=0A%C This module is part of the \CONTEXT\ macro||package and is=0A%C = therefore copyrighted by \PRAGMA. See mreadme.pdf for =0A%C details. =0A%C= =0A%C Modified on 2002-11-03 by Zeljko Vrba (mordor@fly.srk.fer.hr)=0A%C to= support C and C++=0A=0A\writestatus{loading}{Context Support Macros / Pret= ty C++ Verbatim}=0A=0A%D This module differs from the \JAVASCRIPT\ driver i= n its=0A%D handling of comments. We also need a few more handlers: one=0A%D= for \type {//} and \type {/*} and one for \type {*/} as=0A%D well as the \= JAVA doc trigger \type {/**}. =0A=0A%D We build this driver on top of the \= PERL\ one. Since this=0A%D driver looks much like the \JAVASCRIPT\ one, we = don't =0A%D comment it extensively. =0A=0A\ifx\undefined\setupprettyPLtype = \input verb-pl \relax \fi=0A=0A\unprotect=0A=0A\newcount\CPPcommentlevel=0A= =0A\gdef\CPPsetspecials=0A {\PLsetspecials=0A \setpretty`\#=3D32=0A \s= etpretty`\%=3D41=0A \setpretty`\-=3D45 =0A \setpretty`\/=3D43=0A \set= pretty`\*=3D44 }=0A=0A\gdef\CPPsethandlers=0A {\PLsethandlers=0A \instal= lprettyhandler 43 \CPPtypefourthree=0A \installprettyhandler 44 \CPPtypef= ourfour =0A \installprettyhandler 45 \CPPtypefourfive }=0A=0A\gdef\CPPset= controls=0A {\PLsetcontrols=0A \def\flushrestofverbatimline=0A {\end= PLtypesix=0A \ifcase\CPPcommentlevel \inPLcommentfalse \fi=0A \PL= verbosefalse=0A \PLverboseskipped=3D0}}=0A=0A\gdef\CPPsetvariables=0A = {\PLsetvariables=0A \global\CPPcommentlevel=3D0 }=0A=0A\gdef\setuppretty= CPPtype=0A {\def\prettyidentifier{CPP}%=0A \let\PLidentifiers\CPPidentif= iers=0A \let\PLvariables\CPPvariables=0A \CPPsetvariables=0A \CPPsetc= ontrols=0A \CPPsethandlers=0A \CPPsetspecials=0A \PLsetdiagnostics}= =0A=0A\gdef\CPPtypefourthree=0A {\handlenextnextpretty\doCPPtypefourthree\= PLtypefourtwo}=0A=0A\gdef\doCPPtypefourthree#1#2#3%=0A {\getprettydata{#2}= %=0A \ifnum\prettytype=3D43=0A \let\next\dodoCPPtypefourthree=0A \e= lse\ifnum\prettytype=3D44=0A \global\advance\CPPcommentlevel 1=0A \= global\inPLcommenttrue=0A \PLverbosecorrection=0A \getprettydata{#3= }%=0A \ifnum\prettytype=3D44=0A \inPLdoctrue=0A \fi=0A \l= et\next\CPPtogglecomment=0A \else=0A \let\next\PLtypefourtwo=0A \fi= \fi=0A \next{#1}#2#3}=0A=0A\gdef\CPPtogglecomment#1#2%=0A {\ifnum\CPPcom= mentlevel=3D1=0A \beginofpretty[\!!prettyone]\getpretties{#1}{#2}\endof= pretty=0A \else=0A \getpretties{#1}{#2}%=0A \fi}=0A=0A\gdef\dodoCPP= typefourthree=0A {\endPLtypesix=0A \handlenextnextpretty\dododoCPPtypefo= urthree\dodododoPLtypefourthree}=0A=0A\gdef\dododoCPPtypefourthree=0A {\if= newpretty\expandafter\handlenewpretty\fi\dodododoCPPtypefourthree}=0A=0A\gd= ef\dodododoCPPtypefourthree#1#2%=0A {\ifinPLcomment=0A \getpretties{#1= }{#2}%=0A \else=0A \global\inPLcommenttrue=0A \PLverbosecorrectio= n=0A \ifnaturaltextext=0A \let\next\naturaltextext=0A \else= =0A \def\next{\beginofpretty[\!!prettyone]\getpretties{#1}{#2}\endofp= retty}%=0A \fi=0A \expandafter\next=0A \fi}=0A=0A\gdef\CPPtypefou= rfour=0A {\ifinPLdoc=0A \@EA\noCPPtypefourfour=0A \else=0A \@EA\= handlenextnextpretty\@EA\doCPPtypefourfour\@EA\PLtypefourtwo=0A \fi}=0A= =0A\gdef\noCPPtypefourfour#1#2%=0A {\getprettydata{#2}%=0A \ifnum\pretty= type=3D43=0A \CPPtogglecomment{#1}#2%=0A \inPLdocfalse=0A \glob= al\advance\CPPcommentlevel -1=0A \ifcase\CPPcommentlevel \global\inPLco= mmentfalse \fi=0A \else=0A \ifPLdocdone =0A \getpretty{#1}%=0A = \else=0A \beginofpretty[\!!prettyone]\getpretty{#1}\endofpretty= =0A \PLdocdonetrue=0A \fi=0A \expandafter#2%=0A \fi}=0A=0A\= gdef\doCPPtypefourfour#1#2%=0A {\getprettydata{#2}%=0A \ifnum\prettytype= =3D43=0A \CPPtogglecomment{#1}#2%=0A \inPLdocfalse=0A \global\a= dvance\CPPcommentlevel -1=0A \ifcase\CPPcommentlevel \global\inPLcommen= tfalse \fi=0A \else=0A \endPLtypesix=0A \beginofpretty[\!!prettyf= our]\getpretty{#1}\endofpretty=0A \expandafter#2%=0A \fi}=0A=0A\gdef\= CPPtypefourfive % permit - in javadoc @tags =0A {\ifinPLdoc=0A \@EA\PL= typesixtwo=0A \else=0A \@EA\PLtypefourone=0A \fi}=0A=0A\useprettyid= entifiers \CPPidentifiers \CPPsetspecials=0A goto break return continue ca= se default if else switch=0A while for do sizeof int long short char void = signed=0A unsigned float double bool complex struct union enum=0A typedef= static register auto volatile extern const=0A new delete this friend usin= g public protected private=0A inline virtual explicit export throw try cat= ch operator=0A typeid mutable class typename template namespace true false= =0A static_cast reinterpret_cast const_cast dynamic_cast=0A =0A% We use = identifiers for # directives=0A\useprettyidentifiers \CPPvariables \CPPsets= pecials=0A #include #if #endif #elif #else #ifdef #ifndef #pragma=0A=0A%D = The \JAVA doc feature was requested by Robert F.~Beeger, =0A%D who also pro= vided this test class: =0A%D =0A%D \startCPP =0A%D package de.jwamalpha.han= dling.web.rbdipl;=0A%D =0A%D import java.io.IOException;=0A%D import java.i= o.PrintWriter;=0A%D import javax.servlet.http.HttpServlet;=0A%D import java= x.servlet.http.HttpServletRequest;=0A%D import javax.servlet.http.HttpServl= etResponse;=0A%D import javax.servlet.ServletException;=0A%D =0A%D /**=0A%D= * The simple login servlet=0A%D *=0A%D * @author Robert F. Beeger=0A%D = * @version 1.0=0A%D */=0A%D =0A%D public class LoginServlet extends HttpS= ervlet=0A%D {=0A%D // =0A%D // public interface=0A%D //=0A%D /**=0A= %D * Process the get-request.=0A%D *=0A%D * @param request the req= uest=0A%D * @param response the response.=0A%D */=0A%D protected vo= id doGet (HttpServletRequest request, HttpServletResponse response)=0A%D = throws ServletException, IOException=0A%D {=0A%D response.setConte= ntType("text/html");=0A%D PrintWriter writer =3D response.getWriter();= =0A%D writer.println("");=0A%D writer.println(" ");=0A= %D writer.println(" Login");=0A%D writer.println(= " ");=0A%D writer.println(" ");=0A%D writer.println(= " Hallo, Benutzer " + request.getParameter("username") + "!");=0A%D = writer.println(" ");=0A%D writer.println("");=0A%D w= riter.flush();=0A%D }=0A%D }=0A%D \stopCPP =0A=0A\protect \endinput =0A --MGYHOYXEY6WxJCY8 Content-Type: application/x-tex Content-Disposition: attachment; filename="bug.tex" Content-Transfer-Encoding: quoted-printable %\setupoutput[pdftex]=0A\setupcolors[state=3Dstart]=0A\setupbackground[stat= e=3Dstart]=0A\setupinteraction[state=3Dstart,color=3Dblue,style=3Dbold,auth= or=3DZeljko Vrba,title=3DSPA,subject=3DVjezbe iz kolegija SPA]=0A\placebook= marks[chapter,section,subsection,subsubsection]=0A\useencoding[lat2]=0A\mai= nlanguage[hr]=0A=0A\setupbodyfont[cmr,10pt,rm]=0A\setuppagenumbering[locati= on=3Dfooter,alternative=3Ddoublesided]=0A\setupwhitespace[medium]=0A=0A\set= uphead[chapter][style=3D\bfc,page=3Dyes]=0A\setuphead[section][style=3D\bfb= ]=0A\setuphead[subsection][style=3D\bfa]=0A\setuphead[subsubsection][style= =3D\bfa]=0A\setupbodyfontenvironment[default][em=3Ditalic]=0A=0A%\definefra= medtext[codeex][width=3D.9\textwidth,bodyfont=3D8pt]=0A\defineparagraphs[co= deex][rule=3Don,n=3D2]=0A\setupparagraphs[codeex][1][width=3D6cm]=0A\define= description[definition][location=3Dhanging,headstyle=3Dbold]=0A=0A\starttex= t=0AAn example of\footnote{working} footnote.=0A=0A\startcodeex=0AThis is a= n example\footnote{of non-working} footnote.=0A\codeex=0A\startCPP=0Avoid f= (bar& x, bar &y, struct foo *z) {=0A x +=3D z->y;=0A x.*ptr();=0A z->*pt= r();=0A /* comment */=0A y =3D 3;=0A y +=3D x;=0A}=0A\stopCPP=0A\stopcod= eex=0A\stoptext=0A --MGYHOYXEY6WxJCY8--