3

I want to draw the map below.

enter image description here

The input is N,e,R, output is R^d. In the box, S is in \mathcal{S}; so is M. It seems a little hard for me. Who can help me ?

I drew a box with the following code :

\documentclass{article}
\usepackage{amsmath}

\setlength{\fboxrule}{2pt}
 \setlength{\fboxsep}{1cm}

\begin{document}

$\xrightarrow{N,e,R}$
 \fbox{$\mathcal{M}$ $\updownarrow {mOT}$
 $\mathcal{S}$
    }
$\xrightarrow{R^{d}}$

\end{document}

it like this above enter image description here.

A little far from what i want, and also a little ugly.

3
  • 4
    Questions about how to draw specific graphics that just post an image of the desired result are really not reasonable questions to ask on the site. Please post a minimal compilable document showing what you've tried to produce the image and then people will be happy to help you with any specific problems you may have. See minimal working example (MWE) for what needs to go into such a document.
    – jub0bs
    Nov 2, 2013 at 11:21
  • i tried to draw with \fbox{} but...
    – Nax
    Nov 2, 2013 at 15:55
  • 3
    @Alex You included a snippet, that's not a MWE. :) A MWE is a full code (with the only relevant parts for your question) that we can copy and paste in our own computer and typeset immediately. If we need to guess what packages you used or what you wrote in your preamble, then that's not a MWE. :P
    – Alenanno
    Nov 2, 2013 at 16:03

2 Answers 2

4

Here are two solutions, one with tikz which is my personal choice. And one with stackengine below this one. This last one is more intended as help for you rather than a definite answer because this is the first time I've ever touched that kind of code.

Tikz solution

tikz image

The code is:

\documentclass[border=1cm]{standalone}
\usepackage{tikz}

\usetikzlibrary{calc}

\tikzset{squary/.style={anchor=west, 
                        minimum height=7mm,
                        text width=2cm,
                        },
        }

\begin{document}
\begin{tikzpicture}

    % NODES

    \node[squary] (1) at (0,1.5) {$\mathcal{M}$};
    \node[squary] (2) at (0,0) {$S (A,B,\ldots)$};
    \node[squary] (3) at (0,-.8) {$RSA$ $Solver$};

    \draw ($(1.north west)+(-.1,.1)$) |- ($(2.south east)+(.1,-.1)$) |- ($(1.north east)+(.1,.1)$)  -- cycle;

    % PATHS

    \draw[<->] ($(1.south)+(-.8,.1)$) -- ($(2.north)+(-.8,-.1)$) node[midway, right] {$mOT$};
    \draw[->] ($(2.190)+(-1.5,0)$) -- ($(2.190)+(-.1,0)$) node[midway, above]{$N,e,R$};
    \draw[->] ($(1.10)+(.1,0)$) -- ($(1.10)+(1,0)$) node[midway, above]{$R^d$};

\end{tikzpicture}
\end{document}

Stackengine + amsmath solution

Modifying your code you could do this. It has some imperfections but it could help you. Check the stackengine manual for reference.

stackengine image

\documentclass[border=1cm]{standalone}
\usepackage{stackengine}
\usepackage{amsmath}

\def\stackalignment{l}
\setstackgap{L}{1.8\baselineskip}
\fboxsep=1mm

\begin{document}

\stackanchor{}{$\xrightarrow{N,e,R}$}
\stackunder{\fbox{\fboxsep=3pt\Centerstack[l]{$\mathcal{M}$ $\updownarrow {mOT}$ $\mathcal{S (A,B,...,)}$}}}{$RSA Solver$}
\stackanchor{$\xrightarrow{R^{d}}$}{}

\end{document}
2

Here is an "easily understandable"* example solution.

enter image description here

\documentclass{article}

\usepackage{lipsum} % demo only
\usepackage{tikz}

\begin{document}

\lipsum[1] % demo only

\resizebox{4cm}{!}{
\begin{tikzpicture}[thick]
    \draw[->] (0.0,0.2) -- (1.0,0.2);
    \draw (1.0,0.0) -- (1.0,2.0) -- (3.0,2.0) -- (3.0,0.0) -- cycle;
    \draw[->] (3.0,1.6) -- (4.0,1.6);
    \draw[<->, thin] (1.3,0.6) -- (1.3,1.4);
    \node at (0.4,0.4) {$N$,$e$,$R$};
    \node[anchor=west] at (1.0,1.7) {$\mathcal{M}$};
    \node[anchor=west] at (1.3,1.0) {$m\text{OT}$};
    \node[anchor=west] at (1.0,0.3) {$\mathcal{S}\left(A,B,\dots\right)$};
    \node at (2.0,-0.2) {RSA solver};
    \node at (3.4, 1.8) {$R^d$};
\end{tikzpicture}
}

\lipsum[2] % demo only

\end{document}

* that was my main aim, to create a simple enough example

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .