0

The following code produces the result in the picture below.

How can I avoid text justification at the line that starts with "Create Challenge"? I have tried to apply what is suggested here but it does not work in my case.

\begin{figure}
\centering
\fbox{
    \parbox{\textwidth}{
\centerline{\textbf{Protocol $\Pi_{GR}$}}
\bigbreak
Parties $\mathcal{P}$ = \{$\mathcal{P}_{1}$,..., $\mathcal{P}_{n}$\} interact with each other and with $\mathcal{F}_{SmartContract}$, $\mathcal{F}_{RandomCommittee}$, $\mathcal{F}_{Voting}$ as follows:
\bigbreak
\textbf{Create Challenge}: On input $(\textsc{Create-Challenge}, sender, value)$ send $(\textsc{Create-Challenge}, sender, value)$ to $\mathcal{F}_{SmartContract}$.
\newline
\textbf{Accept Challenge}:
\newline
    }
}
\caption{Protocol $\Pi_{GR}$.} \label{fig:sm}
\end{figure}

Result of the code

If I apply \parbox{\textwidth}{\raggedright it is closer to what I want, but it does not split the mathematical expression between two lines.

Result of applying suggestion

6
  • 1
    Try with \parbox{\textwidth}{\raggedright
    – MadyYuvi
    May 14, 2020 at 14:47
  • Thanks a lot. It is closer to what I want, but it does not split the mathematical expression between two lines (I edited the question with the result). I suppose this is another problem however. I had a similar problem with long citations in the past.
    – Lorenzo
    May 14, 2020 at 14:56
  • 1
    @Lorenzo: So you want it split, possible between CREATE- and CHALLENGE?
    – Werner
    May 14, 2020 at 15:46
  • Yes, I tried with \allowbreak without success. As far I understand, you need to add this command manually (or by using a macro) anyway.
    – Lorenzo
    May 14, 2020 at 16:38
  • If you want the three $\mathcal{F}... expressions at the end of the second (input) line to all go to a new line, you can replace the input spacebar spaces between them by ~ to "tie" them together. This, together with \raggedright gives the result I think you want. May 14, 2020 at 20:26

0

You must log in to answer this question.

Browse other questions tagged .