Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>TOPAS EditorNew to Visual Studio Code? Get it now.
TOPAS Editor

TOPAS Editor

johnsoevans

|
1,681 installs
| (1) | Free
Interface to TOPAS powder diffraction software
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

topas-editor extension

topas-editor is a VS Code extension that helps you interact with TOPAS Academic, Bruker TOPAS and tc.exe.

  • It colour-codes and decorates TOPAS files by syntax making it easier to spot errors. Refined and fixed numbers are coloured differently so they can be quickly distinguished.
  • It lets you send files to/from TOPAS.
  • It has various shortcut keys to speed up interactions.
  • It has menus/commands to let you create/edit INP files quickly.
  • It has hover help if you place the cursor over certain keywords.
  • It will highlight common errors like 0.333 site coordinates, wrong space groups or unrecognised atoms, or can correct them automatically.
  • It can automatically set symmetry constraints on structures.
  • It can interact with AI engines via the TOPilot topas-inp-writer skill.
  • It should do everything that the TOPAS community did in jEdit and more.
  • There's an introductory video and a power editing tricks video on John's YouTube channel.
  • Responsibility for INP file scientific content is the user's responsibility - use with care.

Version History

  • 2.0.0 released August 2026 with new python-enabled commands and TOPilot AI integration
  • 1.1.n released for Stuttgart school May 2025
  • 1.0.0 released 1/12/2024

Quick installation guide

  1. First install topas-editor from VS Code market place by searching for "topas-editor" and following the instructions. The "Commands" and "align-columns" and "Edit with Shell Commands" extensions will be automatically installed at the same time.
  2. You should be prompted about setting a colour theme, installing menus and installing skills automatically.
  3. If this doesn't happen, in a VS Code window type ctrl-t-u (hold down ctrl then type t and u ). Alternatively type "ctrl-shift-p" and start typing "Topas menu setup" then select and execute the command suggested. Confirm you happy to install the TOPAS menus, then navigate and select the TOPAS directory if prompted to do so.
  4. You should then be able to see TOPAS menus by clicking on the "triangle in circle icon" on the left panel.
  5. You may need to quit VS Code and restart.
  6. You might like to install the indent-rainbow extension to make viewing indented INP files easier. Add a command like the following to your settings.json so that mixed spaces don't get flagged as errors: "indentRainbow.ignoreErrorLanguages" : ["markdown","haskell","topas"]
  7. More installation detail on John's website, or John's YouTube channel.
  8. Instructions on how to do your first topas-editor refinement are on John's website.

Dependencies

topas-editor is designed to work with the "Commands" extension from Alexander to give jEdit-like functionality to VS Code. "Commands" and a few other useful extensions will auto-installed with topas-editor as listed in the package.json extensionDependencies.
You will need python3 installed for some commands to work, particularly TOPilot commands.

Top 10+ topas-editor tips

  1. ctrl-t* lets you run quick topas commands - see readme or menus for what's available.
  2. Right click in an INP file gives you access to most common commands
  3. shift-ctrl-f gives you a hypersearch like alt-. in jEdit.
  4. shift-ctrl-p lets you enter any vs Code command. Type "Topas" for the TOPAS related ones.
  5. ctrl-th turns hover tips on/off
  6. Try the different TOPAS colour themes in "VS Code+TOPAS commands" or ctrl-tl.
  7. Remove esd or refinement markers from the file with ctrl-te and ctrl-tr.
  8. Toggle comments with ctrl-t/.
  9. Indent your INP files for readability. For example, everything below an xdd should be tabbed in once, everything below one of its str's should be tabbed in twice. Use rainbow-indent to help.
  10. Alt-click lets you set up multiple cursors. Shift-Alt-click will let you highlight blocks for column editing. Right-click Align-columns lets you align by cursor.
  11. ctrl-tf lets you type in a string of text and will search for INP files containing that text.
  12. ctrl-tx creates a time-stamped archive of any file you're working on.
  13. If you have a correlation matrix in your INP file, right click and "insert output lines..." will generate a set of instructions to tabulate all named parameters to a results file for plotting.
  14. Select a str and right click for "Topas symmetrize selection" or "Topas symmetrize selection and refine" to refine atoms according to the space group symmetry.
  15. Try "Refine atoms (with min/max)" (via a right click) to stop atoms wandering from ideal sites or "Refine beq by site type" as a quick way to control adp refinement.
  16. ctrl-td turns horizontal markers for xdd and str sections on/off, xdds have a solid line strs a dashed line.
  17. Use the "Edit with Shell Command" extension to run any linux command like "sort" or "sort -u" or "sort - k2,2" or "grep" on selected text. If it's a new command remember to type "esc" before entering it. You need to make sure your "Edit with Shell" shell is set to wsl in its settings and add "bash" and "-c" to the windows shell arguments. You need a windows subsystem linux environment like ubuntu installed.
  18. Use the TOPilot interace to issue any editing commands via AI.

