Skip to content

Latest commit

 

History

History
34 lines (23 loc) · 1.31 KB

README.md

File metadata and controls

34 lines (23 loc) · 1.31 KB

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}

Result