.. role:: ml(code)
   :language: matlab

.. role:: raw-html(raw)
   :format: html

.. role:: raw-latex(raw)
   :format: latex

.. role:: hl

..
    -------------------------------------------------------------------
    Be sure to update version numbers in xxx-manual-x.x.pdf URLs below
    They should match the corresponding version in premable.tex.txt
    -------------------------------------------------------------------

.. |br| replace:: :raw-html:`<br \>`:raw-latex:`\\`

.. |MATPOWER| replace:: :raw-html:`M<span style="font-size:smaller">ATPOWER</span>`:raw-latex:`\matpower{}`
.. |MATPOWER>| replace:: :raw-html:`<a href="https://matpower.org">M<span style="font-size:smaller">ATPOWER</span></a>`:raw-latex:`\matpowerlink{}`
.. |/MATPOWER/| replace:: :raw-html:`<em>M<span style="font-size:smaller">ATPOWER</span></em>`:raw-latex:`\matpoweri{}`
.. |*MATPOWER*| replace:: :raw-html:`<strong>M<span style="font-size:smaller">ATPOWER</span></strong>`:raw-latex:`\matpowerb{}`
.. |MATPOWER GitHub URL| replace:: https://github.com/MATPOWER/matpower
.. |MUM| replace:: :raw-html:`<a href="https://matpower.org/docs/MATPOWER-manual-8.1.pdf">M<span style="font-size:smaller">ATPOWER</span> User's Manual</a>`:raw-latex:`\mum{}`

.. |MATPOWER-Extras| replace:: :raw-html:`M<span style="font-size:smaller">ATPOWER</span> Extras`:raw-latex:`\matpower{} Extras`
.. |MATPOWER-Extras>| replace:: :raw-html:`<a href="https://github.com/MATPOWER/matpower-extras">M<span style="font-size:smaller">ATPOWER</span> Extras</a>`:raw-latex:`\matpowerextraslink{}`

.. |MATLAB| replace:: :raw-html:`M<span style="font-size:smaller">ATLAB</span>`:raw-latex:`\matlab{}`
.. |MATLAB>| replace:: :raw-html:`<a href="https://www.mathworks.com">M<span style="font-size:smaller">ATLAB</span></a>`:raw-latex:`\matlablink{}`
.. |MATLAB(R)| replace:: :raw-html:`M<span style="font-size:smaller">ATLAB<sup>&reg;</sup></span>`:raw-latex:`\matlabr{}`

.. |Octave| replace:: :raw-html:`GNU Octave`:raw-latex:`\matlab{}`
.. |Octave>| replace:: :raw-html:`<a href="https://www.octave.org">GNU Octave</a>`:raw-latex:`\matlablink{}`

.. |PSerc| replace:: :raw-html:`PS<span style="font-size:smaller">ERC</span>`:raw-latex:`\pserc{}`
.. |PSERC| replace:: :raw-html:`Power Systems Engineering Research Center (PS<span style="font-size:smaller">ERC</span>)`:raw-latex:`\PSERC{}`
.. |Certs| replace:: :raw-html:`C<span style="font-size:smaller">ERTS</span>`:raw-latex:`\certs{}`
.. |CERTS| replace:: :raw-html:`Consortium for Electric Reliability Technology Solutions (C<span style="font-size:smaller">ERTS</span>)`:raw-latex:`\CERTS{}`

.. |MIPS| replace:: :raw-html:`MIPS`:raw-latex:`\mips{}`
.. |MIPS>| replace:: :raw-html:`<a href="https://github.com/MATPOWER/mips">MIPS</a>`:raw-latex:`\mipslink{}`
.. |MIPSname| replace:: :raw-html:`<b>M</b><span style="font-size:smaller">ATPOWER</span> <b>I</b>nterior <b>P</b>oint <b>S</b>olver`:raw-latex:`\mipsname{}`
.. |MIPSman| replace:: :raw-html:`<a href="https://matpower.org/docs/MIPS-manual-1.5.2.pdf">MIPS User's Manual</a>`:raw-latex:`\mipsman{}`

