我如何设置我的小节命令,以便小节 (1) 不编号,并且 (2) 与左边距齐平?(我可以让编号的小节与左边距齐平,但不能让不编号的小节与左边距齐平。)
这是我一直在尝试的。它产生未编号的斜体小节标题,但从边距缩进:
\documentclass[twoside, 11pt]{book}
\usepackage[utf8]{inputenc}
\usepackage{graphicx}
\usepackage{bookman}
\usepackage{microtype}
\usepackage[USenglish]{babel}
\usepackage{sectsty}
\subsectionfont{\normalfont\itshape\raggedright\large}
\renewcommand{\thesubsection}{}
答案1
也许我遗漏了一些东西,但是你为什么不使用计数器secnumdepth
?
梅威瑟:
\documentclass[a4paper]{book}
\usepackage[T1]{fontenc} % unrelated to the question, but recommended
\usepackage{bookman}
\usepackage{sectsty}
\usepackage{lipsum}
\subsectionfont{\normalfont\itshape\large}
\setcounter{secnumdepth}{1}
\begin{document}
\tableofcontents
\chapter{Genesis}\lipsum[1]
\section{Abraham}\lipsum[2]
\subsection{Sarah}
Why is Sarah a sub-section of Abraham?
This is sexism!
\section{Isaac} \lipsum[3]
\section{Jacob} \lipsum[4]
\end{document}