# Collecting algorithm captions in WinEdt

I've installed the add-on Figures&Tables in WinEdt, which lets me collect table and figure captions in WinEdt's Tree.

I would like to be able to collect algorithm captions, as well.

With the following MWE

\documentclass{article}

\usepackage{algorithm}

\begin{document}

\begin{table}[h]
\caption{Table test}
\end{table}

\begin{figure}[h]
\caption{Figure test}
\end{figure}

\begin{algorithm}[h]
\caption{Algorithm test}
\end{algorithm}

\end{document}


WinEdt's Tree shows

Is there any way to show a branch for algorithms?

## Update (2016-04-10)

By installing the add-on Floats you will be able to collect algorithm captions.

Yes, it is possible. Follow these steps:

1. Show the "Options Interface" (Options -> Options Interface)

2. In the "Options Interface", double-click the "Tree" item (Tree.ini gets opened)

3. Since you have the add-on "Figures&Tables" installed, you should have a line

END="Tables-TeX"


Just after that, insert the following lines

BRANCH="Algorithms-TeX"
BRANCH_CAPTION="Algorithms  (#)"
// Change Mode from TeX to ? to disable this item
BRANCH_MODE_FILTER="TeX|DTX;INS;STY;AUX"
BRANCH_ICON="CodeSample"
BRANCH_SORTED=0
BRANCH_CASE_SENSITIVE=1
BRANCH_IGNORE_VERBATIM=1
BRANCH_EXPANDED=0
ITEM="\begin{algorithm}?\end{algorithm}"
ALT="\begin{algorithm*}?\end{algorithm*}"
ALT="\begin{procedure}?\end{procedure}"
ALT="\begin{procedure*}?\end{procedure*}"
ALT="\begin{function}?\end{function}"
ALT="\begin{function*}?\end{function*}"
ALT="\begin{algorithm2e}?\end{algorithm2e}"
ALT="\begin{algorithm2e*}?\end{algorithm2e*}"
MODE_FILTER="TeX"
CASE_SENSITIVE=1
BEGINNING_OF_LINE_ONLY=1
CURRENT_DOCUMENT_ONLY=1
ALL_OPENED_DOCUMENTS=0
COMPLETE_PROJECT_TREE=1
ICON="FlagPurple"
LEVEL=0
CAPTION="%[!|Exe('%b\Macros\Gather\FigTab.edt');|];%-0"
MAX_LINE_SPAN=99
ON_CLICK_MACRO="TreeTrack(2,1);"
ON_DBL_CLICK_MACRO="TreeTrack(2,2);"
ACTION="Find"
IMAGE="Find"
MACRO="TreeTrack(2);"
SUBSTITUTION="\label{*}"
SUB_FIND="\\label\{*\}"
SUB_REPLACE=""
SUB_REG_EX=1
SUB_CASE_SENSITIVE=1
SUBSTITUTION="  "
SUB_FIND=" +{ }"
SUB_REPLACE=" "
SUB_REG_EX=1
SUB_CASE_SENSITIVE=1
SUBSTITUTION="\dots"
SUB_FIND="\dots"
SUB_REPLACE="..."
SUB_REG_EX=0
SUB_CASE_SENSITIVE=1
SUBSTITUTION="\ldots"
SUB_FIND="\ldots"
SUB_REPLACE="..."
SUB_REG_EX=0
SUB_CASE_SENSITIVE=1
END="\begin{algorithm}?\end{algorithm}"
END="Algorithms-TeX"

4. Press Shift+Ctrl+F9 to reload the file.

Now you will be able to collect algorithm captions for the following environments, defined by the algorithm and the algorithm2e packages:

• algorithm
• algorithm*
• procedure
• procedure*
• function
• function*
• algorithm2e
• algorithm2e*

With your MWE you will get this result:

• @Sterry You're welcome. Since it seems to be a good addition, I'm thinking to add it in the add-on Figures&Tables. When it will be available, I will inform you so that you can undo these changes and install the updated package :-) Feb 21 '15 at 6:22
• @Sterry A new package called "Floats" is available at winedt.org/Config/Tree/Floats.php. It contains these improvements and much more. Please undo these changes and uninstall "Figures&Tables" before installing the new add-on. Feb 21 '15 at 12:14
• Wonderful! Great add-on. Feb 21 '15 at 16:26