修改书籍类的回忆录代码

修改书籍类的回忆录代码

我看到了这段漂亮的代码:修改节、小节和小小节样式,并尝试以bookClass 的形式实现它,但是发现很难做到这一点。

我在documentclassMemoir 中的代码是:

\documentclass[oneside,spanish,10pt, letterpaper]{memoir}
\usepackage[applemac]{inputenc}
\usepackage{tikz}
\usepackage{anysize}
\marginsize{3cm}{2cm}{2cm}{2cm}
\usepackage[siunitx,european,americanresistors]{circuitikz}
\definecolor{logo}{HTML}{6C17A1}
\definecolor{logo2}{HTML}{FFFF10}
\definecolor{verde1}{RGB}{78,97,40}
\definecolor{verde2}{RGB}{155,187,89}
\definecolor{verde3}{RGB}{214,227,188}

\usepackage{color} 
\def\sectionfont{\sffamily\bfseries\LARGE}

\setcounter{secnumdepth}{4}% to number subsubsections

% SECTIONS
\makeatletter
\setsecheadstyle{\tikz{\fill[verde1](4,-1) rectangle (0,-2);
\node[inner sep=0pt,outer sep=0pt,text=verde3,scale=1,font=\sectionfont]  at (3.2,-1.5)    {\thesection};}\vskip-6ex\sectionfont\color{verde1}}

\def\@seccntformat#1{\hskip10em}
\makeatother

\setbeforesecskip{-1\onelineskip}
\setaftersecskip{2\onelineskip}

% SUBSECTIONS
\setsubsecheadstyle{\tikz{\fill[verde2](1.2,-3) rectangle (1.7,-4);
\fill[verde2](1.2,-3.95) rectangle (14,-4);
\node[inner sep=0pt,outer sep=0pt,text=verde1,scale=1,font=\sectionfont]  at (.5,-3.5)  {\textbf{\thesubsection}};
\draw[color = verde2] (13.99,-4) node [ground] {};}\vskip-9ex\hskip-4em\sffamily\color{verde1}
}

\setbeforesubsecskip{-1\onelineskip}
\setaftersubsecskip{3\onelineskip}

% SUBSUBSECTIONS
\setsubsubsecheadstyle{\tikz{\fill[verde3](1.7,-5) rectangle (2.2,-6);
\fill[verde3](1.7,-5.95) rectangle (12,-6);
\node[inner sep=0pt,outer sep=0pt,text=verde1,scale=1,font=\sectionfont]  at (.9,-5.5){\thesubsubsection};
\draw[color = verde3] (11.99,-6) node [ground] {};}\vskip-9ex\hskip-3em\sffamily\color{verde1}
}

\setbeforesubsubsecskip{-1\onelineskip}
\setaftersubsubsecskip{3\onelineskip}

\usepackage{lipsum}


\begin{document}
\chapter{A chapter title}
lsdakdasd
amdnad
\section{Some text}
alksdmkald kjasdkasnd jabnsdjsa
\subsection{Some text}
asldald  ajsdbajsd jabsdad jabsdnsad
lkasdskjad
kajsdnasjkd

\subsubsection{Some text}
kjanjkasd ljasndas dljkansdasd kjnasd

\chapter{Another chapter title}
\section{Some text}
\subsection{Some text}
\subsubsection{Some text}

\end{document}

但我想申请:

\documentclass[letterpage, twoside,12pt,final]{book}


\usepackage{fourier}% change to lmodern if fourier is no available
\usepackage{tikz}
\usepackage[explicit]{titlesec}
\usepackage[utf8]{inputenc}
\usepackage{graphicx}

\definecolor{verde}{RGB}{58,77,20}
\definecolor{verde0}{RGB}{28,67,10}
\definecolor{verde1}{RGB}{78,97,40}
\definecolor{verde2}{RGB}{155,187,89}
\definecolor{verde3}{RGB}{214,227,188}
\textwidth=17cm
%----------------------------------------------------------
%FUENTES
%----------------------------------------------------------

\usepackage{times} % Use the Times font for headings
\usepackage{mathptmx} % Use the Adobe Times Roman as the default text font together with math symbols from the Sym­bol, Chancery and Com­puter Modern fonts

\usepackage{microtype} % Slightly tweak font spacing for aesthetics
\usepackage[utf8]{inputenc} % Required for including letters with accents
\usepackage[T1]{fontenc} % Use 8-b
\usepackage{lettrine}
%usepackage{palatino} \usepackage{type1ec}
\usepackage{lmodern} \usepackage{type1cm}


