如何给元素添加边距(章节)

如何给元素添加边距(章节)

我尝试在页面顶部添加一些边距,但没有效果:

请问我该怎么做?

在此处输入图片描述

这里是代码:

\documentclass[12pt, twoside, openany]{book}

 \usepackage{mathptmx} 

 \usepackage[spanish, es-tabla]{babel}
  \usepackage[utf8]{inputenc} 

   \usepackage{graphicx} 
   \graphicspath{ {images/} }
    \usepackage[a4paper,top=30mm,left=30mm,right=25mm,    
    bottom=25mm,headheight=20mm]{geometry} 
    \usepackage{titlesec}
     \usepackage{setspace}
     \usepackage{ragged2e}
     \usepackage{fancyhdr}
     \usepackage{lastpage}
     \usepackage{stackengine}
      \usepackage{array}
     \usepackage{url}
      \usepackage{float}
      \usepackage{hyperref}
      \usepackage{xcolor}
      \usepackage{pdfpages}
      \usepackage{lipsum}
      \input{Configuracion.tex}
      \begin{document}
       \rmfamily % Fuente tipo Romana
       \input{Portada.tex}
       \newpage 
       \large\hspace{-18pt}Chairman of the jury :\\
       \hspace{30pt}protractor:\\
         framing:\\
         \begin{center}
        \centering \large Academic year 2020 / 2021
        \end{center}
         \makeatletter

        %\topmargin=100pt
          introduction 
           \chapter*{Introduction}
            \thispagestyle{plain}
           %\thispagestyle{empty}
             \rfoot{}
             \newpage
              \end{document}

这里是配置

       \definecolor{gris}{RGB}{220,220,220}

        \setcounter{secnumdepth}{3} 

         \addto\captionsspanish{
         \renewcommand{\contentsname}{Índice de contenido}
          \renewcommand{\listfigurename}{Índice de figuras}
          \renewcommand{\listtablename}{Índice de tablas}
           }


           \titleformat{\chapter}[block]
          {\normalfont\Huge\bfseries\singlespacing}{\thechapter.}{1em}{\Huge}
          \titlespacing*{\chapter}{0pt}{-62pt}{0pt}

          \titleformat{\section}[block]
          {\normalfont\large\bfseries}{\thesection.-}{4pt}{\large}
          \titlespacing*{\section}{0pt}{\baselineskip}{0pt}

         \titleformat{\subsection}[block]
         {\normalfont\normalsize\bfseries}{\thesubsection.-}{4pt} 
          {\normalsize}
           \titlespacing*{\subsection}{0pt}{0pt}{0pt}

             \titleformat{\subsubsection}[block]
             {\normalfont\normalsize\bfseries}{\thesubsubsection.-}{4pt} 
             {\normalsize}
            \titlespacing*{\subsubsection}{0pt}{0pt}{0pt}

            \def\tablename{Tabla}


           \fancyhf{}

            \fancyhead[R]{\bfseries{page \thepage \hspace{1pt} of 
            \pageref{LastPage}}}
            \fancyfoot[C]{\thepage}
            \renewcommand{\headrulewidth}{0pt}
            \renewcommand{\footrulewidth}{0.4pt}


             \fancypagestyle{plain}{%
             \fancyhf{}




            \fancyhead[R]{\bfseries{page \thepage \hspace{1pt} of 
           \pageref{LastPage}}}
           \fancyfoot[C]{\thepage}
          \renewcommand{\headrulewidth}{0pt}
          \renewcommand{\footrulewidth}{0.4pt}
          }

          \pagestyle{fancy}
           \pagestyle{plain}
            \restylefloat{table}
  

        

答案1

例如,\titlespacing*{\chapter}{0pt}{150pt}{0pt}%Spacing above = 150pt在上面添加一个正空间。现在你正在 \titlespacing*{\chapter}{0pt}{-62pt}{0pt}使用Configuracion.tex

在此处输入图片描述

相关内容