6

I am a beginner in ConTeXt, and I don't understand why \defineparagraphs turns off grid alignment here:

\showgrid
\setuplayout [grid=yes]

\defineparagraphs[AntiphonNo][n=2]
\setupparagraphs[AntiphonNo][1][width=30pt, color=red]

\starttext

This is aligned just fine.

\startAntiphonNo
Col. 1\AntiphonNo
This is not aligned, and I don't know why.
\stopAntiphonNo

This is aligned just fine.

\stoptext

Here is a screenshot

Should I just fix it with \godown?

\showgrid
\setuplayout [grid=yes]



\defineparagraphs[AntiphonNo][n=2]
\setupparagraphs[AntiphonNo][1][width=30pt, color=red, tolerance=strict]

\starttext

This is aligned just fine.

\godown[4.1pt]
\startAntiphonNo
Col. 1\AntiphonNo
This is not aligned, and I don't know why.
\stopAntiphonNo
\godown[-4.2pt]

This is aligned just fine.

\stoptext

Fixed layout

  • Added comments and screenshot of the problem – Neil Mussett Jan 5 '19 at 13:19
  • @Sebastiano This is a ConTeXt example and is compilable. – TeXnician Jan 5 '19 at 13:19
  • No answers? Is this a hard question? – Neil Mussett Jan 5 '19 at 22:56
  • @NeilMussett It is not a hard question, there are just not many ConTeXt users around here. Also, you shouldn't be so impatient and demanding. People here are volunteers and answer questions in their spare time. – Henri Menke Jan 6 '19 at 0:35
7

What you should always keep in mind is that paragraphs counts as a table environment and not as columns which means grid snapping of the content isn’t a priority.

In the past the content of the environment was on the grid because it used just a few nested horizontal and vertical boxes but since a while the result of the environment is put in a \framed block.

By default \framed stays always one the baseline of the text which means all characters are too high.

\setuppapersize [A6,landscape]

\defineparagraphs [test] [n=2]

\setuplayout [grid=yes]

\setupparagraphs [test] [frame=on]

\showgrid [lines]

\starttext

text

\startparagraphs [test]
  \startparagraphscell
    Weisman
  \stopparagraphscell
  \startparagraphscell
    \samplefile{weisman}
  \stopparagraphscell
\stopparagraphs

\stoptext

enter image description here

You can change the vertical position of \framed with the location key where two options are available in your case. You can either use location=bottom or location=depth to shift the box down.

\setuppapersize [A6,landscape]

\defineparagraphs [test] [n=2]

\setuplayout [grid=yes]

\setupparagraphs [test] [frame=on]
\setupparagraphs [test] [location=depth]

\showgrid [lines]

\starttext

text

\startparagraphs [test]
  \startparagraphscell
    Weisman
  \stopparagraphscell
  \startparagraphscell
    \samplefile{weisman}
  \stopparagraphscell
\stopparagraphs

\stoptext

enter image description here

While location=low seems like another possible settings to get the content on the baseline it works only when you have only a single line of text. When you have more text only the last line appears on the correct position and everything else is moved upwards.

\setuppapersize [A6,landscape]

\defineparagraphs [test] [n=2]

\setuplayout [grid=yes]

\setupparagraphs [test] [frame=on]
\setupparagraphs [test] [location=low]

\showgrid [lines]

\starttext

text

\startparagraphs [test]
  \startparagraphscell
    Weisman
  \stopparagraphscell
  \startparagraphscell
    \samplefile{weisman}
  \stopparagraphscell
\stopparagraphs

\stoptext

enter image description here

  • This is fantastic! location=depth is exactly what fixed my issue. Thank you for taking the time to explain the whole thing to me. This should be in the wiki! :) – Neil Mussett Jan 6 '19 at 13:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.