Shortcut keys/menus

You can run the most common TOPAS commands with short cut keys. Some are also available via a right-click. Hold down ctrl then hit "t" for TOPAS followed by a second key:

  • ctrl-ta: run TOPAS Academic
  • ctrl-tb: run TOPAS Bruker
  • ctrl-tc: run TC on the current INP file
  • ctrl-td: add or remove horizontal markers for xdd and str sections
  • ctrl-tf: find INP file containing specific text
  • ctrl-tg: list standard space groups
  • ctrl-th: toggle hover help on/off
  • ctrl-ti: insert str from CIF
  • ctrl-tl: light/dark theme toggle
  • ctrl-to: open .OUT file corresponding to current .INP
  • ctrl-tr: remove ` backtick refined markers from file
  • ctrl-ts: save and send INP file to TOPAS
  • ctrl-tt: select a template file
  • ctrl-tu: update TOPAS menus after topas-editor update
  • ctrl-tw: set up symmetry constraints on selection (w = wyckoff)
  • ctrl-tx: make a date stamped archive of current INP file
  • ctrl-t/: add/remove comment markers around current selection
  • shift-ctrl-f: does the equivalent of the jEdit alt-. hypersearch

The default TOPAS menus

Most topas-editor commands are written in typescript. A small number use python and are labelled with a snake icon. topas-editor will try to identify an python installation on your computer if one is available.

Top level menus

  • Topas-editor help shows a quick help guide
  • Send INP to TOPAS will save the current INP file and inform TOPAS to read from this file. A .backup is made at the same time.
  • A single click on the "Run *" menus will run either the academic or commercial versions of TOPAS. a dialog window will tell you the software is launching. TA and topas.exe both run in windows high priority mode.
  • Run TC will execute the command line version of TOPAS. You can follow Rwp values in the terminal window. The .INP file gets automatically updated on convergence. A .backup file is made in case things go wrong. TC runs in windows normal priority mode. If you click Cancel the run is stopped (ctrl-c is a full cancel) and the INP file is updated.
  • Archive INP file will create a time-stamped copy of the INP file.

Help/General/Links

  • This subfolder contains links to various help pages.
  • The "View TOPAS..." menus open html files with information about keywords, TOPAS structure and allowed space groups.
  • It also lets you load the various macro files (.inc) that contain TOPAS commands. These are useful for learning the TOPAS syntax and understanding some of the maths underlying fits.
  • topas.log gets written every time TOPAS runs and contains the INP file in a more basic syntax. It's useful for debugging.

TOPAS_Durham menus overview

These reproduce and extend the old jEdit menus. There are fewer submenus than previously as VS Code makes it easier to unify menus.

TOPAS_Durham "Rietveld or Pawley INP File"

If you click through these menus from top to bottom you can create a simple INP file for fitting. Orange icons mean you can only make one choice in that section.

  • First click on "Select Data File" and navigate to select a data file in TOPAS supported format (.xy, .xye, .RAW, etc)
  • Then select one of the instrument choices from the "Instrument Choices" folder
  • Click any of the corrections you need to apply. In general you should refine either zero point or sample height but not both on a lab Bragg-Brentano instrument.
  • In the "Rietveld or Pawley" folder click on one of the options for inputting a structure or for adding a Pawley phase. "Read from str or ISODISTORT" replaces the jEdit symmetry mode refinements menu. Multiple CIFs can be inserted with a single overall peak shape and size/strain can be added for each as appropriate. The first CIF read option is the traditional TOPAS cif1.exe approach. The second uses the TOPilot skills cif_to_str.py and symmetrize_str.py to apply symmetry restraints automatically. It will also read anisotropic adps if present.
  • In the "Miscellaneous for str" folder choose any of the options needed.
  • "Symmetrize Selection" will attempt to set up any cell parameters or site refinements so that they obey symmetry. It uses some of the TOPilot AI python skills, so these must be setup initially, but doesn't rely on a LLM. Highlight a str selection and run. The script will attempt to find the correct spacegroup but may fail if you highlight multiple strs. Symmetry detection is based directly on the TOPAS sg file, so sgcom6.exe is run if the space group isn't detected. The sister command sets the parameters to refine. The python script can also be run directly from a terminal.
  • "Refine sites with min/max" will take the higlighted site lines and introduce macros to control how far atoms can move. This is a good way to start a refinement, and lets you reset coordinates that wander (by setting max_shift limit to +/- 0 from ideal). It sets one beq per atom type and tries to retain any occupancy information in the file. It's best to run this after coordinates have been flagged to refine with "Symmetrize selection and refine".
  • "Refine beq by site type" will put an equated beq value on each atom of the same occupancy type

TOPAS_Durham "Neutron tof", "Single crystal", "PDF fitting", "Indexing", "Peak fitting"

These folders let you access pre-written templates for different types of fitting. The files are read from the templates folder in your topas-editor assets directory. You can also download templates via the "Prewritten Templates" menu if you don't have them. Once a file has been selected you have to save it as an appropriate name in a folder of your choosing (not the templates folder). You then have to remove any text following arrow (->) signs, which will be coloured purple by default. The template folder will be somewhere on your computer like C:\Users\username.vscode\extensions\johnsoevans.topas-editor-n.m.p\assets\templates.

TOPAS_Durham "Prewritten templates"

This folder lets you select a prewritten template. Once a file has been selected you have to save it as an appropriate name in a folder of your choosing (not the templates folder). You then have to remove any text following arrow (->) signs, which will be coloured purple by default. This is often the quickest way to set up more complex INP files. There is a menu for downloading new templates from the TOPAS wiki.

TOPAS_Durham "Simulate pattern"

This menau lets you select a .CIF file and will simulate a Cu Ka2 data set. Edit the INP file directly for other simulations.

TOPAS_Durham "TOPAS examples"

The commands in this submenu let you find example INP files for inspiration.

  • "Search all examples for text string" lets you type in any phrase and search for that phrase in INP files. For example if you type "stack" you will get various INP files for stacking fault refinements. The search could take a few seconds to complete but can be cancelled at any time. By default it prompts with the main TOPAS folder, but you can select another folder. By default it prompts with the main TOPAS folder, but you can select another folder.
  • All examples gives a full list of example inp files that you can select from.
  • The other options list the INP files in various subfolders in "test_examples" of your main TOPAS directory.

TOPAS_Durham "Miscellaneous useful commands"

Contains what you might expect from the title!

  • Most commands should be self explanatory
  • "Insert #list commands" inserts a block of text at the top of the file with #list instructions for multiple runs
  • "Insert output lines automatically" attempts to insert instructions to create an output file called 'results.txt' with all named parameters with headings on the columns. You need do_errors on to create a correlation matrix with parameter names. Any name with 8 consecutive hexadecimal characters is presumed to be auto-created by TOPAS so not output. If this is a problem use short parameter names! It works with #list so presumes you have set up the xdd dataset as "filename" and are using a Run_Number. With this format all parameters with esds can be plotted from a trivial Python script.
  • "Create column headings from Out() lines" will try and make an Out_String("...") line for results.txt based on the Out() and Out_String() lines from the cursor position to the end of file. It will try and identify which parameters have esds. It will probably only work for standardish syntax.
  • "Insert Z-matrix from Gaussian .gzmat" attempts to convert a Gaussian format Z-matrix to TOPAS format. Not extensively tested so use with care.
  • "Insert/process molecular CIF (Fabio)" will run a .js script by Fabio Furlan Ferreira that will insert a CIF for a molecular structure. It attempts to set up riding H atoms and to set atomic coordinates to fractions like =1/2; where needed.
  • "Cu Kb and W Ka contamination" adds lines to the emission profile for these radiations. Cu Kbeta is common when using a psd detector as the Ni filter doesn't remove all radiation. W Kalpha is common on old tubes due to deposition of the filament material on the Cu or Mo target.
  • "Run shell command on selection" lets you put highlighted text through a shell command. It uses the windows linux environment to process text through "sort -u", "grep", "sort -k2,2" or whatever you want.
  • "Insert Reel setup commands" and "Insert Reel output commands" put in text blocks to automatically turn on/off different phases to calculate their contribution to the pattern an write parameters in Reel format
  • "Insert column numbers automatically" will either put numbers into a highlighted column for autonumbering or insert a sequence of numbers. You can enter start, step, max and padding as appropriate. Padding is the number of 0000 characters in label. If you just hit return at the prompt it will do something sensible. If you enter one number it assumes that is start, etc. ",reverse" at the end of the line reverses the order.

TOPAS_v8_Menus

This is reproduced from jEdit. It contains a list of clickable TOPAS commands organised by INP file scope. Most commands will work in v7 or v6.

TOpyAS

Somewhere to store commands to run python routines that are part of your TOPAS workflow. Most commands try to resolve your python path automatically. You can also set it explicitly in topas-editor settings. If you don't have python try the Microsoft Store Python if you have appropriate permissions. Alternatively, WinPython provide a version that can be unzipped to any folder. Note that a small number of other topas-editor commands call python scripts.

  • "Plot refinement results" will copy plot_all.py to your directory and try and plot a file called "results.txt" using Run_Number as the x-axis. If you've done a standard analysis using John's filename conventions you should get plots of all parameters with esd's on the screen. If it fails you have the python script to edit.
  • "TOPAS live plot" will copy live_plot.py to your folder. You can use it to plot parameters from a refinement on a single sheet. It updates as the refinements progress. You can put several items on one plot or use wild cards like "perc*" to put all weight percentages on a single plot. You can enter columns to plot as dictionary items which lets you e.g. normalise data, add columns, divide columns, etc.
  • "Run pdCIFplotter" will launch Matthew Rowles' cif plotter if it's installed.
  • "Execute python from INP" inserts a command for TOPAs to run a python script after Rietveld(s).

VS Code+TOPAS commands

Some VS Code commands that are useful with TOPAS.

  • Set a light, dark or techref TOPAS colour scheme.
  • "Remove esd's from file" will strip out topas `_0.001 type information from the file.
  • "Remove backticks from file" will strip out topas ` characters.
  • "Toggle comment block on-off /../" will put highlighted text into a TOPAS /.../ comment block, or remove the comment markers if it's already commented.
  • Folding commands to make VS Code folds on topas '{{{ '}}} and #ifdef #endif markup, in addition to standard things.
  • Save commands.
  • Update commands.

VS Code+TOPAS setup

  • Set the TOPAS directory environment variable. This should be a permanent change, but I sometimes find it reverts to earlier values. If TOPAS doesn't launch check the settings (menu below) then reset TOPAS directory.
  • Menus won't get automatically updated when topas-editor updates, but you are normally prompted to update them. When this happens you have three options: update, never, later. If you select "later" you will be prompted to update everytime VS Code starts. If you click "never" you won't be asked again until topas-editor is updated. You should be prompted to set the TOPAS directory if it is unset; this isn't fully reliable.
  • Update topas menus lets you update menus even if you clicked "never" in previous setups.
  • Add my menus lets you (re)install personal menus (see below).
  • Install mcaro libraries lets you install e.g. macro libraries for cif, wppm, etc
  • Show topas-editor paths and settings will pop up a message windoow giving the topas directory (TOPAS_DIR) and your topas-editor storage folders.
  • Hover help on/off toggle will turn the pop up help when you hover over a word on/off
  • "Toggle file decorations" will turn decorations on an off. These include horizontal lines to separate xdd and str type sections, highlighting of wrong space groups and site occupancies and highlights on fractional coordinates like 0.333/0.666 which should probably be equations (=1/3;). xdd level gets a solid line and str/hkl_Is/xo_Is get a dashed line above them.

TOPilot AI Interface

This folder contains ways to interact with AI LLMs. This is experimental so use with caution. The final responsibility for INP files is yours.

  • TOPilot help/disclaimer tells you how to set up Claude Code, GitHub Copilot or Codex to work with INP files.
  • "Install/update TOPAS AI skills" will put a topas-inp-writer skills folder in your .claude/skills directory. This teaches Claude and Copilot TOPAS syntax and rules. You can tell Codex to read the same skills. The skill will be downloaded from GitHub and overwrite any existing topas-inp-writer skill in your users/username/.claude/skills directory
  • "AI select a Claude request" sends prewritten prompts directly to the Claude CLI. You can add your own prompts in the skills folder.
  • "AI select a Copilot request" sends prewritten prompts directly to GitHub Copilot.
  • "AI select a Codex request" sends prewritten prompts directly to the Codex CLI (ChatGPT).

Custom menus - My Menus

This is where you can add your own TOPAS commands. You can edit the commands directly in settings.json by right clicking on the menu and selecting "reveal in settings.json". However these commands will get overwritten every time you update topas-editor menus. You should therefore store them in a file called something line "my_menus.json". After every menu update run the command "Add my menus" to reinstall them. There's an example menu file in the topas-editor assets folder. It will be somewhere like: C:\Users\username.vscode\extensions\johnsoevans.topas-editor-1.0.13\assets. This is untested!

Common tips and tricks

These are some useful tricks.

  • If you want to auto-align text for column editing then select the text and type shift-ctrl-P then start typing align. Select "align mulitiple columns by separator". Type in a space.
  • Select a column of text with "shift-alt-click". Hit esc to go back to normal cursor editting.
  • VS Code doesn't have jEdit's ability to select beyond the end of a line. If there is an extension for this let me know.
  • Run TA or TOPAS commercial from the side menus or status bar at the bottom
  • Run tc.exe directly on the current INP file and update the INP file being edited
  • editWithShell.runCommand: uses Edit with Shell Command extension command to execute any shell script on a selection (sort -u, grep, etc)

topas-editor VS Code Topas*.ts commands

Various TOPAS-related commands are available either in menus or via VS Code commands are below. Most are in typescript .ts files written by John. Fabio has contributed some in javascript (.js).

  • TopasAddMyMenus.ts: adds your menus from a .json file
  • TopasArchive.ts: creates a timestamped copy of filename_YYYY-mm-dd-hhmm.INP (or any other extension)
  • TopasBeqByType.ts: sets one beq per atomic type on highlighted atoms
  • TopasCreateInpFile.ts: Will make an INP file via the Durham menus
  • TopasCreatePeakFitFile.js: Fabio's js to create a file for peak fitting
  • TopasDecoration.ts: puts line decorations above xdd and str sections and warn about incorrect space groups, site occupancies and fractions like 0.3333
  • TopasDownloadTechRef.ts: both TopasViewFiles.ts and TopasOpenTechRef.ts read technical_reference.html. This helper downloads it if it is not in topas_dir
  • TopasDownloadTestExamples.ts: gets test_examples if not in topas_dir (e.g. TOPAS commercial users)
  • TopasFold.ts: Will fold on the jEdit style '{{{ ... '}}} brackets, topas #ifdef ... #endif type syntax and macros with a single {} in them
  • TopasGzmatToTopasZmatrixPy.ts: imports a Gaussian .gzmat file using a python script [redundant]
  • TopasHoverHelp.ts sets up hoverhelp to read from hovertext_help.md or from the html version of technical_reference.html linking to the embedded pdf or tree structure (experimental), or to macro_browser.html
  • TopasImportCIF.ts: Will run cif1.exe and insert temp.str. Thanks to Fabio multiple strs can be inserted with a single overall TCHZ function. Each str has an optionsal size/strain peak shape description.
  • TopasImportCIFFabio.js: Fabio's cif reading js
  • TopasImportSymmetrizeCIF.ts: Runs the TOPilot skill cif_to_str.py and symmetrize_str.py to automatically apply symmetry constraints
  • TopasInpFromTemplate.ts: Will load a template file and prompt to save to new filename
  • TopasInsertFileTextArg.ts: Does various insertions of pre-existing files depending on arguments passed
  • TopasInsertGzmat.ts: Tries to read a Gaussian .gzmat Z-matrix format and insert. Has only been tested on a few files. Based on Marko Vando's convert.py.
  • TopasInsertPeakFittingBlock.js: Fabio's js to insert a peak fitting block
  • TopasInsertSnippet.ts: Inserts longer chunks of text based on argument passed (e.g. list for #list commands)
  • TopasInsertStructure.ts: Allows user to insert a basic structure via prompts
  • TopasInstallMacros.ts: Will copy .inc macro libraries from topas-editor assets to the TOPAS directory and update local.inc to #include them
  • TopasLivePlotPy.ts: copies live_plot.py to folder
  • TopasMenuSetup.ts: Will try and set up TOPAS menus from your latest topas-editor installation, and checks if the TOPAS directory is set
  • TopasMessage.ts: test command
  • TopasMolToInp.ts: reads a mol file
  • TopasNumberColumn.ts: Will put in a string of numbers 0001..0010 with specified padding or will auto-number a selected column. With a selection enter start,step,padding[,reverse] (all are optional padding is the number of 0000 in label). If no column selection then also enter maximum value.
  • TopasOpenExamples.ts: Allows user to select from different TOPAS example files
  • TopasOpenMacroBrowser.ts: opens macro library in default browser
  • TopasOpenOut.ts: Opens the .out file corresponding to .inp being editted
  • TopasOpenTechRef.ts works with the hoverhelp interface to technical_reference.html
  • TopasOutputHeader.ts: Creates output string for column names based on Out() and Out_String() lines from cursor position onwards
  • TopasOutputLines.ts: Gets parameter names without 8 hexadecimal characters from correlation matrix and creates ouput lines
  • TopasOutputLinesReel.ts: Does the same thing but with output in e.g. Reel format of "Name: value".
  • TopasPlotAllPy.ts: Copies plot_all.py from assets directory to working directory and tries to run it
  • TopasPythonCommand.ts: Shared helper for any python routines to find python installation
  • TopasReadHoverHelp.ts: Opens hoverhelp_text.md to show all hints
  • TopasReelSetup.ts: Inserts the code to perform a sequential refinement and output data, Rietveld plots and individual phase contributions for Reel
  • TopasRemoveEsds.ts: Strips out '_0.001354 esds from INP file
  • TopasRemoveRefinedMarker.ts: Strips out ' strings which mark numbers as refined
  • TopasResetVersion.ts: Sets the menus version to 0.0.0. Used for testing updates
  • TopasRunTc.ts: Runs tc.exe in a terminal and gives a cancel dialog to stop run
  • TopasSaveSet.ts: Sends current INP file to TOPAS by writing to launch_file.txt in your main TOPAS directory
  • TopasSearchINP.ts will look through example input files for a search string and open them - prompts for directory
  • TopasSetDirectory.ts: sets topas_dir for VS Code and environment variable TOPAS_DIR for TOPilot
  • TopasSetTheme.ts: Theme selector
  • TopasShowSetup.ts: Lists topas-editor paths and settings
  • TopasSimulateFromCIF.ts: Like TopasImportCIF but sets up a logical filename for the INP
  • TopasSiteMinMax.ts: If you highlight atomic coordinates they will get rewritten to refine with min/max values around original values. Best used after setting refineable parameters by symmetry
  • TopasToAdp_5.ts: sets up format for ADP5 atomlet adp description
  • TopasToggleComment.ts: Adds or removes /* */ markers round highlighted text. Standard ctrl-/ works for line comments and shift+alt+A for block comments
  • TopasToggleDecoration.ts: Adds or removes horizontal markers before xdd and str lines
  • TopasViewFiles.ts: used to view html or md files in assets or TOPAS_DIR or elsewhere.
  • TopasAiClaudePrompts.ts: Sends a prewritten prompt to the Claude CLI. Can be useful for prompts that you use repeatedly or to send bare prompts if you have a pay-per-go account and don't want to spend tokens reading the main skills.
  • TopasAiCodexPrompts.ts: ditto for Codex
  • TopasAiCopilotPrompts.ts: ditto for GitHub Copilot
  • TopasAiInpFileSummary.ts: redundant
  • TopasAiReadHelp.ts: redundnant
  • TopasAiSetup.ts: checks GitHub for latest skills and copies to user folder
  • TopasAiSymmetrizeStr.ts: applies symmetry constraints to selection using topas-inp-writer/scripts
  • TopasAiTellDate.ts: redundant

More detailed installation guide/information [hopefully redundant]

  1. This information shouldn't be needed now as most set up is automated. It's retained in case people have problems.
  2. Install the topas-editor extension from the VS Code market place (click on the 3+1 small squares icon, type "topas editor" into the search dialog).
  3. [OR, if you have a .vsix file downloaded (e.g. from github): In a VS Code window type shift-ctrl-p to bring up the command palette. Start typing "Extension install from vsix" then return. Navigate to find topas-editor-x.y.z.vsix on your computer and install.]
  4. Either of these processes should also install the "Commands" extension from Alexander to support the TOPAS menus and other extensions. If this doesn't happen, install Commands directly by clicking on the extensions icon (4+1 small squares) and typing "Commands" in the search window. It should appear as the top entry of three extensions with this name. The icon is a blue triange in a black circle with a blue outline. The full publisher.name is usernamehw.commands@1.14.1.
  5. Set up the TOPAS menus for the Commands extension to access. In an VS Code window type shift-ctrl-p to bring up the command palette. Start typing "Topas menu setup" then select and execute the command suggested. C:\user\username\Appdata\Roaming\Code\User\settings.json should be automatically updated by adding the contents of johnsoevans\topas-editor\assets\topas-editor_settings.json . This could overwrite settings from other extensions, so a settings.json.backup file is created. You'll also be prompted to select the main TOPAS directory (which sets the TOPAS_DIR environment variable). If the setup doesn't work try one of the steps below. None of this has been fully tested.
  6. When you click on Commands' "open triangle in circle" icon on the sidebar you should see TOPAS menus similar to jEdit menus on the left.
  7. You should also see icons for the most common "Send to TOPAS", "Run TA (Academic)", "Run Bruker TOPAS" and "Run TC (command line version)" commands in the bottom status bar.
  8. If you don't see the TOPAS menus, the setup may have failed and you need to set the TOPAS menus up by hand. Try:
    a. EITHER: Add the contents of topas-editor\assets\topas-editor_settings.json to C:\user\username\Appdata\Roaming\Code\User\settings.json. One way is to click on Commands' "arrow in circle" icon. Then click on the settings cog at the top. Then click on the blue text "Edit in settings.json" that appears in the main screen. Add the contents of topas-editor\assets\settings.json, taking care not to overwrite settings of other commands.
    b. OR: If you don't have any other extension settings in settings.json, you can directly copy topas-editor\assets\topas-editor_settings.json directly to C:\Users\username\AppData\Roaming\Code\User\settings.json.
  9. The environment variable TOPAS_DIR should be set when you install menus and reloaded every time you run VS Code. If it didn't work try one of the following (you'll get an error when you try and launch TA if it hasn't worked):
    a. Go to the "VS Code+TOPAS commands" folder and click on "Set TOPAS directory".
    b. OR: in an editor window type "shift-ctrl-p" and start typing "Topas set directory".
    c. OR: as a last resort you can set up a system environment variable, but this will need changing manually if you change your topas directory. On a Durham PC where user doesn't have admin privileges this can be done from a cmd.exe window run with elevated privileges. Type the command: setx TOPAS_DIR "D:\software\topasa_v7". Use the "Show topas-editor paths and settings" command in "VS Code+TOPAS setup" folder to check your settings.
  10. Three TOPAS themes have been defined (Light, Dark and Tech Ref). You can toggle between them and/or return to default themes from the "VS Code+TOPAS commands" menu or using ctrl-shift-p and theme selector.
  11. You might also want to use the align-columns extension (jca02266.align-columns) when editting TOPAS INP files. It should be installed along with topas-editor. Select text then shift-ctrl-p align-columns.... Either align by a separator or using multiple cursors. If you e.g. align on beq sometimes an earlier space is removed; in this case align on " beq". Rylogic Text Aligner is also good for equations - it uses ctrl-alt-[ and ] to align/un-align automatically. It doesn't seem to work with spaces.
  12. You can automatically update topas-editor whenever there is an update on the marketplace. The next time you start VS Code you'll be prompted to update TOPAS menus. If you want to do this instantly, click on "Update TOPAS menus" in the "VS CODE+TOPAS setup" folder. This will overwrite any changes you have made to the menus. It's safest to reset the TOPAS directory each time.

Contributing

Contributions from johnsoevans, JamesDoingStuff, Keeble, PAChater.

FAQ

  1. The commands "triangle in circle" has disappeared from the left bar and I can't see TOPAS menus.
  • Type ctrl-shift-P then type "View reset view locations". It should return.
  1. Next question.
  • answer

Privacy, downloads and disclaimer

The topas-editor author does not collect or store any information about those installing the extension beyond what is available on the VS Code Marketplace. You may be prompted to install example input files, manual files and/or AI skill files as part of the topas-editor setup. These come from either John Evans' website (https://topas.webspace.durham.ac.uk/), John Evans' GitHub (https://github.com/johnsoevans) or https://topas-academic.com/; like any web download, these requests may appear in those sites' server logs. If you choose to use TOPilot AI skills then you need to install extensions from other providers, and the topas-editor author has no knowledge of whether you do this. topas-editor is provided as-is under the MIT licence, and responsibility for using INP files created by topas-editor or TOPilot AI lies with the user.

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
  • Your Privacy Choices
  • Consumer Health Privacy
© 2026 Microsoft