UTF-8 encoding and output RTF formatting in Z-Tree

567 Views Asked by At

I'm trying to build a Prisoner's Dilemma game in Z-Tree (the toolkit for building game theory experiments), and have encountered two irritating problems.

  1. I haven't succeeded in applying formatting to the output inside of an item. Specifically, I'd like to display the number of years of prison each player gets at the end of a game, in the format:

    Years of Prison: value

    using the Layout dialogue of the Item box. Not using the layout and inserting the values directly into the text leads to a far too messy display.

    Is there a way to do that using variables (conceptually, something like Payoff = {\rtf \fs30 Payoff}), and not concrete values (like !text: 1 = {\rtf \fs30 1}).

  2. Is there a way to enable UTF-8 encoding? I have some letters (like č or š) which aren't being displayed correctly?

I'm using the latest Z-Tree version, on Linux ElementaryOS, running on Wine.

1

There are 1 best solutions below

0
On

Answer to 1: In the label of your item, do this:

<>{\rtf Payoff = \fs30 <Payoff|0.1> } 

Answer to 2: I do not know for sure. I think the font z-Tree uses by default does not support those characters. What I would try is to find a font that supports them and use it. In your code the characters will appear as weird symbols, but maybe in the leafs they'll be displayed correctly.