This commit is contained in:
Ming Su 2025-07-27 14:28:19 +08:00
parent e6ec80ebe6
commit 36b6a1a4cb
35 changed files with 424 additions and 86 deletions

Binary file not shown.

View File

@ -99,8 +99,7 @@
% logo
\AtPageLowerLeft{% start the bar at the bottom left of the page
\put(0.5cm,27.2cm){% % 从左侧边缘向右移动0.75cm垂直位置27.2cm
\color{light}\includegraphics[width=1.5cm]{_extensions/drwater/dwbk/logo.png}
\color{light}\includegraphics[width=1.5cm]{_extensions/drwater/dwbk/rceeslogo.png}
}%
}%
}

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 80 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 9.7 KiB

View File

@ -99,8 +99,7 @@
% logo
\AtPageLowerLeft{% start the bar at the bottom left of the page
\put(0.5cm,27.2cm){% % 从左侧边缘向右移动0.75cm垂直位置27.2cm
\color{light}\includegraphics[width=1.5cm]{_extensions/drwater/dwbk/logo.png}
\color{light}\includegraphics[width=1.5cm]{_extensions/drwater/dwbk/rceeslogo.png}
}%
}%
}

BIN
dwbk/rceeslogo.pdf Normal file

Binary file not shown.

BIN
dwbk/rceeslogo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 80 KiB

5
dwbk/rceeslogo.svg Normal file

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 9.7 KiB

12
dwbken/.gitignore vendored Normal file
View File

@ -0,0 +1,12 @@
.Rproj.user
.Rhistory
.RData
.Ruserdata
site_libs/
/.quarto/
site_libs/
BB/Ref.bib
_variables.yml
_freeze/
www/
.source_state

15
dwbken/_extension.yml Normal file
View File

@ -0,0 +1,15 @@
title: PrettyPDF
author: Nicola Rennie
version: 0.0.5
contributes:
formats:
pdf:
documentclass: scrbook
include-in-header:
- "header.tex"
include-before-body:
- "partials/before-body.tex"
toc: false
code-block-bg: light
linkcolor: highlight
urlcolor: highlight

View File

@ -0,0 +1,15 @@
title: PrettyPDF
author: Nicola Rennie
version: 0.0.5
contributes:
formats:
pdf:
documentclass: scrbook
include-in-header:
- "header.tex"
include-before-body:
- "partials/before-body.tex"
toc: false
code-block-bg: light
linkcolor: highlight
urlcolor: highlight

View File

@ -0,0 +1,69 @@
\usepackage{geometry}
\usepackage{xcolor}
\usepackage{eso-pic}
\usepackage{fancyhdr}
\usepackage{tikz}
\usepackage{fontspec}
\usepackage{microtype}
\usepackage{etoolbox}
% 修复spacefactor问题的关键补丁
\makeatletter
\patchcmd{\@makechapterhead}
{\vspace\@tempskipa}
{\vspace\@tempskipa\par\nobreak}
{}{}
\makeatother
% 页面布局设置
\geometry{
left=30mm,
right=30mm,
top=25mm,
bottom=25mm,
headheight=15pt
}
% 颜色定义
\definecolor{light}{HTML}{ECF1EC}
\definecolor{highlight}{HTML}{800080}
\definecolor{dark}{HTML}{330033}
\definecolor{coverbg}{HTML}{F0F0F0}
% 安全的封面设计
\renewcommand{\maketitle}{%
\begin{titlepage}
\AddToShipoutPictureBG*{%
\AtPageLowerLeft{%
\begin{tikzpicture}[remember picture, overlay]
\fill[color=coverbg] (0,0) rectangle (\paperwidth,\paperheight);
\node[anchor=north east, xshift=-15mm, yshift=-15mm]
at (current page.north east)
{\includegraphics[width=8cm]{logo.png}};
\end{tikzpicture}
}
}
\vspace*{3cm}
\begin{center}
{\fontsize{28}{36}\selectfont\bfseries\color{dark}\@title}\\[2cm]
{\LARGE\@subtitle}\\[3cm]
{\Large\@author}\\[2cm]
{\large\@date}
\end{center}
\end{titlepage}
}
% 页眉页脚设置
\fancypagestyle{mainstyle}{%
\fancyhf{}
\fancyhead[RE]{\normalfont\small\leftmark}
\fancyhead[LO]{\normalfont\small\rightmark}
\fancyfoot[C]{\thepage}
\renewcommand{\headrulewidth}{0.4pt}
}
% 应用样式
\pagestyle{mainstyle}
\addtokomafont{chapter}{\color{dark}\Huge\bfseries}
\addtokomafont{section}{\color{dark}\Large\bfseries}
\addtokomafont{subsection}{\color{dark}\large\bfseries}

