实际可以使用leftskip来实现,但是发现图表无法自动在文字区域居中。因此有如下实现代码:
\documentclass{article} \usepackage{lipsum}% http://ctan.org/pkg/lipsum %\usepackage[a4paper,text width=110true mm,text height=224true mm]{geometry} % or \usepackage[a4paper,left=2in,right=1in,top=1in,bottom=1in,height rounded]{geometry} \usepackage{fancyhdr} \pagestyle{fancy} \fancyheadoffset[L]{8em} \usepackage{titlesec} % define section style \titleformat{\section} {\normalfont\Large\bfseries}{\hspace*{-5em}\thesection}{1em}{} \titleformat{\subsection} {\normalfont\large\bfseries}{\hspace*{-6em}\thesubsection}{1em}{} \titleformat{\subsubsection} {\normalfont\normalsize\bfseries}{\hspace*{-6em}\thesubsubsection}{1em}{} \titlespacing*{\section} {0pt}{3.5ex plus 1ex minus .2ex}{2.3ex plus .2ex} \titlespacing*{\subsection} {0pt}{3.25ex plus 1ex minus .2ex}{1.5ex plus .2ex} \titlespacing*{\subsubsection}{0pt}{3.25ex plus 1ex minus .2ex}{1.5ex plus .2ex} \begin{document} \section{First section} \lipsum[1] \begin{figure}[htbp] \centering \rule{4cm}{2cm} \caption{figure}\label{fig:1} \end{figure} \lipsum[2] \subsection{First subsection} \lipsum[2] \subsection{Second subsection} \lipsum[3] \subsection{Third subsection} \lipsum[4] \subsection{Last subsection} \lipsum[5] \section{Second section} \lipsum[1] \subsection{First subsection} \lipsum[2] \subsection{Second subsection} \lipsum[3] \subsection{Third subsection} \lipsum[4] \end{document}
选自:http://tex.stackexchange.com/questions/87994/how-to-indent-the-whole-text-and-float-environment
发表评论 取消回复