0

I've tried copying the Ethereum Yellowpaper EVM bytecodes into my own LaTeX for reference.

After having simplified the code, I'm left with the following (snippet):

\begin{tabular*}{\columnwidth}[h]{rlrrl}
\toprule
\multicolumn{5}{c}{\textbf{0s: Stop and Arithmetic Operations}} \\
\textbf{Value} & \textbf{Mnemonic} & $\delta$ & $\alpha$ & \textbf{Description} \vspace{5pt} \\
0x00 & {\small STOP} & 0 & 0 & Halts execution. \\
\midrule
0x01 & {\small ADD} & 2 & 1 & Addition operation. \\
\midrule
0x02 & {\small MUL} & 2 & 1 & Multiplication operation. \\
\midrule
0x03 & {\small SUB} & 2 & 1 & Subtraction operation. \\
\midrule
0x04 & {\small DIV} & 2 & 1 & Integer division operation. \\
\midrule
0x05 & {\small SDIV} & 2 & 1 & Signed integer division operation (truncated). \\
\midrule
0x06 & {\small MOD} & 2 & 1 & Modulo remainder operation. \\
\midrule
0x07 & {\small SMOD} & 2 & 1 & Signed modulo remainder operation. \\
\midrule
0x08 & {\small ADDMOD} & 3 & 1 & Modulo addition operation. \\
\midrule
0x09 & {\small MULMOD} & 3 & 1 & Modulo multiplication operation. \\
\midrule
0x0a & {\small EXP} & 2 & 1 & Exponential operation. \\
\midrule
0x0b & {\small SIGNEXTEND} & 2 & 1 & Extend length of two's complement signed integer. \\
\end{tabular*}

\begin{tabular*}{\columnwidth}[h]{rlrrl}
\toprule
\multicolumn{5}{c}{\textbf{10s: Comparison \& Bitwise Logic Operations}} \\
\textbf{Value} & \textbf{Mnemonic} & $\delta$ & $\alpha$ & \textbf{Description} \vspace{5pt} \\
0x10 & {\small LT} & 2 & 1 & Less-than comparison. \\
\midrule
0x11 & {\small GT} & 2 & 1 & Greater-than comparison. \\
\midrule
0x12 & {\small SLT} & 2 & 1 & Signed less-than comparison. \\
\midrule
0x13 & {\small SGT} & 2 & 1 & Signed greater-than comparison. \\
\midrule
0x14 & {\small EQ} & 2 & 1 & Equality comparison. \\
\midrule
0x15 & {\small ISZERO} & 1 & 1 & Simple not operator. \\
\midrule
0x16 & {\small AND} & 2 & 1 & Bitwise AND operation. \\
\midrule
0x17 & {\small OR} & 2 & 1 & Bitwise OR operation. \\
\midrule
0x18 & {\small XOR} & 2 & 1 & Bitwise XOR operation. \\
\midrule
0x19 & {\small NOT} & 1 & 1 & Bitwise NOT operation. \\
\midrule
0x1a & {\small BYTE} & 2 & 1 & Retrieve single byte from word. \\
\bottomrule
\end{tabular*}

\begin{tabular*}{\columnwidth}[h]{rlrrl}
\toprule
\multicolumn{5}{c}{\textbf{20s: SHA3}} \vspace{5pt} \\
\textbf{Value} & \textbf{Mnemonic} & $\delta$ & $\alpha$ & \textbf{Description} \vspace{5pt} \\
0x20 & {\small SHA3} & 2 & 1 & Compute Keccak-256 hash. \\
\bottomrule
\end{tabular*}

\begin{tabular*}{\columnwidth}[h]{rlrrl}
\toprule
\multicolumn{5}{c}{\textbf{30s: Environmental Information}} \vspace{5pt} \\
\textbf{Value} & \textbf{Mnemonic} & $\delta$ & $\alpha$ & \textbf{Description} \vspace{5pt} \\
0x30 & {\small ADDRESS} & 0 & 1 & Get address of currently executing account. \\
\midrule
0x31 & {\small BALANCE} & 1 & 1 & Get balance of the given account. \\
\midrule
0x32 & {\small ORIGIN} & 0 & 1 & Get execution origination address. \\
\midrule
0x33 & {\small CALLER} & 0 & 1 & Get caller address. \\
\midrule
0x34 & {\small CALLVALUE} & 0 & 1 & Get deposited value by the instruction/transaction responsible for this execution. \\
\midrule
0x35 & {\small CALLDATALOAD} & 1 & 1 & Get input data of current environment. \\
\midrule
0x36 & {\small CALLDATASIZE} & 0 & 1 & Get size of input data in current environment. \\
\midrule
0x37 & {\small CALLDATACOPY} & 3 & 0 & Copy input data in current environment to memory. \\
\midrule
0x38 & {\small CODESIZE} & 0 & 1 & Get size of code running in current environment. \\
\midrule
0x39 & {\small CODECOPY} & 3 & 0 & Copy code running in current environment to memory. \\
\midrule
0x3a & {\small GASPRICE} & 0 & 1 & Get price of gas in current environment. \\
\midrule
0x3b & {\small EXTCODESIZE} & 1 & 1 & Get size of an account's code. \\
\midrule
0x3c & {\small EXTCODECOPY} & 4 & 0 & Copy an account's code to memory. \\
\bottomrule
\end{tabular*}

Compiling this code, I get the following PDF (snippet):

enter image description here

The tables are not aligned, i.e., the lines are not of equal length and the text is not centered.

How do I fix this?

  • 1
    Put \noindent in front of the second table. – Johannes_B Sep 14 '17 at 10:05
  • 2
    I think you are overusing those midrules. – Johannes_B Sep 14 '17 at 10:05
  • The $\midrules$ are from the yellowpaper. I just try to embed its contents into my own document. – Shuzheng Sep 14 '17 at 10:10
  • 1
    I agree with Johannes, you only need a midrule under the value row, not the others they just makes it harder to read – daleif Sep 14 '17 at 10:10
  • @daleif - thank you, other suggestions for a better design :-) ? – Shuzheng Sep 14 '17 at 10:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.