generate qrcode externally, needs python qrcode and pillow

This commit is contained in:
2020-02-01 14:53:20 -06:00
parent 7594d4f571
commit 9c37ed5960
4 changed files with 32 additions and 42 deletions

View File

@@ -2,12 +2,16 @@ DOC=thiep1
INPUT=$(DOC).tex INPUT=$(DOC).tex
TARGET=$(DOC).pdf TARGET=$(DOC).pdf
TEX=xelatex TEX=xelatex
QR=qr.png
default: $(TARGET) default: $(TARGET)
$(TARGET): $(INPUT) Makefile $(TARGET): $(INPUT) Makefile $(QR)
$(TEX) $< && $(TEX) $< $(TEX) $< && $(TEX) $<
$(QR): event.txt
cat $< | qr > $@
clean: clean:
rm -f $(DOC).{pdf,out,aux,log} rm -f $(DOC).{pdf,out,aux,log}
rm -f *.{pdf,out,aux,log,bbl,blg} rm -f *.{pdf,out,aux,log,bbl,blg}

View File

@@ -0,0 +1,13 @@
BEGIN:VCALENDAR
VERSION:2.0
BEGIN:VEVENT
SUMMARY:Đám cưới Nam-Hương
DTSTART:20200301
DTEND:20200301
DTSTAMP:20200301T140000
LOCATION:Nhà hàng Âu Cơ, 1A Nguyễn Hữu Cầu, P. Ngọc Châu, Thành phố Hải Dương, Hải Dương, Vietnam
GEO:20.9351879;106.3433482,18
URL:https://goo.gl/maps/eyfMhXgjFTQzAWB79
DESCRIPTION:
END:VEVENT
END:VCALENDAR

View File

@@ -1,21 +0,0 @@
\documentclass{article}
\pagestyle{empty}
\usepackage{pstricks}
\usepackage{pst-barcode}
\usepackage{graphicx}
\begin{document}
\begin{pspicture}(2in,2in)
\psbarcode{BEGIN:VCALENDAR^^J%
VERSION:2.0^^J%
BEGIN:VEVENT^^J%
SUMMARY:Wedding Nam-Huong^^J%
LOCATION:Auco Convention Center, Haiduong, Haiduong^^J%
DTSTART;TZID=Asia/Saigon:20200301T160000^^J%
END:VEVENT^^J%
END:VCALENDAR}
{eclevel=M height=2 width=2}{qrcode}
\end{pspicture}
\end{document}

View File

@@ -6,15 +6,18 @@
\usepackage[T1]{fontenc} \usepackage[T1]{fontenc}
\usepackage{ebgaramond} \usepackage{ebgaramond}
\usepackage{pstricks}
\usepackage{pst-barcode}
\usepackage{graphicx}
\usetikzlibrary{fadings} \usetikzlibrary{fadings}
% \tikzfading[name=fade right, left color=transparent!0, right color=transparent!100] % \tikzfading[name=fade right, left color=transparent!0, right color=transparent!100]
% \tikzfading[name=fade in, inner color=transparent!200, outer color=transparent!0] % \tikzfading[name=fade in, inner color=transparent!200, outer color=transparent!0]
% \pgfdeclareradialshading{ellipse}{\pgfpoint{50bp}{50bp}}{
\pgfdeclareradialshading{ellipse}{\pgfpoint{100bp}{100bp}}{
color(0bp)=(pgftransparent!100);
color(25bp)=(pgftransparent!100);
color(50bp)=(pgftransparent!80);
color(75bp)=(pgftransparent!00);
color(100bp)=(pgftransparent!0)}
\pgfdeclarehorizontalshading{FOne}{100bp} { \pgfdeclarehorizontalshading{FOne}{100bp} {
color(0bp)=(pgftransparent!0); color(0bp)=(pgftransparent!0);
color(25bp)=(pgftransparent!0); color(25bp)=(pgftransparent!0);
@@ -28,12 +31,15 @@
\begin{document} \begin{document}
\begin{tikzpicture}[overlay,remember picture] \begin{tikzpicture}[overlay,remember picture]
\node[anchor=east,inner sep=0pt] (pic) at (current page.east) \node[anchor=east,inner sep=0pt] (pic) at (current page.east)
{\includegraphics[height=\pdfpageheight]{GAO_9361_01}}; % {\includegraphics[height=\pdfpageheight]{GAO_9361_01}};
{\includegraphics[height=\pdfpageheight]{027-028}};
% \fill[white,path fading=fade right] (pic.north west) rectangle (pic.south east); % \fill[white,path fading=fade right] (pic.north west) rectangle (pic.south east);
\fill[white,path fading=myfading] (pic.north west) rectangle (pic.south east); \fill[white,path fading=myfading] (pic.north west) rectangle (pic.south east);
\coordinate (pin) at (12,-2.5); % \coordinate (pin) at (12,-2.5);
% \filldraw[ultra thick,draw=red,fill=red!50] (pin) -- ++(70:.5) arc (-20:200:.18) -- cycle; % \filldraw[ultra thick,draw=red,fill=red!50] (pin) -- ++(70:.5) arc (-20:200:.18) -- cycle;
% \path (pin) -- ++(0,.5) node[draw,fill,red,circle,inner sep=1pt] {}; % \path (pin) -- ++(0,.5) node[draw,fill,red,circle,inner sep=1pt] {};
\node[anchor=south east, inner sep=0pt] (qr) at (pic.south east)
{\includegraphics[height=2.8cm]{qr}};
\end{tikzpicture}% \end{tikzpicture}%
\obeylines% \obeylines%
@@ -50,7 +56,7 @@
Nam and Huong Nam and Huong
} }
% \vfill \vfill
{\addfontfeatures{Scale=1.4,LetterSpace=5}\scshape when?} {\addfontfeatures{Scale=1.4,LetterSpace=5}\scshape when?}
\textit{% \textit{%
March 1\/\rlap{,}\textsuperscript{st} 2020 March 1\/\rlap{,}\textsuperscript{st} 2020
@@ -66,16 +72,4 @@
Hai Duong City, Hai Duong Hai Duong City, Hai Duong
} }
\begin{pspicture}(2in,2in)
\psbarcode{BEGIN:VCALENDAR^^J%
VERSION:2.0^^J%
BEGIN:VEVENT^^J%
SUMMARY:Wedding Nam-Huong^^J%
LOCATION:Auco Convention Center, Haiduong, Haiduong^^J%
DTSTART;TZID=Asia/Saigon:20200301T160000^^J%
END:VEVENT^^J%
END:VCALENDAR}
{qrcode}
\end{pspicture}
\end{document} \end{document}