tricks to compile 2 pdf from 1 source file
This commit is contained in:
@@ -1,15 +1,21 @@
|
||||
DOC=thiep1
|
||||
INPUT=$(DOC).tex
|
||||
TARGET=$(DOC).pdf
|
||||
TARGET_EN=thiep_en
|
||||
TARGET_VI=thiep_vi
|
||||
TARGET=$(TARGET_EN).pdf $(TARGET_VI).pdf
|
||||
TEX=xelatex
|
||||
QR=qr.png
|
||||
QR=qrEvent_vi.png qrEvent_en.png
|
||||
|
||||
default: $(TARGET)
|
||||
|
||||
$(TARGET): $(INPUT) Makefile $(QR)
|
||||
$(TEX) $< && $(TEX) $<
|
||||
$(TARGET_EN).pdf: $(INPUT) Makefile $(QR)
|
||||
$(TEX) --jobname=$(TARGET_EN) $< && $(TEX) --jobname=$(TARGET_EN) $<
|
||||
|
||||
$(QR): qrEvent_vi.txt
|
||||
$(TARGET_VI).pdf: $(INPUT) Makefile $(QR)
|
||||
$(TEX) --jobname=$(TARGET_VI) "\def\ViFlag{}\input{$<}" && \
|
||||
$(TEX) --jobname=$(TARGET_VI) "\def\ViFlag{}\input{$<}"
|
||||
|
||||
$(QR): qrEvent_vi.txt qrEvent_en.txt
|
||||
./qrGen.py
|
||||
|
||||
clean:
|
||||
|
||||
11
wedding-invitation/qrEvent_en.txt
Normal file
11
wedding-invitation/qrEvent_en.txt
Normal file
@@ -0,0 +1,11 @@
|
||||
BEGIN:VCALENDAR
|
||||
VERSION:2.0
|
||||
BEGIN:VEVENT
|
||||
SUMMARY:Nam's wedding
|
||||
DTSTART;TZID=Asia/Saigon:20200301T160000
|
||||
DTEND;TZID=Asia/Saigon:20200301T200000
|
||||
LOCATION:Auco Convention Center, 1A Nguyen Huu Cau Str., Ngoc Chau Ward, Hai Duong City, Hai Duong, Vietnam
|
||||
GEO:20.9351879;106.3433482,18
|
||||
URL:https://goo.gl/maps/eyfMhXgjFTQzAWB79
|
||||
END:VEVENT
|
||||
END:VCALENDAR
|
||||
@@ -1,14 +1,15 @@
|
||||
#!/usr/bin/env python3
|
||||
import qrcode
|
||||
|
||||
for fname in ["qrEvent_en", "qrEvent_vi"]:
|
||||
qr = qrcode.QRCode(
|
||||
version=2,
|
||||
error_correction=qrcode.constants.ERROR_CORRECT_Q,
|
||||
box_size=5,
|
||||
border=1)
|
||||
|
||||
with open("qrEvent_vi.txt") as fp:
|
||||
with open(f"{fname}.txt") as fp:
|
||||
qr.add_data(fp.read())
|
||||
qr.make(fit=True)
|
||||
img = qr.make_image(fill_color="orangered", back_color="white")
|
||||
img.save("qr.png")
|
||||
img.save(f"{fname}.png")
|
||||
|
||||
@@ -5,19 +5,19 @@
|
||||
\usepackage[utf8]{inputenc}
|
||||
\usepackage[T1]{fontenc}
|
||||
\usepackage{ebgaramond}
|
||||
\usepackage{etoolbox}
|
||||
|
||||
\newtoggle{Vietnamese}
|
||||
|
||||
\ifdefined\ViFlag
|
||||
\toggletrue{Vietnamese}
|
||||
\else
|
||||
\togglefalse{Vietnamese}
|
||||
\fi
|
||||
|
||||
\usetikzlibrary{fadings}
|
||||
% \tikzfading[name=fade right, left color=transparent!0, right color=transparent!100]
|
||||
% \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} {
|
||||
color(0bp)=(pgftransparent!0);
|
||||
color(25bp)=(pgftransparent!0);
|
||||
@@ -31,39 +31,64 @@
|
||||
\begin{document}
|
||||
\begin{tikzpicture}[overlay,remember picture]
|
||||
\node[anchor=east,inner sep=0pt] (pic) at (current page.east)
|
||||
% {\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=myfading] (pic.north west) rectangle (pic.south east);
|
||||
% \coordinate (pin) at (12,-2.5);
|
||||
% \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] {};
|
||||
\node[anchor=south east, inner sep=0pt] (qr) at (pic.south east)
|
||||
{\includegraphics[height=2.8cm]{qr}};
|
||||
\iftoggle{Vietnamese}{
|
||||
\node[anchor=south east, inner sep=0pt] (qrEvent_vi) at (pic.south east)
|
||||
{\includegraphics[height=2.5cm]{qrEvent_vi}};
|
||||
}{
|
||||
\node[anchor=south east, inner sep=0pt] (qrEvent_en) at (pic.south east)
|
||||
{\includegraphics[height=2.5cm]{qrEvent_en}};
|
||||
}
|
||||
\end{tikzpicture}%
|
||||
|
||||
\obeylines%
|
||||
{\addfontfeatures{Scale=2.8,LetterSpace=9} INVITATION}
|
||||
{\addfontfeatures{Scale=2.8,LetterSpace=9,Color=red}
|
||||
\iftoggle{Vietnamese}{ THIỆP MỜI }{ INVITATION }}
|
||||
|
||||
\bigbreak
|
||||
\textit{%
|
||||
\iftoggle{Vietnamese}{
|
||||
Trân trọng kính mời bạn
|
||||
|
||||
dự tiệc cưới của chúng tôi,
|
||||
|
||||
Nam và Hương.
|
||||
}{
|
||||
Dear friend,
|
||||
|
||||
We'd love to invite you to our wedding reception.
|
||||
|
||||
Sincerly,
|
||||
|
||||
Nam and Huong
|
||||
Nam and Huong.
|
||||
}
|
||||
}
|
||||
|
||||
\vfill
|
||||
{\addfontfeatures{Scale=1.4,LetterSpace=5}\scshape when?}
|
||||
\iftoggle{Vietnamese}{
|
||||
{\addfontfeatures{Scale=1.4,LetterSpace=5,Color=red}\scshape Bao giờ?}
|
||||
\textit{%
|
||||
Chủ Nhật, ngày 1, tháng 3, năm 2020
|
||||
4\kern.5pt:\kern.5pt00 chiều
|
||||
}
|
||||
\medbreak
|
||||
{\addfontfeatures{Scale=1.4,LetterSpace=5,Color=red}\scshape Ở đâu?}
|
||||
\textit{%
|
||||
Trung tâm nhà hàng tiệc cưới Âu Cơ,
|
||||
|
||||
1A Nguyễn Hữu Cầu, Phường Ngọc Châu,
|
||||
|
||||
Thành phố Hải Dương, Hải Dương
|
||||
}
|
||||
}{
|
||||
{\addfontfeatures{Scale=1.4,LetterSpace=5,Color=red}\scshape when?}
|
||||
\textit{%
|
||||
March 1\/\rlap{,}\textsuperscript{st} 2020
|
||||
4\kern.5pt:\kern.5pt00 pm
|
||||
}
|
||||
\medbreak
|
||||
{\addfontfeatures{Scale=1.4,LetterSpace=5}\scshape where?}
|
||||
{\addfontfeatures{Scale=1.4,LetterSpace=5,Color=red}\scshape where?}
|
||||
\textit{%
|
||||
Auco Convention Center,
|
||||
|
||||
@@ -71,5 +96,6 @@
|
||||
|
||||
Hai Duong City, Hai Duong
|
||||
}
|
||||
}
|
||||
|
||||
\end{document}
|
||||
|
||||
Reference in New Issue
Block a user