3

I'm trying to draw a simple line, and at the end of that line include a table. I would like to do it without having to compute myself the position where the table needs to be drawn. How can I do that?

many thanks

2
  • perhaps using tikz: % arara: pdflatex \documentclass{article} \usepackage{tikz} \begin{document} \begin{tikzpicture} \coordinate (a) at (0,0); \node[minimum width=3cm] (b) at (1,0){\begin{tabular}{cc}1&2\\3&4\end{tabular}}; \draw (a)--(b); \end{tikzpicture} \end{document}
    – cmhughes
    Jun 11, 2014 at 17:20
  • @cmhughes: an answer? (it seems we exchanged the usual roles ;) ) Jun 11, 2014 at 17:59

2 Answers 2

5

You could use the wonderfully versatile and popular tikz package; there are lots of way to do it, but one such method follows.

screenshot

% arara: pdflatex 
% !arara: indent: {overwrite: yes}
\documentclass{article} 
\usepackage{tikz} 
\begin{document} 
\begin{tikzpicture} 
    \coordinate (a) at (0,0); 
    \node[minimum width=3cm] (b) at (1,0){\begin{tabular}{cc}1&2\\3&4\end{tabular}}; 
    \draw (a)--(b); 
\end{tikzpicture} 
\end{document}
2

Without tikz ;) (for a change)

\documentclass{article}
\begin{document}
  \noindent
  \rule[0.6ex]{1in}{1pt}
  \begin{tabular}{cc}
    1&2\\
    3&4
  \end{tabular}
\end{document}

enter image description here

6
  • 1
    Then why's tikz loaded? :P
    – Herr K.
    Jun 11, 2014 at 23:51
  • 1
    @KevinC I blame it on cmhughes as I copied his code. But in reality, \usepackage{tikz} is a die hard habit (which my brain refuses to delete) :)
    – user11232
    Jun 11, 2014 at 23:53
  • sneaky :) you currently have 1 vote, and I have 3, yet your answer appears above mine... not at all a big deal - I'm just curious?....
    – cmhughes
    Jun 12, 2014 at 4:27
  • @cmhughes hihi! I were thinking that you won't see this ;)
    – user11232
    Jun 13, 2014 at 0:44
  • lol :) can't believe you posted an answer without tikz :)
    – cmhughes
    Jun 13, 2014 at 4:16

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .