bounty将在5天内到期。此问题的答案有资格获得+50声望奖励。MYaseen208希望引起更多关注这个问题。
免责声明
我从Making Pretty PDFs with Quarto借用了最多的代码。我的代码在classoption: [oneside]
上工作正常,但在classoption: [twoside]
上有问题。我将非常感谢任何指导如何正确地呈现它。
---
book:
title: "Title"
author: "MYaseen208"
format:
pdf:
documentclass: scrreprt
classoption: [twoside]
# classoption: [oneside]
toc: true
toc-depth: 3
lot: true
lof: true
include-in-header:
- text: |
%% load packages
\usepackage{lipsum}
\usepackage{geometry}
\usepackage{xcolor}
\usepackage{eso-pic}
\usepackage{fancyhdr}
\usepackage{sectsty}
\usepackage{fontspec}
\usepackage{titlesec}
%% Set page size with a wider right margin
\geometry{a4paper, total={170mm,257mm}, left=20mm, top=20mm, bottom=20mm, right=50mm}
%% Let's define some colours
\definecolor{light}{HTML}{E6E6FA}
\definecolor{highlight}{HTML}{800080}
\definecolor{dark}{HTML}{330033}
%% Let's add the border on the right hand side
\AddToShipoutPicture{%
\AtPageLowerLeft{%
\put(\LenToUnit{\dimexpr\paperwidth-3cm},0){%
\color{light}\rule{3cm}{\LenToUnit\paperheight}%
}%
}%
}
include-before-body:
- text: |
%% Style the page number
\fancypagestyle{mystyle}{
\fancyhf{}
\renewcommand\headrulewidth{0pt}
\fancyfoot[R]{\thepage}
\fancyfootoffset{3.5cm}
}
\setlength{\footskip}{20pt}
%% style the chapter/section fonts
\chapterfont{\color{dark}\fontsize{20}{16.8}\selectfont}
\sectionfont{\color{dark}\fontsize{18}{16.8}\selectfont}
\subsectionfont{\color{dark}\fontsize{14}{16.8}\selectfont}
%% 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
---
# Introduction
\lipsum[1-50]
# Material and Methods
\lipsum[1-20]
1条答案
按热度按时间2hh7jdfx1#
您可以测试页面是偶数还是奇数,并相应地放置蓝色条:
完整文档: