.sty 问题

.sty 问题

我正在用 LaTeX 编辑讲义,在编译 .tex 文件时发现了很多错误。我怀疑这些问题出在决定书本风格的 .sty 文件中。我该如何在 .sty 文件中查找错误?

这是 .sty 文件的代码

\NeedsTeXFormat{LaTeX2e}[1995/06/01]
\ProvidesPackage{estiluoc}[1999/04/23 v0 extensio]

\RequirePackage{ifthen}
\RequirePackage{amssymb}
\RequirePackage{graphicx}
\RequirePackage{subfigure}
%algorismes
\RequirePackage{amsmath} %Luis Marco (11-9-2006). Alerta: si ``amsmath'' es carrega després ``programa'' es produeix un error.
\RequirePackage{programa} %El paquet ``programa.sty'' es una adaptació de ``program.sty''

%Coloringos
\RequirePackage[dvips]{color}
\definecolor{blanc}{gray}{1}
\definecolor{gris}{gray}{0.8}
\definecolor{negre}{gray}{0}
\definecolor{light-gray}{rgb}{0.83,0.83,0.83}
\definecolor{sepia}{rgb}{1,0.93,0.76}

\RequirePackage{colortbl}

%\newcommand\filet{l}
\newcommand{\nroregistre}{PX/XXXXX}
\newcommand\ISBN{ISBN: xx-xxxx-xxx-x}
\newcommand\dipositlegal{Dip\`osit legal: B-x.xxx-xx}

\newtheorem{teorema}{Teorema}
\newtheorem{definicio}{Definici\'o} 
\newtheorem{propietat}{Propietat}
\newtheorem{proposicio}{Proposici\'o}
\newtheorem{protocol}{Protocol}
\newtheorem{algorisme}{Algorisme}
\newtheorem{problema}{Problema}
%jaume, 10/04/2002
\newtheorem{rema}{Observaci\'o}
\newenvironment{demo}{\begin{quotation}\small\noindent \textbf{Demostració:}\ }{\ \rule{1mm}{2mm}\normalsize\end{quotation}}

\renewcommand{\figurename}{Figura}

% comptadors de llistes
\newcounter{cs}
\stepcounter{cs}
\newcommand{\casos}{\hspace{10mm}\begin{itemize}}
\newcommand{\fcasos}{\end{itemize}\setcounter{cs}{1}}
\newcommand{\cas}{\item[\textbf{(\alph{cs})}]\ \stepcounter{cs}}

\newcommand{\figcen}[1]
              {\begin{center}
              \setlength{\fboxsep}{4mm}
              #1  \end{center}}       

%jaume, 15/06/2002
%etiqueta exemples i exercicis (substitueix \label)
\newcommand{\etiqexe}[1]{\label{#1}\newcounter{c#1}\setcounter{c#1}{\thenexemple}}

%etiqueta test i resultats destacats (substitueix \label)
\newcommand{\etiqdes}[1]{\label{#1}\newcounter{t#1}\setcounter{t#1}{\thenumres}}

\newcounter{sref}
%referencia \etiqexe
\newcommand{\mref}[1]{\setcounter{sref}{\value{c#1}}\textbf{\arabic{modul}-\arabic{sref}}}

\newcounter{tref}
%referencia \etiqdes
\newcommand{\dref}[1]{\setcounter{tref}{\value{t#1}}\textbf{\arabic{modul}.\arabic{tref}}}

%inicialització comptador respostes
\newcommand{\respini}{\setcounter{numresp}{\thenexemple}}

%Luis Marco, 31-8-2006. Instrucció per a forçar el justificat de l'última línia de text.
\newcommand{\liniaforzada}{\linebreak\vspace{-15.35pt}} 

%Instrucció per a fer servir el tipus semibold en comptes de la negreta. (Lluís Marco. 12-5-2006)
\newcommand{\textsbold}[1]{{\fontseries{sb}\selectfont #1}}

%Distàncies entre les fórmules i el texto
\setlength{\abovedisplayskip}{22pt}
\setlength{\belowdisplayskip}{22pt}
\setlength{\abovedisplayshortskip}{22pt}
\setlength{\belowdisplayshortskip}{22pt}
\setlength{\jot}{15.35pt}% Distància entre fórmules als entorns eqnarray.

%Format de les taules
\setlength{\extrarowheight}{3pt} %Addicció d'espai vertical entre les files d'una taula.

%bibliografia en català. 
%Luis Marco. 22-12-2009
\newcommand{\biblio}{
\addcontentsline{toc}{previs}{Bibliografia}
\bibliographystyle{uoctex}
 \makeatletter
 \renewcommand\@biblabel[1]{\hspace{-14pt}}
 \renewcommand\@bibsetup[1]{}
 \makeatother
\bibliography{bibliografia}}

%Bibliografia en castellà
%Luis Marco. 22-12-2009
\newcommand{\biblioes}{
\addcontentsline{toc}{previs}{Bibliograf\'ia}
\bibliographystyle{uoctex-es}
\makeatletter
\renewcommand\@biblabel[1]{\hspace{-14pt}}
\renewcommand\@bibsetup[1]{}
\makeatother
\bibliography{bibliografia}}

%Instrucció per a Incidències
\newcommand{\incidencia}[1]{\fbox{\parbox{17cm}{\textcolor[named]{Red}{\textbf{INCIDENCIA. #1}}} }}
\newcommand{\faltafigura}[1]{\fbox{\parbox{17cm}{\textcolor[named]{Red}{\textbf{FALTA FIGURA\vspace{#1}}}}}}


%Instrucció que crea un salt de pàgina per als casos on els recursos al lateral no permeten un resultat òptim en fer servir \newpage. 
%Es pot fer servir com a \paginanueva o \paginanueva[-42pt]
\newcommand{\paginanueva}[1][-22pt]{\newpage\mbox{}\vspace{#1}}

%Instrucció per a crear una pàgina en blanc
\newcommand{\paginablanca}{\newpage\mbox{ }\thispagestyle{empty}\newpage}

\endinput
%
%

该文件的开头是

\documentclass{uoc-es}
% treure el comentari per a la versio en castella
%\castella


%\usepackage[\CATSP]{babel}
%canviar els comentaris per a la versi\'{o} en castell\`{a}
\usepackage[spanish,catalan]{babel}
%\selectlanguage{catalan}
\selectlanguage{spanish}


\usepackage[latin1]{inputenc}

\usepackage{amssymb, amsmath, graphicx}
\usepackage{mathstone}%MathStone versión 1.2
\usepackage{color} 
\usepackage{colortbl}
\usepackage[right,eurosym]{eurofont}
%\usepackage{hyperref}

%local package
\usepackage{fancyhdr}
\usepackage{ifpdf}
\usepackage{pgfplots}
\usepackage{tkz-berge}
\usepackage{tikz}
\usetikzlibrary{arrows,shapes,trees}
% algorismes, conve que sigui el darrer
\usepackage{programa}



\title{\color[gray]{0.5}{Fundamentos de grafos}}
\author{Joaquim Borges\\[4.25pt]  Robert Clarisó\\[4.25pt] Ramon Masi\`{a}\\[4.25pt] Jaume Pujol\\[4.25pt] Josep Rif\`{a}\\[4.25pt] Joan Vancells\\[4.25pt] Merc\`{e} Villanueva}
\newcommand{\credits}{}
\newcommand{\nommodul}{Fundamentos de grafos}
\renewcommand{\nroregistre}{PID_00174686}
%arxiu que incorpora la foto de la portada
%\newcommand{\fotoportada}{./logo-uoc.png}
%\newcommand{\modulEncap}{$\text{ }\bullet$ M\'{o}dulo 2} %M\`{o}dul en l'encap\c{c}alament.
\newcommand{\modulEncap}{}
\newcommand{\modul}{}
\renewcommand{\UOC}{CC-BY-NC-ND}
%local commands

% \hypersetup{
%     pdfauthor = {Joaquim Borges, Ramon Masi\`{a}, Jaume Pujol, Josep
% Rif\`{a}, Joan Vancells, Merc\`{e} Villanueva},
%     pdftitle = {Fundamentos de grafos},
%     pdfsubject = {},
%     pdfkeywords = {},
%     }

%%%%%%%%%%

\newcommand{\textsbold}[1]{{\fontseries{sb}\selectfont #1}}
\newcommand{\lfor}{\linebreak\vspace{-15.35pt}} 
\nofiles


\begin{document}

%\selectlanguage{spanish}

\maketitle


\newpage
\mbox{ }
\thispagestyle{empty}

我发现的第一个错误是

LaTeX Font Info:    Calculating math sizes for size <14> on input line 67.
! Undefined control sequence.
\maketitle ...\titulet \credits \par \nroregistre 
                                                  \par \modul } \par \vfil \...
l.67 \maketitle

The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.

相关内容