[GRASS-SVN] r59755 - in grass-promo/grassposter/2014_EGU_G7_Landscape: . texpdfs

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Apr 16 20:23:07 PDT 2014


Author: wenzeslaus
Date: 2014-04-16 20:23:07 -0700 (Wed, 16 Apr 2014)
New Revision: 59755

Added:
   grass-promo/grassposter/2014_EGU_G7_Landscape/texpdfs/
   grass-promo/grassposter/2014_EGU_G7_Landscape/texpdfs/pygrass_code.tex
Modified:
   grass-promo/grassposter/2014_EGU_G7_Landscape/Makefile
   grass-promo/grassposter/2014_EGU_G7_Landscape/poster.tex
Log:
2014_EGU_G7_Landscape: using listings package in a separate document

Modified: grass-promo/grassposter/2014_EGU_G7_Landscape/Makefile
===================================================================
--- grass-promo/grassposter/2014_EGU_G7_Landscape/Makefile	2014-04-17 03:18:11 UTC (rev 59754)
+++ grass-promo/grassposter/2014_EGU_G7_Landscape/Makefile	2014-04-17 03:23:07 UTC (rev 59755)
@@ -1,11 +1,14 @@
 FILE=poster
 SVGDIR = svg_images
 ODPDIR = odp_slides
