0

I need to 'draw' a protocol flow using LaTeX. I decided to go with \begin{array}, since it is sufficient for my needs. However, the arrowhead in \xleftarrow and \xrightarrow is so small, that it is not very readable.

Is there a way to increase its size? Or at least change it to something bigger, which will be easy to see? Thank you.

\documentclass[extrafontsizes,10pt]{article}
\usepackage{amssymb}
\usepackage{amsfonts}
\usepackage{stmaryrd}
\usepackage{amsmath}

\begin{document}

\[
\begin{array}{c c c}
\text{\textsf{C}} & & \text{\textsf{S}} \\
& \text{\scriptsize \texttt{REQUEST}}  &\\
& \xrightarrow{\hspace{15em}\hspace{10em}} & \\
& \text{\scriptsize \texttt{RESPONSE}} & \\
& \xleftarrow{\hspace{15em}\hspace{10em}} & \\
\end{array}
\]

\end{document}

enter image description here

1
\documentclass[12pt]{article}
\usepackage{amssymb}
\usepackage{amsfonts}
\usepackage{stmaryrd}
\usepackage{amsmath}
\usepackage{tikz}

% add the following two lines to your document to get bigger arrows
\usetikzlibrary{arrows.meta}
\tikzset{>={Latex[width=3mm,length=3mm]}}

\begin{document}
\[
\begin{array}{c c c}
\text{\textsf{C}} & & \text{\textsf{S}} \\
& \text{\scriptsize \texttt{REQUEST}}  &\\
& \begin{tikzpicture}
\draw[->] (0,0) node[left]{} -- (10,0) node[right]{};
\end{tikzpicture} & \\
& \text{\scriptsize \texttt{RESPONSE}} & \\
& \begin{tikzpicture}
\draw[<-] (0,0) node[left]{} -- (10,0) node[right]{};
\end{tikzpicture} & \\
\end{array}
\]
\end{document}

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.