add device option pad

This commit is contained in:
EthanDeng
2019-05-06 12:32:11 +08:00
parent f93ad428c0
commit 7e0a8f1015
3 changed files with 35 additions and 19 deletions

Binary file not shown.

View File

@@ -1,4 +1,4 @@
\documentclass[cn,11pt,fancy,hide]{elegantbook}
\documentclass[cn,11pt,fancy,hide,pad]{elegantbook}
\title{ElegantBook优美的 \LaTeX{} 书籍模板}

View File

@@ -21,7 +21,7 @@
\DeclareStringOption[answer]{result}
\DeclareStringOption[fancy]{mode}
\DeclareStringOption[show]{base}
\DeclareStringOption[normal]{device}
% ----- backward compatibility
\DeclareVoidOption{green}{\ekv{color=green}}
@@ -43,6 +43,8 @@
\DeclareVoidOption{hide}{\ekv{base=hide}}
\DeclareVoidOption{show}{\ekv{base=show}}
\DeclareVoidOption{normal}{\ekv{device=normal}}
\DeclareVoidOption{pad}{\ekv{device=pad}}
% ----- Math option -----
\newcommand\mailto[1]{\href{mailto:#1}{\nolinkurl{#1}}}
@@ -276,16 +278,24 @@
%% device settings
\RequirePackage{geometry}
\ifdefstring{\ELEGANT@device}{normal}{
\geometry{
a4paper,
% left=27mm, %% or inner=23mm
% right=27mm, %% or outer=18mm
top=25.4mm, bottom=25.4mm,
headheight=2.17cm,
headsep=4mm,
footskip=12mm
}
}}{\relax}
\ifdefstring{\ELEGANT@device}{pad}{
\geometry{
paperwidth=7.5in,
paperheight=10in,
margin=16mm,
headheight=2.17cm,
footskip=4mm
}}{\relax}
\RequirePackage{hyperref}
\hypersetup{
@@ -615,11 +625,17 @@
\def\@logo{\includegraphics[width=4.2cm]{#1}
}
}
\ifdefstring{\ELEGANT@device}{normal}{
\newcommand*{\cover}[1]{
\def\@cover{\includegraphics[width=\linewidth]{#1}
}
}
}}{\relax}
\ifdefstring{\ELEGANT@device}{pad}{
\newcommand*{\cover}[1]{
\def\@cover{\includegraphics[trim=0 26px 0 26px,clip=true, width=\linewidth]{#1}
}
}}{\relax}
\renewcommand{\baselinestretch}{1.35}