+TEXDIR = texpdfs
 
 SVGFILES = $(shell ls $(SVGDIR)/*.svg)
 SVGPDF = $(patsubst %.svg, %.pdf, $(SVGFILES))
 ODPFILES = $(shell ls $(ODPDIR)/*.odp)
 ODPPDF = $(patsubst %.odp, %.pdf, $(ODPFILES))
+TEXFILES = $(shell ls $(TEXDIR)/*.tex)
+TEXPDF = $(patsubst %.tex, %.pdf, $(TEXFILES))
 
 all: $(FILE).pdf
 
@@ -19,7 +22,7 @@
 pdf: fig
 	pdflatex $(FILE).tex
 
-fig: $(SVGPDF) $(ODPPDF)
+fig: $(SVGPDF) $(ODPPDF) $(TEXPDF)
 
 $(SVGPDF): %.pdf: %.svg
 	inkscape -z --export-pdf=$@ --export-area-drawing --export-dpi=300 $<
@@ -27,9 +30,12 @@
 $(ODPPDF): %.pdf: %.odp
 	libreoffice --headless --convert-to pdf --outdir $(ODPDIR) $<
 
+$(TEXPDF): %.pdf: %.tex
+	pdflatex -output-directory=$(TEXDIR) $< 
+
 clean:
 	rm -f *~ *.aux *.log *.out *.toc *.bbl *.blg *-blx.bib *.ps
-	rm -f $(SVGPDF) $(ODPPDF)
+	rm -f $(SVGPDF) $(ODPPDF) $(`PDF)
 
 distclean:
 	make clean

Modified: grass-promo/grassposter/2014_EGU_G7_Landscape/poster.tex
===================================================================
--- grass-promo/grassposter/2014_EGU_G7_Landscape/poster.tex	2014-04-17 03:18:11 UTC (rev 59754)
+++ grass-promo/grassposter/2014_EGU_G7_Landscape/poster.tex	2014-04-17 03:23:07 UTC (rev 59755)
@@ -11,6 +11,8 @@
 
 \usepackage[margin=\margin cm, paperwidth=197cm, paperheight=100cm]{geometry}
 
+\usepackage{listings}
+
 % \setbackgrounddarkcolor{ForestGreen!70!black}
 % \setbackgroundlightcolor{YellowGreen!90!}
 
@@ -84,7 +86,7 @@
  \hspace{10mm}
  \includegraphics[width=0.48\textwidth]{svg_images/grass7-topo}
  \newline
- Figure 1b: Topology changes from version 6 to 7 after [5]
+ Figure 1b: Topology changes from version 6 to 7 after [Landa 2013]
 \end{center}
 }
 
@@ -114,25 +116,11 @@
 
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 \blocknode{PyGRASS: fast Python API}{
-[Zambelli 2013]
+PyGRASS [Zambelli 2013] is an object-oriented Python API which allows efficient manipulation with vectors.
+It is easy-to-use but its performance is comparable to C code since it calls GRASS C API behind the scenes.
 
+\includegraphics[width=0.9\textwidth]{texpdfs/pygrass_code}
 
->>> from grass.pygrass.vector.geometry import Point, Line
-
->>> point = Point()
->>> point.x = 150.65
->>> point.y = 368.50
->>> point
->>> Point(150.650000, 368.500000)
->>> point.distance(Point(160.2, 372.6))
-10.39290623454286
-%%%%>>> point.get_wkt()
-'POINT(150.650000 368.500000)'
-
->>> line = Line([(5, 12), (6, 13), (4, 19)])
->>> line.bbox()
-Bbox(19.0, 12.0, 6.0, 4.0)
-
 }
 
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Added: grass-promo/grassposter/2014_EGU_G7_Landscape/texpdfs/pygrass_code.tex
===================================================================
--- grass-promo/grassposter/2014_EGU_G7_Landscape/texpdfs/pygrass_code.tex	                        (rev 0)
+++ grass-promo/grassposter/2014_EGU_G7_Landscape/texpdfs/pygrass_code.tex	2014-04-17 03:23:07 UTC (rev 59755)
@@ -0,0 +1,76 @@
+\documentclass{article}
+
+\usepackage[active,tightpage]{preview}
+\usepackage{listings}
+\PreviewEnvironment{lstlisting}
+
+\usepackage[usenames,dvipsnames,svgnames,table]{xcolor}
+
+% http://tex.stackexchange.com/questions/34896/coloring-digits-with-the-listings-package
+\makeatletter
+\newcommand{\ProcessDigit}[1]
+{%
+  \ifnum\lst at mode=\lst at Pmode\relax%
+   {\digitstyle #1}%
+  \else
+    #1%
+  \fi
+}
+\makeatother
+\lstset{literate=%
+    {0}{{{\ProcessDigit{0}}}}1
+    {1}{{{\ProcessDigit{1}}}}1
+    {2}{{{\ProcessDigit{2}}}}1
+    {3}{{{\ProcessDigit{3}}}}1
+    {4}{{{\ProcessDigit{4}}}}1
+    {5}{{{\ProcessDigit{5}}}}1
+    {6}{{{\ProcessDigit{6}}}}1
+    {7}{{{\ProcessDigit{7}}}}1
+    {8}{{{\ProcessDigit{8}}}}1
+    {9}{{{\ProcessDigit{9}}}}1
+    {<=}{{\(\leq\)}}1,
+    morestring=[b]",
+    morestring=[b]',
+    morecomment=[l]//,
+}
+
+
+
+\lstset{
+  language=Python,
+  showstringspaces=false,
+  basicstyle=\ttfamily\small,
+  commentstyle=\itshape\color{OliveGreen},
+  keywordstyle=\bfseries, % needs different \ttdefault
+  stringstyle=\color{Goldenrod},
+  identifierstyle=\color{black},
+  emph=[1]{Point,Line,Bbox},
+  emphstyle=[1]{\color{Red}},
+}
+
+\definecolor{poster-dark-blue}{HTML}{2222AA}
+\newcommand\digitstyle{\color{poster-dark-blue}}
+
+\begin{document}
+
+% >>> from grass.pygrass.vector.geometry import Point, Line
+
+\begin{lstlisting}
+# create a point
+>>> point = Point()
+>>> point.x = 150.65
+>>> point.y = 368.50
+>>> point
+>>> Point(150.650000, 368.500000)
+# distance to another point
+>>> point.distance(Point(160.2, 372.6))
+10.39290623454286
+# conversion to Well-known text (WKT)
+>>> point.get_wkt()
+'POINT(150.650000 368.500000)'
+# bounding box of a line
+>>> line = Line([(5, 12), (6, 13), (4, 19)])
+>>> line.bbox()
+Bbox(19.0, 12.0, 6.0, 4.0)
+\end{lstlisting}
+\end{document}  
\ No newline at end of file



More information about the grass-commit mailing list