Graphics, Figures & Tablestext in a table

Information and discussion about graphics, figures & tables in LaTeX documents.
Post Reply
paulosousa
Posts: 90
Joined: Sun Jun 24, 2012 8:48 pm

text in a table

Post by paulosousa »

Hi

I have a little problem when I write text in a table...

When I use:

Code: Select all

\documentclass[11pt, twoside, a4paper]{article}
\usepackage[portuguese]{babel}
\usepackage[applemac]{inputenc}
\usepackage[left=2.0cm,top=1.5cm,right=2.0cm,bottom=1.5cm]{geometry}
\usepackage{amsmath,amssymb,amsfonts,textcomp,setspace,graphicx,makeidx, color,fancyhdr,enumerate,environ,tikz}
\usepackage[bottom]{footmisc}
\usepackage[none]{hyphenat}
\pagestyle{fancy}
\setcounter{tocdepth}{3}

\renewcommand{\headrulewidth}{0pt} % retirar linha
\renewcommand{\footrulewidth}{1pt} % colocar linha

\renewcommand*{\theenumii}{\arabic{enumii}}
\renewcommand*{\labelenumii}{\theenumi.\theenumii.}


\fancyhead{}
\lfoot{\tiny Prof. Paulo Sousa}
\cfoot{\tiny Matemática A 2012/2013}
\rfoot{\tiny \thepage}
\begin{document}
\begin{tabular}{cclcc}

\textbf{1.} &  &  &  &  \\ 
 & \textbf{1.1.} & \multicolumn{2}{l}{................................................................................................................} & 50 pontos   \\ 
 &  & Assinalando em cada cruzamento um vértice e a respetiva letra, ligando-as por arestas, obtem-se o grafo seguinte: &  &    \\  
 & \textbf{1.2.} & \multicolumn{2}{l}{................................................................................................................} & 50 pontos   \\
 & \textbf{1.3.} & \multicolumn{2}{l}{................................................................................................................} & 50 pontos   \\
 & \textbf{1.4.} & \multicolumn{2}{l}{................................................................................................................} & 50 pontos   \\ 
 &  & Indicar um circuito possível, por exemplo,   &  &    \\  
 &  & $ABCDEHGFEKJHGIOIJNONMLKCALA$ ...............  & 50 pontos &  \\  
 
\end{tabular} 
\end{document}
the column width won't be the same anymore. How can I break the text inside the same row?
Is this possible?
Who can help me?

regards,
Paulo

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

Learn LaTeX easily with newest books:

The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis

The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more

LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis

User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

text in a table

Post by localghost »

What is the purpose of this example? It seems a table is not the right method.

And it would be good if you reduce the problem to a proper minimal example. The vast majority of the packages you load are not necessary to reproduce the problem.


Thorsten
paulosousa
Posts: 90
Joined: Sun Jun 24, 2012 8:48 pm

text in a table

Post by paulosousa »

localghost wrote:What is the purpose of this example? It seems a table is not the right method.

And it would be good if you reduce the problem to a proper minimal example. The vast majority of the packages you load are not necessary to reproduce the problem.


Thorsten

I need to make the criteria for the exam correction, is this the purpose of the example
don't know how to do it if the table is not the right method

anyone with a good idea?
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

text in a table

Post by localghost »

paulosousa wrote:[…] don't know how to do it if the table is not the right method […]
A list perhaps?

Code: Select all

\documentclass[11pt,a4paper,twoside,portuguese]{article}
\usepackage[T1]{fontenc}
\usepackage{selinput}
\SelectInputMappings{
  aacute={á},
  ccedilla={ç},
  ntilde={ñ}
}
\usepackage{babel}
\usepackage[hmargin=2cm,vmargin=1.5cm]{geometry}
\usepackage{enumitem}

\begin{document}
  \begin{enumerate}[font=\bfseries]
    \item
    \item[]
      \begin{enumerate}[label=\arabic{enumi}.\arabic*.,font=\bfseries]
        \item Assinalando em cada cruzamento um vértice e a respetiva letra, ligando-as por arestas, obtem-se o grafo seguinte: \dotfill\enspace 50 pontos
      \end{enumerate}
    \item
  \end{enumerate}
\end{document}
If you insist on doing it with a table, you will need some enhancements.

Code: Select all

\documentclass[11pt,a4paper,twoside,portuguese]{article}
\usepackage[T1]{fontenc}
\usepackage{selinput}
\SelectInputMappings{
  aacute={á},
  ccedilla={ç},
  ntilde={ñ}
}
\usepackage{babel}
\usepackage[hmargin=2cm,vmargin=1.5cm]{geometry}
\usepackage{tabularx}

\renewcommand*{\tabularxcolumn}[1]{m{#1}}

\begin{document}
  \begin{tabularx}{\linewidth}{>{\bfseries}l>{\bfseries}lXr}
    1. & & &\\
       & 1.1.& Assinalando em cada cruzamento um vértice e a respetiva letra, ligando-as por arestas, obtem-se o grafo seguinte: \dotfill & 50 pontos
  \end{tabularx}
\end{document}
Post Reply