我在制作清单目录时遇到了一些问题。我想将其添加到我的文档(memoir
类)中List of Listings
,但我只能获得与目录中其他图形和表格完全不同的样式。在这里您可以看到“效果”和一段代码。有人能帮帮我吗?非常感谢。
%--------------------------------------------------------------------------------------------------
% PREAMBOLO
%---------------------------------------------------------------------------------------------------
\documentclass[a4paper,11pt,titlepage,twoside,openleft]{memoir}
\usepackage[utf8x]{inputenc}
%---------------------------------------------------------------------------------------------------
% Pacchetti ed impostazioni generali
\usepackage{plain}
\usepackage{setspace}
%--------------------------------------------------------------------
%------------------------- NENA layout ----------------------
% Better page layout for A4 paper, see memoir manual.
\settrimmedsize{297mm}{210mm}{*}
\setlength{\trimtop}{0pt}
\setlength{\trimedge}{\stockwidth}
\addtolength{\trimedge}{-\paperwidth}
\settypeblocksize{634pt}{448.13pt}{*}
\setulmargins{4cm}{*}{*}
\setlrmargins{*}{*}{1.5}
\setmarginnotes{17pt}{51pt}{\onelineskip}
\setheadfoot{\onelineskip}{2\onelineskip}
\setheaderspaces{*}{2\onelineskip}{*}
\checkandfixthelayout
%
\frenchspacing
% Font with math support: New Century Schoolbook
\usepackage{fouriernc}
\usepackage[T1]{fontenc}
% Sets numbering division level
\setsecnumdepth{subsection}
\maxsecnumdepth{subsubsection}
%
\usepackage{float} %Helps to place figures, tables, etc.
%\newfloat{algo}{tbp}{loa}[chapter]
\usepackage{xpatch}
\usepackage{calc,soul,fourier}
\makeatletter
\newlength\dlf@normtxtw
\setlength\dlf@normtxtw{\textwidth}
\newsavebox{\feline@chapter}
\newcommand\feline@chapter@marker[1][4cm]{%
\sbox\feline@chapter{%
\resizebox{!}{#1}{\fboxsep=1pt%
\colorbox{gray}{\color{white}\thechapter}%
}}%
\rotatebox{90}{%
\resizebox{%
\heightof{\usebox{\feline@chapter}}+\depthof{\usebox{\feline@chapter}}}%
{!}{\scshape\so\@chapapp}}\quad%
\raisebox{\depthof{\usebox{\feline@chapter}}}{\usebox{\feline@chapter}}%
}
\newcommand\feline@chm[1][4cm]{%
\sbox\feline@chapter{\feline@chapter@marker[#1]}%
\makebox[0pt][c]{% aka \rlap
\makebox[1cm][r]{\usebox\feline@chapter}%
}}
\makechapterstyle{daleifmodif}{
\renewcommand\chapnamefont{\normalfont\Large\scshape\raggedleft\so}
\renewcommand\chaptitlefont{\normalfont\Large\bfseries\scshape}
\renewcommand\chapternamenum{} \renewcommand\printchaptername{}
\renewcommand\printchapternum{\null\hfill\feline@chm[2.5cm]\par}
\renewcommand\afterchapternum{\par\vskip\midchapskip}
\renewcommand\printchaptertitle[1]{\color{gray}\chaptitlefont\raggedleft ##1\par}
}
\makeatother
\chapterstyle{daleifmodif}
%
% The pages should be numbered consecutively at the bottom centre of the
% page.
\makepagestyle{myvf}
\makeoddfoot{myvf}{}{\thepage}{}
\makeevenfoot{myvf}{}{\thepage}{}
\makeheadrule{myvf}{\textwidth}{\normalrulethickness}
\makeevenhead{myvf}{\small\textsc{\leftmark}}{}{}
\makeoddhead{myvf}{}{}{\small\textsc{\rightmark}}
\pagestyle{myvf}
%
\makeindex
\usepackage{filecontents}
\usepackage[italian]{babel}
%
\usepackage{natbib}
\usepackage{bibentry}
%Formato titolo
\titleformat{\chapter}[hang]
{\normalfont\huge\bfseries}
{\chaptertitlename\ \thechapter:\ }
{0pt}
{\filcenter}
\titlespacing*{\chapter}{0pt}{40pt}{40pt}
\titleformat*{\section}{\Large\bfseries}
\titleformat*{\subsection}{\large\bfseries}
\usepackage{etoolbox}
\makeatletter
\patchcmd{\chapter}{\if@openleft\cleardoublepage\else\clearpage\fi}{\par}{}{}
\makeatother
\usepackage[framed,numbered,autolinebreaks,useliterate]{mcode}
\addto\captionsitalian{%
\renewcommand{\lstlistingname}{Codice}}
%---------------------------------------------------------------------------------------------------
% DOCUMENTO
%---------------------------------------------------------------------------------------------------
\begin{document}
%---------------------------------------------------------------------------------------------------
% Frontespizio
\pagenumbering{gobble}
\input{pagina_iniziale}
\clearpage
%---------------------------------------------------------------------------------------------------
% Se si volesse aggiungere anche elenco tabelle
\newpage
\listoftables
\newpage
\lstlistoflistings
% \newpage
%**********************************************************************
% DEFINIZIONE TITOLI ED INDENTATURE
\titleformat{\chapter}
{\normalfont\huge\bfseries}{\thechapter}{1em}{}
\titlespacing*{\chapter}{0pt}{0in}{0.1in}
\titlespacing*{\section}{0pt}{0.20in}{0.1in}
\titlespacing*{\subsection}{0pt}{0.10in}{0.08in}
\titlespacing*{\paragraph}{5mm}{0.02in}{5mm}
\titlespacing*{\subsubsection}{0pt}{0.02in}{0in}
%---------------------------------------------------------------------------------------------------
% LISTA DEI CAPITOLI
% % \input{Agenda/Agenda}
%---------------------------------------------------------------------------------------------------
\end{document}