COIN-OR::LEMON - Graph Library

Changeset 59:5d9170b19285 in lemon-tutorial


Ignore:
Timestamp:
04/08/10 09:20:19 (15 years ago)
Author:
Alpar Juttner <alpar@…>
Branch:
default
Phase:
public
Message:

Support of the PDF version

Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • .hgignore

    r17 r59  
    1313.dirstamp
    1414Doxyfile
     15DoxyfilePdf
    1516Makefile
    1617
     
    2122^gen-images/.*
    2223^gen-dox/.*
     24^gen-pdf-dox/.*
     25^latex/.*
    2326^demo/build/.*
  • Makefile.in

    r52 r59  
    3939html: Doxyfile-gen $(PNG_IMAGES)
    4040        -mkdir -p gen-dox
     41        -mkdir -p gen-pdf-dox
    4142        ./scripts/titlegen.py
    4243        doxygen Doxyfile
     44
     45pdf: Doxyfile-gen $(PNG_IMAGES)
     46        -mkdir -p gen-dox
     47        -mkdir -p gen-pdf-dox
     48        ./scripts/titlegen.py   
     49        doxygen DoxyfilePdf
     50        make -C latex
    4351
    4452demos: $(DEMOS)
     
    4856            -e 's/@lemon_doc_prefix@/@make_lemon_doc_prefix@/g' \
    4957        < Doxyfile.in >Doxyfile
     58        sed -e 's/@version@/'`./scripts/chg-len.py`'/g' \
     59            -e 's/@lemon_doc_prefix@/@make_lemon_doc_prefix@/g' \
     60        < DoxyfilePdf.in >DoxyfilePdf
    5061
    5162clean:
  • scripts/titlegen.py

    r42 r59  
    11#! /usr/bin/env python
     2#
     3# This file is a part of LEMON, a generic C++ optimization library.
     4#
     5# Copyright (C) 2003-2010
     6# Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
     7# (Egervary Research Group on Combinatorial Optimization, EGRES).
     8#
     9# Permission to use, modify and distribute this software is granted
     10# provided that this copyright notice appears in all copies. For
     11# precise terms see the accompanying LICENSE file.
     12#
     13# This software is provided "AS IS" with no warranty of any kind,
     14# express or implied, and with no claim as to its suitability for any
     15# purpose.
     16#
    217
    318import sys
     
    4156toc={}
    4257ind={}
     58page_files={}
     59ordered_pages = []
     60
     61for doxfile in os.listdir('.'):
     62    if doxfile[-4:]=='.dox':
     63        for l in open(doxfile).readlines():
     64            gr = re.match(r"(^[[]PAGE[]].*[[]PAGE[]])?(.*)$", l).groups()
     65            if gr[0]:
     66                page=gr[0][6:-6]
     67                page_files[page]=doxfile
    4368
    4469prev_page=''
     
    5782                ind[prev_page][2]=t_link
    5883            prev_page=t_link
     84            ordered_pages.append(t_link)
    5985        toc[format_sec(t_sec)]=t_link
    6086
     
    96122                fo.write(gr[4]+'\n')
    97123        fo.close()
     124
     125fpdf=open(os.path.join("gen-pdf-dox","full.dox"),"w")
     126for doxfile in [page_files[p] for p in ordered_pages]:
     127    page=''
     128    for l in open(doxfile).readlines():
     129        gr = re.match(r"(^[[]PAGE[]].*[[]PAGE[]])?(^[[]SEC[]].*[[]SEC[]])?(^[[]TRAILER[]])?(^[[]TOC[]])?(.*)$", l).groups()
     130        if gr[0]:
     131            page=gr[0][6:-6]
     132            fpdf.write("\page %s %s\n"%(page,gr[4]))
     133        elif gr[1]:
     134            sec=gr[1][5:-5]
     135            fpdf.write("\section %s %s\n"%(sec,gr[4]))
     136        elif gr[2]:
     137            pass
     138        elif gr[3]:
     139            pass
     140        else:
     141            fpdf.write(gr[4]+'\n')
     142fpdf.close()
Note: See TracChangeset for help on using the changeset viewer.