我正在使用 memoir 类和 pedersen 样式创建文档。在我的文档中,主要是纵向的,我必须以横向显示一些图表。不幸的是,其中一页也是章节标题。现在通常这不会是个问题,但我的文档有页眉和页脚。结果发生了以下情况:
\documentclass[12pt,a4paper,oneside]{memoir}
\usepackage[left=3.00cm, right=3.00cm, top=3.00cm, bottom=3.00cm, a4paper]{geometry}
\usepackage{pdflscape,blindtext,graphicx,xcolor}
%Defining a colour %
\definecolor{ared}{HTML}{BF0000}
\renewcommand\colorchapnum{\color{ared}}
\renewcommand\colorchaptitle{\color{ared}}
\chapterstyle{pedersen}
%The header of the document %
\makeevenhead{plain}{MyName}{Document Title}{Date}
\makeheadrule{plain}{\textwidth}{1pt}
\makeoddhead{plain}{MyName}{Document Title}{Date}
\begin{document}
\Blindtext
\pagebreak
\begin{landscape}
\chapter{Chapter Name}
\Blindtext
\end{landscape}
\end{document}
有没有办法可以暂时重新定位章节编号,以便它只影响此页面或我设置为横向的页面?
提前致谢
答案1
我不会改变章节标题本身的样式,而是保持页面样式不变 --- 切换章节样式对我来说似乎很奇怪。
相反,我会让图表浮动到另一页或者仅仅旋转标题页上的图表,而不旋转页面本身。
例如,让图表浮动到下一页:
我认为这不是一种选择,否则你一开始就应该避免将图表放在标题页上。在这种情况下,我会单独旋转图表:
该rotating
包可以管理旋转。caption
可以为非浮动情况提供标题。(但如果memoir
提供了其中任何一种功能,最好使用这些功能而不是其他包。我只是对这个类不太熟悉。)
\documentclass[12pt,a4paper,oneside]{memoir}
\usepackage[left=3.00cm, right=3.00cm, top=3.00cm, bottom=3.00cm]{geometry}
\usepackage{blindtext,rotating,xcolor,caption}
\usepackage{graphicx}
%Defining a colour %
\definecolor{ared}{HTML}{BF0000}
\renewcommand\colorchapnum{\color{ared}}
\renewcommand\colorchaptitle{\color{ared}}
\chapterstyle{pedersen}
%The header of the document %
\makeevenhead{plain}{MyName}{Document Title}{Date}
\makeheadrule{plain}{\textwidth}{1pt}
\makeoddhead{plain}{MyName}{Document Title}{Date}
\begin{document}
\Blindtext
\chapter{Chapter Name}
\begin{sidewaysfigure}
\includegraphics[width=\textheight, keepaspectratio=false]{example-image-a}
\caption{Image}
\end{sidewaysfigure}
\Blindtext
\chapter{Chapter Name}
\begin{center}
\begin{sideways}
\includegraphics[width=.825\textheight, keepaspectratio=false]{example-image-b}
\end{sideways}
\captionof{figure}{Another}
\end{center}
\Blindtext
\end{document}
答案2
我会创造一种‘特殊’的pedersen
风格并使用它。
\documentclass[12pt,a4paper,oneside]{memoir}
\usepackage[left=3.00cm, right=3.00cm, top=3.00cm, bottom=3.00cm, a4paper]{geometry}
\usepackage{pdflscape,blindtext,graphicx,xcolor}
%Defining a colour %
\definecolor{ared}{HTML}{BF0000}
\renewcommand\colorchapnum{\color{ared}}
\renewcommand\colorchaptitle{\color{ared}}
\makechapterstyle{mypedersen}{% <-- definition of `pedersen` from memoir.cls
\chapterstyle{default}
\setlength{\beforechapskip}{-20pt}
\setlength{\afterchapskip}{10pt}
\renewcommand*{\chapnamefont}{\normalfont\LARGE\itshape}
\renewcommand*{\chapnumfont}{\normalfont\HUGE\itshape\colorchapnum}
\renewcommand*{\chaptitlefont}{\normalfont\huge\itshape\colorchaptitle}
\renewcommand*{\afterchapternum}{}
\renewcommand*{\printchaptername}{}
\setlength{\midchapskip}{20mm}% was \numberheight
\renewcommand*{\chapternamenum}{}
\renewcommand*{\printchapternum}{%
\sidebar{%
\hspace*{-48pt}% <-- added
\raisebox{0pt}[0pt][0pt]{\makebox[0pt][l]{%
\resizebox{!}{\midchapskip}{\chapnumfont\thechapter}}}}}%
\renewcommand*{\printchaptertitle}[1]{\chaptitlefont ##1}}
\chapterstyle{pedersen}
%The header of the document %
\makeevenhead{plain}{MyName}{Document Title}{Date}
\makeheadrule{plain}{\textwidth}{1pt}
\makeoddhead{plain}{MyName}{Document Title}{Date}
\begin{document}
\Blindtext
\pagebreak
\begin{landscape}
\chapterstyle{mypedersen}% <-- switch to the modified style
\chapter{Chapter Name}
\Blindtext
\end{landscape}
% strictly speaking, the next line isn't needed because the previous \chaptersytle command is in a group; but it is sometimes helpful to be reminded of what you are doing!
\chapterstyle{pedersen}% <-- switch back to normal;
\chapter{Chapter Name}
\Blindtext
\end{document}