ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Gerben Wierda <Gerben.Wierda@rna.nl>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: Printing source code intelligently with ConTeXt (with overlay)
Date: Sat, 6 Jun 2009 16:16:06 +0200	[thread overview]
Message-ID: <FA3D39DC-D023-4525-A3EA-B6AFAB786304@rna.nl> (raw)
In-Reply-To: <7746F014-C28F-447E-A679-E195F05858E1@gmail.com>

The overlay if a prelimiary of IfSQ code inspection (http:// 
www.ifsq.org). Source code is printed with the overlay and then a  
visual inspection process is performed using the overlay to keep track  
of results.

I tried the following with a test TeX file (no landscape or line  
numbers yet):

> \defineoverlay[ifsqoverlay][\overlayfigure{IfSQ-overlay.pdf}]
> \starttext
> \setupbackgrounds[page][overlay=ifsqoverlay]
> \typefile[SQL][]{details.pls}
> \stoptext

And the start of file details.pls is:

> PACKAGE BODY DETAILS IS
> /* Let op: wanneer er foutmeldingen ontstaan als
>    "Invalid cursor" en
>    "Missing mandotory parameter (ORA-01009)
>    dan wordt de form waarschijnlijk aangeroepen met "shared library  
> data"
>    Kijk eerst bij de aanroep en zorg dat de aanroep met  
> "no_share_library_data"
> is
> */
> -- mantis 1055: g_aantal_items toegevoegd en in update_details  
> p_aanroeper toege
> voegd.
>
> -- lokaal:
> -- globale variabelen, eenmalig gezet bij initialisatie
> g_debug boolean := false; -- aanzetten om debuggen te vergemakkelijken
> g_max_lengte NUMBER := 2.5;
> g_max_hoogte NUMBER := 1.5;
> g_begin_pos_x NUMBER := 5;
> g_begin_pos_y NUMBER := 2.844;
> g_alleen_tonen VARCHAR2(1) := 'N';
> g_aantal_structuren NUMBER := -9; -- -9 en 9 zijn "schakel-waarden"
> g_multi BOOLEAN := TRUE;

But that ends in tears:

> (/usr/local/texlive/2008/texmf-dist/tex/context/base/pdfr-def.tex)
> systems         : begin file testsql at line 2
> (/usr/local/texlive/2008/texmf-dist/tex/context/base/verb-sql.tex
> loading         : Context Support Macros / Pretty SQL Verbatim
> (/usr/local/texlive/2008/texmf-dist/tex/context/base/verb-pl.tex
> loading         : Context Support Macros / Pretty PERL Verbatim
> ))
> Overfull \hbox (23.9878pt too wide) in paragraph at lines 4--4
> []|[] [][] [][] []\*12pttttftt*: dan[] []wordt[] []de[] []form[]  
> []waarschijnli
> jk[] []aangeroepen[] []met[] []"shared[] []library[] []data"
>
> Overfull \hbox (61.03781pt too wide) in paragraph at lines 4--4
> []|[] [][] [][] []\*12pttttftt*: Kijk[] []eerst[] []bij[] []de[]  
> []aanroep[] []
> en[] []zorg[] []dat[] []de[] []aanroep[] []met[]  
> []"no_share_library_data"[]
> ! Undefined control sequence.
> \doSQLtypefourfour ...ntfalse \prettyverbatimfont
>                                                   \fi \else  
> \endPLtypesix \b...
> <argument> */
>              \relax \flushrestofverbatimline
> \processverbatimline #1->#1
>
> \dodoverbatimline ...ax \flushrestofverbatimline }
>                                                   \endverbatimline  
> \global \...
>
> \presetnormalverbatimline ...\doflushverbatimline
>                                                   \fi \global \let  
> \savedver...
>
> \readline ...line \else \presetnormalverbatimline
>                                                   \fi \fi \fi \fi  
> \handlever...
> ...
> l.4 \typefile[SQL][]{details.pls}
>
> ? x

The overlay I am using is:

http://www.ifsq.org/resources/level-2/overlay.pdf

If prettyprinting does not work I would be happy with verbatim print  
with line numbers and correct indentation.

Gerben

On 6 Jun 2009, at 15:58, Wolfgang Schuster wrote:

>
> Am 06.06.2009 um 15:52 schrieb Gerben Wierda:
>
>> Here is the question. I have source code which i want to print  
>> using an overlay in PDF, linenumbers, fixed width font, correct  
>> indentation of tabs and in landscape mode. I could create some of  
>> this with the pr program, but preferably I would like some sort of  
>> ConTeXt setup which I could automate.
>
> What do you want to do with the overlay?
>
> Wolfgang
>
> ___________________________________________________________________________________
> If your question is of interest to others as well, please add an  
> entry to the Wiki!
>
> maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
> webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
> archive  : https://foundry.supelec.fr/projects/contextrev/
> wiki     : http://contextgarden.net
> ___________________________________________________________________________________
>

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


  reply	other threads:[~2009-06-06 14:16 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-29 14:58 Printen van code met een PDF overlay, makkelijk met ConTeXt? Gerben Wierda
2009-05-29 16:21 ` Hans Hagen
2009-06-04 14:10   ` Gerben.Wierda
2009-06-04 14:17     ` Wolfgang Schuster
2009-06-06 13:52       ` Printing source code intelligently with ConTeXt (with overlay) Gerben Wierda
2009-06-06 13:58         ` Wolfgang Schuster
2009-06-06 14:16           ` Gerben Wierda [this message]
2009-06-06 14:59             ` Interaction between overlay and typing? Gerben Wierda
2009-06-06 16:13               ` Wolfgang Schuster
2009-06-06 16:25                 ` Gerben Wierda
2009-06-06 16:36                   ` Wolfgang Schuster
2009-06-06 17:45                     ` PL/SQL pretty print Gerben Wierda

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=FA3D39DC-D023-4525-A3EA-B6AFAB786304@rna.nl \
    --to=gerben.wierda@rna.nl \
    --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).