View File

Before

Width:  |  Height:  |  Size: 81 KiB

After

Width:  |  Height:  |  Size: 81 KiB

View File

@ -0,0 +1 @@
\pagestyle{mystyle}

14
dwbken/a.aux Normal file
View File

@ -0,0 +1,14 @@
\relax
\providecommand*\new@tpo@label[2]{}
\@writefile{toc}{\contentsline {section}{\numberline {0.1}Zbirka vaj fizike za studente gradbenistva}{3}{}\protected@file@percent }
\newlabel{sec:zbirka-vaj-fizike}{{0.1}{3}{Zbirka vaj fizike za studente gradbenistva}{section.0.1}{}}
\newlabel{k-umm}{{0.1}{3}{Zbirka vaj fizike za studente gradbenistva}{equation.0.1}{}}
\newlabel{k-uamm1}{{0.2}{3}{Zbirka vaj fizike za studente gradbenistva}{equation.0.2}{}}
\newlabel{k-uamm2}{{0.3}{3}{Zbirka vaj fizike za studente gradbenistva}{equation.0.3}{}}
\newlabel{k-uamm3}{{0.4}{3}{Zbirka vaj fizike za studente gradbenistva}{equation.0.4}{}}
\@writefile{lof}{\contentsline {figure}{\numberline {1}{\ignorespaces Poševni met}}{3}{}\protected@file@percent }
\newlabel{k-prsx}{{0.5}{4}{Zbirka vaj fizike za studente gradbenistva}{equation.0.5}{}}
\newlabel{k-prsy}{{0.6}{4}{Zbirka vaj fizike za studente gradbenistva}{equation.0.6}{}}
\newlabel{k-prvx}{{0.7}{4}{Zbirka vaj fizike za studente gradbenistva}{equation.0.7}{}}
\newlabel{k-prvy}{{0.8}{4}{Zbirka vaj fizike za studente gradbenistva}{equation.0.8}{}}
\gdef \@abspage@last{2}

BIN
dwbken/a.pdf Normal file

Binary file not shown.

81
dwbken/a.tex Normal file
View File

