4

I have started to use the tikzposter class and I wonder why the text inside blocks is flushed left by default instead of justified. How can I change the text alignment in blocks to be fully justified?

  • 3
    typically the columns in a poster (particularly in portrait mode) are fairly narrow - so a ragged right margin tends to look better than justified; try align=justify in the specs for your nodes – prettygully Sep 13 '13 at 5:44
  • @prettygully Thanks, I tried \block[align=justify]{Title}{Text} and get Error: align' undefined in families block' – Miguel de Val-Borro Sep 13 '13 at 9:39
6

basically you don't like line 426 which says

        {\large\color{blockbodyfgcolor}#3}

If it said

        {\large\rightskip\z@skip\spaceskip\z@\xspaceskip\z@ 
                               \color{blockbodyfgcolor}#3\par}

then you would get justified text (and fix the \par issue of your other question. It's a bit inconvenient to patch that you could just edit a local, renamed, copy and use that instead, or simpler just put

       \rightskip0pt
       \spaceskip0pt
       \xspaceskip0pt

at the start of your block entry, and

     \par

at the end. (The need for \par is a bug in the class file really, so you could report that)

If you do want to patch it, egreg suggests:

\documentclass{tikzposter}
\usepackage{xpatch}
\makeatletter
\xpatchcmd{\block}
  {\large\color{blockbodyfgcolor}#3}
  {\large\rightskip\z@skip
   \spaceskip\z@\xspaceskip\z@
   \color{blockbodyfgcolor}#3\par}
  {}{}
\makeatother

which would save editing a local copy of the class.

  • I was puzzled by this. How is line 426 causing this to happen. If I try to create my own MWE with something like \begin{minipage}{5in} {\large\color{red}\mycontent} \end{minipage} where \mycontent is just filler text without any other LaTeX commands, I still get full justification. So, what's happening here that I'm causing the lost of full justification? Granted, my MWE was in an article class. So, is this something at the level of the class? – A.Ellett Sep 13 '13 at 14:01
  • @A.Ellett that line is wrong because it's missing \par the settings to 0pt that I suggested adding is undoing a setting of \raggedright that has happened earlier, somewhere in the depths of tikz, I decided not to go there, as undoing it there is easier than finding out where raggedright is done and changing things not to do it – David Carlisle Sep 13 '13 at 14:59
  • Thanks, editing the class file works perfectly, although patching the block command witch xpatchcmd does not seem to have any effect. – Miguel de Val-Borro Sep 13 '13 at 18:10
  • I don't know if it is related with this issue, but indenting paragraphs with \indent does not have any effect. I have made sure the \parindent length is defined in the preamble. – Miguel de Val-Borro Sep 17 '13 at 13:44
  • \indent is approximately never used in Latex: it just indents a paragraph by the amount it would be indented anyway (ie the value of \parindent) – David Carlisle Sep 17 '13 at 13:52

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.