%----------------------------------------------------------
%PARTE
%----------------------------------------------------------
\newpage{}
\thispagestyle{empty}
\renewcommand\thepart{\Roman{part}}

\newcommand\partnumfont{% font specification for the number
    \fontsize{380}{180}\color{verde2}\selectfont%
}

\newcommand\partnamefont{% font specification for the name "PART"
    \normalfont\color{white}\scshape\small\bfseries 
}
\newpage\thispagestyle{empty}
\titleformat{\part}
{\normalfont\huge\filleft}
{}
{20pt}
{\begin{tikzpicture}[remember picture,overlay]
    \fill[verde3] 
    (current page.north west) rectangle ([yshift=-13cm]current page.north east);   
    \node[
    fill=verde1,
    text width=2\paperwidth,
    rounded corners=6cm,
    text depth=18cm,
    anchor=center,
    inner sep=0pt] at (current page.north east) (parttop)
    {\thepart};%
    \node[
    anchor=south east,
    inner sep=0pt,
    outer sep=0pt] (partnum) at ([xshift=-20pt]parttop.south) 
    {\partnumfont\thepart};
    \node[
    anchor=south,
    inner sep=0pt] (partname) at ([yshift=2pt]partnum.south)   
    {\partnamefont PARTE};
    \node[
    anchor=north east,
    align=right,
    inner xsep=-40pt] at ([yshift=-0.5cm]partname.east|-partnum.south) 
    {\parbox{.7\textwidth}{\raggedleft#1}};
    \end{tikzpicture}%
    \thispagestyle{empty}
}


%----------------------------------------------------------
%CAPITULO
%----------------------------------------------------------
\usepackage{titlesec}
\usepackage{tikz}
\usetikzlibrary{calc}
\usepackage{textpos}
\usepackage{calc}
%\usepackage[spanish]{babel}
\usepackage[T1]{fontenc}
\usepackage{times}


\DeclareFixedFont{\chapternumberfont}{T1}{ppl}{}{}{1.5in}
\newcommand*\chapterlabel{}
{\gdef\chapterlabel{}
    \Huge\bfseries\sffamily\color{white}}
\renewcommand{\chapterlabel}{\Huge\bfseries\rmfamily\color{verde3}\underline} 
\setlength{\fboxrule}{1mm}
%
\titleformat{\chapter}[display]{\Huge\bfseries\sffamily\color{white}}
{
    \thispagestyle{empty}
    \begin{tikzpicture}[overlay, remember picture]
    \path let \p1 = (current page.west), \p2 = (current page.east) in
    node[minimum width=\x2-\x1, minimum height=6cm, rectangle, fill=verde3!50, anchor=north west, align=left, text width=\x2-\x1] at ($(current page.north west)$){};
    %
    \path let \p1 = (current page.west), \p2 = (current page.east) in
    node[minimum width=\x2-\x1, minimum height=5cm, rectangle, fill=verde1, anchor=north west, align=left, text width=\x2-\x1] at ($(current page.north west)$) {
        \begin{textblock*}{5in}(\dimexpr\x2-4.5in,\dimexpr0.25\headheight-1in)
        \tikz \node [white,text width=2in, align=right, font=\sffamily]             {\raisebox{50pt}{{\large\color{verde2} \chaptertitlename}} \raisebox{-12pt}{\chapternumberfont \fbox\thechapter}};
        \end{textblock*}
    };
    \end{tikzpicture}
    \vspace{-5.5cm}
    {\chapterlabel{}}
}{-1.75in}{}[\vspace*{1in}]

%----------------------------------------------------------
%SECCIÓN
%----------------------------------------------------------
\usepackage{xcolor}
\def\chpcolor{verde2}
\def\chpcolortxt{black}
\def\sectionfont{\rmfamily\LARGE}

\setcounter{secnumdepth}{4}

\makeatletter
%Section:
\def\@sectionstrut{\vrule\@width\z@\@height12.5\p@}
\def\@makesectionhead#1{%
    {\par\vspace{20pt}%
        \parindent 0pt\raggedleft\sectionfont
        \colorbox{\chpcolortxt}{%
            \parbox[t]{60pt}{\color{white}\@sectionstrut\@depth4.5\p@\hfill
                \ifnum\c@secnumdepth>\z@\thesection\fi}%
        }%
        \begin{minipage}[t]{\dimexpr\textwidth-60pt-2\fboxsep\relax}
            \color{\chpcolortxt}\@sectionstrut\hspace{5pt}#1

        \end{minipage}\par
        \vspace{10pt}%
    }
}
\def\section{\@afterindentfalse\secdef\@section\@ssection}
\def\@section[#1]#2{%
    \ifnum\c@secnumdepth>\m@ne
    \refstepcounter{section}%
    \addcontentsline{toc}{section}{\protect\numberline{\thesection}#1}%
    \else
    \phantomsection
    \addcontentsline{toc}{section}{#1}%
    \fi
    \sectionmark{#1}%
    \if@twocolumn
    \@topnewpage[\@makesectionhead{#2}]%
    \else
    \@makesectionhead{#2}\@afterheading
    \fi
}
\def\@ssection#1{%
    \if@twocolumn
    \@topnewpage[\@makesectionhead{#1}]%
    \else
    \@makesectionhead{#1}\@afterheading
    \fi
}
\makeatother


\titleformat{\subsection}
{\normalfont\Large\bfseries}{\colorbox{verde0}\thesubsection}{1em}{\textcolor{verde0}{#1}}
\titleformat{\subsubsection}
{\normalfont\large\bfseries}{\colorbox{verde1}\thesubsubsection}{1em}{\textcolor{verde1}{#1}}
\titleformat{\paragraph}
{\normalfont\normalsize\bfseries\textcolor{black}{#1}}
\titleformat{\subparagraph}
{\normalfont\normalsize\bfseries\textcolor{black}{#1}}

%----------------------------------------------------------
%ENUMERACION
%----------------------------------------------------------
\newcounter{local}\renewcommand{\labelenumi}
{\setcounter{local}{171+\value{enumi}}%
    \ding{\value{local}}}

%----------------------------------------------------------
%DOCUMENTO
%----------------------------------------------------------

\begin{document}
    \newpage\thispagestyle{empty}\cleardoublepage  
    \begin{minipage}[c][0.1\textheight][c]{0.2\textwidth}
        \begin{center}
            %\includegraphics[width=2cm, height=2cm]{imagenes/escudo2}
        \end{center}
    \end{minipage}
    \begin{minipage}[c][0.1\textheight][t]{0.65\textwidth}
        \begin{center}
            {\scshape Universidad Nacional Aut\'onoma de M\'exico}
            \vspace{.3cm}
            \hrule height2.5pt
            \vspace{.1cm}
            \hrule height1pt
            \vspace{.3cm}
            {\scshape  Facultad de Ciencias}
        \end{center}
    \end{minipage}

    \begin{minipage}[c][0.6\textheight][t]{0.2\textwidth}
        \begin{center}
            \hskip2pt
            \vrule width2.5pt height10cm
            \hskip1mm
            \vrule width1pt height10cm \\
            %\begin{figure}
            %%\includegraphics[height=3cm]{imagenes/escudo}
            %\caption{}
            %\label{fig:escudo}
            %\end{figure}
        \end{center}
    \end{minipage}
    \begin{minipage}[c][0.6\textheight][t]{0.65\textwidth}
        \begin{center}
            {\Large \scshape {T\'itulo de la tesis}}

            \vspace{2cm}

            \makebox[5cm][c]{\LARGE TESIS}  \\[8pt]
            QUE PARA OBTENER EL T\'iTULO DE:\\[5pt]
            {\large \textbf{{t\'itulo}}}\\[40pt]            
            PRESENTA:\\[5pt]
            \textbf{{Nombre del tesista}}

            \vspace{1cm}

            {\small DIRECTOR DEL TRABAJO:\\ {Nombre del director del trabajo}}

            \vspace{0.5cm}

            {Lugar,}{ }{Fecha}
        \end{center}
    \end{minipage}
    \thispagestyle{empty}\cleardoublepage 

    %----------------------------------------------------------------------------------------
    %   COPYRIGHT PAGE
    %----------------------------------------------------------------------------------------

    \newpage\thispagestyle{empty}\cleardoublepage 
    ~\vfill
    \thispagestyle{empty}

    \begin{figure}
        \includegraphics[height=6cm]{imagenes/Escudo_UD}
        %\caption{}
        \label{fig:Escudo_UD}
    \end{figure}
    \noindent \\\\Derechos de autor 2015 ]Nidia Esperanza Ochoa Q. % Copyright notice

    \noindent \textsc{Universidad Distrital Francisco José de Caldas} % Publisher

    %\noindent \textsc{book-website.com}\\ % URL

    %\noindent Licensed under the Creative Commons Attribution-NonCommercial 3.0 Unported License (the ``License''). You may not use this file except in compliance with the License. You may obtain a copy of the License at \url{http://creativecommons.org/licenses/by-nc/3.0}. Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an \textsc{``as is'' basis, without warranties or conditions of any kind}, either express or implied. See the License for the specific language governing permissions and limitations under the License.\\ % License information

    \noindent \textit{Julio de 2015} % Printing/edition date


    %----------------------------------------------------------------------------------------
    %   DEDICATORIA
    %----------------------------------------------------------------------------------------
    \newpage\thispagestyle{empty}\cleardoublepage 
    \vspace*{3cm}
    \begin{flushright}
        \thispagestyle{empty}

        \textsl{To my charming prince\\} 
        \setlength{\parskip}{8mm}

    \end{flushright}
    \vspace*{\fill}


    %----------------------------------------------------------------------------------------
    %   AGRADECIMIENTOS
    %----------------------------------------------------------------------------------------
    \newpage\thispagestyle{empty}\cleardoublepage 
    \pagestyle{empty} % No headers
    \vspace*{3cm}
    \noindent
    \title{Agradecimientos}\textcolor{verde1}{\Huge Agradecimientos}\\
    \textcolor{verde3}{\rule{58mm}{0.8mm}}
    %Escribir los agradecimeintos
    \\\\
    A la Universidad y los profesores
    \vspace*{\fill}

    %   ABSTRACT
    %----------------------------------------------------------------------------------------
    \newpage\thispagestyle{empty}\cleardoublepage 
    \pagestyle{empty} % No headers
    \vspace*{3cm}
    \noindent
    \title{Resumen}\textcolor{verde1}{\Huge Resumen}
    \\
    \textcolor{verde2}{\rule{33mm}{0.8mm}}
    \\\\
    Escribir resumen


    \vspace*{\fill}

    \newpage\thispagestyle{empty}\cleardoublepage 
    \pagestyle{empty} % No headers
    \vspace*{3cm}
    \noindent
    \title{Abstract}\textcolor{verde1}{\Huge Abstract}
    \\
    \textcolor{verde1}{\rule{30mm}{0.8mm}}
    \\\\
    Write abstract
    \vspace*{\fill}

    \newpage\thispagestyle{empty}\cleardoublepage 
    \pagestyle{empty} % No headers
    \vspace*{3cm}
    \noindent
    \title{Abreviaturas y Siglas}\textcolor{verde1}{\Huge Abreviaturas y Siglas}\index{Abreviaturas}
    \\
    \textcolor{verde1}{\rule{75mm}{0.8mm}}
    \\\\
    Tabla de siglas
    \vspace*{\fill}


    \newpage\thispagestyle{empty}\cleardoublepage 
    \pagestyle{empty} % No headers
    \vspace*{1cm}
    \noindent
    \begin{center}
        \textcolor{verde2}{\rule{30mm}{1mm}}\\
        \vspace*{0.4cm}
        \title{Introducción}\textcolor{verde1}{\Huge Introducción}\index{Introducción}
        \\
        \textcolor{verde2}{\rule{30mm}{1mm}}
    \end{center}

%       \normalfont\normalsize\textcolor{black}{
        \lettrine{P}{hD Universal Languages } es una comunidad académica que busca la universalidad del conocimiento de los idiomas, basados en el continuo ejercicio de la libertad, tanto de cátedra como de horarios, lugar de desarrollo de actividades, e iniciativas propias del estudiante, así como la constante investigación y desarrollo de técnicas y herramientas que permitan un característico perfil del académico, que le ayudarán a desarrollar competencias de carácter individual y colectivas, enfocadas hacia las necesidades globales de una sociedad; por eso la institucionalidad de la escuela, estará en constante comunión con el Marco Común Europeo de Referencia para la enseñanza de idiomas.\\\\
Esta empresa presenta al mercado una propuesta innovadora tanto en la forma como el contenido que plantea y continuamente esta incoporando las tecnologías de la información en la enseñanza y evaluación en la suficiencia de una segunda lengua.\\\\
Dentro de su propuesta y cadena de valor se busca continuamente el mejoramiento continuo de sus procesos y de la entidad como tal, por ello para optimizar y estar continuamente innovando se requiere del conocimiento de la empresa, así como de herramientos que coadyuden con este fin.\\\\
Lo anterior ahonado a que sus  estrategias  no está integrada a los datos, aplicaciones, principios, visión y la organización en sí, afectando de esta manera su competitividad.
    %   }%}Escribir introducción
    \vspace*{\fill}


    %-----------------------------------------------------
    %-----------------------------------------------------
    %-----------------------------------------------------
    %-----------------------------------------------------

    \part{\textbf{\textcolor{verde1}{Descripción del Problema y Conceptualización}}}
    %-----------------------------------------------------
    %-----------------------------------------------------

    \newpage\thispagestyle{empty}\cleardoublepage 
    \chapter{Planteamiento del problema}\chapterlabel{Planteamiento del problema}\index{Introducción}
    \vspace{2cm}
    {\normalfont\normalsize\textcolor{black}{
    \lettrine{L}{a Cámara de Calzado, Cuero, Marroquinería y afines de Bogotá D.C.} es una comunidad académica que busca la universalidad del conocimiento de los idiomas, basados en el continuo ejercicio de la libertad, tanto de cátedra como de horarios, lugar de desarrollo de actividades, e iniciativas propias del estudiante, así como la constante investigación y desarrollo de técnicas y herramientas que permitan un característico perfil del académico, que le ayudarán a desarrollar competencias de carácter individual y colectivas, enfocadas hacia las necesidades globales de una sociedad; por eso la institucionalidad de la escuela, estará en constante comunión con el Marco Común Europeo de Referencia para la enseñanza de idiomas.\\\\
            Uno de los mayores retos para los desarrolladores es 
        }}
        \section{Objetivos}
        \normalfont\normalsize\textcolor{black}{
        Los objetivos estan planteados hacia la organización y hacia la aplicación del lenguaje Archimate 2.0 en la Cámara.
        \\\\
        Este estudio ha de permitir realizar las ....   
        }
        \subsection{Objetivo General}
        \normalfont\normalsize\textcolor{black}{
        Identificar las potencialidades de la Arquitectura Empresarial, el lenguaje Archimate 2.0 y el software Coloso en la definición y estructuración de una empresa sin animo de lucro y en estado incipiente de desarrollo.}
        \subsubsection{Hacia la CCCMA}
        \normalfont\normalsize\textcolor{black}{
            Brindar herramientas al Director Ejecutivo y Junta Directiva para el diseño de la estructura orgánica de la Cámara y el alcance de la misma.
        }
        \subsubsection{De la aplicación}
\normalfont\normalsize\textcolor{black}{
Ver la correlación entre la 
}               
        \subsection{Objetivos Especifícos}
        \section{Alcance}
        %-----------------------------------------------------
        \chapter{Presentación de la Empresa}\chapterlabel{\textbf{Presentación de la Empresa}}\index{CCCMA}
    \vspace{2cm}
\normalfont\normalsize\textcolor{black}{\newline
La Cámara es una persona jurídica de derecho privado de segundo grado, sin ánimo de lucro,  de interés general, regida por la Constitución Nacional, por los valores y principios de la economía Solidaria, por los presentes estatutos y por las leyes de la República de Colombia, que se denomina CÁMARA DEL CALZADO, CUERO, MARROQUINERIA Y AFINES DE BOGOTA D.C. tendrá duración hasta el 7 de marzo del año 2114.
}

        \part{\textbf{\textcolor{verde1}{Arquitectura Empresarial de CCCMA}}}

        \part{\textbf{\textcolor{verde1}{Patrones de Software}}}

        \part{\textbf{\textcolor{verde1}{Conclusiones}}}

        \part{\textbf{\textcolor{verde1}{Bibliografía}}}

        \part{\textbf{\textcolor{verde1}{Anexos}}}


        \chapter{ATENCION}\chapterlabel{Arquitectura Empresarial}
        \vspace{2cm}
        \section{Introducción}
        \subsection{objetivos}
        \subsection{objetivosasd}
        \subsubsection{aksjdasjdnasjdasdsfd}
        {\normalsize\textcolor{black}{ jhjjzasdadda
            }
            {\normalsize\textcolor{black}{ Nuestro primer documento estaba compuesto por un único párrafo justificado por ambos lados, es decir, cada línea ocupaba todo el espacio disponible desde el margen izquierdo al derecho. Esto es así porque éste es el entorno por defecto en LaTeX. Por tanto, si se quiere que la alineación sea otra se debe introducir el texto dentro de un entorno que indique cuál es la alineación deseada.
                    Los entornos en LaTeX son zonas del fichero fuente delimitadas por los comandos que sirven para dar instrucciones al compilador LaTeX sobre su comportamiento en el interior de éstos. Los entornos tienen la siguiente apariencia:}}
            \begin{figure}
                \centering
                \includegraphics[width=0.7\linewidth]{imagenes/escudo2}
                \caption{escudo2}
                \label{fig:escudo2}
            \end{figure}


        \end{document}

我对这段代码还有其他问题,章节或部分中的字母总是绿色的,而且很大。

感谢您的时间>D

相关内容