@ -0,0 +1,81 @@
\documentclass[12pt,parskip=half, DIV=calc, BCOR=10mm, x11names]{scrbook}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern, libertine}
\usepackage{amsmath, xcolor, tcolorbox, empheq}
\usepackage[ilines, headsepline]{scrpage2}
\setheadwidth[0pt]{textwithmarginpar}
%\input{slike_1} % TikZ pictures
\clearscrheadfoot
\ihead{\headmark}
\ohead{\pagemark}
\setcounter{page}{3}
\addtokomafont{pagenumber}{\bfseries\Large\color{LightBlue4}}
\addtokomafont{pagehead}{\color{LightBlue4}}
\renewcommand{\textit}[1]{\textcolor{LightBlue4}{\emph{#1}}}
%\tcbuselibrary{skins,breakable}
\tcbuselibrary{theorems}
\tcbset{colback=blue!60!green!10!white,
colframe=LightBlue4!50!black, ams nodisplayskip}
\begin{document}
\pagestyle{scrheadings}
\section{Zbirka vaj fizike za studente gradbenistva}
\label{sec:zbirka-vaj-fizike}
\textit{Enakomerno večdimenzionalno gibanje} označuje gibanje, pri katerem je vektor hitrosti konstanten. Gibanje tem primeru opisuje enačba, ki je posplošitev enačbe~(...)
%
\begin{equation}
\tcboxmath{\vec{r} = \vec{v} t + \vec{r}_0,\label{k-umm}}
\end{equation}
%
kjer $\vec{r}$ označuje trenutni, $\vec{r}_0$ pa začetni položaj telesa. Vektorju $\text{r}$, ki označuje položaj telesa, pravimo tudi \textit{krajevni vektor}.
\textit{Enakomerno pospešeno večdimenzionalno gibanje} označuje gibanje, pri katerem je vektor pospeška~$\vec{a}$ konstanten. Gibanje v tem primeru opisujejo enačbe, ki so posplošitve enačb~(...)
%
\begin{empheq}[box={\tcbhighmath[colback=blue!60!green!10!white,
colframe=LightBlue4!50!black]}]{align}
\vec{r} &= \tfrac{1}{2} \vec{a} t^2 + \vec{v}_0 t + \vec{r}_0\label{k-uamm1}\\
\vec{v} &= \vec{a} t + \vec{v}_0 \label{k-uamm2}\\
v^2 &= v_0^2 + 2 \vec{a} \cdot (\vec{r} - \vec{r}_0) \label{k-uamm3}
\end{empheq}
%
kjer so $\vec{r}$ trenutni in $\vec{r}_0$ začetni krajevni vektor telesa, ter $\vec{v}$ trenutni in $\vec{v}_0$ začetni vektor hitrosti telesa. Pri tem je tretja enačba izpeljana iz prvih dveh.
\begin{figure}[!ht]
\centering
%\Tpro
\caption{Poševni met}
\end{figure}
Če se telo nahaja v bližini Zemeljske površine, nanj deluje konstantni pospešek prostega pada $g = 10$~m/s$^2$ navpično navzdol. Vsako tako gibanje telesa je dejansko \textit{dvo}-dimenzionalno, saj se telo giblje po navpični ravnini. Po dogovoru $y$~os usmerimo navpično navzgor, torej nasproti smeri pospeška prostega pada ($\vec{a} = - g \vec{j}$), $x$~os pa tako, da začetna hitrost leži v $xy$ ravnini $\vec{v}_0 = v_{x0} \vec{i} + v_{y0} \vec{j}$. Potem lahko vsako od enačb~(...) razstavimo na \textit{dve} skalarni enačbi in dobimo
%
\begin{empheq}[box={\tcbhighmath[colback=blue!60!green!10!white,
colframe=LightBlue4!50!black]}]{align}
x(t) &= v_{x0} t + x_0, \label{k-prsx}\\
y(t) &= -\tfrac{1}{2} g t^2 + v_{y0} t + y_0, \label{k-prsy}\\
v_x(t) &= v_{x0}, \label{k-prvx}\\
v_y(t) &= -g t + v_{y0}. \label{k-prvy}
\end{empheq}
Pri tem smo upoštevali, da je pospešek v $x$~smeri enak $a_x = 0$, pospešek v $y$~smeri pa $a_y = -g$, kar pomeni, da imamo v $x$~smeri enakomerno gibanje, v $y$~smeri pa enakomerno pospešeno gibanje.
\end{document}

3
dwbken/a.toc Normal file
View File

@ -0,0 +1,3 @@
\contentsline {chapter}{\numberline {1}引言}{1}{}%
\contentsline {section}{\numberline {1.1}研究背景}{1}{}%
\providecommand \tocbasic@end@toc@file {}\tocbasic@end@toc@file

69
dwbken/header.tex Normal file
View File

@ -0,0 +1,69 @@
\usepackage{geometry}
\usepackage{xcolor}
\usepackage{eso-pic}
\usepackage{fancyhdr}
\usepackage{tikz}
\usepackage{fontspec}
\usepackage{sectsty}
\usepackage{titlesec}
% 设置页面布局
\geometry{a4paper,
total={170mm,257mm},
left=30mm,
top=25mm,
bottom=25mm,
right=30mm,
headheight=15pt}
% 定义颜色
\definecolor{light}{HTML}{ECF1EC}
\definecolor{highlight}{HTML}{800080}
\definecolor{dark}{HTML}{330033}
\definecolor{coverbg}{HTML}{F0F0F0} % 封面背景灰
% 封面设计
\AddToShipoutPictureBG*{% 仅作用于封面
\AtPageLowerLeft{
\begin{tikzpicture}[remember picture, overlay]
\fill[color=coverbg] (0,0) rectangle (\paperwidth,\paperheight);
\node[anchor=north east] at (0.95\paperwidth,0.9\paperheight)
{\includegraphics[width=8cm]{logo.png}};
\end{tikzpicture}
}
}
% 正文页眉页脚
\fancypagestyle{mainstyle}{
\fancyhf{}
\fancyhead[RE]{\normalfont\small\leftmark} % 偶数页章标题
\fancyhead[LO]{\normalfont\small\rightmark} % 奇数页节标题
\fancyfoot[C]{\thepage}
\renewcommand{\headrulewidth}{0.4pt}
\renewcommand{\footrulewidth}{0pt}
}
% 章节标题样式
\addtokomafont{chapter}{\color{dark}\Huge\bfseries}
\addtokomafont{section}{\color{dark}\Large\bfseries}
\addtokomafont{subsection}{\color{dark}\large\bfseries}
% 标题格式调整
\RedeclareSectionCommand[
beforeskip=-1sp,
afterskip=1sp
]{chapter}
% 自定义标题页
\renewcommand{\maketitle}{%
\begin{titlepage}
\ThisCenterWallPaper{1.0}{logo.png} % 封面背景图
\vspace*{3cm}
\begin{center}
{\fontsize{28}{36}\selectfont\bfseries\color{dark} \@title}\\[2cm]
{\LARGE \@subtitle}\\[3cm]
{\Large \@author}\\[2cm]
{\large \@date}
\end{center}
\end{titlepage}
}

View File

Before

Width:  |  Height:  |  Size: 81 KiB

After

Width:  |  Height:  |  Size: 81 KiB

View File

@ -0,0 +1 @@
\pagestyle{mystyle}

4
dwbken/template.aux Normal file
View File

@ -0,0 +1,4 @@
\relax
\providecommand*\new@tpo@label[2]{}
\providecommand\hyper@newdestlabel[2]{}
\providecommand*\HyPL@Entry[1]{}

27
dwbken/template.qmd Normal file
View File

@ -0,0 +1,27 @@
---
title: "Pretty PDFs with Quarto"
author: Ming Su
format:
dwbken-pdf: default
---
# Quarto
Quarto enables you to weave together content and executable code into a finished document. To learn more about Quarto see <https://quarto.org>.
## Running Code
When you click the **Render** button a document will be generated that includes both content and the output of embedded code. You can embed code like this:
```{r}
1 + 1
```
You can add options to executable code like this
```{r}
#| echo: false
2 * 2
```
The `echo: false` option disables the printing of code (only output is displayed).

View File

@ -5,12 +5,10 @@
\PassOptionsToPackage{dvipsnames,svgnames,x11names}{xcolor}
%
\documentclass[
letterpaper,
DIV=11,
numbers=noendperiod]{scrartcl}
]{scrbook}
\usepackage{xcolor}
\usepackage{amsmath,amssymb}
\setcounter{secnumdepth}{-\maxdimen} % remove section numbering
\setcounter{secnumdepth}{5}
\usepackage{iftex}
\ifPDFTeX
\usepackage[T1]{fontenc}
@ -146,66 +144,75 @@
% load packages
\usepackage{geometry}
\usepackage{xcolor}
\usepackage{eso-pic}
\usepackage{fancyhdr}
\usepackage{sectsty}
\usepackage{tikz}
\usepackage{fontspec}
\usepackage{titlesec}
\usepackage{microtype}
\usepackage{etoolbox}
%% Set page size with a wider right margin
\geometry{a4paper, total={170mm,257mm}, left=20mm, top=20mm, bottom=20mm, right=50mm}
% 修复spacefactor问题的关键补丁
\makeatletter
\patchcmd{\@makechapterhead}
{\vspace\@tempskipa}
{\vspace\@tempskipa\par\nobreak}
{}{}
\makeatother
%% Let's define some colours
% 页面布局设置
\geometry{
left=30mm,
right=30mm,
top=25mm,
bottom=25mm,
headheight=15pt
}
% 颜色定义
\definecolor{light}{HTML}{ECF1EC}
\definecolor{highlight}{HTML}{800080}
\definecolor{dark}{HTML}{330033}
\definecolor{coverbg}{HTML}{F0F0F0}
%% Let's add the border on the right hand side
\AddToShipoutPicture{%
\AtPageLowerLeft{%
\put(\LenToUnit{\dimexpr\paperwidth-3cm},0){%
\color{light}\rule{3cm}{\LenToUnit\paperheight}%
}%
}%
% logo
\AtPageLowerLeft{% start the bar at the bottom right of the page
\put(\LenToUnit{\dimexpr\paperwidth-2.25cm},27.2cm){% move it to the top right
\color{light}\includegraphics[width=1.5cm]{_extensions/drwater/dwen/logo.png}
}%
}%
% 安全的封面设计
\renewcommand{\maketitle}{%
\begin{titlepage}
\AddToShipoutPictureBG*{%
\AtPageLowerLeft{%
\begin{tikzpicture}[remember picture, overlay]
\fill[color=coverbg] (0,0) rectangle (\paperwidth,\paperheight);
\node[anchor=north east, xshift=-15mm, yshift=-15mm]
at (current page.north east)
{\includegraphics[width=8cm]{logo.png}};
\end{tikzpicture}
}
}
\vspace*{3cm}
\begin{center}
{\fontsize{28}{36}\selectfont\bfseries\color{dark}\@title}\\[2cm]
{\LARGE\@subtitle}\\[3cm]
{\Large\@author}\\[2cm]
{\large\@date}
\end{center}
\end{titlepage}
}
%% Style the page number
\fancypagestyle{mystyle}{
% 页眉页脚设置
\fancypagestyle{mainstyle}{%
\fancyhf{}
\renewcommand\headrulewidth{0pt}
\fancyfoot[R]{\thepage}
\fancyfootoffset{3.5cm}
\fancyhead[RE]{\normalfont\small\leftmark}
\fancyhead[LO]{\normalfont\small\rightmark}
\fancyfoot[C]{\thepage}
\renewcommand{\headrulewidth}{0.4pt}
}
\setlength{\footskip}{20pt}
%% style the chapter/section fonts
\chapterfont{\color{dark}\fontsize{20}{16.8}\selectfont}
\sectionfont{\color{dark}\fontsize{20}{16.8}\selectfont}
\subsectionfont{\color{dark}\fontsize{14}{16.8}\selectfont}
\titleformat{\subsection}
{\sffamily\Large\bfseries}{\thesection}{1em}{}[{\titlerule[0.8pt]}]
% left align title
\makeatletter
\renewcommand{\maketitle}{\bgroup\setlength{\parindent}{0pt}
\begin{flushleft}
{\sffamily\huge\textbf{\MakeUppercase{\@title}}} \vspace{0.3cm} \newline
{\Large {\@subtitle}} \newline
\@author
\end{flushleft}\egroup
}
\makeatother
\KOMAoption{captions}{tableheading}
% 应用样式
\pagestyle{mainstyle}
\addtokomafont{chapter}{\color{dark}\Huge\bfseries}
\addtokomafont{section}{\color{dark}\Large\bfseries}
\addtokomafont{subsection}{\color{dark}\large\bfseries}
\makeatletter
\@ifpackageloaded{caption}{}{\usepackage{caption}}
\AtBeginDocument{%
@ -257,13 +264,14 @@
\@ifundefined{codebgcolor}{\definecolor{codebgcolor}{named}{light}}{}
\makeatother
\makeatletter
\ifdefined\Shaded\renewenvironment{Shaded}{\begin{tcolorbox}[frame hidden, colback={codebgcolor}, boxrule=0pt, enhanced, sharp corners, breakable]}{\end{tcolorbox}}\fi
\ifdefined\Shaded\renewenvironment{Shaded}{\begin{tcolorbox}[frame hidden, sharp corners, boxrule=0pt, enhanced, colback={codebgcolor}, breakable]}{\end{tcolorbox}}\fi
\makeatother
\usepackage{bookmark}
\IfFileExists{xurl.sty}{\usepackage{xurl}}{} % add URL line breaks if available
\urlstyle{same}
\hypersetup{
pdftitle={Pretty PDFs with Quarto},
pdfauthor={Ming Su},
colorlinks=true,
linkcolor={highlight},
filecolor={Maroon},
@ -273,21 +281,23 @@
\title{Pretty PDFs with Quarto}
\author{}
\author{Ming Su}
\date{}
\begin{document}
\frontmatter
\maketitle
\pagestyle{mystyle}
\section{Quarto}\label{quarto}
\mainmatter
\chapter{Quarto}\label{quarto}
Quarto enables you to weave together content and executable code into a
finished document. To learn more about Quarto see
\url{https://quarto.org}.
\subsection{Running Code}\label{running-code}
\section{Running Code}\label{running-code}
When you click the \textbf{Render} button a document will be generated
that includes both content and the output of embedded code. You can
@ -313,6 +323,7 @@ The \texttt{echo:\ false} option disables the printing of code (only
output is displayed).
\backmatter
\end{document}

View File

@ -15,19 +15,19 @@
\definecolor{highlight}{HTML}{800080}
\definecolor{dark}{HTML}{330033}
%% Let's add the border on the right hand side
\AddToShipoutPicture{%
% Add right sidebar
\AtPageLowerLeft{%
\put(\LenToUnit{\dimexpr\paperwidth-3cm},0){%
\color{light}\rule{3cm}{\LenToUnit\paperheight}%
}%
}%
% logo
\AtPageLowerLeft{% start the bar at the bottom right of the page
\put(\LenToUnit{\dimexpr\paperwidth-2.25cm},27.2cm){% move it to the top right
\color{light}\includegraphics[width=1.5cm]{_extensions/drwater/dwen/logo.png}
}%
}%
\color{light}\rule{3cm}{\paperheight}%
}%
}%
% Add logo
\AtPageLowerLeft{%
\put(\LenToUnit{\dimexpr\paperwidth-2.25cm},\LenToUnit{27.2cm}){%
\includegraphics[width=1.5cm]{_extensions/drwater/dwen/rceeslogo.png}
}%
}%
}
%% Style the page number

Binary file not shown.

Before

Width:  |  Height:  |  Size: 81 KiB

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 80 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 9.7 KiB

View File

@ -15,19 +15,19 @@
\definecolor{highlight}{HTML}{800080}
\definecolor{dark}{HTML}{330033}
%% Let's add the border on the right hand side
\AddToShipoutPicture{%
% Add right sidebar
\AtPageLowerLeft{%
\put(\LenToUnit{\dimexpr\paperwidth-3cm},0){%
\color{light}\rule{3cm}{\LenToUnit\paperheight}%
}%
}%
% logo
\AtPageLowerLeft{% start the bar at the bottom right of the page
\put(\LenToUnit{\dimexpr\paperwidth-2.25cm},27.2cm){% move it to the top right
\color{light}\includegraphics[width=1.5cm]{_extensions/drwater/dwen/logo.png}
}%
}%
\color{light}\rule{3cm}{\paperheight}%
}%
}%
% Add logo
\AtPageLowerLeft{%
\put(\LenToUnit{\dimexpr\paperwidth-2.25cm},\LenToUnit{27.2cm}){%
\includegraphics[width=1.5cm,bb=0 0 100 100]{_extensions/drwater/dwen/rceeslogo.svg}
}%
}%
}
%% Style the page number

BIN
dwen/rceeslogo.pdf Normal file

Binary file not shown.

5
dwen/rceeslogo.svg Normal file

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 9.7 KiB

Binary file not shown.

View File

@ -1,10 +1,8 @@
---
title: "Pretty PDFs with Quarto"
author: Ming Su
format:
dwen-pdf:
keep-tex: true
# documentclass: scrbook
# documentclass: scrreprt
dwen-pdf: default
---
# Quarto