Skip to content

Commit

Permalink
Address the issue with the watermark insertion method to avoid a ligh…
Browse files Browse the repository at this point in the history
…t gray background during printing
  • Loading branch information
anlit75 committed Apr 30, 2024
1 parent a401b87 commit 50d3bac
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 10 deletions.
12 changes: 5 additions & 7 deletions ccuthesis.cls
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
% --------------------------------------------------
% Author : Ting-An Cheng <anson40512@gmail.com>
% Repository : https://github.com/anlit75/CCU-Thesis-LaTeX-Template
% Last Updated : 2024.04.29
% Last Updated : 2024.04.30
% --------------------------------------------------

% --------------------------------------------------
Expand Down Expand Up @@ -652,20 +652,18 @@
}

% [插入浮水印]
% - \makewatermark{#1}{#2} 生成浮水印
% #1 Opacity 設置透明度
% #2 Logo Path 校徽路徑
% - \makewatermark{#1} 生成浮水印
% #1 Logo Path 校徽路徑
%
\newcommand{\makewatermark}[2]{
\newcommand{\makewatermark}[1]{
\AddToShipoutPicture{
\put(-\paperwidth/2,-\paperheight/2){
\parbox[b][\paperheight]{\paperwidth}{
\vfill
\centering
\begin{tikzpicture}[remember picture, overlay]
\coordinate (WM) at (current page.center);
\node [scale=1.5] at (WM) {\includegraphics[width=5cm, height=5cm]{#2}};
\filldraw [fill=white, draw=none, opacity=1-\the\numexpr#1] (current page.north east) rectangle (current page.south west);
\node [scale=1.5] at (WM) {\includegraphics[width=5cm, height=5cm]{#1}};
\end{tikzpicture}
\vfill
}}}}
Expand Down
Binary file removed figures/watermark.jpg
Binary file not shown.
Binary file added figures/watermark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 4 additions & 3 deletions main.tex
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,9 @@
\input{ccusetup}

\begin{document}
% 加入浮水印 Watermark
\makewatermark{0.25}{watermark} % 加入浮水印(Watermark)

% 封面 Cover
% 若需要在封面加上(初稿)字樣,請在\makecover後加上{draft}
%
% \makecover{draft} % 有(初稿)字樣的論文封面(Cover with Draft)
\makecover % 論文封面(Cover)

Expand All @@ -25,6 +23,9 @@
% \makeverification % 口試委員審定書(Verification Letter)
\renderverification{frontpages/verification} % 渲染口試委員審定書(Render Verification Letter)

% 加入浮水印 Watermark
\makewatermark{watermark} % 加入浮水印(Watermark)

% 致謝與論文摘要 Acknowledgement and Abstract
\frontmatter
\input{frontpages/acknowledgement} % 致謝(Acknowledgement)
Expand Down

0 comments on commit 50d3bac

Please sign in to comment.