2

I want to place a table besides some text:

\starttext
  \placetable[left,none]{}{%
    \starttable[|l|]
      \HL \VL Test \VL \SR \HL
    \stoptable
  }

  Here be some text
\stoptext

This does not look very nice, because the table starts somewhat below the text:

Inserting \blank[2cm] before the text does not seem to do anything. How can I have the table start at the same vertical position as the text?

1
  • Try \blank[2cm,force] to make that solution work. Commented Oct 19, 2016 at 14:07

2 Answers 2

3

If you do not need to have it aligned exactly with the baseline of the text, just add a negative multiple of line in the location key. My personal advice is to always use the \start...\stop interface, also for placetable. Furthermore, I recommend using Natural Tables.

\starttext
\startplacetable
  [
    location={left,none,-line},
  ]
  \startTABLE
    \NC Test \NC\NR
  \stopTABLE
\stopplacetable
Here be some text
\stoptext

enter image description here

3
  • 2
    You can use the high keyword to get rid of the space before the float, this positions the content a bit lower than your solution with -line. Commented Oct 19, 2016 at 15:41
  • 1
    I must admit that I don't like this solution, but it's difficult to come up with a better proposal as the question is a bit vague. If the table and the text next to it must stay together, a float doesn't seem the best solution (because it, um, floats). And what does "the same vertical position as the text" mean for a table? The baseline of the first row is identical? Or of the last row? Or the text is in the middle of the table height? My instinct would be to use a combination or frames within frames, but the question has to be clarified.
    – Thomas
    Commented Oct 19, 2016 at 18:51
  • I agree that I did not specify exactly what I wanted, but this seems to be a good solution. I already tried using paragraphs, but that did not work with the formula I had in the text besides the table. The problem with using paragraphs (or columns) is that I need to specify their width in advance rather than letting the table decide its width.
    – flyx
    Commented Oct 20, 2016 at 8:34
0

Given the simplicity, I hope I understood the question correctly. Why don't you use the cline command ? Is the following what you expect ?

\documentclass{article}
\begin{document}
    \begin{tabular}{|c|l}
        \cline{1-1}
        Test & Here be some text\\
        \cline{1-1}
    \end{tabular}
\end{document}

enter image description here

2
  • Well firstly, the question was about ConTeXt, not LaTeX. Second, my example was minimal. The actual table has many rows and the text besides it many paragraphs, which makes your solution not suitable.
    – flyx
    Commented Oct 19, 2016 at 13:17
  • Well, I guess "no" I did not understand the question :) minipage environment sometimes helps in LaTeX, is there any equivalent in ConTeXt ?
    – jchd
    Commented Oct 19, 2016 at 13:43

You must log in to answer this question.

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