.. |MPTEST| replace:: :raw-html:`MP-Test`:raw-latex:`\mptest{}`
.. |MPTEST>| replace:: :raw-html:`<a href="https://github.com/MATPOWER/mptest">MP-Test</a>`:raw-latex:`\mptestlink{}`
.. |MPTESTman| replace:: :raw-html:`<a href="https://github.com/MATPOWER/mptest">MP-Test README</a>`:raw-latex:`\mptestman{}`

.. |MPOM| replace:: :raw-html:`MP-Opt-Model`:raw-latex:`\mpom{}`
.. |MPOM>| replace:: :raw-html:`<a href="https://github.com/MATPOWER/mp-opt-model">MP-Opt-Model</a>`:raw-latex:`\mpomlink{}`
.. |MPOMman| replace:: :raw-html:`<a href="https://matpower.org/docs/MP-Opt-Model-manual-5.0.pdf">MP-Opt-Model User's Manual</a>`:raw-latex:`\mpomman{}`

.. |MOST| replace:: :raw-html:`MOST`:raw-latex:`\most{}`
.. |MOST>| replace:: :raw-html:`<a href="https://github.com/MATPOWER/most">MOST</a>`:raw-latex:`\mostlink{}`
.. |MOSTname| replace:: :raw-html:`<b>M</b><span style="font-size:smaller">ATPOWER</span> <b>O</b>ptimal <b>S</b>cheduling <b>T</b>ool`:raw-latex:`\mostname{}`
.. |MOSTman| replace:: :raw-html:`<a href="https://matpower.org/docs/MOST-manual-1.3.1.pdf">MOST User's Manual</a>`:raw-latex:`\mostman{}`

.. |TN5| replace:: :raw-html:`<a href="https://matpower.org/docs/TN5-MP-Element.pdf"><em>M<span style="font-size:smaller">ATPOWER</span> Technical Note 5</em></a>`:raw-latex:`\TNfive{}`
.. |MATPOWER-Users-Manual| replace:: :ref:`MATPOWER User's Manual <matpower_users_manual>`
.. |MATPOWER-Dev-Manual| replace:: :ref:`MATPOWER Developer's Manual <matpower_dev_manual>`
.. |MATPOWER-Ref-Manual| replace:: :ref:`MATPOWER Reference Manual <matpower_ref_manual>`
.. |MP-Test-Users-Manual| replace:: :ref:`MP-Test User's Manual <mptest_users_manual>`
.. |MIPS-Users-Manual| replace:: :ref:`MIPS User's Manual <mips_users_manual>`
.. |MP-Opt-Model-Users-Manual| replace:: :ref:`MP-Opt-Model User's Manual <mpom_users_manual>`
.. |MOST-Users-Manual| replace:: :ref:`MOST User's Manual <most_users_manual>`

..
    .. |MATPOWER-Users-Manual| replace:: :raw-html:`<a class="reference external" href="https://matpower.org/doc/users-manual/"><em>M<span style="font-size:smaller">ATPOWER</span> User’s Manual</em></a>`:raw-latex:`\userman{}`
    .. |MATPOWER-Dev-Manual| replace:: :raw-html:`<a class="reference external" href="https://matpower.org/doc/dev-manual/"><em>M<span style="font-size:smaller">ATPOWER</span> Developer’s Manual</em></a>`:raw-latex:`\devman{}`
    .. |MATPOWER-Ref-Manual| replace:: :raw-html:`<a class="reference external" href="https://matpower.org/doc/ref-manual/"><em>M<span style="font-size:smaller">ATPOWER</span> Reference Manual</em></a>`:raw-latex:`\refman{}`
    .. |MATPOWER-Dev-Manual| replace:: *Developer's Manual*
    .. _MATPOWER-Dev-Manual: https://matpower.org/doc/dev-manual/
    .. |MATPOWER-Ref-Manual| replace:: *Reference Manual*
    .. _MATPOWER-Ref-Manual: https://matpower.org/doc/ref-manual/
