solidity-latex-highlighting
solidity-latex-highlighting copied to clipboard
Include nice-looking Solidity examples into LaTeX files
Solidity LaTeX Highlighting
Solidity is a major programming language for Ethereum smart contracts. Solidity LaTeX highlighting helps researchers include readable code examples in their papers. Compared to some other previous attempts, this highlighter fully supports the Solidity syntax (if you think this is not the case, feel free to submit an issue or a pull request).
Usage
Source
\documentclass{article}
\input{solidity-highlighting.tex} % copy the file from this repo
\begin{lstlisting}[language=Solidity]
pragma solidity 0.4.16;
contract TestContract {
string private myString = "foo";
function getString() constant returns (string) {
return myString;
}
function setString (string _string) {
myString = _string;
}
}
\end{lstlisting}