这是我从一开始的文档:
\documentclass[11pt, openany]{exam}
\usepackage[utf8]{inputenc}
\usepackage[a4paper, margin=1in]{geometry}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage{tikz-cd}
\usepackage{makecell}
\usepackage{mathtools}
\usepackage{commath}
\usepackage{bbm}
\usetikzlibrary{babel}
\usetikzlibrary{shapes.geometric}
\usepackage{amsmath,amsfonts,amssymb}
\usepackage{amsthm}
\usepackage{graphicx}
\usepackage{setspace}
\usepackage{lipsum}
\usepackage{titlesec}
\usepackage{circledsteps}
\usepackage{ relsize, stackengine}
\usepackage[all,cmtip]{xy}
\usepackage[english]{babel}
\usepackage{xurl}
\usepackage{stmaryrd}
\usepackage[backend=biber,style=alphabetic,sorting=ynt]{biblatex}
\usepackage[nottoc,notlot,notlof]{tocbibind}
\usetikzlibrary{intersections}
\newtheorem{theorem}{Theorem}
\newtheorem{prop}{Proposition}
\theoremstyle{definition}
\newtheorem{definition}{Definition}
\newtheorem{example}{Example}
\newtheorem{cor}{Corollary}
\newtheorem{question}{Question}
\usepackage[nottoc]{tocbibind} % For adding List of Tables and List of Figures to Table of Contents
\usepackage[titles]{tocloft}
\makeatletter
\def\ps@headings{%
\def\@oddfoot{\normalfont\hfil\thepage\hfil}%
\def\@evenfoot{\normalfont\hfil\thepage\hfil}}
\def\@evenhead{\hfil\slshape\leftmark}%
\def\@oddhead{{\slshape\rightmark}\hfil%
\let\@mkboth\markboth
\def\chaptermark##1{%
\markboth {\MakeUppercase{%
\ifnum \c@secnumdepth >\m@ne
\if@mainmatter
\@chapapp\ \thechapter. \ %
\fi
\fi
##1}}{}}%
\def\sectionmark##1{%
\markright {\MakeUppercase{%
\ifnum \c@secnumdepth >\z@
\thesection. \ %
\fi
##1}}}}
\makeatother
\pagestyle{headings}% apply new definitions
\begin{document}
\newgeometry{top=1.5in,hmargin=1in, bottom = 2 in}
\pagenumbering{gobble}
\Large
\begin{center}
Assignment 1 \\
%\vspace{2\baselineskip}
\hspace{10pt}
% Author names and affiliations
\large
Josef, \\
Sept. 13, 2021.
\end{center}
\date{September 2021}
\lipsum[1]
\begin{question}
$\quad$
\lipsum[1]
\end{question}
\end{document}
但我需要将问题的陈述变为斜体,有人可以帮我调整代码来实现这一点吗?
有人能帮我纠正一下吗?
答案1
这个单词问题以及斜体文本。我维护了这些包,以检查与该类的加载不兼容性exam
。
该\qformat{...}
命令\renewcommand{\questionshook}{...}
让您控制问题的风格。
% !TeX TS-program = pdflatex
\documentclass[11pt,addpoints]{exam}
\usepackage[utf8]{inputenc}
\usepackage[a4paper, margin=1in]{geometry}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage{lipsum}
\usepackage{tikz-cd}
\usetikzlibrary{babel}
\usetikzlibrary{shapes.geometric}
\usetikzlibrary{intersections}
\usepackage{makecell}
\usepackage{mathtools}
\usepackage{commath}
\usepackage{bbm}
\usepackage{amsmath,amsfonts,amssymb}
\usepackage{amsthm}
\usepackage{graphicx}
\usepackage{setspace}
\usepackage{titlesec}
\usepackage{circledsteps}
\usepackage{ relsize, stackengine}
\usepackage[all,cmtip]{xy}
\usepackage[english]{babel}
\usepackage{xurl}
\usepackage{stmaryrd}
\usepackage[backend=biber,style=alphabetic,sorting=ynt]{biblatex}
\usepackage[nottoc,notlot,notlof]{tocbibind}
\newtheorem{theorem}{Theorem}
\newtheorem{prop}{Proposition}
\theoremstyle{definition}
\newtheorem{definition}{Definition}
\newtheorem{example}{Example}
\newtheorem{cor}{Corollary}
%%%\newtheorem{question}{Question} %<<<<<<<<<<<<<<
\usepackage[nottoc]{tocbibind} % For adding List of Tables and List of Figures to Table of Contents
\usepackage[titles]{tocloft}
\makeatletter
\def\ps@headings{%
\def\@oddfoot{\normalfont\hfil\thepage\hfil}%
\def\@evenfoot{\normalfont\hfil\thepage\hfil}}
\def\@evenhead{\hfil\slshape\leftmark}%
\def\@oddhead{{\slshape\rightmark}\hfil%
\let\@mkboth\markboth
\def\chaptermark##1{%
\markboth {\MakeUppercase{%
\ifnum \c@secnumdepth >\m@ne
\if@mainmatter
\@chapapp\ \thechapter. \ %
\fi
\fi
##1}}{}}%
\def\sectionmark##1{%
\markright {\MakeUppercase{%
\ifnum \c@secnumdepth >\z@
\thesection. \ %
\fi
##1}}}}
\makeatother
\pagestyle{headings}% apply new definitions
\qformat{\normalfont \bfseries Question \thequestion \hfill}% added<<<<<<<<<<<<
\renewcommand{\questionshook}{\itshape}% added <<<<<<<<<<<<
\begin{document}
\newgeometry{top=1.5in,hmargin=1in, bottom = 2 in}
\thispagestyle{empty}
\begin{center}
\Large
Assignment 1 \\
%\vspace{2\baselineskip}
\hspace{10pt}
% Author names and affiliations
\large
Josef, \\ \bigskip
\today
\end{center}
\lipsum[1]
\newpage
\begin{questions}
\question
\lipsum[1]
\question
How much wood would a woodchuck chuck if a woodchuck could chuck
wood?
\question Compute $\displaystyle\int_0^1 x^2 \, dx$.
\end{questions}
\end{document}