Closed Mikachu2333 closed 7 months ago
如果只是想把 \author
和 \date
上移,可以在 \title
内容末尾加 \vspace{-10pt}
之类。
\Huge
, \normalsize
, \large
等命令不接受参数,应该用 {\Huge text}
,而不是 \Huge{text}
eso-pic
可以由 latex2e shipout hooks 代替,见文档 texdoc ltshipout-doc
\title
, \author
, \date
只储存,\maketitle
统一输出。所以在 \title
和 \author
之间用 \bigbreak
有点奇怪。geometry
了,就完全通过它来设置页面布局,不要再手动修改 \headheight
, \topmargin
等参数。完整的页面布局参数列表可以见 https://latexref.xyz/Page-layout-parameters.html 和 layout
宏包的文档。
我替换为了 \usepackage[a4paper, hmargin=1.5cm, vmargin=1cm, headheight=0pt, ignorehead]{geometry}
\documentclass[a4paper,twoside,onecolumn,12pt]{ctexrep}
\usepackage{titlesec,graphicx}
\usepackage[a4paper, hmargin=1.5cm, vmargin=1cm, headheight=0pt, ignorehead]{geometry}
%\setmainfont[BoldFont=Dream Han Serif CN W20]{Dream Han Serif CN W7}
%\setCJKmainfont{Dream Han Serif CN W7}[BoldFont=Dream Han Serif CN W20]
\setlength{\parindent}{1em}
\newcommand\BackgroundPic{%
\parbox{\paperwidth}{%
\centering
\vspace*{300pt}
\includegraphics[width=5cm]{example-image.pdf}%
}
}
\begin{document}
% 添加标题校徽背景图
\AddToHookNext{shipout/background}{\BackgroundPic}
% 题目
\title{%
\normalsize
{\Huge\textbf{山二医入学与生活指南}}\\
(简称:三二一新指南)\\[10pt]
{\large 浮烟山校区专用}\vspace{-30pt}}
\author{LinkChou\thanks{第2.2.3版}\and 山二医校园频道}
\date{\today}
\maketitle
\end{document}
非常感谢您的解答!我正在尝试着对照着您给的范例以及相关文件照虎画猫,现已初步取得成果,谢谢!
另:刚刚入门,正在竭力试图理解shipout hooks的使用方法
检查
编译环境
描述问题
1.希望在标题页插入校徽背景图,同时让原本位于页面正中的标题略微上移
最小工作示例(MWE)
我还做了这些尝试
附件