我正在为考试班的学生准备一本多项选择题试卷。这本书涵盖了几个不同的主题,所以我想在每个主题的开头添加章节名称。正如你在我的 MWE 中看到的,它符合要求,没有任何错误,但\titlesec
不要修改章节名称,它只会写出章节名称。你能在这里解决这个问题吗?
妇女权利委员会:
\documentclass[11pt]{exam}
\usepackage{lipsum}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{pgf}
\usepackage{multicol}
\usepackage{amsmath}
\usepackage{color}
\usepackage{mdframed}
\footer{}{\thepage}{}
\usepackage[top=1in, bottom=1.25in, left=0.8in, right=0.8in]{geometry}
\usepackage{xcolor}
\usepackage{titlesec}
\usepackage{hyperref}
\usepackage{graphicx}
\usepackage[percent]{overpic}
\usepackage{fix-cm}
\newcommand\ctformatchapter[1]{%
\parbox[b][6cm][b]{\dimexpr.5\textwidth\relax}{%
\raggedright%
\textcolor{cyan!50!blue}{\textsf{#1}}%
}%
}
\titleformat{\chapter}[display]%
{\fontsize{20pt}{20pt}\bfseries\selectfont}%
{%
\raggedleft{%
\begin{overpic}[width=0.5\textwidth]{Untitled.png}
\put (38,22) {{\fontsize{50pt}{50pt}\selectfont\textsf{\Roman{chapter}}}}
\put (20,50) {\textcolor{cyan!50!blue}{\textsf{Chapter}}}
\end{overpic}
}%
}%
{-6.5cm}%
{\ctformatchapter}%
[\phantomsection]
\begin{document}
\chapter{Introduction}
\begin{multicols}{2}
\lipsum[1-5]
\end{multicols}
\end{document}
提前致谢,
干杯。
答案1
文章类别,因此考试,不支持\chapter
。
\documentclass[11pt]{exam}
\usepackage{lipsum}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{pgf}
\usepackage{multicol}
\usepackage{amsmath}
\usepackage{color}
\usepackage{mdframed}
\footer{}{\thepage}{}
\usepackage[top=1in, bottom=1.25in, left=0.8in, right=0.8in]{geometry}
\usepackage{xcolor}
\usepackage{titlesec}
\usepackage{hyperref}
\usepackage{graphicx}
\usepackage[percent]{overpic}
\usepackage{fix-cm}
\newcommand\ctformatsection[1]{%
\parbox[b][6cm][b]{\dimexpr.5\textwidth\relax}{%
\raggedright%
\textcolor{cyan!50!blue}{\textsf{#1}}%
}%
}
\titleformat{\section}[display]%
{\fontsize{20pt}{20pt}\bfseries\selectfont}%
{%
\raggedleft{%
\begin{overpic}[width=0.5\textwidth]{example-image}
\put (38,22) {{\fontsize{50pt}{50pt}\selectfont\textsf{\Roman{section}}}}
\put (20,50) {\textcolor{cyan!50!blue}{\textsf{Chapter}}}
\end{overpic}
}%
}%
{-6.5cm}%
{\ctformatsection}%
[\phantomsection]
\begin{document}
\section{Introduction}
\begin{multicols}{2}
\lipsum[1-5]
\end{multicols}
\end{document}