fix build

This commit is contained in:
Marc Wäckerlin
2025-11-09 11:03:42 +01:00
parent af2a53a9d9
commit 07898c33a1
31 changed files with 35 additions and 22 deletions
+10 -10
View File
@@ -5,9 +5,9 @@ What happens, if you give your visiting card to someone? Either he manually type
Other available visitingcard templates, such as [mschlenker] distribute the cards on an A4 paper. But if you want a professional printer, such as [onlineprinters], then you need to be able to generate a PDF with exactly one card, an exactly defined border and crop marks.
[![Example: John Doe from Hongkong](screenshots/john-doe-hongkong.jpg)](examples/john-doe-hongkong.tex)
[![Example: Businesscard of Peter Muster from Zürich](screenshots/peter-muster-example-company-zuerich.jpg)](examples/peter-muster-example-company-zuerich.tex)
[![Example: Nearly Real Examle Of My Card](screenshots/example.jpg)](examples/example.tex)
[![Example: John Doe from Hongkong](screenshots/john-doe-hongkong.png)](examples/john-doe-hongkong.tex)
[![Example: Businesscard of Peter Muster from Zürich](screenshots/peter-muster-example-company-zuerich.png)](examples/peter-muster-example-company-zuerich.tex)
[![Example: Nearly Real Examle Of My Card](screenshots/example.png)](examples/example.tex)
Features
@@ -174,7 +174,7 @@ The card is designed for professional printing service, such as [onlineprinters]
cutdist=2]
{businesscard-qrcode}
![example with special paper size](screenshots/special-papersize.jpg)
![example with special paper size](screenshots/special-papersize.png)
Usage Example
@@ -204,7 +204,7 @@ Save it as file [texstudio_d30266.tex] and compile it to get [texstudio_d30266.p
xelatex -synctex=1 -interaction=nonstopmode texstudio_d30266.tex
![the visiting card resulting from the usage example](screenshots/texstudio_d30266.jpg)
![the visiting card resulting from the usage example](screenshots/texstudio_d30266.png)
See [examples] for more examples.
@@ -214,7 +214,7 @@ Photo (optional)
You can add an optional photo that appears next to the name or in the center of the QR code. The photo is dynamically scaled to match the name line height (when next to name) or to 25% of the QR code width (when in QR).
```latex
\photo{path/to/photo.jpg}
\photo{path/to/photo.png}
```
### Photo Placement Options:
@@ -222,13 +222,13 @@ You can add an optional photo that appears next to the name or in the center of
**Default (photo next to name):**
```latex
\documentclass{businesscard-qrcode}
\photo{photo.jpg}
\photo{photo.png}
```
**Photo in QR code center:**
```latex
\documentclass[photoinqr,qreclevel=H,qrlogoscale=0.25]{businesscard-qrcode}
\photo{photo.jpg}
\photo{photo.png}
```
**Important:** When using `photoinqr=true`:
@@ -241,7 +241,7 @@ You can add an optional photo that appears next to the name or in the center of
**Large photo next to name:**
```latex
\documentclass[photoscale=2.5]{businesscard-qrcode}
\photo{photo.jpg}
\photo{photo.png}
```
**Background color:**
@@ -253,7 +253,7 @@ You can add an optional photo that appears next to the name or in the center of
**Background image:**
```latex
\documentclass[bgscale=1.5,bgopacity=0.3,qrbgopacity=1.0]{businesscard-qrcode}
\background{photo.jpg}
\background{photo.png}
```
Note: Use `bgopacity` to fade the background (e.g., `0.2` or `0.3`) so text remains readable. The QR code has a white background by default (`qrbgopacity=1.0`) to ensure scannability.
+9 -7
View File
@@ -80,6 +80,8 @@
\RequirePackage{graphicx} % needed for optional photo
\RequirePackage{tikz} % needed for logo overlay in QR code
\RequirePackage{eso-pic} % needed for background images without layout impact
% Fix XeLaTeX opacity issue: ensure TikZ/PGF is loaded before eso-pic uses opacity
\DeclareHookRule{shipout/background}{pgfrcs}{>}{eso-pic}
\RequirePackage[\content,top=\padding,left=\padding,right=\padding,bottom=\padding]{geometry}
%\RequirePackage{pbox}
\RequirePackage{varwidth}
@@ -383,15 +385,15 @@ END:VCARD\BCQ@nl}
\ifcsdef{Xbackground}{%
\IfFileExists{\Xbackground}{%
% It's an image file: add to background using eso-pic (no layout impact)
% Fix XeLaTeX opacity issue: ensure TikZ/PGF is loaded before opacity is used
\AddToHook{shipout/background}[businesscard]{%
\put (\LenToUnit{.5\paperwidth},\LenToUnit{-.5\paperheight}) {%
\tikz[overlay]{\node[opacity=\fpeval{\BCQ@bgopacity}, inner sep=0pt] at (0,0) {%
\includegraphics[height=\fpeval{\BCQ@bgscale}\paperheight]{\Xbackground}%
};}%
\AddToShipoutPictureBG*{%
\AtPageCenter{%
\begin{tikzpicture}[overlay]
\node[inner sep=0pt, opacity=\fpeval{\BCQ@bgopacity}] at (0,0) {%
\includegraphics[height=\fpeval{\BCQ@bgscale}\paperheight]{\Xbackground}%
};
\end{tikzpicture}%
}%
}%
\DeclareHookRule{shipout/background}{pgfrcs}{>}{businesscard}%
}{%
% Not a file: treat as color
\pagecolor{\Xbackground}%
Binary file not shown.
Binary file not shown.
+1
View File
@@ -4,6 +4,7 @@
\type{home}
\givennames{Petra}
\familynames{Test}
\additionalnames{Example Company Ltd.}
\street{Bildstrasse\ 99}
\city{Basel}
\zip{4000}
Binary file not shown.
Binary file not shown.
+13 -1
View File
@@ -1,8 +1,20 @@
EXAMPLES = example \
john-doe-hongkong \
peter-muster-example-company-zuerich \
special-papersize \
photo-example \
photo-in-qr-example \
photo-large-example \
background-color-example \
background-image-example \
test-country-short \
texstudio_d30266
examplesdir = ${docdir}/examples
dist_examples_DATA = $(EXAMPLES:%=%.tex) $(EXAMPLES:%=%.pdf)
%.pdf:%.tex
xelatex -synctex=1 -interaction=nonstopmode $<
CLEANFILES = $(EXAMPLES:%=%.aux) $(EXAMPLES:%=%.log) $(EXAMPLES:%=%.synctex.gz)
CLEANFILES = $(EXAMPLES:%=%.aux) $(EXAMPLES:%=%.log) $(EXAMPLES:%=%.synctex.gz) $(EXAMPLES:%=%.fdb_latexmk) $(EXAMPLES:%=%.fls) $(EXAMPLES:%=%.xdv)
MAINTAINERCLEANFILES = makefile.in
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
-2
View File
@@ -1,5 +1,3 @@
% !TeX program = xelatex
% Note: Requires photo.png in same directory
\documentclass[bgscale=1.2,bgopacity=0.6,qrbgopacity=0.8,photoscale=4]{businesscard-qrcode}
\type{home}
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

Before

Width:  |  Height:  |  Size: 102 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 77 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

+2 -2
View File
@@ -1,7 +1,7 @@
screenshotdir=${docdir}/screenshots
dist_screenshot_DATA=$(EXAMPLES:%=%.jpg)
dist_screenshot_DATA=$(EXAMPLES:%=%.png)
%.jpg:${top_srcdir}/examples/%.pdf
%.png:${top_srcdir}/examples/%.pdf
convert -density 200 -quality 90 $< $@
MAINTAINERCLEANFILES = makefile.in
Binary file not shown.

Before

Width:  |  Height:  |  Size: 91 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 77 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 70 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB