我使用经典论文,我想执行以下操作:每个章节应从奇数页开始(双页视图的右侧),左侧页面应显示我选择的图片。
那可能吗?
谢谢
编辑:
使用 classicthesis,这会将标题页放在右页而不是左页:
\documentclass[10pt, a4paper,twoside,openright,titlepage]{scrreprt}
\makeatletter
\newcommand\ChapImage{\huge image page -- should be on the left!}
\newcommand*\Invcleardoublepage{
\clearpage\if@twoside
\ifodd\c@page \null\newpage\if@twocolumn\null%
\newpage\fi\fi\fi
}
\renewcommand\chapter{%
\if@openright
\ifodd\c@page{\clearpage}\else{\Invcleardoublepage}\fi
{
\pagestyle{empty}
\ChapImage
\clearpage
}
\else
\clearpage
\fi
\thispagestyle{\chapterpagestyle}%
\global\@topnum\z@
\@afterindentfalse
\secdef\@chapter\@schapter
}
\makeatother
\usepackage[T1]{fontenc} % la codifica dei font
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{changepage,calc} % per impostare i margini del frontespizio
\usepackage{lipsum} % genera testo fittizio
\usepackage{classicthesis-ldpkg} % carica molti pacchetti utili a ClassicThesis
\usepackage[eulerchapternumbers,% % numeri dei capitoli in Euler
subfig,% % compatibilità con subfig
beramono,% % Bera Mono come font a spaziatura fissa
eulermath,% % AMS Euler come font per la matematica
pdfspacing% % migliora il riempimento di riga con PDFLaTeX
]{classicthesis} % lo stile ClassicThesis
%\usepackage[english]{arsclassica} % modifica alcuni aspetti di ClassicThesis
\begin{document}
\pagestyle{plain}
\begin{titlepage}
\changetext{}{}{}{((\paperwidth - \textwidth) / 2) - \oddsidemargin - \hoffset - 1in}{}
\null\vfill
\large
\sffamily
{Title page}
\vfill
\end{titlepage}
\pagenumbering{roman}
\pagestyle{scrheadings}
\clearpage
\lipsum[1-4]
\clearpage
\setcounter{tocdepth}{2}
\thispagestyle{empty}
\tableofcontents
\markboth{\spacedlowsmallcaps{\contentsname}}{\spacedlowsmallcaps{\contentsname}}
\pagenumbering{arabic}
\chapter{First chapter}
\lipsum[1-10]
\chapter{Second chapter}
\lipsum[1-8]
\chapter{Third chapter}
\lipsum[1-10]
\chapter{Fourth chapter}
\lipsum[1-8]
\end{document}
答案1
基本思想是\chapter
按照相应.cls
文件中的定义重新定义。我使用了scrbook.cls
,但所需的修改很清楚予以适当修改对于其他类别)。为了保证所有章节都从奇数页开始,并且图像在章节开始之前包含在(偶数)页中,我使用了一个辅助命令,\Invcleardoublepage
它充当“逆”命令\cleardoublepage
:它会刷新所有材料并开始一个新页面,但从新的偶数页开始。
最后,在包的帮助下,xparse
我定义了一个\MyChapter
命令,它有一个可选参数(目录的条目)和两个强制参数(章节的标题和要使用的图像的名称)。
\documentclass[11pt,a5paper,footinclude=true,headinclude=true]{scrbook}
\usepackage{xparse}
\usepackage{lipsum}
\usepackage[linedheaders]{classicthesis}
\usepackage{graphicx}
\newcommand\ChapImage{}
\makeatletter
% A command that acts as an "inverse" cleardoublepage:
% flush all material and start a new page, start new even numbered page
\newcommand*\Invcleardoublepage{\clearpage\if@twoside
\ifodd\c@page \null\newpage\if@twocolumn\null%
\newpage\fi\fi\fi
}
\renewcommand\chapter{%
\if@openright
\ifodd\c@page\clearpage\else\Invcleardoublepage\fi% NEW
\thispagestyle{empty}\ChapImage\clearpage
\else\clearpage
\fi
\thispagestyle{\chapterpagestyle}%
\global\@topnum\z@
\@afterindentfalse
\secdef\@chapter\@schapter
}
\makeatother
\DeclareDocumentCommand\MyChapter{omm}{%
\renewcommand\ChapImage{\includegraphics[width=.95\textwidth,height=.95\textheight]{#3}}
\IfNoValueTF{#1}
{\chapter{#2}}{\chapter[#1]{#2}}
}
\begin{document}
\tableofcontents
\MyChapter[Entry in ToC]{Test Chapter with an Image}{image1}
\lipsum[1-3]
\MyChapter{Another Test Chapter with another Image}{image3}
\lipsum[1-3]
\end{document}
我使用了demo
选项graphicx
使我的例子可供所有人编译,请执行不是在实际代码中使用该选项。
scrbook
如果文档使用 \part,则还应在序言中添加以下重新定义(如果类不是,则添加类似的定义):
\renewcommand\part{%
\if@openright
\ifodd\c@page\clearpage\else\Invcleardoublepage\fi% NEW
\else\clearpage
\fi
\thispagestyle{\partpagestyle}%
\if@twocolumn
\onecolumn
\@tempswatrue
\else
\@tempswafalse
\fi
\partheadstartvskip
\vbox to\z@{\vss\use@preamble{part@o}\strut\par}%
\vskip-\baselineskip\nobreak%
\secdef\@part\@spart
}
答案2
我将定义一个命令来调用图像和章节,
\documentclass[oneside]{book}
\usepackage[demo]{graphicx}
\usepackage{lipsum}
\pagestyle{empty}
\makeatletter
\def\chapter{\clearpage\thispagestyle{plain}\global\@topnum
\z@\@afterindentfalse
\secdef\@chapter\@schapter
}
\makeatother
\title{My Picture Chapters}
\begin{document}
\maketitle
\newcommand{\chapterwithpic}[3][]{%
\includegraphics[width=1.2\textwidth]{./graphics/#3}
\chapter[#1]{#2}
}
\chapterwithpic[option]{Amato}{pic}
\lipsum
\end{document}