Si prefieres el trazo de la derecha recuerda añadir el paquete lmodern:
\usepackage{lmodern}
\usepackage{lmodern}
\providecommand{\abs}[1]{\lvert#1\rvert}
\providecommand{\norm}[1]{\lVert#1\rVert}
Estos comandos se usan de la siguiente manera: \begin{gather}
\abs{r_1} = \sqrt{\alpha^2 + \beta^2}\\
\norm{r_2} = \sqrt{\alpha^2 + \beta^2 + \gamma^2}
\end{gather}
Dando lugar a:\usepackage{pstricks,pst-node,pst-circ,pst-plot,pst-3dplot} \begin{figure}[ht]
\centering
\scalebox{0.8}{
\ovalbox{\begin{pspicture}(-1,-1)(9,6)
%Nodos del circuito
\pnode(0,0){A}
\pnode(3,0){B}
\pnode(4,0){C}
\pnode(5,0){D}
\pnode(8,0){E}
\pnode(0,2){F}
\pnode(0,5){G}
\pnode(3,5){H}
\pnode(4,5){I}
\pnode(8,5){J}
%Conexiones
\battery[directconvention=false,labeloffset=1.](F)(A){$3V$}
\battery[directconvention=true](H)(I){$5V$}
\myresistor{$i_1$}{A}{B}{$5\Omega$}
\myresistor{$i_2$}{D}{E}{$1\Omega$}
\myresistor{$i_1$}{F}{G}{$1\Omega$}
\myresistor{$i_1$}{G}{H}{$2\Omega$}
\myresistor{$i_3$}{I}{C}{$3\Omega$}
\myresistor{$i_2$}{I}{J}{$2\Omega$}
\myresistor{$i_2$}{J}{E}{$4\Omega$}
%Cable para completar el circuito
\wire(B)(C)
\wire(C)(D)
%Tierra
\newground(C)
\end{pspicture}}}
\caption{Circuito con dos mallas.}\label{fig:circuito}
\end{figure}
<link href="http://google-code-prettify.googlecode.com/svn/trunk/styles/sunburst.css" rel="stylesheet" type="text/css"></link>
<script src="http://google-code-prettify.googlecode.com/svn/trunk/src/prettify.js" type="text/javascript">
</script>
Y en la etiqueta <body> poner:<body onload='prettyPrint()'>Para utilizarlo, en la entrada hay que poner:
<pre class="prettyprint"><code class="language-java">...</code></pre>
Puede ver un ejemplo de código Java resaltado haciendo clic aquí. Si dispones de algún dominio en internet, puedes decargar el script de Google Pretty Print y no depender de los enlaces de Google. Para ello, puedes descargarlo desde la página oficial de Google Pretty Print haciendo clic aquí.
/**
* Creates a new CD, provided its title, group, and song list.
* @param title The title.
* @param group The group.
* @param tracks The song titles.
*/
public CompactDisc(String title, String group, String... tracks) {
this.title = title;
this.group = group;
this.tracks = Arrays.asList(tracks);
// Since CompactDiscs are immutable, the hash value will never change for an instance.
this.hashvalue = (new String(title + group)).hashCode();
}