Printen van code met een PDF overlay, makkelijk met ConTeXt?
Beste allemaal, ik wil broncode uitprinten met regelnummers op pagina's met een bepaalde overlay. Ik heb dus ascii text files als input (de code) een overlay in PDF en wil deze gecombineerd printen. Ik zat te denken: is een ConTeXt based workflow hier een mogelijke oplossing? De regelnummers e.d. kan ik eventueel met het pr programma genereren. Met vriendelijke groet, Gerben
Gerben Wierda wrote:
Beste allemaal,
ik wil broncode uitprinten met regelnummers op pagina's met een bepaalde overlay. Ik heb dus ascii text files als input (de code) een overlay in PDF en wil deze gecombineerd printen.
Ik zat te denken: is een ConTeXt based workflow hier een mogelijke oplossing? De regelnummers e.d. kan ik eventueel met het pr programma genereren.
\defineoverlay[myoverlay][\overlayfigure{myfile.pdf}] \setupbackgrounds[page][overlay=myoverlay] if it has to be on top: \setupbackgrounds[page][overlay={foreground,myoverlay}] ----------------------------------------------------------------- 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 -----------------------------------------------------------------
Gerben Wierda wrote:
Beste allemaal,
ik wil broncode uitprinten met regelnummers op pagina's met een bepaalde overlay. Ik heb dus ascii text files als input (de code) een overlay in PDF en wil deze gecombineerd printen.
Ik zat te denken: is een ConTeXt based workflow hier een mogelijke oplossing? De regelnummers e.d. kan ik eventueel met het pr programma genereren.
\defineoverlay[myoverlay][\overlayfigure{myfile.pdf}]
\setupbackgrounds[page][overlay=myoverlay]
if it has to be on top:
\setupbackgrounds[page][overlay={foreground,myoverlay}]
Dank. Om het completer te maken. Stel ik heb een serie ASCII files met broncode. Deze files wil ik printen - landscape - in fixed width font en zonder de tekstfiles te hoeven aanpassen - met regelnummers - met PDF overlay (als hierboven) - met juiste vertaling van tabs naar posities Wat is dan de (slimste) ConTeXt oplossing? G
Can you ask your questions in english, your question could be relevant for other users too and it would be a shame if the don't understand it because you use dutch. Wolfgang Am 04.06.2009 um 16:10 schrieb Gerben.Wierda@rna.nl:
Gerben Wierda wrote:
Beste allemaal,
ik wil broncode uitprinten met regelnummers op pagina's met een bepaalde overlay. Ik heb dus ascii text files als input (de code) een overlay in PDF en wil deze gecombineerd printen.
Ik zat te denken: is een ConTeXt based workflow hier een mogelijke oplossing? De regelnummers e.d. kan ik eventueel met het pr programma genereren.
\defineoverlay[myoverlay][\overlayfigure{myfile.pdf}]
\setupbackgrounds[page][overlay=myoverlay]
if it has to be on top:
\setupbackgrounds[page][overlay={foreground,myoverlay}]
Dank. Om het completer te maken. Stel ik heb een serie ASCII files met broncode. Deze files wil ik printen - landscape - in fixed width font en zonder de tekstfiles te hoeven aanpassen - met regelnummers - met PDF overlay (als hierboven) - met juiste vertaling van tabs naar posities
Wat is dan de (slimste) ConTeXt oplossing?
G
On 4 Jun 2009, at 16:17, Wolfgang Schuster wrote:
Can you ask your questions in english, your question could be relevant for other users too and it would be a shame if the don't understand it because you use dutch.
Sorry, I forgot. 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. Yours, Gerben Overlay answer from Hans:
\defineoverlay[myoverlay][\overlayfigure{myfile.pdf}]
\setupbackgrounds[page][overlay=myoverlay]
if it has to be on top:
\setupbackgrounds[page][overlay={foreground,myoverlay}]
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
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 ___________________________________________________________________________________
I'm almost there: \definetyping[SQL][option=color,numbering=line] \defineoverlay[ifsqoverlay][\overlayfigure{IfSQ-overlay.pdf}] \starttext \setuppapersize[A4,landscape][a4,landscape] \setupbackgrounds[page][overlay=ifsqoverlay] \typefile[SQL][]{details.pls} \stoptext Gets me the landscape, A4, numbered output. It does not get me the overlay. Some interaction between verbatim and overlay? I also do not see any coloration. G
Am 06.06.2009 um 16:59 schrieb Gerben Wierda:
I'm almost there:
\setupcolors[state=start]
\definetyping[SQL][option=color,numbering=line] %% linenumbering did not work in MkIV
method=<language>
\defineoverlay[ifsqoverlay][\overlayfigure{IfSQ-overlay.pdf}] \starttext \setuppapersize[A4,landscape][a4,landscape] \setupbackgrounds[page][overlay=ifsqoverlay]
background=ifsqoverlay
\typefile[SQL][]{details.pls} \stoptext
Gets me the landscape, A4, numbered output. It does not get me the overlay. Some interaction between verbatim and overlay? I also do not see any coloration.
Wolfgang
On 6 Jun 2009, at 18:13, Wolfgang Schuster wrote:
Am 06.06.2009 um 16:59 schrieb Gerben Wierda:
I'm almost there:
\setupcolors[state=start]
Gives me colors for SQL, but not very useful ones. I'll have to look into that more.
\definetyping[SQL][option=color,numbering=line] %% linenumbering did not work in MkIV
method=<language>
What do you mean? Does this somehow get me good coloration?
\defineoverlay[ifsqoverlay][\overlayfigure{IfSQ-overlay.pdf}] \starttext \setuppapersize[A4,landscape][a4,landscape] \setupbackgrounds[page][overlay=ifsqoverlay]
background=ifsqoverlay
Yes, in the meantime I guessed this too. Hans' instruction was erroneous. (I would give something for decent ConTeXt documentation. This has taken me hours fiddling around and guessing on the basis of sources, just for something that simple as a background image) G
\typefile[SQL][]{details.pls} \stoptext
Gets me the landscape, A4, numbered output. It does not get me the overlay. Some interaction between verbatim and overlay? I also do not see any coloration.
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 ___________________________________________________________________________________
Am 06.06.2009 um 18:25 schrieb Gerben Wierda:
What do you mean? Does this somehow get me good coloration?
Forget this, you can get different colors by redefining these settings: \definecolor [colorprettyone] [r=.9, g=.0, b=.0] % red \definecolor [colorprettytwo] [r=.0, g=.8, b=.0] % green \definecolor [colorprettythree] [r=.0, g=.0, b=.9] % blue \definecolor [colorprettyfour] [r=.8, g=.8, b=.6] % yellow Wolfgang
On 6 Jun 2009, at 18:36, Wolfgang Schuster wrote:
Am 06.06.2009 um 18:25 schrieb Gerben Wierda:
What do you mean? Does this somehow get me good coloration?
Forget this, you can get different colors by redefining these settings:
\definecolor [colorprettyone] [r=.9, g=.0, b=.0] % red \definecolor [colorprettytwo] [r=.0, g=.8, b=.0] % green \definecolor [colorprettythree] [r=.0, g=.0, b=.9] % blue \definecolor [colorprettyfour] [r=.8, g=.8, b=.6] % yellow
It doesn't work out anyway. The pretty print for SQL is doing weird things, e.g.: - not coloring commentary in a seperate color - coloring _ characters in variable names separately Seems ConTeXt SQL pretty print of the PL/SQL I have does not work properly with respect to coloring. G
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 ___________________________________________________________________________________
participants (5)
-
Gerben Wierda
-
Gerben Wierda
-
Gerben.Wierda@rna.nl
-
Hans Hagen
-
Wolfgang Schuster