将 ToC/LoF/LoT 和人物向左移动

将 ToC/LoF/LoT 和人物向左移动

我已使用 将 ToC/LoF/LoT 移至左侧adjustwidth。这是好的解决方案吗?

您知道如何将图形(+标题)向左移动 2 厘米吗?

梅威瑟:

\documentclass[a4paper,12pt]{article}
\usepackage{lipsum}

\usepackage[showframe]{geometry}
\geometry{paper=a4paper}
\geometry{bindingoffset=1.5cm,hmargin={3.5cm,1.5cm},vmargin={1cm,1cm}}
\geometry{includehead=true,headheight=3cm,headsep=1cm}
\geometry{includefoot=false}
\usepackage{changepage}
\usepackage{titlesec}
\usepackage{etoolbox} 
\usepackage{xcolor}
\usepackage{tikz}
\usepackage{background}
\usetikzlibrary{calc}
\usetikzlibrary{positioning}

\SetBgOpacity{100.0}    %% Select opacity
\SetBgScale{1}          %% Select scale factor of logo
\SetBgAngle{0}          %% Select rotation of logo
\SetBgColor{black}      %% Select color
\SetBgContents{
    \begin{tikzpicture}[overlay,remember picture]
    \draw [line width=1pt,rounded corners=0pt]
    ($ (current page.north west) + (2.5cm,-1cm) $)
    rectangle
    ($ (current page.south east) + (-1cm,1cm) $);
    \end{tikzpicture}
}

\titleformat{\section}{\Large\bfseries}{\parbox{2cm}{\thesection}}{-0.5pt}{}
\titleformat{\subsection}{\large\bfseries}{\parbox{2cm}{\thesubsection}}{-0.5pt}{}
\titleformat{\subsubsection}{\normalsize\bfseries}{\parbox{2cm}{\thesubsubsection}}{-0.5pt}{}
\titlespacing*{\section}{-2cm}{0.6cm}{0.6cm}
\titlespacing*{\subsection}{-2cm}{0.4cm}{0.4cm}
\titlespacing*{\subsubsection}{-2cm}{0.2cm}{0.2cm}

\renewcommand{\contentsname}{\hfill \textit{Table of Contents}}     %%Table of contents name change
\renewcommand{\listfigurename}{\hfill \textit{List of Figures}}     %%List of figures name change
\renewcommand{\listtablename}{\hfill \textit{List of Tables}}       %%List of tables name change

\newcommand\tocloflot{%
    \begin{adjustwidth}{-2cm}{}
        \tableofcontents
        \addtocontents{toc}{\hrule height1pt}
        \clearpage
        \csname phantomsection\endcsname
        \listoffigures
        \addtocontents{lof}{\hrule height1pt\par\bigskip}
        \addcontentsline{toc}{section}{List of Figures}
        \clearpage
        \csname phantomsection\endcsname
        \listoftables
        \addtocontents{lot}{\hrule height1pt\par\bigskip}
        \addcontentsline{toc}{section}{List of Tables}
        \clearpage
    \end{adjustwidth}
}

\begin{document}
    \tocloflot
        \section{Section Section Section Section Section Section Section Section Section}
        \lipsum[1]      

        \begin{figure}
            \centering\includegraphics[width=6cm]{example-image}
            \caption{example-image}
            \label{fig:example-image}
        \end{figure}    
        \subsection{Section Section Section Section Section Section Section Section Section Section Section Section Section Section Section Section Section Section}
        \lipsum[1]
        \subsubsection{Section Section Section Section Section Section Section Section Section Section Section Section Section Section Section Section Section Section}
        \lipsum[1]

\end{document}

在此处输入图片描述

相关内容