texlive[48243] trunk: getmap (21jul18)
commits+karl at tug.org
commits+karl at tug.org
Sat Jul 21 22:18:51 CEST 2018
Revision: 48243
http://tug.org/svn/texlive?view=revision&revision=48243
Author: karl
Date: 2018-07-21 22:18:51 +0200 (Sat, 21 Jul 2018)
Log Message:
-----------
getmap (21jul18)
Modified Paths:
--------------
trunk/Build/source/texk/texlive/linked_scripts/getmap/getmapdl.lua
trunk/Master/texmf-dist/doc/latex/getmap/README.md
trunk/Master/texmf-dist/doc/latex/getmap/getmap-example.tex
trunk/Master/texmf-dist/doc/latex/getmap/getmap.dtx
trunk/Master/texmf-dist/doc/latex/getmap/getmap.pdf
trunk/Master/texmf-dist/doc/latex/getmap/makefile
trunk/Master/texmf-dist/scripts/getmap/getmapdl.lua
trunk/Master/texmf-dist/tex/latex/getmap/getmap.cfg
trunk/Master/texmf-dist/tex/latex/getmap/getmap.sty
Modified: trunk/Build/source/texk/texlive/linked_scripts/getmap/getmapdl.lua
===================================================================
--- trunk/Build/source/texk/texlive/linked_scripts/getmap/getmapdl.lua 2018-07-21 20:18:30 UTC (rev 48242)
+++ trunk/Build/source/texk/texlive/linked_scripts/getmap/getmapdl.lua 2018-07-21 20:18:51 UTC (rev 48243)
@@ -8,9 +8,16 @@
--
-- License: LPPL
--
-local http = require("socket.http");
+local http = require("socket.http")
local ltn12 = require("ltn12")
-local url = require("socket.url")
+-- local url = require("socket.url")
+-- avoid bug in luatex v1.0.7
+-- copied socket.url's escape function into local function url_escape
+function url_escape(s)
+ return (string.gsub(s, "([^A-Za-z0-9_])", function(c)
+ return string.format("%%%02x", string.byte(c))
+ end))
+end
local OSMURL = "http://open.mapquestapi.com/staticmap/v4/getplacemap"
local GMURL = "http://maps.googleapis.com/maps/api/staticmap"
@@ -41,7 +48,7 @@
local BOUND = 0.1
local OFILE = "getmap"
local QUIET = "false"
-local VERSION = "v1.5 (07/10/2014)"
+local VERSION = "v1.5a (2018/07/18)"
function pversion()
print("getmapdl.lua " .. VERSION)
@@ -765,12 +772,12 @@
local IMGURL = ""
if MODE == "gm" then
- ULOCATION = "center=" .. url.escape(LOCATION)
+ ULOCATION = "center=" .. url_escape(LOCATION)
if MARKERS == "" then
- UMARKERS = "&markers=size:mid|color:" .. COLOR .. "|label:" .. NUMBER .. "|" .. url.escape(LOCATION)
- UZOOM = "&zoom=" .. url.escape(ZOOM)
+ UMARKERS = "&markers=size:mid|color:" .. COLOR .. "|label:" .. NUMBER .. "|" .. url_escape(LOCATION)
+ UZOOM = "&zoom=" .. url_escape(ZOOM)
else
- UMARKERS = "" .. url.escape(MARKERS)
+ UMARKERS = "" .. url_escape(MARKERS)
-- correct cruft escaping of "&markers="
UMARKERS = UMARKERS:gsub("%%26markers%%3d","&markers=")
UZOMM = ""
@@ -777,13 +784,13 @@
if CENTER == "" then
ULOCATION = ""
else
- ULOCATION = "center=" .. url.escape(CENTER)
+ ULOCATION = "center=" .. url_escape(CENTER)
end
end
- USIZE = "&size=" .. url.escape(SIZE)
- USCALE = "&scale=" .. url.escape(SCALE)
- UTYPE = "&maptype=" .. url.escape(TYPE)
- UIMAGETYPE = "&format=" .. url.escape(IMAGETYPE)
+ USIZE = "&size=" .. url_escape(SIZE)
+ USCALE = "&scale=" .. url_escape(SCALE)
+ UTYPE = "&maptype=" .. url_escape(TYPE)
+ UIMAGETYPE = "&format=" .. url_escape(IMAGETYPE)
if IMAGETYPE == "jpg-baseline" then
IMAGETYPE = "jpg"
end
@@ -790,12 +797,12 @@
if VISIBLE == "" then
UVISIBLE = ""
else
- UVISIBLE = "&visible=" .. url.escape(VISIBLE)
+ UVISIBLE = "&visible=" .. url_escape(VISIBLE)
end
if IPATH == "" then
UIPATH = ""
else
- UIPATH = "" .. url.escape(IPATH)
+ UIPATH = "" .. url_escape(IPATH)
-- correct cruft escaping of "&path="
UIPATH = UIPATH:gsub("%%26path%%3d","&path=")
end
@@ -805,7 +812,7 @@
EPLFILE = io.open(FPATH, "r")
local contents = EPLFILE:read()
EPLFILE:close()
- UFPATH = "" .. url.escape(contents)
+ UFPATH = "" .. url_escape(contents)
-- correct cruft escaping of "&path="
UFPATH = UFPATH:gsub("%%26path%%3d","&path=")
end
@@ -817,25 +824,25 @@
UOFILE = OFILE .. "." .. IMAGETYPE
IMGURL = GMURL .. "?" .. ULOCATION .. USIZE .. UZOOM .. UMARKERS .. UTYPE .. USCALE .. UIMAGETYPE .. UVISIBLE .. UIPATH .. UFPATH .. ULANGUAGE .. "&sensor=false"
elseif MODE == "gsv" then
- ULOCATION = "location=" .. url.escape(LOCATION)
- USIZE = "&size=" .. url.escape(SIZE)
- UHEADING = "&heading=" .. url.escape(HEADING)
- UFOV = "&fov=" .. url.escape(FOV)
- UPITCH = "&pitch=" .. url.escape(PITCH)
+ ULOCATION = "location=" .. url_escape(LOCATION)
+ USIZE = "&size=" .. url_escape(SIZE)
+ UHEADING = "&heading=" .. url_escape(HEADING)
+ UFOV = "&fov=" .. url_escape(FOV)
+ UPITCH = "&pitch=" .. url_escape(PITCH)
UOFILE = OFILE .. ".jpg"
IMGURL = GSVURL .. "?" .. ULOCATION .. USIZE .. UHEADING .. UFOV .. UPITCH .. "&sensor=false"
elseif MODE == "osm" then
- UKEY = "?key=" .. url.escape(KEY)
- ULOCATION = "&location=" .. url.escape(LOCATION)
- USIZE = "&size=" .. url.escape(SIZE)
+ UKEY = "?key=" .. url_escape(KEY)
+ ULOCATION = "&location=" .. url_escape(LOCATION)
+ USIZE = "&size=" .. url_escape(SIZE)
if ZOOM == "" then
- USCALEZOOM = "&scale=" .. url.escape(SCALE)
+ USCALEZOOM = "&scale=" .. url_escape(SCALE)
else
- USCALEZOOM = "&zoom=" .. url.escape(ZOOM)
+ USCALEZOOM = "&zoom=" .. url_escape(ZOOM)
end
- UTYPE = "&type=" .. url.escape(TYPE)
- UIMAGETYPE = "&imagetype=" .. url.escape(IMAGETYPE)
- USHOWICON = "&showicon=" .. url.escape(COLOR) .. "-" .. url.escape(NUMBER)
+ UTYPE = "&type=" .. url_escape(TYPE)
+ UIMAGETYPE = "&imagetype=" .. url_escape(IMAGETYPE)
+ USHOWICON = "&showicon=" .. url_escape(COLOR) .. "-" .. url_escape(NUMBER)
UOFILE = OFILE .. "." .. IMAGETYPE
IMGURL = OSMURL .. UKEY .. ULOCATION .. USIZE .. USCALEZOOM .. UTYPE .. UIMAGETYPE .. USHOWICON
end
Modified: trunk/Master/texmf-dist/doc/latex/getmap/README.md
===================================================================
--- trunk/Master/texmf-dist/doc/latex/getmap/README.md 2018-07-21 20:18:30 UTC (rev 48242)
+++ trunk/Master/texmf-dist/doc/latex/getmap/README.md 2018-07-21 20:18:51 UTC (rev 48243)
@@ -10,10 +10,9 @@
License: LPPL
-Changes in v1.9:
+Changes in v1.10:
-* compatibility fix for luatex v0.85+
+* Workaround for module (socket.url) loading bug in luatex v1.0.7
-* Bugfix: restore some option defaults to guarantee correct
- download URLs after changing mode in \getmap
+* Bugfix: fix for strange encoding problems when calling getmapdl.lua
Modified: trunk/Master/texmf-dist/doc/latex/getmap/getmap-example.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/getmap/getmap-example.tex 2018-07-21 20:18:30 UTC (rev 48242)
+++ trunk/Master/texmf-dist/doc/latex/getmap/getmap-example.tex 2018-07-21 20:18:51 UTC (rev 48243)
@@ -6,7 +6,7 @@
%%
%% getmap.dtx (with options: `examplefile')
%%
-%% Copyright (C) 2014,2016 by:
+%% Copyright (C) 2014,2016,2018 by:
%% Josef Kleber
%% <josef.kleber at gmx.de>
%%
@@ -32,7 +32,6 @@
%%
%%
\documentclass{article}
-\usepackage[utf8]{inputenc}
\usepackage{graphicx}
\usepackage{filecontents}
%% use overwrite while optimizing the image
Modified: trunk/Master/texmf-dist/doc/latex/getmap/getmap.dtx
===================================================================
--- trunk/Master/texmf-dist/doc/latex/getmap/getmap.dtx 2018-07-21 20:18:30 UTC (rev 48242)
+++ trunk/Master/texmf-dist/doc/latex/getmap/getmap.dtx 2018-07-21 20:18:51 UTC (rev 48243)
@@ -16,12 +16,11 @@
License: LPPL
-Changes in v1.9:
+Changes in v1.10:
-* compatibility fix for luatex v0.85+
+* Workaround for module (socket.url) loading bug in luatex v1.0.7
-* Bugfix: restore some option defaults to guarantee correct
- download URLs after changing mode in \getmap
+* Bugfix: fix for strange encoding problems when calling getmapdl.lua
%</readme>
%<*bibfile>
@@ -121,15 +120,22 @@
--
-- getmapdl [options]
--
--- downloads an OpenStreetMap, Google Maps or Google Street View map
--- specified by [options] or parses gpx, gps and kml files to create
+-- downloads an OpenStreetMap, Google Maps or Google Street View map
+-- specified by [options] or parses gpx, gps and kml files to create
-- encoded polylines
--
-- License: LPPL
--
-local http = require("socket.http");
+local http = require("socket.http")
local ltn12 = require("ltn12")
-local url = require("socket.url")
+-- local url = require("socket.url")
+-- avoid bug in luatex v1.0.7
+-- copied socket.url's escape function into local function url_escape
+function url_escape(s)
+ return (string.gsub(s, "([^A-Za-z0-9_])", function(c)
+ return string.format("%%%02x", string.byte(c))
+ end))
+end
local OSMURL = "http://open.mapquestapi.com/staticmap/v4/getplacemap"
local GMURL = "http://maps.googleapis.com/maps/api/staticmap"
@@ -160,7 +166,7 @@
local BOUND = 0.1
local OFILE = "getmap"
local QUIET = "false"
-local VERSION = "v1.5 (07/10/2014)"
+local VERSION = "v1.5a (2018/07/18)"
function pversion()
print("getmapdl.lua " .. VERSION)
@@ -173,13 +179,13 @@
getmapdl.lua [options]
downloads an OpenStreetMap, Google Maps or Google Street View map
- specified by [options] or parses gpx, gps and kml files to create
+ specified by [options] or parses gpx, gps and kml files to create
encoded polylines
Options:
-m specify the mode (osm|gm|gsv|gpx2epl|gps2epl|gpx2gps|kml2epl|kml2gps)
-
+
-l specify a location
e.g. 'Bergheimer Straße 110A, 69115 Heidelberg, Germany'
@@ -215,9 +221,9 @@
-h prints help information
gm mode only:
-
+
-L specify the language of map labels (xx language code (en,de,fr,...))
-
+
-M specify markers; see:
https://developers.google.com/maps/documentation/staticmaps/index#Markers
e.g.: &markers=size:mid|color:blue|label:1|address or more of these
@@ -229,31 +235,31 @@
-P specify path from location to location
e.g.: &path=weight:7|color:purple|loc1|loc2
-
+
-p specify a file holding the path specification
(maybe needed for encoded polylines)
gsv mode only:
-
+
-H specify heading (view) (0) (0 -- 360) (east: 90, ...)
-
+
-T specify the pitch (angle) (0) (-90 -- 90)
-
+
-F specify horizontal field of view (90) (0 -- 120)
The field of view is expressed in degrees and a kind of zoom!
-
+
gpx2epl, gps2epl and gpx2gps mode only:
-
+
-G specify the gpx or gps file
-
+
kml2epl and kml2gps mode only:
-
+
-K specify the kml file
-
+
gps2gps mode only:
-
+
-B specify the bound for reducing way points (default: 0.1)
-
+
]])
pversion()
end
@@ -430,13 +436,13 @@
local Olatitude = 0
local Olongitude = 0
local epl = {}
-
+
for line in io.lines(file)
do
local latitude
local longitude
local encnum
-
+
if string.match(line, "<trk>") then
Olatitude = 0
Olongitude = 0
@@ -483,13 +489,13 @@
local file = GPFILE
local name
local desc
-
+
for line in io.lines(file)
do
local latitude
local longitude
local encnum
-
+
if string.match(line, "<trk>") then
name = ""
desc = ""
@@ -545,7 +551,7 @@
line = ""
ignorenextline = false
end
- -- if line contains "Point:" then gps coordinates
+ -- if line contains "Point:" then gps coordinates
-- in the next line must be ignored!
if line:match("Point:") then
ignorenextline = true
@@ -566,7 +572,7 @@
print("\n" .. line .. "\n")
line = ""
end
- if line == "" or isnotnumber(latitude) or isnotnumber(longitude)
+ if line == "" or isnotnumber(latitude) or isnotnumber(longitude)
then
-- empty line or no gps coordinates -> do nothing
else
@@ -609,7 +615,7 @@
local latitude
local longitude
local encnum
-
+
latitude, longitude = line:match("([^,]+),([^,]+)")
if ignorenextline == true then
line = ""
@@ -884,12 +890,12 @@
local IMGURL = ""
if MODE == "gm" then
- ULOCATION = "center=" .. url.escape(LOCATION)
+ ULOCATION = "center=" .. url_escape(LOCATION)
if MARKERS == "" then
- UMARKERS = "&markers=size:mid|color:" .. COLOR .. "|label:" .. NUMBER .. "|" .. url.escape(LOCATION)
- UZOOM = "&zoom=" .. url.escape(ZOOM)
+ UMARKERS = "&markers=size:mid|color:" .. COLOR .. "|label:" .. NUMBER .. "|" .. url_escape(LOCATION)
+ UZOOM = "&zoom=" .. url_escape(ZOOM)
else
- UMARKERS = "" .. url.escape(MARKERS)
+ UMARKERS = "" .. url_escape(MARKERS)
-- correct cruft escaping of "&markers="
UMARKERS = UMARKERS:gsub("%%26markers%%3d","&markers=")
UZOMM = ""
@@ -896,13 +902,13 @@
if CENTER == "" then
ULOCATION = ""
else
- ULOCATION = "center=" .. url.escape(CENTER)
+ ULOCATION = "center=" .. url_escape(CENTER)
end
end
- USIZE = "&size=" .. url.escape(SIZE)
- USCALE = "&scale=" .. url.escape(SCALE)
- UTYPE = "&maptype=" .. url.escape(TYPE)
- UIMAGETYPE = "&format=" .. url.escape(IMAGETYPE)
+ USIZE = "&size=" .. url_escape(SIZE)
+ USCALE = "&scale=" .. url_escape(SCALE)
+ UTYPE = "&maptype=" .. url_escape(TYPE)
+ UIMAGETYPE = "&format=" .. url_escape(IMAGETYPE)
if IMAGETYPE == "jpg-baseline" then
IMAGETYPE = "jpg"
end
@@ -909,12 +915,12 @@
if VISIBLE == "" then
UVISIBLE = ""
else
- UVISIBLE = "&visible=" .. url.escape(VISIBLE)
+ UVISIBLE = "&visible=" .. url_escape(VISIBLE)
end
if IPATH == "" then
UIPATH = ""
else
- UIPATH = "" .. url.escape(IPATH)
+ UIPATH = "" .. url_escape(IPATH)
-- correct cruft escaping of "&path="
UIPATH = UIPATH:gsub("%%26path%%3d","&path=")
end
@@ -924,7 +930,7 @@
EPLFILE = io.open(FPATH, "r")
local contents = EPLFILE:read()
EPLFILE:close()
- UFPATH = "" .. url.escape(contents)
+ UFPATH = "" .. url_escape(contents)
-- correct cruft escaping of "&path="
UFPATH = UFPATH:gsub("%%26path%%3d","&path=")
end
@@ -936,25 +942,25 @@
UOFILE = OFILE .. "." .. IMAGETYPE
IMGURL = GMURL .. "?" .. ULOCATION .. USIZE .. UZOOM .. UMARKERS .. UTYPE .. USCALE .. UIMAGETYPE .. UVISIBLE .. UIPATH .. UFPATH .. ULANGUAGE .. "&sensor=false"
elseif MODE == "gsv" then
- ULOCATION = "location=" .. url.escape(LOCATION)
- USIZE = "&size=" .. url.escape(SIZE)
- UHEADING = "&heading=" .. url.escape(HEADING)
- UFOV = "&fov=" .. url.escape(FOV)
- UPITCH = "&pitch=" .. url.escape(PITCH)
+ ULOCATION = "location=" .. url_escape(LOCATION)
+ USIZE = "&size=" .. url_escape(SIZE)
+ UHEADING = "&heading=" .. url_escape(HEADING)
+ UFOV = "&fov=" .. url_escape(FOV)
+ UPITCH = "&pitch=" .. url_escape(PITCH)
UOFILE = OFILE .. ".jpg"
IMGURL = GSVURL .. "?" .. ULOCATION .. USIZE .. UHEADING .. UFOV .. UPITCH .. "&sensor=false"
elseif MODE == "osm" then
- UKEY = "?key=" .. url.escape(KEY)
- ULOCATION = "&location=" .. url.escape(LOCATION)
- USIZE = "&size=" .. url.escape(SIZE)
+ UKEY = "?key=" .. url_escape(KEY)
+ ULOCATION = "&location=" .. url_escape(LOCATION)
+ USIZE = "&size=" .. url_escape(SIZE)
if ZOOM == "" then
- USCALEZOOM = "&scale=" .. url.escape(SCALE)
+ USCALEZOOM = "&scale=" .. url_escape(SCALE)
else
- USCALEZOOM = "&zoom=" .. url.escape(ZOOM)
+ USCALEZOOM = "&zoom=" .. url_escape(ZOOM)
end
- UTYPE = "&type=" .. url.escape(TYPE)
- UIMAGETYPE = "&imagetype=" .. url.escape(IMAGETYPE)
- USHOWICON = "&showicon=" .. url.escape(COLOR) .. "-" .. url.escape(NUMBER)
+ UTYPE = "&type=" .. url_escape(TYPE)
+ UIMAGETYPE = "&imagetype=" .. url_escape(IMAGETYPE)
+ USHOWICON = "&showicon=" .. url_escape(COLOR) .. "-" .. url_escape(NUMBER)
UOFILE = OFILE .. "." .. IMAGETYPE
IMGURL = OSMURL .. UKEY .. ULOCATION .. USIZE .. USCALEZOOM .. UTYPE .. UIMAGETYPE .. USHOWICON
end
@@ -1002,7 +1008,6 @@
%%
% \fi
\documentclass{article}
-\usepackage[utf8]{inputenc}
\usepackage{graphicx}
\usepackage{filecontents}
% \iffalse
@@ -1051,7 +1056,7 @@
\askforoverwritefalse
\preamble
-Copyright (C) 2014,2016 by:
+Copyright (C) 2014,2016,2018 by:
Josef Kleber
<josef.kleber at gmx.de>
@@ -1133,7 +1138,7 @@
\usepackage[automark,nouppercase]{scrpage2}
\usepackage[tocgraduated]{tocstyle}
\usetocstyle{classic}
-\usepackage[overwrite=false]{getmap}
+\usepackage[overwrite=true]{getmap}
\usepackage{attachfile}
\usepackage{metalogo}
\usepackage{tikz}
@@ -1184,7 +1189,7 @@
\draw[anchor=west,yshift=-9cm,xshift=3cm,color=NavyBlue] (0,0) node%
{\parbox{15cm}{\RaggedRight\huge\sffamily\textbf{\@subtitle}}};%
\draw[anchor=west,yshift=-14cm,xshift=3cm,color=NavyBlue] (0,0) node%
- {\includegraphics[width=8cm]{getmap}};%
+ {\includegraphics[width=8cm]{getmap.png}};%
\draw[anchor=west,yshift=-18cm,xshift=3cm,color=NavyBlue] (0,0) node%
{\parbox{15cm}{\huge\sffamily\textbf{\@date}}};%
\draw[anchor=west,yshift=-20cm,xshift=3cm,color=NavyBlue] (0,0) node%
@@ -1360,7 +1365,7 @@
% \renewcommand*{\abstractname}{Acknowledgment}
% \begin{abstract}
% I want to thank Norbert Preining, who did most of the recoding of \texttt{osmimage}
-% (\texttt{Bash} $\rightarrow$ \texttt{Lua}). Moreover many thanks to Taco Hoekwater,
+% (\texttt{Bash} $\rightarrow$ \texttt{Lua}). Moreover many thanks to Taco Hoekwater, Akira Kakuto,
% Reinhard Kotucha and Heiko Oberdiek for their valuable contributions.
% Finally, I want to thank Doug Currie for helping me to implement the algorithm
% for encoded polylines in Lua.
@@ -1610,7 +1615,7 @@
% By default, the image is saved under the name \texttt{getmap.png}!
% If you need only one map (e.g. the office of Dante e.V.) in your document, it can be as simple as:
%
-% \begin{center}\includegraphics[width=9cm]{getmap}\end{center}
+% \begin{center}\includegraphics[width=9cm]{getmap.png}\end{center}
%
% \iffalse
%<*example>
@@ -1780,7 +1785,7 @@
% no way to support extreme long paths!
% \subsection{OpenStreetMap}
% OpenStreetMap does not offer routing service directly, but you can
-% use an OpenStreetMap based route service\footnote{\href{http://openrouteservice.org}{http://openrouteservice.org}}
+% use an OpenStreetMap based route service\footnote{\href{http://maps.openrouteservice.org}{http://maps.openrouteservice.org}}
% to create your route and export it to a \texttt{gpx} file\footnote{This also means that you can visualize your own routes tracked with hardware or a software app!}.
% It's basically a xml-packaged list of geographical coordinates.
% You can use the \texttt{getmapdl} script to convert a route to encoded polylines, e.g.
@@ -2084,6 +2089,7 @@
% \changes{v1.8}{2014/10/07}{\texttt{getmapdl.lua}: added \texttt{gps2gps} mode to reduce way points with a given bound (default: 0.1)}
% \changes{v1.8}{2014/10/07}{\texttt{getmapdl.lua}: added multi route support for \texttt{gps2epl} mode}
% \changes{v1.8}{2014/10/07}{\texttt{getmapdl.lua}: added rounding of gps coordinates to \texttt{kml2gps} and \texttt{gpx2gps} modes}
+% \changes{v1.10}{2018/07/18}{\texttt{getmapdl.lua}: fix problem (unable to load socket.url module) caused by bug in luatex v1.0.7 (TeXLive2018)}
% \begin{macrocode}
%<*package>
% \end{macrocode}
@@ -2090,7 +2096,7 @@
% First, we provide the \LaTeX\ package \package{getmap}.
% \begin{macrocode}
\NeedsTeXFormat{LaTeX2e}%
-\ProvidesPackage{getmap}[2016/06/18 v1.9 getmap.sty - Josef Kleber (C) 2014,2016]%
+\ProvidesPackage{getmap}[2018/07/18 v1.10 getmap.sty - Josef Kleber (C) 2014,2016,2018]%
% \end{macrocode}
% We need a few packages!
% \begin{macrocode}
@@ -2102,6 +2108,23 @@
% \begin{macrocode}
\RequirePackage{shellesc}%
% \end{macrocode}
+% Fix a bug with problematic url encodings coming up with \texttt{luatex} v1.0.7 (TeXLive 2018)
+% fixed by Akira Kakuto (see: \href{https://tug.org/pipermail/tex-live/2018-June/041997.html}{TeXLive mailing list})
+% \begin{macrocode}
+\RequirePackage{ifxetex}%
+\ifxetex%
+ \def\StringEncodingConvert#1#2#3#4%
+ {%
+ \def#1{#2}%
+ }%
+\fi%
+\ifluatex%
+ \def\StringEncodingConvert#1#2#3#4%
+ {%
+ \def#1{#2}%
+ }%
+\fi%
+% \end{macrocode}
% We provide a macro \cmd\GM at JK@define at key, which defines package options with global scope%
% and options for \cmd\getmap\ with local scope. It takes four arguments \marg{prefix},%
% \marg{package},\marg{option} and \marg{default}.
@@ -2241,6 +2264,7 @@
% \cmd\write18\ is enabled and issue a package error if not! Otherwise we execute%
% \cmd\ShellEscape\ depending on the mode%
% \changes{v1.9}{2016/06/16}{\LuaTeX\ v0.85+ fix: use \texttt{shellesc}'s \texttt{\textbackslash ShellEscape} instead of \texttt{\textbackslash write18}}
+% \changes{v1.10}{2018/07/18}{Bugfix: fixes encoding problems with luatex v1.0.7 (TeXLive2018)}
% \begin{macrocode}
\newcommand*\GM at JK@shellescape%
{%
@@ -2247,6 +2271,7 @@
\ifGM at JK@writexviii\relax%
\ifthenelse{\equal{\GM at JK@mode}{osm}}%
{%
+ \ifluatex\directlua{os.setlocale('','ctype')}\fi%
\ShellEscape{getmapdl \space-l\space "\GM at JK@location at string"%
\space-m\space osm%
\space-k\space "\GM at JK@key at string"%
@@ -2263,6 +2288,7 @@
{%
\ifthenelse{\equal{\GM at JK@mode}{gm}}%
{%
+ \ifluatex\directlua{os.setlocale('','ctype')}\fi%
\ShellEscape{getmapdl \space-l\space "\GM at JK@location at string"%
\space-m\space gm%
\space-x\space \GM at JK@xsize%
@@ -2284,6 +2310,7 @@
{%
\ifthenelse{\equal{\GM at JK@mode}{gsv}}%
{%
+ \ifluatex\directlua{os.setlocale('','ctype')}\fi%
\ShellEscape{getmapdl \space-l\space "\GM at JK@location at string"%
\space-m\space gsv%
\space-x\space \GM at JK@xsize%
Modified: trunk/Master/texmf-dist/doc/latex/getmap/getmap.pdf
===================================================================
(Binary files differ)
Modified: trunk/Master/texmf-dist/doc/latex/getmap/makefile
===================================================================
--- trunk/Master/texmf-dist/doc/latex/getmap/makefile 2018-07-21 20:18:30 UTC (rev 48242)
+++ trunk/Master/texmf-dist/doc/latex/getmap/makefile 2018-07-21 20:18:51 UTC (rev 48243)
@@ -12,14 +12,14 @@
bibtex $(PKGNAME)
makeindex -s gind.ist $(PKGNAME)
makeindex -s gglo.ist $(PKGNAME).glo -o $(PKGNAME).gls
- pdflatex $(PKGNAME).dtx
+ pdflatex -shell-escape $(PKGNAME).dtx
bibtex $(PKGNAME)
makeindex -s gind.ist $(PKGNAME)
makeindex -s gglo.ist $(PKGNAME).glo -o $(PKGNAME).gls
- pdflatex $(PKGNAME).dtx
+ pdflatex -shell-escape $(PKGNAME).dtx
makeindex -s gind.ist $(PKGNAME)
makeindex -s gglo.ist $(PKGNAME).glo -o $(PKGNAME).gls
- pdflatex $(PKGNAME).dtx
+ pdflatex -shell-escape $(PKGNAME).dtx
package:
pdftex $(PKGNAME).dtx
@@ -57,7 +57,7 @@
cp getmap.cfg ./../dev/tex/latex/getmap/getmap.cfg
cp README.md ./../README.md
-ctan:
+ctan: $(PKGNAME).pdf
./copyCTAN
clean:
@@ -67,6 +67,6 @@
cleanall: clean
$(RM) getmapdl.lua *.sty *.png *.jpg manifest.txt \
- *.cfg *.tex README.md getmap.pdf
+ *.cfg *.tex README.md *.pdf
.PHONY: all doc package install uninstall styles git ctan clean cleanall
Modified: trunk/Master/texmf-dist/scripts/getmap/getmapdl.lua
===================================================================
--- trunk/Master/texmf-dist/scripts/getmap/getmapdl.lua 2018-07-21 20:18:30 UTC (rev 48242)
+++ trunk/Master/texmf-dist/scripts/getmap/getmapdl.lua 2018-07-21 20:18:51 UTC (rev 48243)
@@ -8,9 +8,16 @@
--
-- License: LPPL
--
-local http = require("socket.http");
+local http = require("socket.http")
local ltn12 = require("ltn12")
-local url = require("socket.url")
+-- local url = require("socket.url")
+-- avoid bug in luatex v1.0.7
+-- copied socket.url's escape function into local function url_escape
+function url_escape(s)
+ return (string.gsub(s, "([^A-Za-z0-9_])", function(c)
+ return string.format("%%%02x", string.byte(c))
+ end))
+end
local OSMURL = "http://open.mapquestapi.com/staticmap/v4/getplacemap"
local GMURL = "http://maps.googleapis.com/maps/api/staticmap"
@@ -41,7 +48,7 @@
local BOUND = 0.1
local OFILE = "getmap"
local QUIET = "false"
-local VERSION = "v1.5 (07/10/2014)"
+local VERSION = "v1.5a (2018/07/18)"
function pversion()
print("getmapdl.lua " .. VERSION)
@@ -765,12 +772,12 @@
local IMGURL = ""
if MODE == "gm" then
- ULOCATION = "center=" .. url.escape(LOCATION)
+ ULOCATION = "center=" .. url_escape(LOCATION)
if MARKERS == "" then
- UMARKERS = "&markers=size:mid|color:" .. COLOR .. "|label:" .. NUMBER .. "|" .. url.escape(LOCATION)
- UZOOM = "&zoom=" .. url.escape(ZOOM)
+ UMARKERS = "&markers=size:mid|color:" .. COLOR .. "|label:" .. NUMBER .. "|" .. url_escape(LOCATION)
+ UZOOM = "&zoom=" .. url_escape(ZOOM)
else
- UMARKERS = "" .. url.escape(MARKERS)
+ UMARKERS = "" .. url_escape(MARKERS)
-- correct cruft escaping of "&markers="
UMARKERS = UMARKERS:gsub("%%26markers%%3d","&markers=")
UZOMM = ""
@@ -777,13 +784,13 @@
if CENTER == "" then
ULOCATION = ""
else
- ULOCATION = "center=" .. url.escape(CENTER)
+ ULOCATION = "center=" .. url_escape(CENTER)
end
end
- USIZE = "&size=" .. url.escape(SIZE)
- USCALE = "&scale=" .. url.escape(SCALE)
- UTYPE = "&maptype=" .. url.escape(TYPE)
- UIMAGETYPE = "&format=" .. url.escape(IMAGETYPE)
+ USIZE = "&size=" .. url_escape(SIZE)
+ USCALE = "&scale=" .. url_escape(SCALE)
+ UTYPE = "&maptype=" .. url_escape(TYPE)
+ UIMAGETYPE = "&format=" .. url_escape(IMAGETYPE)
if IMAGETYPE == "jpg-baseline" then
IMAGETYPE = "jpg"
end
@@ -790,12 +797,12 @@
if VISIBLE == "" then
UVISIBLE = ""
else
- UVISIBLE = "&visible=" .. url.escape(VISIBLE)
+ UVISIBLE = "&visible=" .. url_escape(VISIBLE)
end
if IPATH == "" then
UIPATH = ""
else
- UIPATH = "" .. url.escape(IPATH)
+ UIPATH = "" .. url_escape(IPATH)
-- correct cruft escaping of "&path="
UIPATH = UIPATH:gsub("%%26path%%3d","&path=")
end
@@ -805,7 +812,7 @@
EPLFILE = io.open(FPATH, "r")
local contents = EPLFILE:read()
EPLFILE:close()
- UFPATH = "" .. url.escape(contents)
+ UFPATH = "" .. url_escape(contents)
-- correct cruft escaping of "&path="
UFPATH = UFPATH:gsub("%%26path%%3d","&path=")
end
@@ -817,25 +824,25 @@
UOFILE = OFILE .. "." .. IMAGETYPE
IMGURL = GMURL .. "?" .. ULOCATION .. USIZE .. UZOOM .. UMARKERS .. UTYPE .. USCALE .. UIMAGETYPE .. UVISIBLE .. UIPATH .. UFPATH .. ULANGUAGE .. "&sensor=false"
elseif MODE == "gsv" then
- ULOCATION = "location=" .. url.escape(LOCATION)
- USIZE = "&size=" .. url.escape(SIZE)
- UHEADING = "&heading=" .. url.escape(HEADING)
- UFOV = "&fov=" .. url.escape(FOV)
- UPITCH = "&pitch=" .. url.escape(PITCH)
+ ULOCATION = "location=" .. url_escape(LOCATION)
+ USIZE = "&size=" .. url_escape(SIZE)
+ UHEADING = "&heading=" .. url_escape(HEADING)
+ UFOV = "&fov=" .. url_escape(FOV)
+ UPITCH = "&pitch=" .. url_escape(PITCH)
UOFILE = OFILE .. ".jpg"
IMGURL = GSVURL .. "?" .. ULOCATION .. USIZE .. UHEADING .. UFOV .. UPITCH .. "&sensor=false"
elseif MODE == "osm" then
- UKEY = "?key=" .. url.escape(KEY)
- ULOCATION = "&location=" .. url.escape(LOCATION)
- USIZE = "&size=" .. url.escape(SIZE)
+ UKEY = "?key=" .. url_escape(KEY)
+ ULOCATION = "&location=" .. url_escape(LOCATION)
+ USIZE = "&size=" .. url_escape(SIZE)
if ZOOM == "" then
- USCALEZOOM = "&scale=" .. url.escape(SCALE)
+ USCALEZOOM = "&scale=" .. url_escape(SCALE)
else
- USCALEZOOM = "&zoom=" .. url.escape(ZOOM)
+ USCALEZOOM = "&zoom=" .. url_escape(ZOOM)
end
- UTYPE = "&type=" .. url.escape(TYPE)
- UIMAGETYPE = "&imagetype=" .. url.escape(IMAGETYPE)
- USHOWICON = "&showicon=" .. url.escape(COLOR) .. "-" .. url.escape(NUMBER)
+ UTYPE = "&type=" .. url_escape(TYPE)
+ UIMAGETYPE = "&imagetype=" .. url_escape(IMAGETYPE)
+ USHOWICON = "&showicon=" .. url_escape(COLOR) .. "-" .. url_escape(NUMBER)
UOFILE = OFILE .. "." .. IMAGETYPE
IMGURL = OSMURL .. UKEY .. ULOCATION .. USIZE .. USCALEZOOM .. UTYPE .. UIMAGETYPE .. USHOWICON
end
Modified: trunk/Master/texmf-dist/tex/latex/getmap/getmap.cfg
===================================================================
--- trunk/Master/texmf-dist/tex/latex/getmap/getmap.cfg 2018-07-21 20:18:30 UTC (rev 48242)
+++ trunk/Master/texmf-dist/tex/latex/getmap/getmap.cfg 2018-07-21 20:18:51 UTC (rev 48243)
@@ -6,7 +6,7 @@
%%
%% getmap.dtx (with options: `cfgfile')
%%
-%% Copyright (C) 2014,2016 by:
+%% Copyright (C) 2014,2016,2018 by:
%% Josef Kleber
%% <josef.kleber at gmx.de>
%%
Modified: trunk/Master/texmf-dist/tex/latex/getmap/getmap.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/getmap/getmap.sty 2018-07-21 20:18:30 UTC (rev 48242)
+++ trunk/Master/texmf-dist/tex/latex/getmap/getmap.sty 2018-07-21 20:18:51 UTC (rev 48243)
@@ -6,7 +6,7 @@
%%
%% getmap.dtx (with options: `package')
%%
-%% Copyright (C) 2014,2016 by:
+%% Copyright (C) 2014,2016,2018 by:
%% Josef Kleber
%% <josef.kleber at gmx.de>
%%
@@ -27,11 +27,24 @@
%% This work consists of all files listed in manifest.txt.
%%
\NeedsTeXFormat{LaTeX2e}%
-\ProvidesPackage{getmap}[2016/06/18 v1.9 getmap.sty - Josef Kleber (C) 2014,2016]%
+\ProvidesPackage{getmap}[2018/07/18 v1.10 getmap.sty - Josef Kleber (C) 2014,2016,2018]%
\RequirePackage{xkeyval}%
\RequirePackage{stringenc}%
\RequirePackage{ifthen}%
\RequirePackage{shellesc}%
+\RequirePackage{ifxetex}%
+\ifxetex%
+ \def\StringEncodingConvert#1#2#3#4%
+ {%
+ \def#1{#2}%
+ }%
+\fi%
+\ifluatex%
+ \def\StringEncodingConvert#1#2#3#4%
+ {%
+ \def#1{#2}%
+ }%
+\fi%
\newcommand*\GM at JK@define at key[4]%
{%
\expandafter\gdef\csname#1@#3\endcsname{#4}%
@@ -124,6 +137,7 @@
\ifGM at JK@writexviii\relax%
\ifthenelse{\equal{\GM at JK@mode}{osm}}%
{%
+ \ifluatex\directlua{os.setlocale('','ctype')}\fi%
\ShellEscape{getmapdl \space-l\space "\GM at JK@location at string"%
\space-m\space osm%
\space-k\space "\GM at JK@key at string"%
@@ -140,6 +154,7 @@
{%
\ifthenelse{\equal{\GM at JK@mode}{gm}}%
{%
+ \ifluatex\directlua{os.setlocale('','ctype')}\fi%
\ShellEscape{getmapdl \space-l\space "\GM at JK@location at string"%
\space-m\space gm%
\space-x\space \GM at JK@xsize%
@@ -161,6 +176,7 @@
{%
\ifthenelse{\equal{\GM at JK@mode}{gsv}}%
{%
+ \ifluatex\directlua{os.setlocale('','ctype')}\fi%
\ShellEscape{getmapdl \space-l\space "\GM at JK@location at string"%
\space-m\space gsv%
\space-x\space \GM at JK@xsize%
More information about the tex-live-commits
mailing list