From 35e64bf95130074ac0596f7c7035b152ae577dd2 Mon Sep 17 00:00:00 2001 From: Juergen Spitzmueller Date: Sun, 26 Jan 2014 19:23:40 +0100 Subject: [PATCH] Allow usage of algorithm2e package (#8744) This simple module allows users to use the algorithm2e package at all. Before, it was not possible with LyX, since this package conflicts with LyX's own algorithm support (see also #8728) --- lib/Makefile.am | 1 + lib/chkconfig.ltx | 1 + lib/doc/LaTeXConfig.lyx | 76 ++++++++++++++++++++++++++++++++-- lib/layouts/algorithm2e.module | 26 ++++++++++++ src/LaTeXFeatures.cpp | 3 +- 5 files changed, 103 insertions(+), 4 deletions(-) create mode 100644 lib/layouts/algorithm2e.module diff --git a/lib/Makefile.am b/lib/Makefile.am index f1b2d9cc14..debe510262 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -1890,6 +1890,7 @@ dist_layouts_DATA =\ layouts/agu_stdtitle.inc \ layouts/agums.layout \ layouts/aguplus.inc \ + layouts/algorithm2e.module \ layouts/amsart.layout \ layouts/amsbook.layout \ layouts/amsdefs.inc \ diff --git a/lib/chkconfig.ltx b/lib/chkconfig.ltx index bd593e5da4..e22c7d9371 100644 --- a/lib/chkconfig.ltx +++ b/lib/chkconfig.ltx @@ -271,6 +271,7 @@ \TestPackage{accents} \TestPackage{achicago} \TestPackage{algorithm} +\TestPackage{algorithm2e} \TestPackage{amstext} \TestPackage{apacite} \TestPackage{apalike} diff --git a/lib/doc/LaTeXConfig.lyx b/lib/doc/LaTeXConfig.lyx index a856894e5d..f1df9ce3ea 100644 --- a/lib/doc/LaTeXConfig.lyx +++ b/lib/doc/LaTeXConfig.lyx @@ -1,5 +1,5 @@ #LyX 2.1 created this file. For more info see http://www.lyx.org/ -\lyxformat 462 +\lyxformat 474 \begin_document \begin_header \textclass article @@ -31,6 +31,7 @@ \use_geometry false \use_package amsmath 0 \use_package amssymb 0 +\use_package cancel 0 \use_package esint 0 \use_package mathdots 0 \use_package mathtools 0 @@ -39,7 +40,7 @@ \use_package stmaryrd 0 \use_package undertilde 0 \cite_engine basic -\cite_engine_type numerical +\cite_engine_type default \biblio_style plain \use_bibtopic false \use_indices false @@ -59,7 +60,7 @@ \papercolumns 1 \papersides 1 \paperpagestyle plain -\tracking_changes false +\tracking_changes true \output_changes false \html_math_output 0 \html_css_as_file 0 @@ -67,6 +68,7 @@ \html_latex_start \html_latex_end \author -1379302345 "Julien Rioux" jrioux@lyx.org +\author -712698321 "Jürgen Spitzmüller" \end_header \begin_body @@ -6193,6 +6195,74 @@ index of algorithms \end_inset too. +\change_inserted -712698321 1390760230 + +\end_layout + +\begin_layout Subsection + +\change_inserted -712698321 1390760234 +algorithm2e +\end_layout + +\begin_layout Description + +\change_inserted -712698321 1390760231 +Found: +\begin_inset Info +type "package" +arg "algorithm2e" +\end_inset + + +\end_layout + +\begin_layout Description + +\change_inserted -712698321 1390760405 +CTAN: +\family typewriter +/macros/latex/contrib/algorithm2e/ +\end_layout + +\begin_layout Description + +\change_inserted -712698321 1390760383 +Notes: The package +\family sans +algorithm2e +\family default + is an alternative, somewhat more powerful way to output +\begin_inset Quotes eld +\end_inset + +algorithm +\begin_inset Quotes erd +\end_inset + + floats. + If you want to use it instead of the standard +\family sans +algorithm +\family default + package, select the module +\begin_inset Quotes eld +\end_inset + +Algorithm2e +\begin_inset Quotes erd +\end_inset + + in +\family sans +Document\SpecialChar \menuseparator +Settings\SpecialChar \ldots{} +\SpecialChar \menuseparator +Modules +\family default +. +\change_unchanged + \end_layout \begin_layout Subsection diff --git a/lib/layouts/algorithm2e.module b/lib/layouts/algorithm2e.module new file mode 100644 index 0000000000..ededd8d3bf --- /dev/null +++ b/lib/layouts/algorithm2e.module @@ -0,0 +1,26 @@ +#\DeclareLyXModule[algorithm2e.sty]{Algorithm2e} +#DescriptionBegin +# Use the algorithm2e package for algorithm floats rather +# then LyX's home-brewn algorithm floats. +#DescriptionEnd +# +#Author: Jürgen Spitzmüller + +Format 35 + +Requires algorithm2e + +Float + Type algorithm + GuiName Algorithm + Placement tbp + Extension loa + NumberWithin none + Style plain + ListName "List of Algorithms" + IsPredefined true + UsesFloatPkg false + ListCommand listofalgorithms + RefPrefix alg +End + diff --git a/src/LaTeXFeatures.cpp b/src/LaTeXFeatures.cpp index 458d07ff61..c68729f5aa 100644 --- a/src/LaTeXFeatures.cpp +++ b/src/LaTeXFeatures.cpp @@ -740,7 +740,8 @@ char const * simplefeatures[] = { "multirow", "tfrupee", "shapepar", - "rsphrase" + "rsphrase", + "algorithm2e" }; char const * bibliofeatures[] = {