
Estoy intentando usar minipágina para obtener una tabla junto a un texto como en la imagen a continuación. Leí sobre el tema pero parece que no puedo entenderlo. Se agradece cualquier ayuda. Soy muy nuevo en esto, si alguien pudiera decirme qué estoy haciendo mal, sería genial.
Recibo los siguientes errores:
line 22: Not in outer par mode. \begin{table}[h]
line 22: Undefined control sequence \begin{table}[h]
line 22: Missing number, treated as zero \begin{table}[h]
line 3: Overfull \hbox (2.60513pt too wide) in paragraph
line 23: Overfull \hbox (117.52068pt too wide) in paragraph
line 21: Overfull \hbox (20.2359pt too wide) in paragraph
Sé que \hbox se puede arreglar agregando % al final de algunas líneas (¿quizás?), pero no estoy muy seguro de en qué líneas es apropiado.
Aquí está el código de los dos archivos que estoy creando.
título_prueba.tex
\documentclass[pdftex,12pt,letterpaper]{report}
\usepackage[pdftex]{graphicx}
\newcommand{\labno}{3}
\newcommand{\labtitle}{Fuerzas Hidrostaticas}
\newcommand{\authorname}{Author 1 \\ Author 2 \\ Author 3 \\ Author 4}
\newcommand{\instructor}{Instructor}
\newcommand{\classno}{Laboratorio INGE4010}
\begin{document}
\input{./title.tex}
\end{document}
título.tex
\begin{titlepage}
\noindent
\includegraphics[width=0.15\textwidth]{UPRMlogo}%
\begin{minipage}[b]{0.7\textwidth}
\centering
Universidad de Puerto Rico \\
Recinto de Mayaguez\\
Departamento de Ingenieria Mecanica
\end{minipage} %
\includegraphics[width=0.15\textwidth]{UPRMlogo}
\vspace*{\stretch{7}}
\begin{center}
\textsc{Laboratorio \#\labno \ \labtitle}
\end{center}
\vspace{\stretch{6}}
\vfill
\begin{minipage}{.2\textwidth} %
\begin{table}[h]
\begin{tabular}{|l|r|}
\hline
\textbf{Partes del Informe} & \multicolumn{1}{c|}{\textbf{Calificación}} \\ \hline
Introducción & /10 \\ \hline
Datos y Cálculos & /20 \\ \hline
Análisis de Resultados & /45 \\ \hline
Conclusiones & /20 \\ \hline
Referencia y Apéndice & /5 \\ \hline
Total & /100 \\ \hline
\end{tabular}
\end{table}
\end{minipage} %
\begin{minipage}{\textwidth} %
\begin{flushright}
\textsc{\authorname \\ \classno \\ \instructor \\ \today}
\end{flushright}
\end{minipage} %
\end{titlepage}
Respuesta1
No es necesario que tabular
haya un entorno dentro de un archivo table
.
Aquí hay una versión simplificada de su página de título:
\documentclass[12pt,letterpaper]{report}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[spanish]{babel}
\usepackage[demo]{graphicx}
\newcommand{\labno}{3}
\newcommand{\labtitle}{Fuerzas Hidrostaticas}
\newcommand{\authorname}{Author 1 \\ Author 2 \\ Author 3 \\ Author 4}
\newcommand{\instructor}{Instructor}
\newcommand{\classno}{Laboratorio INGE4010}
\begin{document}
\begin{titlepage}
\centering
\includegraphics[width=0.15\textwidth]{UPRMlogo}%
\begin{minipage}[b]{0.7\textwidth}
\centering
Universidad de Puerto Rico \\
Recinto de Mayaguez\\
Departamento de Ingenieria Mecanica
\end{minipage}%
\includegraphics[width=0.15\textwidth]{UPRMlogo}
\vspace*{\stretch{7}}
\textsc{Laboratorio \#\labno \ \labtitle}
\vspace{\stretch{6}}
\vfill
\begin{tabular}{@{}|l|r|@{}}
\hline
\textbf{Partes del Informe} & \multicolumn{1}{c|}{\textbf{Calificación}} \\ \hline
Introducción & /10 \\ \hline
Datos y Cálculos & /20 \\ \hline
Análisis de Resultados & /45 \\ \hline
Conclusiones & /20 \\ \hline
Referencia y Apéndice & /5 \\ \hline
Total & /100 \\ \hline
\end{tabular}%
\hfill
{\scshape
\begin{tabular}{@{}c@{}}
\authorname \\ \classno \\ \instructor \\ \today
\end{tabular}}
\end{titlepage}
\end{document}
Tenga en cuenta que no debe pasar la pdftex
opción a la clase ni al graphicx
paquete. Lo usé demo
porque no tengo los logos, quítalo.
Respuesta2
Propongo utilizar booktabs
y cellspace
mejorar el aspecto y el espaciado de su tabular. No lo coloques en un entorno de mesa ya que no flota.
\documentclass[pdftex,12pt,letterpaper]{report}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage[pdftex]{graphicx}
\usepackage{booktabs}
\usepackage{cellspace}
\setlength\cellspacetoplimit{3pt}
\setlength\cellspacebottomlimit{3pt}
\newcommand{\labno}{3}
\newcommand{\labtitle}{Fuerzas Hidrostaticas}
\newcommand{\authorname}{Author 1 \\ Author 2 \\ Author 3 \\ Author 4}
\newcommand{\instructor}{Instructor}
\newcommand{\classno}{Laboratorio INGE4010}
\begin{document}
\begin{titlepage}
\noindent
\includegraphics[width=0.15\textwidth]{uprm_logo.jpg}%
\begin{minipage}[b]{0.7\textwidth}
\centering
Universidad de Puerto Rico \\
Recinto de Mayaguez\\
Departamento de Ingenieria Mecanica
\end{minipage} %
\includegraphics[width=0.15\textwidth]{logo_upr.png}
\vspace*{\stretch{7}}
\begin{center}
\textsc{Laboratorio \#\labno \ \labtitle}
\end{center}
\vspace{\stretch{6}}
\vfill
\noindent
\begin{minipage}{.2\textwidth}%
\begin{tabular}{@{}Slr@{}}
\toprule
\textbf{Partes del Informe} & \textbf{Calificación} \\
\midrule
Introducción & /10 \\
Datos y Cálculos & /20 \\
Análisis de Resultados & /45 \\
Conclusiones & /20 \\
Referencia y Apéndice & /5 \\
Total & /100 \\
\bottomrule
\end{tabular}
\end{minipage} %
\hfill
\begin{minipage}{0.7\textwidth} %
\begin{flushright}
\textsc{\authorname \\[1ex] \classno \\[1ex] \instructor \\[1ex] \today}
\end{flushright}
\end{minipage}
%
\end{titlepage}
\end{document}