【发布时间】:2014-01-12 11:22:35
【问题描述】:
为什么这不起作用:
\documentclass[a4paper,10pt]{article}
\usepackage{a4wide}
\usepackage[T1]{fontenc}
\usepackage[portuguese]{babel}
\usepackage[latin1]{inputenc}
\usepackage{indentfirst}
\usepackage{listings}
\usepackage{fancyhdr}
\usepackage{url}
\usepackage[compat2,a4paper,left=25mm,right=25mm,bottom=15mm,top=20mm]{geometry}
\usepackage{color}
\usepackage[colorlinks]{hyperref}
\usepackage[pdftex]{graphicx}
\renewcommand{\headrulewidth}{0.4pt}
\renewcommand{\footrulewidth}{0.4pt}
\pagestyle{fancy}
\fancyhead[L]{\small Laboratórios de Informática III}
\fancyhead[R]{\small Projecto 1 (Linguagem \textsf{C})}
\lstset{
basicstyle=\ttfamily\footnotesize,
showstringspaces=false,
frame=single,
tabsize=4,
breaklines=true,
}
\definecolor{Section1}{rgb}{0.09,0.21,0.36}
\definecolor{Section2}{rgb}{0.21,0.37,0.56}
\definecolor{Section3}{rgb}{0.30,0.50,0.74}
\hypersetup{
bookmarks=false,
linkcolor=red,
urlcolor=cyan,
}
\renewcommand{\section}[1]{\texorpdfstring{\color{green}#1}{#1}}
\parskip=6pt
\begin{document}
\begin{titlepage}
\begin{center}
\includegraphics[width=5cm]{./logo.jpg}\\[1cm]
\textsc{\LARGE Universidade do Minho}\\[1cm]
\textsc{\large Licenciatura em Engenharia Informática\\Laboratórios de Informática III}\\[1.5cm]
\rule{\linewidth}{0.5mm}\\[0.4cm]
\huge{\textbf{\textsc{Relatório do Projecto 1 (Linguagem C)}}}
\rule{\linewidth}{0.5mm}
\vfill
\begin{tabular}{c c}
\includegraphics[width=3.5cm]{./nuno.jpg} & \includegraphics[width=3.5cm]{./ricardo.jpg} \\
\textsc{\large{Nuno Mendes (51161)}} & \textsc{\large{Ricardo Amaral (48404)}} \\
\end{tabular}
\vfill
\large{\today}
\end{center}
\end{titlepage}
\tableofcontents
\newpage
\section{Introdução}
Lorem ipsum...
\newpage
\appendix
\section{\color{Section1}Diagrama das Estruturas de Dados}
\begin{center}
\includegraphics[width=16cm]{./Diagrama.pdf}
\end{center}
\end{document}
! LaTeX 错误:有些东西 错误——可能缺少 \item。
参见 LaTeX 手册或 LaTeX 解释的伴侣。 H型 寻求即时帮助。 ...
l.2 ...rline {1}\color{green}Teste}{3}{section.1}
我怎样才能让它正常工作?
【问题讨论】:
-
你的括号怎么样?对于每一个打开,都有一个关闭,并且在正确的位置?那个“teste}”在我看来格格不入。
-
我只在我的代码上这样使用它:\section{Teste}
-
用“完整”示例更新问题。
-
您的文件在这里没问题。请注意,我们无法运行该文件,因为它引用了我们系统上没有的图形。请不要发布我们无法通过简单的复制和粘贴运行的示例代码。您可以通过说
\vrule width 16cm height 5cm来模拟图形。我们不会将其打印出来 :-) 如果您已经替换了测试代码中的图形,请运行它并发布您在问题中得到的确切输出。 -
在 superuser.com 网站上发帖可能会更好:)
标签: latex renewcommand