changeset 17352:75c18fc1d060

Merge with main repo
author Andrej Lojdl <andrej.lojdl@gmail.com>
date Thu, 29 Aug 2013 12:47:02 +0200
parents dc6ab0b04abb (current diff) 6470a113eae2 (diff)
children 4ee5b344a4e3
files configure.ac libinterp/Makefile.am libinterp/corefcn/gl-render.cc libinterp/corefcn/graphics.cc libinterp/corefcn/module.mk libinterp/corefcn/txt-eng-ft.cc libinterp/corefcn/txt-eng-ft.h libinterp/corefcn/txt-eng.h
diffstat 616 files changed, 5482 insertions(+), 3282 deletions(-) [+]
line wrap: on
line diff
--- a/.hgsubstate
+++ b/.hgsubstate
@@ -1,1 +1,1 @@
-5a51fb7777a9950502965a043a70bd6ca5e0498b gnulib-hg
+6057744acd2c71c069a4b171c5fe1ff0d86c9e5f gnulib-hg
--- a/.hgtags
+++ b/.hgtags
@@ -78,3 +78,4 @@
 b29b10fbb7448cdfe29322446e1a589e7fe1a40a release-3-6-4
 4e50bd2946d8563d3e201cc04b3ba0720c991b06 ss-3-7-4
 608e307b49149b32a6d09c2f06493d04d3af9be4 ss-3-7-5
+3a9efb68272df556dccb84c87933dd8238e88902 ss-3-7-6
--- a/NEWS
+++ b/NEWS
@@ -43,29 +43,28 @@
       endfunction
     endfunction
 
- ** 'emptymatch', 'noemptymatch' options added to regular expressions.
+ ** Line continuations inside character strings have changed.
 
-    With this addition Octave now accepts the entire set of Matlab options
-    for regular expressions.  'noemptymatch' is the default, but 'emptymatch'
-    has certain uses where you need to match an assertion rather than actual
-    characters.  For example, 
-
-    regexprep ('World', '^', 'Hello ', 'emptymatch')
-      => Hello World
-
-    where the pattern is actually the assertion '^' or start-of-line.
+    The sequence '...' is no longer recognized as a line continuation
+    inside a character string.  A backslash '\' followed by a newline
+    character is no longer recognized as a line continuation inside
+    single-quoted character strings.  Inside double-quoted character
+    strings, a backslash followed by a newline character is still
+    recognized as a line continuation, but the backslash character must
+    be followed *immediately* by the newline character.  No whitespace or
+    end-of-line comment may appear between them.
 
- ** For compatibility with Matlab, the regexp, regexpi, and regexprep
-    functions now process backslash escape sequences in single-quoted pattern
-    strings.  In addition, the regexprep function now processes backslash
-    escapes in single-quoted replacement strings.  For example,
-    
-    regexprep (str, '\t', '\n')
+ ** Backslash as a continuation marker outside of double-quoted strings
+    is now deprecated.
 
-    would search the variable str for a TAB character (escape sequence \t)
-    and replace it with a NEWLINE (escape sequence \n).  Previously the
-    expression would have searched for a literal '\' followed by 't' and
-    replaced the two characters with the sequence '\', 'n'.
+    Using '\' as a continuation marker outside of double quoted strings
+    is now deprecated and will be removed from a future version of
+    Octave.  When that is done, the behavior of
+
+      (a \
+       b)
+
+    will be consistent with other binary operators.
 
  ** Redundant terminal comma accepted by parser
 
@@ -77,29 +76,6 @@
      c,...
     ] = deal (1,2,3)
 
- ** Line continuations inside character strings have changed.
-
-    The sequence '...' is no longer recognized as a line continuations
-    are inside character strings.  A backslash followed by a newline
-    character is no longer recognized as a line continuation inside
-    single-quoted character strings.  Inside double-quoted character
-    strings, a backslash followed by a newline character is still
-    recognized as a line continuation but the backslash character must
-    be followed immediately by the newline character.  No whitespace or
-    end-of-linecomment may appear between them.
-
- ** Backslash as a continuation marker outside of double-quoted strings
-    is now deprecated.
-
-    Using '\' as a continuation marker outside fo double quoted strings
-    is now deprecated and will be removed from a future version of
-    Octave.  When that is done, the behavior of
-
-      (a \
-       b)
-
-    will be consistent with other binary operators.
-
  ** Octave now has limited support for named exceptions
 
     The following syntax is now accepted:
@@ -128,6 +104,30 @@
     Octave:array-as-scalar => Octave:array-to-scalar
     Octave:array-as-vector => Octave:array-to-vector
 
+ ** 'emptymatch', 'noemptymatch' options added to regular expressions.
+
+    With this addition Octave now accepts the entire set of Matlab options
+    for regular expressions.  'noemptymatch' is the default, but 'emptymatch'
+    has certain uses where you need to match an assertion rather than actual
+    characters.  For example, 
+
+    regexprep ('World', '^', 'Hello ', 'emptymatch')
+      => Hello World
+
+    where the pattern is actually the assertion '^' or start-of-line.
+
+ ** For compatibility with Matlab, the regexp, regexpi, and regexprep
+    functions now process backslash escape sequences in single-quoted pattern
+    strings.  In addition, the regexprep function now processes backslash
+    escapes in single-quoted replacement strings.  For example,
+    
+    regexprep (str, '\t', '\n')
+
+    would search the variable str for a TAB character (escape sequence \t)
+    and replace it with a NEWLINE (escape sequence \n).  Previously the
+    expression would have searched for a literal '\' followed by 't' and
+    replaced the two characters with the sequence '\', 'n'.
+
  ** The m-files in the image directory have been overhauled.
 
     The principal benefit is that Octave will now no longer automatically
@@ -138,12 +138,30 @@
 
     Other changes include fixes to the way indexed images are read from a
     colormap depending on the image class (integer images have a -1 offset to
-    the colormap row number), and always returning the actual indexed image
-    with imread instead of a RGB image if the colormap was not requested
-    as output.
+    the colormap row number).
+
+ ** The imread and imwrite functions have been completely rewritten
+
+    The main changes relate to the alpha channel, support for reading and
+    writing of floating point images, implemented writing of indexed images,
+    and appending images to multipage image files.
+
+    The issues that may arise due to backwards incompatibility are:
 
- ** The colormap function now provides new options--"list", "register",
-    and "unregister"--to list all available colormap functions, and to
+      * imwrite no longer interprets a length of 2 or 4 in the third dimension
+        as grayscale or RGB with alpha channel (a length of 4 will be saved
+        as CMYK image).  Alpha channel must be passed as separate argument.
+      * imread will always return the colormap indexes when reading an indexed
+        image, even if the colormap is not requested as output.
+      * transparency values are now inverted from the previous Octave versions
+        (0 is for completely transparent instead of completely opaque).
+
+    In addition, the function imformats has been implemented to expand
+    reading and writing of images of different formats through imread
+    and imwrite.
+
+ ** The colormap function now provides new options---"list", "register",
+    and "unregister"---to list all available colormap functions, and to
     add or remove a function name from the list of known colormap
     functions.  Packages that implement extra colormaps should use these
     commands with PKG_ADD and PKG_DEL statements.
@@ -196,6 +214,11 @@
     In addition two new error functions erfi (imaginary error function) and
     dawson (scaled imaginary error function) have been added.
 
+ ** The glpk function has been modified to reflect changes in the GLPK
+    library.  The "round" and "itcnt" options have been removed.  The
+    "relax" option has been replaced by the "rtest" option.  The numeric
+    values of error codes and of some options have also changed.
+
  ** The default name of the Octave crash dump file is now called
     octave-workspace instead of octave-core.
 
@@ -222,11 +245,6 @@
       helpdlg    listdlg   questdlg
       inputdlg   msgbox    warndlg
 
- ** The glpk function has been modified to reflect changes in the GLPK
-    library. The "round" and "itcnt" options have been removed. The
-    "relax" option has been replaced by the "rtest" option. The numeric
-    values of error codes and of some options have also changed.
-
  ** Other new functions added in 3.8.0:
                                                   
       atan2d                     erfi             jit_startcnt
@@ -241,10 +259,12 @@
       dawson                     imformats        shrinkfaces               
       dblist                     importdata       splinefit                 
       debug_jit                  isaxes           stemleaf                  
-      doc_cache_create           iscolormap       strjoin   
-      ellipj                     isequaln         struct2hdl                
-      ellipke                    jit_debug        tetramesh                 
-      erfcinv                    jit_enable       waterfall 
+      desktop                    iscolormap       strjoin    
+      doc_cache_create           isequaln         struct2hdl 
+      ellipj                     jit_debug        tetramesh                 
+      ellipke                    jit_enable       waterfall                 
+      erfcinv                    
+
 
  ** Deprecated functions.
 
@@ -286,7 +306,7 @@
     The internal class <Octave_map> has been deprecated in Octave 3.8 and will
     be removed from Octave 3.12 (or whatever version is the second major
     release after 3.8).  Replacement classes are <octave_map> (struct array)
-    or <octave_scalar_map> for single structure.
+    or <octave_scalar_map> for a single structure.
 
 Summary of important user-visible changes for version 3.6:
 ---------------------------------------------------------
--- a/bootstrap
+++ b/bootstrap
@@ -1,10 +1,10 @@
 #! /bin/sh
 # Print a version string.
-scriptversion=2012-07-19.14; # UTC
+scriptversion=2013-08-15.22; # UTC
 
 # Bootstrap this package from checked-out sources.
 
-# Copyright (C) 2003-2012 Free Software Foundation, Inc.
+# Copyright (C) 2003-2013 Free Software Foundation, Inc.
 
 # This program is free software: you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -140,20 +140,21 @@
 "wget --mirror -nd -q -np -A.po -P '%s' \
  http://translationproject.org/latest/%s/"
 
+# Prefer a non-empty tarname (4th argument of AC_INIT if given), else
+# fall back to the package name (1st argument with munging)
 extract_package_name='
-  /^AC_INIT(/{
-     /.*,.*,.*, */{
-       s///
-       s/[][]//g
-       s/)$//
+  /^AC_INIT(\[*/{
+     s///
+     /^[^,]*,[^,]*,[^,]*,[ []*\([^][ ,)]\)/{
+       s//\1/
+       s/[],)].*//
        p
        q
      }
-     s/AC_INIT(\[*//
-     s/]*,.*//
+     s/[],)].*//
      s/^GNU //
      y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/
-     s/[^A-Za-z0-9_]/-/g
+     s/[^abcdefghijklmnopqrstuvwxyz0123456789_]/-/g
      p
   }
 '
@@ -205,10 +206,8 @@
 # default.
 bootstrap_sync=false
 
-# Don't use git to update gnulib sources. We keep gnulib under a
-# Mercurial subrepository instead
-use_git=false
-GNULIB_SRCDIR=gnulib-hg
+# Use git to update gnulib sources
+use_git=true
 
 # find_tool ENVVAR NAMES...
 # -------------------------
@@ -225,27 +224,21 @@
   find_tool_names=$@
   eval "find_tool_res=\$$find_tool_envvar"
   if test x"$find_tool_res" = x; then
-    for i
-    do
+    for i; do
       if ($i --version </dev/null) >/dev/null 2>&1; then
-       find_tool_res=$i
-       break
+        find_tool_res=$i
+        break
       fi
     done
-  else
-    find_tool_error_prefix="\$$find_tool_envvar: "
   fi
-  test x"$find_tool_res" != x \
-    || die "one of these is required: $find_tool_names"
-  ($find_tool_res --version </dev/null) >/dev/null 2>&1 \
-    || die "${find_tool_error_prefix}cannot run $find_tool_res --version"
+  if test x"$find_tool_res" = x; then
+    warn_ "one of these is required: $find_tool_names;"
+    die   "alternatively set $find_tool_envvar to a compatible tool"
+  fi
   eval "$find_tool_envvar=\$find_tool_res"
   eval "export $find_tool_envvar"
 }
 
-# Find sha1sum, named gsha1sum on MacPorts, and shasum on Mac OS X 10.6.
-find_tool SHA1SUM sha1sum gsha1sum shasum
-
 # Override the default configuration, if necessary.
 # Make sure that bootstrap.conf is sourced from the current directory
 # if we were invoked as "sh bootstrap".
@@ -257,12 +250,12 @@
 # Extra files from gnulib, which override files from other sources.
 test -z "${gnulib_extra_files}" && \
   gnulib_extra_files="
-        $build_aux/install-sh
-        $build_aux/mdate-sh
-        $build_aux/texinfo.tex
-        $build_aux/depcomp
-        $build_aux/config.guess
-        $build_aux/config.sub
+        build-aux/install-sh
+        build-aux/mdate-sh
+        build-aux/texinfo.tex
+        build-aux/depcomp
+        build-aux/config.guess
+        build-aux/config.sub
         doc/INSTALL
 "
 
@@ -308,34 +301,34 @@
   die "Bootstrapping from a non-checked-out distribution is risky."
 fi
 
-# Ensure that lines starting with ! sort last, per gitignore conventions
-# for whitelisting exceptions after a more generic blacklist pattern.
-sort_patterns() {
-  sort -u "$@" | sed '/^!/ {
-    H
-    d
-  }
-  $ {
-    P
-    x
-    s/^\n//
-  }' | sed '/^$/d'
+# Strip blank and comment lines to leave significant entries.
+gitignore_entries() {
+  sed '/^#/d; /^$/d' "$@"
 }
 
-# If $STR is not already on a line by itself in $FILE, insert it,
-# sorting the new contents of the file and replacing $FILE with the result.
-insert_sorted_if_absent() {
+# If $STR is not already on a line by itself in $FILE, insert it at the start.
+# Entries are inserted at the start of the ignore list to ensure existing
+# entries starting with ! are not overridden.  Such entries support
+# whitelisting exceptions after a more generic blacklist pattern.
+insert_if_absent() {
   file=$1
   str=$2
   test -f $file || touch $file
-  echo "$str" | sort_patterns - $file | cmp -s - $file > /dev/null \
-    || { echo "$str" | sort_patterns - $file > $file.bak \
-      && mv $file.bak $file; } \
-    || die "insert_sorted_if_absent $file $str: failed"
+  test -r $file || die "Error: failed to read ignore file: $file"
+  duplicate_entries=$(gitignore_entries $file | sort | uniq -d)
+  if [ "$duplicate_entries" ] ; then
+    die "Error: Duplicate entries in $file: " $duplicate_entries
+  fi
+  linesold=$(gitignore_entries $file | wc -l)
+  linesnew=$( { echo "$str"; cat $file; } | gitignore_entries | sort -u | wc -l)
+  if [ $linesold != $linesnew ] ; then
+    { echo "$str" | cat - $file > $file.bak && mv $file.bak $file; } \
+      || die "insert_if_absent $file $str: failed"
+  fi
 }
 
 # Adjust $PATTERN for $VC_IGNORE_FILE and insert it with
-# insert_sorted_if_absent.
+# insert_if_absent.
 insert_vc_ignore() {
   vc_ignore_file="$1"
   pattern="$2"
@@ -346,7 +339,7 @@
     # .gitignore entry.
     pattern=$(echo "$pattern" | sed s,^,/,);;
   esac
-  insert_sorted_if_absent "$vc_ignore_file" "$pattern"
+  insert_if_absent "$vc_ignore_file" "$pattern"
 }
 
 # Die if there is no AC_CONFIG_AUX_DIR($build_aux) line in configure.ac.
@@ -470,7 +463,7 @@
     if [ "$req_ver" = "-" ]; then
       # Merely require app to exist; not all prereq apps are well-behaved
       # so we have to rely on $? rather than get_version.
-      $app --version >/dev/null 2>&1
+      $app --version >/dev/null 2>&1 </dev/null
       if [ 126 -le $? ]; then
         warn_ "Error: '$app' not found"
         ret=1
@@ -504,6 +497,12 @@
   # can't depend on column -t
 }
 
+# Find sha1sum, named gsha1sum on MacPorts, shasum on Mac OS X 10.6.
+# Also find the compatible sha1 utility on the BSDs
+if test x"$SKIP_PO" = x; then
+  find_tool SHA1SUM sha1sum gsha1sum shasum sha1
+fi
+
 use_libtool=0
 # We'd like to use grep -E, to see if any of LT_INIT,
 # AC_PROG_LIBTOOL, AM_PROG_LIBTOOL is used in configure.ac,
@@ -552,7 +551,7 @@
 echo "$0: Bootstrapping from checked-out $package sources..."
 
 # See if we can use gnulib's git-merge-changelog merge driver.
-if test -d .git && (git --version) >/dev/null 2>/dev/null ; then
+if $use_git && test -d .git && (git --version) >/dev/null 2>/dev/null ; then
   if git config merge.merge-changelog.driver >/dev/null ; then
     :
   elif (git-merge-changelog --version) >/dev/null 2>/dev/null ; then
@@ -575,13 +574,17 @@
   test -f .gitmodules && git config --file .gitmodules "$@"
 }
 
-gnulib_path=$(git_modules_config submodule.gnulib.path)
-test -z "$gnulib_path" && gnulib_path=gnulib
+if $use_git; then
+  gnulib_path=$(git_modules_config submodule.gnulib.path)
+  test -z "$gnulib_path" && gnulib_path=gnulib
+fi
 
-# Get gnulib files.
+# Get gnulib files.  Populate $GNULIB_SRCDIR, possibly updating a
+# submodule, for use in the rest of the script.
 
 case ${GNULIB_SRCDIR--} in
 -)
+  # Note that $use_git is necessarily true in this case.
   if git_modules_config submodule.gnulib.url >/dev/null; then
     echo "$0: getting gnulib files..."
     git submodule init || exit $?
@@ -602,8 +605,8 @@
   GNULIB_SRCDIR=$gnulib_path
   ;;
 *)
-  # Use GNULIB_SRCDIR as a reference.
-  if test -d "$GNULIB_SRCDIR"/.git && \
+  # Use GNULIB_SRCDIR directly or as a reference.
+  if $use_git && test -d "$GNULIB_SRCDIR"/.git && \
         git_modules_config submodule.gnulib.url >/dev/null; then
     echo "$0: getting gnulib files..."
     if git submodule -h|grep -- --reference > /dev/null; then
@@ -629,12 +632,19 @@
   ;;
 esac
 
+# $GNULIB_SRCDIR now points to the version of gnulib to use, and
+# we no longer need to use git or $gnulib_path below here.
+
 if $bootstrap_sync; then
   cmp -s "$0" "$GNULIB_SRCDIR/build-aux/bootstrap" || {
     echo "$0: updating bootstrap and restarting..."
+    case $(sh -c 'echo "$1"' -- a) in
+      a) ignored=--;;
+      *) ignored=ignored;;
+    esac
     exec sh -c \
       'cp "$1" "$2" && shift && exec "${CONFIG_SHELL-/bin/sh}" "$@"' \
-      -- "$GNULIB_SRCDIR/build-aux/bootstrap" \
+      $ignored "$GNULIB_SRCDIR/build-aux/bootstrap" \
       "$0" "$@" --no-bootstrap-sync
   }
 fi
@@ -682,11 +692,10 @@
     cksum_file="$ref_po_dir/$po.s1"
     if ! test -f "$cksum_file" ||
         ! test -f "$po_dir/$po.po" ||
-        ! $SHA1SUM -c --status "$cksum_file" \
-            < "$new_po" > /dev/null; then
+        ! $SHA1SUM -c "$cksum_file" < "$new_po" > /dev/null 2>&1; then
       echo "$me: updated $po_dir/$po.po..."
       cp "$new_po" "$po_dir/$po.po" \
-          && $SHA1SUM < "$new_po" > "$cksum_file"
+          && $SHA1SUM < "$new_po" > "$cksum_file" || return
     fi
   done
 }
@@ -891,20 +900,21 @@
   -depth \( -name '*.m4' -o -name '*.[ch]' \) \
   -type l -xtype l -delete > /dev/null 2>&1
 
+# Invoke autoreconf with --force --install to ensure upgrades of tools
+# such as ylwrap.
+AUTORECONFFLAGS="--verbose --install --force -I $m4_base $ACLOCAL_FLAGS"
+
 # Some systems (RHEL 5) are using ancient autotools, for which the
 # --no-recursive option had not been invented.  Detect that lack and
 # omit the option when it's not supported.  FIXME in 2017: remove this
 # hack when RHEL 5 autotools are updated, or when they become irrelevant.
-no_recursive=
 case $($AUTORECONF --help) in
-  *--no-recursive*) no_recursive=--no-recursive;;
+  *--no-recursive*) AUTORECONFFLAGS="$AUTORECONFFLAGS --no-recursive";;
 esac
 
 # Tell autoreconf not to invoke autopoint or libtoolize; they were run above.
-echo "running: AUTOPOINT=true LIBTOOLIZE=true " \
-    "$AUTORECONF --verbose --install $no_recursive -I $m4_base $ACLOCAL_FLAGS"
-AUTOPOINT=true LIBTOOLIZE=true \
-    $AUTORECONF --verbose --install $no_recursive -I $m4_base $ACLOCAL_FLAGS \
+echo "running: AUTOPOINT=true LIBTOOLIZE=true $AUTORECONF $AUTORECONFFLAGS"
+AUTOPOINT=true LIBTOOLIZE=true $AUTORECONF $AUTORECONFFLAGS \
   || die "autoreconf failed"
 
 # Get some extra files from gnulib, overriding existing files.
--- a/bootstrap.conf
+++ b/bootstrap.conf
@@ -143,6 +143,15 @@
 gnulib_name="libgnu"
 source_base="libgnu"
 
+# Don't use git to update gnulib sources. We keep gnulib under a
+# Mercurial subrepository instead.
+use_git=false
+GNULIB_SRCDIR=gnulib-hg
+
+# Don't check for translations since we don't have any in Octave yet.
+# This avoids the need for sha1sum or compatible utility in bootstrap.
+SKIP_PO=true
+
 ## Use --foreign since we auto-generate the AUTHORS file and the default
 ## --gnu strictness level doesn't like it if the AUTHORS file is missing.
 
--- a/configure.ac
+++ b/configure.ac
@@ -19,13 +19,13 @@
 ### <http://www.gnu.org/licenses/>.
 
 AC_PREREQ([2.62])
-AC_INIT([GNU Octave], [3.7.5], [http://octave.org/bugs.html], [octave])
+AC_INIT([GNU Octave], [3.7.6+], [http://octave.org/bugs.html], [octave])
 
 dnl PACKAGE_VERSION is set by the AC_INIT VERSION arg
 OCTAVE_VERSION="$PACKAGE_VERSION"
 OCTAVE_API_VERSION_NUMBER="48"
 OCTAVE_API_VERSION="api-v$OCTAVE_API_VERSION_NUMBER+"
-OCTAVE_RELEASE_DATE="2013-05-14"
+OCTAVE_RELEASE_DATE="2013-08-20"
 OCTAVE_COPYRIGHT="Copyright (C) 2013 John W. Eaton and others."
 AC_SUBST(OCTAVE_VERSION)
 AC_SUBST(OCTAVE_API_VERSION_NUMBER)
@@ -1062,6 +1062,10 @@
       AC_MSG_RESULT(yes)
       AC_DEFINE(HAVE_FREETYPE, 1, [Define to 1 if you have Freetype library.])
       XTRA_CXXFLAGS="$XTRA_CXXFLAGS $FT2_CFLAGS"
+      save_LIBS="$LIBS"
+      LIBS="$FT2_LIBS $LIBS"
+      AC_CHECK_FUNCS([FT_Reference_Face])
+      LIBS="$save_LIBS"
     else
       AC_MSG_RESULT(no)
       warn_freetype="FreeType library not found.  Native graphics will be disabled."
--- a/doc/interpreter/Makefile.am
+++ b/doc/interpreter/Makefile.am
@@ -30,7 +30,7 @@
 TEXMFCNF := "..$(PATH_SEPARATOR)$(srcdir)/..$(PATH_SEPARATOR)$(TEXMFCNF)$(PATH_SEPARATOR)"
 export TEXMFCNF
 
-dist_man1_MANS = \
+dist_man_MANS = \
   mkoctfile.1 \
   octave-config.1 \
   octave.1
@@ -225,19 +225,19 @@
 		cp $(srcdir)/contributors.texi contributors.texi; \
 		touch -r $(srcdir)/contributors.texi contributors.texi; \
 	fi
-	-$(MAKEINFO) -D AUTHORSONLY \
+	-$(MAKEINFO) -D AUTHORSONLY -I $(srcdir) \
 	  --no-validate --no-headers --no-split --output AUTHORS $<
 	mv AUTHORS ../../AUTHORS
 
 ../../BUGS: bugs.texi
 	rm -f BUGS
-	-$(MAKEINFO) -D BUGSONLY \
+	-$(MAKEINFO) -D BUGSONLY -I $(srcdir) \
 	  --no-validate --no-headers --no-split --output BUGS $<
 	mv BUGS ../../BUGS
 
 ../../INSTALL.OCTAVE: install.texi
 	rm -f INSTALL
-	-$(MAKEINFO) -D INSTALLONLY \
+	-$(MAKEINFO) -D INSTALLONLY -I $(srcdir) \
 	  --no-validate --no-headers --no-split --output INSTALL $<
 	mv INSTALL ../../INSTALL.OCTAVE
 
--- a/doc/interpreter/basics.txi
+++ b/doc/interpreter/basics.txi
@@ -1099,8 +1099,8 @@
 @end example
 
 @noindent
-will produce a very quick countdown from '3' to 'Blast Off' as the
-lines "@code{disp (2);}" and "@code{disp (1);}" won't be executed.
+will produce a very quick countdown from @qcode{'3'} to @qcode{"Blast Off"} as
+the lines "@code{disp (2);}" and "@code{disp (1);}" won't be executed.
 
 The block comment markers must appear alone as the only characters on a line
 (excepting whitespace) in order to be parsed correctly.
--- a/doc/interpreter/container.txi
+++ b/doc/interpreter/container.txi
@@ -372,9 +372,9 @@
 @subsection Creating Structures
 @cindex dynamic naming
 
-Besides the index operator ".", Octave can use dynamic naming "(var)" or the
-@code{struct} function to create structures.  Dynamic naming uses the string
-value of a variable as the field name.  For example:
+Besides the index operator @qcode{"."}, Octave can use dynamic naming
+@qcode{"(var)"} or the @code{struct} function to create structures.  Dynamic
+naming uses the string value of a variable as the field name.  For example:
 
 @example
 @group
@@ -484,12 +484,12 @@
      @result{} ans =
         @{
           field1 =
-        
+
         @{
           [1,1] =  1
           [1,2] = one
         @}
-        
+
           field2 =  2
         @}
 @end group
@@ -587,7 +587,7 @@
 c@{1:2@}
      @result{} ans = a string
      @result{} ans =
-          
+
                0.593993   0.627732
                0.377037   0.033643
 @end group
@@ -601,14 +601,14 @@
 @group
 c@{3@} = 3
      @result{} c =
-         
+
          @{
            [1,1] = a string
            [1,2] =
-         
+
               0.593993   0.627732
               0.377037   0.033643
-         
+
            [1,3] =  3
          @}
 @end group
@@ -656,7 +656,7 @@
 @group
 c = cell (2,2)
      @result{} c =
-         
+
          @{
            [1,1] = [](0x0)
            [2,1] = [](0x0)
--- a/doc/interpreter/contributors.in
+++ b/doc/interpreter/contributors.in
@@ -273,6 +273,7 @@
 Ivan Sutoris
 John Swensen
 Daisuke Takago
+Falk Tannhäuser
 Ariel Tankus
 Matthew Tenny
 Georg Thimm
--- a/doc/interpreter/doccheck/aspell-octave.en.pws
+++ b/doc/interpreter/doccheck/aspell-octave.en.pws
@@ -152,6 +152,7 @@
 colormap
 colormaps
 ColorOrder
+colororder
 colperm
 Comint
 Commandline
@@ -185,6 +186,7 @@
 cumsum
 cURL
 CurrentObject
+currentpoint
 Cuthill
 cxsparse
 Cygwin
@@ -277,6 +279,7 @@
 errorbars
 errordlg
 ErrorHandler
+ESC
 Esmond
 et
 etree
@@ -332,6 +335,8 @@
 Frobenius
 Fs
 FSF
+fullpath
+fullpathext
 FunValCheck
 gamcdf
 gaminv
@@ -431,6 +436,7 @@
 Hypergeometric
 hypergeometric
 IEC
+ieee
 IEEE
 ifelse
 ifft
@@ -485,8 +491,10 @@
 JVM's
 Kac
 Kahan
+kendall
 keybindings
 keypress
+keypressfcn
 Kolmogorov
 kolmogorov
 Konrod
@@ -532,6 +540,7 @@
 linespec
 linespoints
 linestyle
+linewidth
 linkprop
 listdlg
 ListSize
@@ -575,6 +584,10 @@
 Mandriva
 MANOVA
 manova
+markeredgecolor
+markerfacecolor
+markersize
+markerstyle
 Marsaglia
 Maschhoff
 matchcase
@@ -714,6 +727,7 @@
 pbm
 PBM
 PBMplus
+pc
 pcg
 PCG
 pchip
@@ -724,6 +738,7 @@
 pcx
 pdf
 PDF
+pearson
 pentadiagonal
 periodogram
 perp
@@ -747,6 +762,7 @@
 polyeig
 polyfit
 polyval
+pos
 POSIX
 postorder
 PostScript
@@ -1000,6 +1016,7 @@
 TolX
 toolkits
 Toolkits
+toplevel
 tp
 tpdf
 traceback
@@ -1011,6 +1028,7 @@
 trimesh
 triplot
 trnd
+truecolor
 TrueColor
 Tsang
 Tukey
@@ -1048,6 +1066,8 @@
 Uninstall
 uninstalled
 univariate
+unix
+unnorm
 unnormalized
 unpadded
 unpermuted
@@ -1086,6 +1106,7 @@
 warndlg
 Wathen
 WAV
+WayPoints
 wblcdf
 wblinv
 wblpdf
@@ -1106,6 +1127,9 @@
 Wildcards
 wildcards
 Wilks
+windowbuttondownfcn
+windowbuttonmotionfcn
+windowbuttonupfcn
 windowstyle
 WinRand
 WIPO
--- a/doc/interpreter/emacs.txi
+++ b/doc/interpreter/emacs.txi
@@ -251,7 +251,7 @@
 @samp{,} (@code{Info-index-next}) command of the Info reader.
 
 The variable @code{octave-help-files} is a list of files to search
-through and defaults to @code{'("octave")}.  If there is also an Octave
+through and defaults to @qcode{'("octave")}.  If there is also an Octave
 Local Guide with corresponding info file, say, @file{octave-LG}, you can
 have @code{octave-help} search both files by 
 @lisp
@@ -390,7 +390,7 @@
 
 This will start Octave in a special buffer the name of which is
 specified by the variable @code{inferior-octave-buffer} and defaults to
-@code{"*Inferior Octave*"}.  From within this buffer, you can
+@qcode{"*Inferior Octave*"}.  From within this buffer, you can
 interact with the inferior Octave process `as usual', i.e., by entering
 Octave commands at the prompt.  The buffer is in Inferior Octave mode,
 which is derived from the standard Comint mode, a major mode for
@@ -456,7 +456,7 @@
 The variable @code{inferior-octave-startup-args} can be used for
 specifying command lines arguments to be passed to Octave on startup
 as a list of strings.  For example, to suppress the startup message and
-use `traditional' mode, set this to @code{'("-q" "--traditional")}.
+use `traditional' mode, set this to @qcode{'("-q" "--traditional")}.
 You can also specify a startup file of Octave commands to be loaded on
 startup; note that these commands will not produce any visible output
 in the process buffer.  Which file to use is controlled by the variable
--- a/doc/interpreter/errors.txi
+++ b/doc/interpreter/errors.txi
@@ -185,8 +185,8 @@
 as will be shown in the next example.  To assign an ID to an error,
 simply call @code{error} with two string arguments, where the first
 is the identification string, and the second is the actual error.  Note
-that error IDs are in the format "NAMESPACE:ERROR-NAME".  The namespace
-"Octave" is used for Octave's own errors.  Any other string is available
+that error IDs are in the format @qcode{"NAMESPACE:ERROR-NAME"}.  The namespace
+@qcode{"Octave"} is used for Octave's own errors.  Any other string is available
 as a namespace for user's own errors.
 
 The next example counts indexing errors.  The errors are caught using the
@@ -330,9 +330,9 @@
 as will be described in the next section.  To assign an ID to a warning,
 simply call @code{warning} with two string arguments, where the first
 is the identification string, and the second is the actual warning.  Note
-that warning IDs are in the format "NAMESPACE:WARNING-NAME".  The namespace
-"Octave" is used for Octave's own warnings.  Any other string is available
-as a namespace for user's own warnings.
+that warning IDs are in the format @qcode{"NAMESPACE:WARNING-NAME"}.  The
+namespace @qcode{"Octave"} is used for Octave's own warnings.  Any other string
+is available as a namespace for user's own warnings.
 
 @DOCSTRING(warning)
 
@@ -348,7 +348,7 @@
 
 The @code{warning} function also allows you to control which warnings
 are actually printed to the screen.  If the @code{warning} function
-is called with a string argument that is either @code{"on"} or @code{"off"}
+is called with a string argument that is either @qcode{"on"} or @qcode{"off"}
 all warnings will be enabled or disabled.
 
 It is also possible to enable and disable individual warnings through
--- a/doc/interpreter/eval.txi
+++ b/doc/interpreter/eval.txi
@@ -135,7 +135,7 @@
 
 @noindent
 Here, @samp{caller} is the @code{create_data} function and @code{name1}
-is the string @code{"x"}, which evaluates simply as the value of @code{x}.
+is the string @qcode{"x"}, which evaluates simply as the value of @code{x}.
 
 You later want to load the values back from @code{mydata}
 in a different context:
--- a/doc/interpreter/expr.txi
+++ b/doc/interpreter/expr.txi
@@ -433,7 +433,7 @@
 @noindent
 you should not think of the argument as being ``the variable
 @code{foo}.''  Instead, think of the argument as the string value,
-@code{"bar"}.
+@qcode{"bar"}.
 
 Even though Octave uses pass-by-value semantics for function arguments,
 values are not copied unnecessarily.  For example,
@@ -1043,7 +1043,7 @@
 The @samp{=} sign is called an @dfn{assignment operator}.
 
 Assignments can store string values also.  For example, the following
-expression would store the value @code{"this food is good"} in the
+expression would store the value @qcode{"this food is good"} in the
 variable @code{message}:
 
 @example
--- a/doc/interpreter/external.txi
+++ b/doc/interpreter/external.txi
@@ -305,8 +305,8 @@
 a resemblance to functions that exist in the interpreter.  A selection of
 useful methods include
 
-@deftypefn  Method T& {operator ()} (octave_idx_type)
-@deftypefnx Method T& elem (octave_idx_type)
+@deftypefn  {Method} {T&} operator () (octave_idx_type)
+@deftypefnx {Method} {T&} elem (octave_idx_type)
 The @code{()} operator or @code{elem} method allow the values of the
 matrix or array to be read or set.  These can take a single argument,
 which is of type @code{octave_idx_type}, that is the index into the matrix or
@@ -319,30 +319,30 @@
 circumstances the user might prefer to access the data of the array or
 matrix directly through the @nospell{fortran_vec} method discussed below.
 
-@deftypefn Method octave_idx_type numel (void) const
+@deftypefn {Method} {} octave_idx_type numel (void) const
 The total number of elements in the matrix or array.
 @end deftypefn
 
-@deftypefn Method size_t byte_size (void) const
+@deftypefn {Method} {size_t} byte_size (void) const
 The number of bytes used to store the matrix or array.
 @end deftypefn
 
-@deftypefn Method dim_vector dims (void) const
+@deftypefn {Method} {dim_vector} dims (void) const
 The dimensions of the matrix or array in value of type dim_vector.
 @end deftypefn
 
-@deftypefn Method int ndims (void) const
+@deftypefn {Method} {int} ndims (void) const
 The number of dimensions of the matrix or array.  Matrices are 2-D,
 but arrays can be N-dimensional.
 @end deftypefn
 
-@deftypefn Method void resize (const dim_vector&)
+@deftypefn {Method} {void} resize (const dim_vector&)
 A method taking either an argument of type @code{dim_vector}, or in the
 case of a matrix two arguments of type @code{octave_idx_type} defining
 the number of rows and columns in the matrix.
 @end deftypefn
 
-@deftypefn Method T* fortran_vec (void)
+@deftypefn {Method} {T*} fortran_vec (void)
 This method returns a pointer to the underlying data of the matrix or
 array so that it can be manipulated directly, either within Octave or by
 an external library.
@@ -357,9 +357,7 @@
 @w{@code{DEFUN_DLD}} function is as follows
 
 @example
-@group
 @EXAMPLEFILE(addtwomatrices.cc)
-@end group
 @end example
 
 To avoid segmentation faults causing Octave to abort this function
@@ -484,9 +482,7 @@
 example is
 
 @example
-@group
 @EXAMPLEFILE(celldemo.cc)
-@end group
 @end example
 
 Note that cell arrays are used less often in standard oct-files and so
@@ -616,7 +612,7 @@
 The use of @code{numel} should therefore be avoided useless it is known
 it won't overflow.
 
-Extreme care must be take with the elem method and the "()" operator,
+Extreme care must be take with the elem method and the @qcode{"()"} operator,
 which perform basically the same function.  The reason is that if a
 sparse object is non-const, then Octave will assume that a
 request for a zero element in a sparse matrix is in fact a request
@@ -1307,9 +1303,9 @@
 
 The first line @code{#include "mex.h"} makes available all of the definitions
 necessary for a mex-file.  One important difference between Octave and
-@sc{matlab} is that the header file @code{"matrix.h"} is implicitly included
-through the inclusion of @code{"mex.h"}.  This is necessary to avoid a conflict
-with the Octave file @code{"Matrix.h"} for operating systems and compilers that
+@sc{matlab} is that the header file @qcode{"matrix.h"} is implicitly included
+through the inclusion of @qcode{"mex.h"}.  This is necessary to avoid a conflict
+with the Octave file @qcode{"Matrix.h"} for operating systems and compilers that
 don't distinguish between filenames in upper and lower case.
 
 The entry point into the mex-file is defined by @code{mexFunction}.  The
@@ -1517,9 +1513,7 @@
 as shown below.
 
 @example
-@group
 @EXAMPLEFILE(mycell.c)
-@end group
 @end example
 
 @noindent
@@ -1617,23 +1611,23 @@
     b =
     @{
       this =
-    
+
       (,
         [1] = this1
         [2] = this2
         [3] = this3
         [4] = this4
       ,)
-    
+
       that =
-    
+
       (,
         [1] = that1
         [2] = that2
         [3] = that3
         [4] = that4
       ,)
-    
+
     @}
 @end example
 
@@ -1737,9 +1731,7 @@
 @file{liboctave.so}.
 
 @example
-@group
 @EXAMPLEFILE(standalone.cc)
-@end group
 @end example
 
 @noindent
@@ -1766,9 +1758,7 @@
 seen in the code
 
 @example
-@group
 @EXAMPLEFILE(embedded.cc)
-@end group
 @end example
 
 @noindent
--- a/doc/interpreter/func.txi
+++ b/doc/interpreter/func.txi
@@ -114,7 +114,7 @@
 @end example
 
 The @code{printf} statement (@pxref{Input and Output}) simply tells
-Octave to print the string @code{"\a"}.  The special character @samp{\a}
+Octave to print the string @qcode{"\a"}.  The special character @samp{\a}
 stands for the alert character (ASCII 7).  @xref{Strings}.
 
 Once this function is defined, you can ask Octave to evaluate it by
@@ -737,7 +737,7 @@
 running Octave, you can improve performance by calling
 @code{ignore_function_time_stamp ("all")}, so that Octave will
 ignore the time stamps for all function files.  Passing
-@code{"system"} to this function resets the default behavior.
+@qcode{"system"} to this function resets the default behavior.
 
 @c FIXME -- note about time stamps on files in NFS environments?
 
--- a/doc/interpreter/grammar.txi
+++ b/doc/interpreter/grammar.txi
@@ -78,9 +78,9 @@
 @DOCSTRING(remove_input_event_hook)
 
 Finally, when the parser cannot identify an input token it calls a particular
-function to handle this.  By default, this is the function "unimplemented"
-which makes suggestions about possible Octave substitutes for @sc{matlab}
-functions.
+function to handle this.  By default, this is the function
+@qcode{"unimplemented"} which makes suggestions about possible Octave
+substitutes for @sc{matlab} functions.
 
 @DOCSTRING(missing_function_hook)
 
--- a/doc/interpreter/image.txi
+++ b/doc/interpreter/image.txi
@@ -204,7 +204,7 @@
 @DOCSTRING(gmap40)
 
 The following three functions modify the existing colormap rather than
-replace it.   
+replace it.
 
 @DOCSTRING(brighten)
 
--- a/doc/interpreter/install.txi
+++ b/doc/interpreter/install.txi
@@ -25,6 +25,7 @@
 @end ifclear
 
 @ifset INSTALLONLY
+@include macros.texi
 
 This file documents the installation of Octave.
 
@@ -205,7 +206,7 @@
 @table @asis
 @item ARPACK
 Library for the solution of large-scale eigenvalue problems
-(@url{http://forge.scilab.org/index.php/p/arpack-ng}).  ARPACK is
+(@url{http://forge.scilab.org/index.php/p/arpack-ng}).  @sc{arpack} is
 required to provide the functions @code{eigs} and @code{svds}.
 
 @item cURL
@@ -247,7 +248,7 @@
 
 @item HDF5
 Library for manipulating portable data files
-(@url{http://www.hdfgroup.org/HDF5}).  HDF5 is required for Octave's
+(@url{http://www.hdfgroup.org/HDF5}).  @sc{hdf5} is required for Octave's
 @code{load} and @code{save} commands to read and write HDF data files.
 
 @item LLVM
@@ -383,7 +384,7 @@
 
 @item --with-magick=<lib>
 Select the library to use for image I/O@.  The two possible values are
-"GraphicsMagick" (default) or "ImageMagick".
+@qcode{"GraphicsMagick"} (default) or @qcode{"ImageMagick"}.
 
 @item --with-sepchar=<char>
 Use <char> as the path separation character.  This option can help when
@@ -1064,7 +1065,7 @@
 @env{CFLAGS}, @env{CXXFLAGS}, @env{FFLAGS}, and @env{LDFLAGS}.  Passing
 them as options to the configure script also records them in the
 @file{config.status} file.  By default, @env{CPPFLAGS} and @env{LDFLAGS}
-are empty, @env{CFLAGS} and @env{CXXFLAGS} are set to @code{"-g -O"} and
-@env{FFLAGS} is set to @code{"-O"}.
+are empty, @env{CFLAGS} and @env{CXXFLAGS} are set to @qcode{"-g -O"} and
+@env{FFLAGS} is set to @qcode{"-O"}.
 
 @end itemize
--- a/doc/interpreter/interp.txi
+++ b/doc/interpreter/interp.txi
@@ -34,13 +34,13 @@
 @DOCSTRING(interp1)
 
 There are some important differences between the various interpolation
-methods.  The 'spline' method enforces that both the first and second
+methods.  The @qcode{"spline"} method enforces that both the first and second
 derivatives of the interpolated values have a continuous derivative,
 whereas the other methods do not.  This means that the results of the
-'spline' method are generally smoother.  If the function to be
-interpolated is in fact smooth, then 'spline' will give excellent
+@qcode{"spline"} method are generally smoother.  If the function to be
+interpolated is in fact smooth, then @qcode{"spline"} will give excellent
 results.  However, if the function to be evaluated is in some manner
-discontinuous, then 'pchip' interpolation might give better results.
+discontinuous, then @qcode{"pchip"} interpolation might give better results.
 
 This can be demonstrated by the code
 
@@ -51,16 +51,16 @@
 ti =-2:0.025:2;
 dti = 0.025;
 y = sign (t);
-ys = interp1 (t,y,ti,'spline');
-yp = interp1 (t,y,ti,'pchip');
+ys = interp1 (t,y,ti,"spline");
+yp = interp1 (t,y,ti,"pchip");
 ddys = diff (diff (ys)./dti) ./ dti;
 ddyp = diff (diff (yp)./dti) ./ dti;
 figure (1);
 plot (ti,ys,'r-', ti,yp,'g-');
-legend ('spline', 'pchip', 4);
+legend ("spline", "pchip", 4);
 figure (2);
 plot (ti,ddys,'r+', ti,ddyp,'g*');
-legend ('spline', 'pchip');
+legend ("spline", "pchip");
 @end group
 @end example
 
@@ -71,13 +71,13 @@
 
 @float Figure,fig:interpderiv1
 @center @image{interpderiv1,4in}
-@caption{Comparison of 'pchip' and 'spline' interpolation methods for a 
+@caption{Comparison of @qcode{"pchip"} and @qcode{"spline"} interpolation methods for a 
 step function}
 @end float
 
 @float Figure,fig:interpderiv2
 @center @image{interpderiv2,4in}
-@caption{Comparison of the second derivative of the 'pchip' and 'spline' 
+@caption{Comparison of the second derivative of the @qcode{"pchip"} and @qcode{"spline"} 
 interpolation methods for a step function}
 @end float
 @end ifnotinfo
@@ -107,9 +107,9 @@
 ti = t(1) + [0 : k-1]*dt*n/k;
 y = sin (4*t + 0.3) .* cos (3*t - 0.1);
 yp = sin (4*ti + 0.3) .* cos (3*ti - 0.1);
-plot (ti, yp, 'g', ti, interp1 (t, y, ti, 'spline'), 'b', ...
-      ti, interpft (y, k), 'c', t, y, 'r+');
-legend ('sin(4t+0.3)cos(3t-0.1', 'spline', 'interpft', 'data');
+plot (ti, yp, "g", ti, interp1 (t, y, ti, "spline"), "b", ...
+      ti, interpft (y, k), "c", t, y, 'r+');
+legend ('sin(4t+0.3)cos(3t-0.1', "spline", "interpft", "data");
 @end group
 @end example
 
@@ -148,12 +148,11 @@
 
 A significant difference between @code{interpn} and the other two
 multi-dimensional interpolation functions is the fashion in which the
-dimensions are treated.  For @code{interp2} and @code{interp3}, the 'y'
-axis is considered to be the columns of the matrix, whereas the 'x'
-axis corresponds to the rows of the array.  As Octave indexes arrays in
-column major order, the first dimension of any array is the columns, and
-so @code{interpn} effectively reverses the 'x' and 'y' dimensions. 
-Consider the example,
+dimensions are treated.  For @code{interp2} and @code{interp3}, the y-axis is
+considered to be the columns of the matrix, whereas the x-axis corresponds to
+the rows of the array.  As Octave indexes arrays in column major order, the
+first dimension of any array is the columns, and so @code{interpn} effectively
+reverses the 'x' and 'y' dimensions.  Consider the example,
 
 @example
 @group
@@ -163,9 +162,9 @@
 v = f (xx,yy,zz);
 xi = yi = zi = -1:0.1:1;
 [xxi, yyi, zzi] = meshgrid (xi, yi, zi);
-vi = interp3 (x, y, z, v, xxi, yyi, zzi, 'spline');
+vi = interp3 (x, y, z, v, xxi, yyi, zzi, "spline");
 [xxi, yyi, zzi] = ndgrid (xi, yi, zi);
-vi2 = interpn (x, y, z, v, xxi, yyi, zzi, 'spline');
+vi2 = interpn (x, y, z, v, xxi, yyi, zzi, "spline");
 mesh (zi, yi, squeeze (vi2(1,:,:)));
 @end group
 @end example
--- a/doc/interpreter/io.txi
+++ b/doc/interpreter/io.txi
@@ -702,8 +702,8 @@
 followed by a digit.
 
 The following flags can be used to modify the behavior:
+@c Not @samp so we can have ' ' as an item.
 
-@c Not @samp so we can have ' ' as an item.
 @table @asis
 @item @samp{-}
 Left-justify the result in the field.  Normally the result is
@@ -977,9 +977,9 @@
 @end example
 
 @noindent
-with the conversion @samp{%10c} produces @code{" hello, wo"}, but
+with the conversion @samp{%10c} produces @qcode{" hello, wo"}, but
 reading the same input with the conversion @samp{%10s} produces
-@code{"hello,"}.
+@qcode{"hello,"}.
 
 @node Binary I/O
 @subsection Binary I/O
--- a/doc/interpreter/macros.texi
+++ b/doc/interpreter/macros.texi
@@ -16,12 +16,27 @@
 @c along with Octave; see the file COPYING.  If not, see
 @c <http://www.gnu.org/licenses/>.
 
-@c FIXME -- someday, we might replace this with @backslashchar, which
-@c has been added to Texinfo.
+@c The following macro marks words that aspell should ignore during
+@c spellchecking.  Within Texinfo it has no effect as it merely replaces
+@c the macro call with the argument itself.
+
+@macro nospell {arg}
+\arg\
+@end macro
 
-@macro xbackslashchar
-\\
+@c The following macro works around the Info/plain text expansion of @code{XXX}
+@c which is `XXX'.  This looks particularly bad when the macro body is 
+@c single or double-quoted text, such as a property value `"position"'
+@ifinfo
+@macro qcode{arg}
+\arg\
 @end macro
+@end ifinfo
+@ifnotinfo
+@macro qcode{arg}
+@code{\arg\}
+@end macro
+@end ifnotinfo
 
 @c The following macro is used for the on-line help system, but we don't
 @c want lots of `See also: foo, bar, and baz' strings cluttering the
@@ -30,7 +45,7 @@
 @c
 @c Implementation Note:
 @c For TeX, @vskip produces a nice separation.
-@c For Texinfo '@sp 1' should work, but in practice produces ugly results
+@c For Texinfo, '@sp 1' should work, but in practice produces ugly results
 @c for HTML.  We use a simple blank line to produce the correct behavior. 
 
 @macro seealso {args}
@@ -40,34 +55,34 @@
 @ifnottex
 
 @end ifnottex
-@ifinfo
-@noindent
-See also: \args\.
-@end ifinfo
 @ifnotinfo
 @noindent
 @strong{See also:} \args\.
 @end ifnotinfo
-@end macro
-
-@c The following macro marks words that aspell should ignore during
-@c spellchecking.  Within Texinfo it has no effect as it merely replaces
-@c the macro call with the argument itself.
-
-@macro nospell {arg}
-\arg\
+@ifinfo
+@noindent
+See also: \args\.
+@end ifinfo
 @end macro
 
 @c The following macro works around a situation where the Info/plain text
 @c expansion of the @code{XXX} macro is `XXX'.  The use of the apostrophe
 @c can be confusing if the code segment itself ends with a transpose operator.
 @ifinfo
-@macro xcode{arg}
+@macro tcode{arg}
 \arg\
 @end macro
 @end ifinfo
 @ifnotinfo
-@macro xcode{arg}
+@macro tcode{arg}
 @code{\arg\}
 @end macro
 @end ifnotinfo
+
+@c FIXME: someday, when Texinfo 5.X is standard, we might replace this with
+@c @backslashchar, which is a new addition to Texinfo.
+
+@macro xbackslashchar
+\\
+@end macro
+
--- a/doc/interpreter/matrix.txi
+++ b/doc/interpreter/matrix.txi
@@ -77,7 +77,7 @@
 @DOCSTRING(common_size)
 
 @DOCSTRING(find)
-        
+
 @DOCSTRING(lookup)
 
 If you wish to check if a variable exists at all, instead of properties
@@ -174,7 +174,7 @@
 
 The generators operate in the new or old style together, it is not
 possible to mix the two.  Initializing any generator with
-@code{"state"} or @code{"seed"} causes the others to switch to the
+@qcode{"state"} or @qcode{"seed"} causes the others to switch to the
 same style for future calls.
 
 The state of each generator is independent and calls to different
@@ -208,7 +208,7 @@
 
 @noindent
 produce equivalent results.  When the generators are initialized in
-the old style with @code{"seed"} only @code{rand} and @code{randn} are
+the old style with @qcode{"seed"} only @code{rand} and @code{randn} are
 independent, because the old @code{rande}, @code{randg} and
 @code{randp} generators make calls to @code{rand} and @code{randn}.
 
--- a/doc/interpreter/numbers.txi
+++ b/doc/interpreter/numbers.txi
@@ -620,7 +620,7 @@
 This is the double precision version of the function @code{intmax},
 previously discussed.
 
-Octave also includes the basic bitwise 'and', 'or' and 'exclusive or'
+Octave also includes the basic bitwise 'and', 'or', and 'exclusive or'
 operators.
 
 @DOCSTRING(bitand)
--- a/doc/interpreter/octave.texi
+++ b/doc/interpreter/octave.texi
@@ -147,54 +147,54 @@
 @c ------------------------------------------------------------------------
 
 @menu
-* Preface::                     
+* Preface::
 * Introduction::                A brief introduction to Octave.
-* Getting Started::             
-* Data Types::                  
-* Numeric Data Types::          
-* Strings::                     
-* Data Containers::             
-* Variables::                   
-* Expressions::                 
-* Evaluation::                  
+* Getting Started::
+* Data Types::
+* Numeric Data Types::
+* Strings::
+* Data Containers::
+* Variables::
+* Expressions::
+* Evaluation::
 * Statements::                  Looping and program flow control.
-* Functions and Scripts::       
-* Errors and Warnings::              
+* Functions and Scripts::
+* Errors and Warnings::
 * Debugging::
-* Input and Output::            
-* Plotting::                    
-* Matrix Manipulation::         
-* Arithmetic::                  
+* Input and Output::
+* Plotting::
+* Matrix Manipulation::
+* Arithmetic::
 * Linear Algebra::
 * Vectorization and Faster Code Execution::
 * Nonlinear Equations::
 * Diagonal and Permutation Matrices::
 * Sparse Matrices::
-* Numerical Integration::                  
-* Differential Equations::      
-* Optimization::                
-* Statistics::                  
-* Sets::                        
-* Polynomial Manipulations::    
+* Numerical Integration::
+* Differential Equations::
+* Optimization::
+* Statistics::
+* Sets::
+* Polynomial Manipulations::
 * Interpolation::
 * Geometry::
-* Signal Processing::           
-* Image Processing::            
-* Audio Processing::            
-* Object Oriented Programming::            
-* GUI Development::            
-* System Utilities::            
+* Signal Processing::
+* Image Processing::
+* Audio Processing::
+* Object Oriented Programming::
+* GUI Development::
+* System Utilities::
 * Java Interface:: 
 * Packages:: 
 * External Code Interface::
 * Test and Demo Functions::
-* Tips and Standards::                        
+* Tips and Standards::
 * Contributing Guidelines::
 * Obsolete Functions::
 * Trouble::                     If you have trouble installing Octave.
 * Installation::                How to configure, compile and install Octave.
-* Emacs Octave Support::                       
-* Grammar and Parser::                     
+* Emacs Octave Support::
+* Grammar and Parser::
 * Copying::                     The GNU General Public License.
 * Concept Index::               An item for each concept.
 * Function Index::              An item for each documented function.
--- a/doc/interpreter/oop.txi
+++ b/doc/interpreter/oop.txi
@@ -94,9 +94,7 @@
 our polynomial might look like
 
 @example
-@group
 @EXAMPLEFILE(@polynomial/polynomial.m)
-@end group
 @end example
 
 Note that the return value of the constructor must be the output of
@@ -177,9 +175,7 @@
 An example of a display method for the polynomial class might be
 
 @example
-@group
 @EXAMPLEFILE(@polynomial/display.m)
-@end group
 @end example
 
 @noindent
@@ -195,9 +191,7 @@
 all of the properties of the class.  For example:
 
 @example
-@group
 @EXAMPLEFILE(@polynomial/get.m)
-@end group
 @end example
 
 @noindent
@@ -205,9 +199,7 @@
 object to modify, and then take property/value pairs to be modified. 
 
 @example
-@group
 @EXAMPLEFILE(@polynomial/set.m)
-@end group
 @end example
 
 @noindent
@@ -276,15 +268,13 @@
 
 @DOCSTRING(subsref)
 
-For example we might decide that indexing with "()" evaluates the
-polynomial and indexing with "@{@}" returns the @var{n}-th coefficient (of
-@var{n}-th power).  In this case the @code{subsref} method of our polynomial
-class might look like
+For example we might decide that indexing with @qcode{"()"} evaluates the
+polynomial and indexing with @qcode{"@{@}"} returns the @var{n}-th coefficient
+(of @var{n}-th power).  In this case the @code{subsref} method of our
+polynomial class might look like
 
 @example
-@group
 @EXAMPLEFILE(@polynomial/subsref.m)
-@end group
 @end example
 
 The equivalent functionality for subscripted assignments uses the 
@@ -640,21 +630,19 @@
 @end example
 
 @noindent
-That mixes an object of the class "double" with an object of the class
-"polynomial".  In this case we like to ensure that the return type of
-the above is of the type "polynomial" and so we use the
+That mixes an object of the class @qcode{"double"} with an object of the class
+@qcode{"polynomial"}.  In this case we like to ensure that the return type of
+the above is of the type @qcode{"polynomial"} and so we use the
 @code{superiorto} function in the class constructor.  In particular our
 polynomial class constructor would be modified to be
 
 @example
-@group
 @EXAMPLEFILE(@polynomial/polynomial_superiorto.m)
-@end group
 @end example
 
 Note that user classes always have higher precedence than built-in
 Octave types.  So in fact marking our polynomial class higher than the 
-"double" class is in fact not necessary.
+@qcode{"double"} class is in fact not necessary.
 
 When faced with two objects that have the same precedence, Octave will use the
 method of the object that appears first on the list of arguments.
@@ -692,9 +680,7 @@
 FIRfilter.m in the class directory.
 
 @example
-@group
 @EXAMPLEFILE(@FIRfilter/FIRfilter.m)
-@end group
 @end example
 
 As before, the leading comments provide command-line documentation for
@@ -758,12 +744,10 @@
 to access the fields.  The @code{subsref} method may be used for both.
 
 @example
-@group
 @EXAMPLEFILE(@FIRfilter/subsref.m)
-@end group
 @end example
 
-The "()" case allows us to filter data using the polynomial provided
+The @qcode{"()"} case allows us to filter data using the polynomial provided
 to the constructor.
 
 @example
@@ -781,7 +765,7 @@
 @end group
 @end example
 
-The "." case allows us to view the contents of the polynomial field.
+The @qcode{"."} case allows us to view the contents of the polynomial field.
 
 @example
 @group
@@ -819,9 +803,7 @@
 constructor for this case might be
 
 @example
-@group
 @EXAMPLEFILE(@FIRfilter/FIRfilter_aggregation.m)
-@end group
 @end example
 
 For our example, the remaining class methods remain unchanged.
--- a/doc/interpreter/package.txi
+++ b/doc/interpreter/package.txi
@@ -71,7 +71,7 @@
 
 @noindent
 In this case only version 1.0.0 of the @code{image} package is
-installed.  The '*' character next to the package name shows that the
+installed.  The @qcode{'*'} character next to the package name shows that the
 image package is loaded and ready for use.
 
 It is possible to remove a package from the system using the
@@ -469,7 +469,7 @@
 @end itemize
 
 @noindent
-The format can be summarized with the following example.
+The format can be summarized with the following example:
 
 @example
 @group
@@ -571,6 +571,7 @@
 @noindent
 In both cases @code{some_octave_command} should be replaced by the
 command that should be placed in the @w{@code{PKG_ADD}} file.
-@w{@code{PKG_DEL}} directives work in the same way, except the @w{@code{PKG_ADD}}
-keyword is replaced with @w{@code{PKG_DEL}} and the commands get added
-to the @w{@code{PKG_DEL}} file.
+@w{@code{PKG_DEL}} directives work in the same way, except the
+@w{@code{PKG_ADD}} keyword is replaced with @w{@code{PKG_DEL}} and the commands
+get added to the @w{@code{PKG_DEL}} file.
+
--- a/doc/interpreter/plot.txi
+++ b/doc/interpreter/plot.txi
@@ -588,13 +588,13 @@
 @subsection Use of the @code{interpreter} Property
 
 All text objects, including titles, labels, legends, and text, include
-the property 'interpreter', this property determines the manner in which
+the property @qcode{"interpreter"}, this property determines the manner in which
 special control sequences in the text are rendered.  If the interpreter
-is set to 'none', then no rendering occurs.  At this point the 'latex'
-option is not implemented and so the 'latex' interpreter also does not
-interpret the text.
-
-The 'tex' option implements a subset of @TeX{} functionality in the
+is set to @qcode{"none"}, then no rendering occurs.  At this point the
+@qcode{"latex"} option is not implemented and so the @qcode{"latex"}
+interpreter also does not interpret the text.
+
+The @qcode{"tex"} option implements a subset of @TeX{} functionality in the
 rendering of the text.  This allows the insertion of special characters
 such as Greek or mathematical symbols within the text.  The special
 characters are also inserted with a code starting with the back-slash
@@ -618,7 +618,7 @@
 @end example
 
 @noindent
-where the character 'a' will not appear in a bold font.  Note that to
+where the character @qcode{'a'} will not appear in a bold font.  Note that to
 avoid having Octave interpret the backslash characters in the strings,
 the strings should be in single quotes.
 
@@ -630,11 +630,11 @@
 use @tab
 @end multitable
 
-Finally, the superscript and subscripting can be controlled with the '^'
-and '_' characters.  If the '^' or '_' is followed by a @{ character,
-then all of the block surrounded by the @{ @} pair is super- or
-sub-scripted.  Without the @{ @} pair, only the character immediately
-following the '^' or '_' is super- or sub-scripted.
+Finally, the superscript and subscripting can be controlled with the @qcode{'^'}
+and @qcode{'_'} characters.  If the @qcode{'^'} or @qcode{'_'} is followed by a
+@{ character, then all of the block surrounded by the @{ @} pair is super- or
+sub-scripted.  Without the @{ @} pair, only the character immediately following
+the @qcode{'^'} or @qcode{'_'} is super- or sub-scripted.
 
 @float Table,tab:extended
 @tex
@@ -950,8 +950,8 @@
 properties of graphics objects.  In addition, the @code{get} command may be
 used to obtain property names.
 
-For example, the property "type" of the graphics object pointed to by the
-graphics handle h may be displayed by:
+For example, the property @qcode{"type"} of the graphics object pointed to by
+the graphics handle h may be displayed by:
 
 @example
 get (h, "type")
@@ -962,7 +962,7 @@
 allowed properties are wanted they may be displayed by:
 @code{get (h, "")}.
 
-Thus, for example,
+Thus, for example:
 
 @smallexample
 h = figure ();
@@ -1227,12 +1227,12 @@
 
 @table @code
 @item __modified__  
---- Values: "on," "off"
+--- Values: @qcode{"on"}, @qcode{"off"}
 
 @item __myhandle__
 
 @item beingdeleted  
---- Values: "on," "off"
+--- Values: @qcode{"on"}, @qcode{"off"}
 
 @item busyaction
 
@@ -1243,7 +1243,7 @@
 @item children
 
 @item clipping
- --- Values: "on," "off"
+ --- Values: @qcode{"on"}, @qcode{"off"}
 
 @item createfcn
 
@@ -1252,13 +1252,13 @@
 @item deletefcn
 
 @item handlevisibility  
---- Values: "on," "off"
+--- Values: @qcode{"on"}, @qcode{"off"}
 
 @item hittest
---- Values: "on," "off"
+--- Values: @qcode{"on"}, @qcode{"off"}
 
 @item interruptible  
---- Values: "on," "off"
+--- Values: @qcode{"on"}, @qcode{"off"}
 
 @item parent
 
@@ -1277,7 +1277,7 @@
 @item screenpixelsperinch
 
 @item showhiddenhandles  
---- Values: "on," "off"
+--- Values: @qcode{"on"}, @qcode{"off"}
 
 @item tag
 
@@ -1313,7 +1313,7 @@
 @item alphamap
 
 @item beingdeleted 
---- Values: "on," "off"
+--- Values: @qcode{"on"}, @qcode{"off"}
 
 @item busyaction
 
@@ -1323,7 +1323,7 @@
 Handle to children.
 
 @item clipping
---- Values: "on," "off"
+--- Values: @qcode{"on"}, @qcode{"off"}
 
 @item closerequestfcn 
 --- Handle of function to call on close.
@@ -1347,36 +1347,36 @@
 @item currentpoint
 Holds the coordinates of the point over which the mouse pointer was when
 the mouse button was pressed.  If a mouse callback function is defined,
-@code{"currentpoint"} holds the coordinates of the point over which the
+@qcode{"currentpoint"} holds the coordinates of the point over which the
 mouse pointer is when the function gets called.
 
 @item deletefcn
 
 @item dockcontrols 
---- Values: "on," "off"
+--- Values: @qcode{"on"}, @qcode{"off"}
 
 @item doublebuffer 
---- Values: "on," "off"
+--- Values: @qcode{"on"}, @qcode{"off"}
 
 @item filename
 
 @item handlevisibility 
---- Values: "on," "off"
+--- Values: @qcode{"on"}, @qcode{"off"}
 
 @item hittest
 
 @item integerhandle
 
 @item interruptible 
---- Values: "on," "off"
+--- Values: @qcode{"on"}, @qcode{"off"}
 
 @item inverthardcopy
 
 @item keypressfcn
-see @code{"keypressfcn"}
+see @qcode{"keypressfcn"}
 
 @item keyreleasefcn
-With @code{"keypressfcn"}, The keyboard callback functions.  These
+With @qcode{"keypressfcn"}, the keyboard callback functions.  These
 callback functions get called when a key is pressed/released
 respectively.  The functions are called with two input arguments.  The
 first argument holds the handle of the calling figure.  The second
@@ -1391,8 +1391,8 @@
 
 @item Modifier
 A cell array containing strings representing the modifiers pressed with
-the key.  Possible values are @code{"shift"}, @code{"alt"}, and
-@code{"control"}.
+the key.  Possible values are @qcode{"shift"}, @qcode{"alt"}, and
+@qcode{"control"}.
 @end table
 
 @item menubar
@@ -1404,21 +1404,21 @@
 @item nextplot
 May be one of
 
-@table @code
-@item "new"
-
-@item "add"
-
-@item "replace"
-
-@item "replacechildren"
+@table @asis
+@item @qcode{"new"}
+
+@item @qcode{"add"}
+
+@item @qcode{"replace"}
+
+@item @qcode{"replacechildren"}
 @end table
 
 @item numbertitle
 
 @item paperorientation
-Indicates the orientation for printing.  Either @code{"landscape"} or
-@code{"portrait"}.
+Indicates the orientation for printing.  Either @qcode{"landscape"} or
+@qcode{"portrait"}.
 
 @item paperposition
 
@@ -1449,7 +1449,7 @@
 @item selected
 
 @item selectionhighlight 
---- Values: "on," "off"
+--- Values: @qcode{"on"}, @qcode{"off"}
 
 @item selectiontype
 
@@ -1464,19 +1464,19 @@
 @item userdata
 
 @item visible
-Either @code{"on"} or @code{"off"} to toggle display of the figure.
+Either @qcode{"on"} or @qcode{"off"} to toggle display of the figure.
 
 @item windowbuttondownfcn
-See @code{"windowbuttonupfcn"}
+See @qcode{"windowbuttonupfcn"}
 
 @item windowbuttonmotionfcn
-See @code{"windowbuttonupfcn"}
+See @qcode{"windowbuttonupfcn"}
 
 @item windowbuttonupfcn
-With @code{"windowbuttondownfcn"} and @code{"windowbuttonmotionfcn"},
-The mouse callback functions.  These callback functions get called when
+With @qcode{"windowbuttondownfcn"} and @qcode{"windowbuttonmotionfcn"},
+the mouse callback functions.  These callback functions get called when
 the mouse button is pressed, dragged, and released respectively.  When
-these callback functions are called, the @code{"currentpoint"} property
+these callback functions are called, the @qcode{"currentpoint"} property
 holds the current coordinates of the cursor.
 
 @item windowscrollwheelfcn
@@ -1517,7 +1517,7 @@
 
 @item box
 Box surrounding axes. 
---- Values: "on," "off"
+--- Values: @qcode{"on"}, @qcode{"off"}
 
 @item busyaction
 
@@ -1545,10 +1545,10 @@
 Two-element vector defining the limits for the c axis of
 an image.  See @code{pcolor} property.
 Setting this property also forces the corresponding mode
-property to be set to @code{"manual"}.
+property to be set to @qcode{"manual"}.
 
 @item climmode
-Either @code{"manual"} or @code{"auto"}.
+Either @qcode{"manual"} or @qcode{"auto"}.
 
 @item clipping
 
@@ -1561,7 +1561,7 @@
 @item currentpoint
 Holds the coordinates of the point over which the mouse pointer was when
 the mouse button was pressed.  If a mouse callback function is defined,
-@code{"currentpoint"} holds the coordinates of the point over which the
+@qcode{"currentpoint"} holds the coordinates of the point over which the
 mouse pointer is when the function gets called.
 
 @item dataaspectratio
@@ -1570,10 +1570,10 @@
 2]} causes the length of one unit as displayed on the y-axis to be the
 same as the length of 2 units on the x-axis.  Setting
 @code{dataaspectratio} also forces the @code{dataaspectratiomode}
-property to be set to @code{"manual"}.
+property to be set to @qcode{"manual"}.
 
 @item dataaspectratiomode 
-Either @code{"manual"} or @code{"auto"}.
+Either @qcode{"manual"} or @qcode{"auto"}.
 
 @item deletefcn
 
@@ -1610,14 +1610,12 @@
 @item nextplot
 May be one of
 
-@table @code
-@item "new"
-
-@item "add"
-
-@item "replace"
-
-@item "replacechildren"
+@table @asis
+@item @qcode{"add"}
+
+@item @qcode{"replace"}
+
+@item @qcode{"replacechildren"}
 @end table
 
 @item outerposition
@@ -1675,7 +1673,7 @@
 A three element vector specifying the view point for three-dimensional plots.
 
 @item visible
-Either @code{"on"} or @code{"off"} to toggle display of the axes.
+Either @qcode{"on"} or @qcode{"off"} to toggle display of the axes.
 
 @item x_normrendertransform
 
@@ -1688,15 +1686,15 @@
 @item x_viewtransform
 
 @item xaxislocation 
-Either @code{"top"} or @code{"bottom"}.
+Either @qcode{"top"} or @qcode{"bottom"}.
 
 @item xcolor
 
 @item xdir
-Either @code{"forward"} or @code{"reverse"}.
+Either @qcode{"forward"} or @qcode{"reverse"}.
 
 @item xgrid
-Either @code{"on"} or @code{"off"} to toggle display of grid lines.
+Either @qcode{"on"} or @qcode{"off"} to toggle display of grid lines.
 
 @item xlabel
 Indices to text objects for the axes labels.
@@ -1704,44 +1702,44 @@
 @item xlim
 Two-element vector defining the limits for the x-axis.
 Setting this property also forces the corresponding mode
-property to be set to @code{"manual"}.
+property to be set to @qcode{"manual"}.
 
 @item xlimmode
-Either @code{"manual"} or @code{"auto"}.
+Either @qcode{"manual"} or @qcode{"auto"}.
 
 @item xminorgrid 
-Either @code{"on"} or @code{"off"} to toggle display of minor grid lines.
+Either @qcode{"on"} or @qcode{"off"} to toggle display of minor grid lines.
 
 @item xminortick
 
 @item xscale
-Either @code{"linear"} or @code{"log"}.
+Either @qcode{"linear"} or @qcode{"log"}.
 
 @item xtick
 Set position of tick marks.
 Setting this property also forces the corresponding mode
-property to be set to @code{"manual"}.
+property to be set to @qcode{"manual"}.
 
 @item xticklabel
 Setting this property also forces the corresponding mode
-property to be set to @code{"manual"}.
+property to be set to @qcode{"manual"}.
 
 @item xticklabelmode 
-Either @code{"manual"} or @code{"auto"}.
+Either @qcode{"manual"} or @qcode{"auto"}.
 
 @item xtickmode 
-Either @code{"manual"} or @code{"auto"}.
+Either @qcode{"manual"} or @qcode{"auto"}.
 
 @item yaxislocation 
-Either @code{"left"} or @code{"right"}
+Either @qcode{"left"} or @qcode{"right"}
 
 @item ycolor
 
 @item ydir
-Either @code{"forward"} or @code{"reverse"}.
+Either @qcode{"forward"} or @qcode{"reverse"}.
 
 @item ygrid
-Either @code{"on"} or @code{"off"} to toggle display of grid lines.
+Either @qcode{"on"} or @qcode{"off"} to toggle display of grid lines.
 
 @item ylabel
 Indices to text objects for the axes labels.
@@ -1749,41 +1747,41 @@
 @item ylim
 Two-element vectors defining the limits for the x, y, and z axes and the
 Setting one of these properties also forces the corresponding mode
-property to be set to @code{"manual"}.
+property to be set to @qcode{"manual"}.
 
 @item ylimmode
-Either @code{"manual"} or @code{"auto"}.
+Either @qcode{"manual"} or @qcode{"auto"}.
 
 @item yminorgrid 
-Either @code{"on"} or @code{"off"} to toggle display of minor grid lines.
+Either @qcode{"on"} or @qcode{"off"} to toggle display of minor grid lines.
 
 @item yminortick
 
 @item yscale
-Either @code{"linear"} or @code{"log"}.
+Either @qcode{"linear"} or @qcode{"log"}.
 
 @item ytick
 Set position of tick marks.
 Setting this property also forces the corresponding mode
-property to be set to @code{"manual"}.
+property to be set to @qcode{"manual"}.
 
 @item yticklabel
 Setting this property also forces the corresponding mode
-property to be set to @code{"manual"}.
+property to be set to @qcode{"manual"}.
 
 @item yticklabelmode 
-Either @code{"manual"} or @code{"auto"}.
+Either @qcode{"manual"} or @qcode{"auto"}.
 
 @item ytickmode 
-Either @code{"manual"} or @code{"auto"}.
+Either @qcode{"manual"} or @qcode{"auto"}.
 
 @item zcolor
 
 @item zdir
-Either @code{"forward"} or @code{"reverse"}.
+Either @qcode{"forward"} or @qcode{"reverse"}.
 
 @item zgrid
-Either @code{"on"} or @code{"off"} to toggle display of grid lines.
+Either @qcode{"on"} or @qcode{"off"} to toggle display of grid lines.
 
 @item zlabel
 Indices to text objects for the axes labels.
@@ -1791,33 +1789,33 @@
 @item zlim
 Two-element vector defining the limits for z-axis.
 Setting this property also forces the corresponding mode
-property to be set to @code{"manual"}.
+property to be set to @qcode{"manual"}.
 
 @item zlimmode
-Either @code{"manual"} or @code{"auto"}.
+Either @qcode{"manual"} or @qcode{"auto"}.
 
 @item zminorgrid 
-Either @code{"on"} or @code{"off"} to toggle display of minor grid lines.
+Either @qcode{"on"} or @qcode{"off"} to toggle display of minor grid lines.
 
 @item zminortick
 
 @item zscale
-Either @code{"linear"} or @code{"log"}.
+Either @qcode{"linear"} or @qcode{"log"}.
 
 @item ztick
 Set position of tick marks.
 Setting this property also forces the corresponding mode
-property to be set to @code{"manual"}.
+property to be set to @qcode{"manual"}.
 
 @item zticklabel 
 Setting this property also forces the corresponding mode
-property to be set to @code{"manual"}.
+property to be set to @qcode{"manual"}.
 
 @item zticklabelmode 
-Either @code{"manual"} or @code{"auto"}.
+Either @qcode{"manual"} or @qcode{"auto"}.
 
 @item ztickmode
-Either @code{"manual"} or @code{"auto"}.
+Either @qcode{"manual"} or @qcode{"auto"}.
 
 @end table
 
@@ -1973,8 +1971,8 @@
 @item erasemode
 
 @item fontangle
-Flag whether the font is italic or normal.  Valid values are 'normal',
-'italic' and 'oblique'.
+Flag whether the font is italic or normal.  Valid values are @qcode{"normal"},
+@qcode{"italic"}, and @qcode{"oblique"}.
 
 @item fontname
 The font used for the text.
@@ -1985,19 +1983,19 @@
 @item fontunits
 
 @item fontweight
-Flag whether the font is bold, etc.  Valid values are 'normal', 'bold',
-'demi' or 'light'.
+Flag whether the font is bold, etc.  Valid values are @qcode{"normal"},
+@qcode{"bold"}, @qcode{"demi"}, or @qcode{"light"}.
 
 @item handlevisibility
 
 @item hittest
 
 @item horizontalalignment
-May be @code{"left"}, @code{"center"}, or @code{"right"}.
+May be @qcode{"left"}, @qcode{"center"}, or @qcode{"right"}.
 
 @item interpreter
-Determines how the text is rendered.  Valid values are 'none', 'tex' or
-'latex'.
+Determines how the text is rendered.  Valid values are @qcode{"none"},
+@qcode{"tex"}, or @qcode{"latex"}.
 
 @item interruptible
 
@@ -2029,7 +2027,7 @@
 @item uicontextmenu
 
 @item units
-May be @code{"normalized"} or @code{"graph"}.
+May be @qcode{"normalized"} or @qcode{"graph"}.
 
 @item userdata
 
@@ -2440,8 +2438,8 @@
 Although default values may be set for any object, they are set in
 parent objects and apply to child objects, of the specified object type.
 For example, setting the default @code{color} property of @code{line}
-objects to "green", for the @code{root} object, will result in all
-@code{line} objects inheriting the @code{color} "green" as the default
+objects to @qcode{"green"}, for the @code{root} object, will result in all
+@code{line} objects inheriting the @code{color} @qcode{"green"} as the default
 value.
 
 @example
@@ -2489,7 +2487,7 @@
 from the global root figure parent object.
 
 To remove a user-defined default setting, set the default property to
-the value @code{"remove"}.  For example,
+the value @qcode{"remove"}.  For example,
 
 @example
 set (gca (), "defaultlinecolor", "remove");
@@ -2502,7 +2500,7 @@
 
 @DOCSTRING(reset)
 
-Getting the @code{"default"} property of an object returns a list of
+Getting the @qcode{"default"} property of an object returns a list of
 user-defined defaults set for the object.  For example,
 
 @example
@@ -2544,9 +2542,9 @@
 @cindex colors, graphics
 
 Colors may be specified as RGB triplets with values ranging from zero to
-one, or by name.  Recognized color names include @code{"blue"},
-@code{"black"}, @code{"cyan"}, @code{"green"}, @code{"magenta"},
-@code{"red"}, @code{"white"}, and @code{"yellow"}.
+one, or by name.  Recognized color names include @qcode{"blue"},
+@qcode{"black"}, @qcode{"cyan"}, @qcode{"green"}, @qcode{"magenta"},
+@qcode{"red"}, @qcode{"white"}, and @qcode{"yellow"}.
 
 @node Line Styles
 @subsection Line Styles
@@ -2572,7 +2570,7 @@
 @item "-."
 A dash-dot line.
 
-@item "none"
+@item @qcode{"none"}
 No line.  Points will still be marked using the current Marker Style.
 @end table
 
@@ -2591,14 +2589,14 @@
 @table @code
 @item marker
 A character indicating a plot marker to be place at each data point, or
-@code{"none"}, meaning no markers should be displayed.
+@qcode{"none"}, meaning no markers should be displayed.
 
 @item markeredgecolor
-The color of the edge around the marker, or @code{"auto"}, meaning that
+The color of the edge around the marker, or @qcode{"auto"}, meaning that
 the edge color is the same as the face color.  @xref{Colors}.
 
 @item markerfacecolor
-The color of the marker, or @code{"none"} to indicate that the marker
+The color of the marker, or @qcode{"none"} to indicate that the marker
 should not be filled.  @xref{Colors}.
 
 @item markersize
@@ -2906,8 +2904,8 @@
 @itemx baseline
 @itemx basevalue
 The property @code{showbaseline} flags whether the baseline of the bar
-series is displayed (default is "on").  The handle of the graphics object
-representing the baseline is given by the @code{baseline} property and
+series is displayed (default is @qcode{"on"}).  The handle of the graphics
+object representing the baseline is given by the @code{baseline} property and
 the y-value of the baseline by the @code{basevalue} property.
 
 Changes to any of these property are propagated to the other members of
@@ -2920,7 +2918,7 @@
 @itemx horizontal
 The property @code{barwidth} is the width of the bar corresponding to
 the @var{width} variable passed to @code{bar} or @var{barh}.  Whether the
-bar series is "grouped" or "stacked" is determined by the
+bar series is @qcode{"grouped"} or @qcode{"stacked"} is determined by the
 @code{barlayout} property and whether the bars are horizontal or
 vertical by the @code{horizontal} property.
 
@@ -2964,37 +2962,37 @@
 create the contours of the plot.
 
 @item fill
-A radio property that can have the values "on" or "off" that flags whether the
-contours to plot are to be filled.
+A radio property that can have the values @qcode{"on"} or @qcode{"off"} that
+flags whether the contours to plot are to be filled.
 
 @item  zlevelmode
 @itemx zlevel
-The radio property @code{zlevelmode} can have the values "none", "auto" or
-"manual".  When its value is "none" there is no z component to the plotted
-contours.  When its value is "auto" the z value of the plotted contours is
-at the same value as the contour itself.  If the value is "manual", then the
-z value at which to plot the contour is determined by the @code{zlevel}
-property.
+The radio property @code{zlevelmode} can have the values @qcode{"none"},
+@qcode{"auto"}, or @qcode{"manual"}.  When its value is @qcode{"none"} there is
+no z component to the plotted contours.  When its value is @qcode{"auto"} the z
+value of the plotted contours is at the same value as the contour itself.  If
+the value is @qcode{"manual"}, then the z value at which to plot the contour is
+determined by the @code{zlevel} property.
 
 @item  levellistmode
 @itemx levellist
 @itemx levelstepmode
 @itemx levelstep
-If @code{levellistmode} is "manual", then the levels at which to plot the
-contours is determined by @code{levellist}.  If @code{levellistmode} is
-set to "auto", then the distance between contours is determined by
-@code{levelstep}.  If both @code{levellistmode} and @code{levelstepmode}
-are set to "auto", then there are assumed to be 10 equal spaced contours.
+If @code{levellistmode} is @qcode{"manual"}, then the levels at which to plot
+the contours is determined by @code{levellist}.  If @code{levellistmode} is set
+to @qcode{"auto"}, then the distance between contours is determined by
+@code{levelstep}.  If both @code{levellistmode} and @code{levelstepmode} are
+set to @qcode{"auto"}, then there are assumed to be 10 equal spaced contours.
 
 @item  textlistmode
 @itemx textlist
 @itemx textstepmode
 @itemx textstep
-If @code{textlistmode} is "manual", then the labeled contours
+If @code{textlistmode} is @qcode{"manual"}, then the labeled contours
 is determined by @code{textlist}.  If @code{textlistmode} is set to
-"auto", then the distance between labeled contours is determined by
+@qcode{"auto"}, then the distance between labeled contours is determined by
 @code{textstep}.  If both @code{textlistmode} and @code{textstepmode}
-are set to "auto", then there are assumed to be 10 equal spaced
+are set to @qcode{"auto"}, then there are assumed to be 10 equal spaced
 labeled contours.
 
 @item showtext
@@ -3011,9 +3009,9 @@
 The properties of the contour lines.  The properties @code{linewidth} and
 @code{linestyle} are similar to the corresponding properties for lines.  The
 property @code{linecolor} is a color property (@pxref{Colors}), that can also
-have the values of "none" or "auto".  If @code{linecolor} is "none", then no
-contour line is drawn.  If @code{linecolor} is "auto" then the line color is
-determined by the colormap.
+have the values of @qcode{"none"} or @qcode{"auto"}.  If @code{linecolor} is
+@qcode{"none"}, then no contour line is drawn.  If @code{linecolor} is
+@qcode{"auto"} then the line color is determined by the colormap.
 
 @item  xdata
 @itemx ydata
@@ -3247,7 +3245,7 @@
 @itemx baseline
 @itemx basevalue
 The property @code{showbaseline} flags whether the baseline of the
-stem series is displayed (default is "on").  The handle of the graphics
+stem series is displayed (default is @qcode{"on"}).  The handle of the graphics
 object representing the baseline is given by the @code{baseline}
 property and the y-value (or z-value for @code{stem3}) of the baseline
 by the @code{basevalue} property.
--- a/doc/interpreter/quad.txi
+++ b/doc/interpreter/quad.txi
@@ -134,9 +134,10 @@
 is reasonably accurate (to see why, examine what happens to the result
 if you move the lower bound to 0.1, then 0.01, then 0.001, etc.).
 
-The function "f" can be the string name of a function, a function handle, or
-an inline function.  These options make it quite easy to do integration
-without having to fully define a function in an m-file.  For example:
+The function @qcode{"f"} can be the string name of a function, a function
+handle, or an inline function.  These options make it quite easy to do
+integration without having to fully define a function in an m-file.  For
+example:
 
 @example
 @group
--- a/doc/interpreter/sparse.txi
+++ b/doc/interpreter/sparse.txi
@@ -573,8 +573,8 @@
 same manner as there full counterparts.  However, there are certain differences
 and especially differences with other products sparse implementations.
 
-Firstly, the "./" and ".^" operators must be used with care.  Consider what
-the examples
+Firstly, the @qcode{"./"} and @qcode{".^"} operators must be used with care. 
+Consider what the examples
 
 @example
 @group
--- a/doc/interpreter/strings.txi
+++ b/doc/interpreter/strings.txi
@@ -154,13 +154,13 @@
 @section Character Arrays
 
 The string representation used by Octave is an array of characters, so
-internally the string @nospell{"dddddddddd"} is actually a row vector of length
-10 containing the value 100 in all places (100 is the ASCII code of "d").  This
-lends itself to the obvious generalization to character matrices.  Using a
-matrix of characters, it is possible to represent a collection of same-length
-strings in one variable.  The convention used in Octave is that each row in a
-character matrix is a separate string, but letting each column represent a
-string is equally possible.
+internally the string @nospell{@qcode{"dddddddddd"}} is actually a row vector
+of length 10 containing the value 100 in all places (100 is the ASCII code of
+@qcode{"d"}).  This lends itself to the obvious generalization to character
+matrices.  Using a matrix of characters, it is possible to represent a
+collection of same-length strings in one variable.  The convention used in
+Octave is that each row in a character matrix is a separate string, but letting
+each column represent a string is equally possible.
 
 The easiest way to create a character matrix is to put several strings
 together into a matrix.
@@ -288,8 +288,8 @@
 char ("orange", "green", "", "red")
     @result{} orange
        green 
-             
-       red   
+
+       red
 @end group
 
 @group
@@ -331,7 +331,7 @@
 @example
 @group
 strcat (["dir1";"directory2"], ["/";"/"], ["file1";"file2"])
-     @result{} dir1/file1      
+     @result{} dir1/file1
         directory2/file2
 @end group
 @group
--- a/doc/interpreter/system.txi
+++ b/doc/interpreter/system.txi
@@ -491,7 +491,7 @@
 @DOCSTRING(getgrent)
 
 @DOCSTRING(getgrgid)
-         
+
 @DOCSTRING(getgrnam)
 
 @DOCSTRING(setgrent)
--- a/doc/interpreter/tips.txi
+++ b/doc/interpreter/tips.txi
@@ -352,7 +352,7 @@
 Help text in Texinfo format.  Code samples should be marked 
 like @@code@{sample of code@} and variables should be marked
 as @@var@{variable@}.
-@@seealso@{fn2@}
+@@seealso@{fn2, fn3@}
 @@end deftypefn
 @end group
 @end example
@@ -385,7 +385,13 @@
 All samples of code should be marked with this macro for the same
 reasons as the @@var macro.
 
-@item @@seealso@{function2@}
+@item  @nospell{@@qcode@{"sample_code"@}}
+@itemx @nospell{@@qcode@{'sample_code'@}}
+All samples of code which are quoted should use this more specialized macro.
+This happens frequently when discussing graphics properties such as "position"
+or options such as "on"/"off".
+
+@item @@seealso@{function2, function3@}
 This is a comma separated list of function names that allows cross
 referencing from one function documentation string to another.
 @end table
@@ -467,8 +473,8 @@
 The @code{@@group} block prevents the example from being split across a
 page boundary, while the @code{@@result@{@}} macro produces a right
 arrow signifying the result of a command.  If your example is larger than
-20 lines it is better NOT to use grouping so that a reasonable page boundary
-can be calculated.
+20 lines it is better @emph{NOT} to use grouping so that a reasonable page
+boundary can be calculated.
 
 In many cases a function has multiple ways in which it can be called,
 and the @code{@@deftypefnx} macro can be used to give alternatives.  For
@@ -556,14 +562,15 @@
 @@seealso@{bincoeff, perms@}
 @@end deftypefn
 @end example
+
 @noindent
 which demonstrates most of the concepts discussed above.
 @iftex
 This documentation string renders as
-
 @c Note: use the actual output of info below, rather than try and 
 @c reproduce it here to prevent it looking different from how it would
 @c appear with info.
+
 @example
  -- Function File: C = nchoosek (N, K)
  -- Function File: C = nchoosek (SET, K)
--- a/doc/interpreter/vectorize.txi
+++ b/doc/interpreter/vectorize.txi
@@ -674,7 +674,7 @@
 @item Use @code{ignore_function_time_stamp} when appropriate.
 If you are calling lots of functions, and none of them will need to change
 during your run, set the variable @code{ignore_function_time_stamp} to
-@code{"all"}.  This will stop Octave from checking the time stamp of a function
+@qcode{"all"}.  This will stop Octave from checking the time stamp of a function
 file to see if it has been updated while the program is being run.
 @end itemize
 
--- a/examples/mysparse.c
+++ b/examples/mysparse.c
@@ -11,14 +11,14 @@
   double *pr2, *pi2;
   mwIndex *ir, *jc;
   mwIndex *ir2, *jc2;
-  
+
   if (nrhs != 1 || ! mxIsSparse (prhs[0]))
     mexErrMsgTxt ("ARG1 must be a sparse matrix");
 
   m = mxGetM (prhs[0]);
   n = mxGetN (prhs[0]);
   nz = mxGetNzmax (prhs[0]);
-  
+
   if (mxIsComplex (prhs[0]))
     {
       mexPrintf ("Matrix is %d-by-%d complex sparse matrix", m, n);
@@ -40,7 +40,7 @@
       pi2 = mxGetPi (v);
       ir2 = mxGetIr (v);
       jc2 = mxGetJc (v);
-      
+
       for (i = 0; i < nz; i++)
         {
           pr2[i] = 2 * pr[i];
@@ -72,7 +72,7 @@
       pbr2 = mxGetLogicals (v);
       ir2 = mxGetIr (v);
       jc2 = mxGetJc (v);
-      
+
       for (i = 0; i < nz; i++)
         {
           pbr2[i] = pbr[i];
@@ -102,7 +102,7 @@
       pr2 = mxGetPr (v);
       ir2 = mxGetIr (v);
       jc2 = mxGetJc (v);
-      
+
       for (i = 0; i < nz; i++)
         {
           pr2[i] = 2 * pr[i];
--- a/libgui/qterminal/libqterminal/unix/Screen.cpp
+++ b/libgui/qterminal/libqterminal/unix/Screen.cpp
@@ -788,8 +788,8 @@
 
   lastPos = loc(cuX,cuY);
 
-  // check if selection is still valid.
-  checkSelection(cuX,cuY);
+  // clear selection on text input
+  clearSelection ();
 
   Character& currentChar = screenLines[cuY][cuX];
 
--- a/libgui/qterminal/libqterminal/win32/QWinTerminalImpl.cpp
+++ b/libgui/qterminal/libqterminal/win32/QWinTerminalImpl.cpp
@@ -1227,6 +1227,8 @@
 QWinTerminalImpl::QWinTerminalImpl (QWidget* parent)
     : QTerminal (parent), d (new QConsolePrivate (this))
 {
+    installEventFilter (this);
+
     connect (this, SIGNAL (set_global_shortcuts_signal (bool)),
            parent, SLOT (set_global_shortcuts (bool)));
 }
@@ -1397,6 +1399,22 @@
   QWidget::focusOutEvent (event);
 }
 
+bool QWinTerminalImpl::eventFilter (QObject *obj, QEvent * event)
+{
+  // if a keypress, filter out tab keys so that the next/prev tabbing is
+  // disabled - but we still need to pass along to the console .
+  if (event->type () == QEvent::KeyPress)
+  {
+    QKeyEvent* k = static_cast<QKeyEvent*>(event);
+    if (k->key () == Qt::Key_Tab)
+    {
+      sendText ("\t");
+      return true;
+    }
+  }
+  return false;
+}
+
 void QWinTerminalImpl::keyPressEvent (QKeyEvent* event)
 {
   QString s = translateKey (event);
--- a/libgui/qterminal/libqterminal/win32/QWinTerminalImpl.h
+++ b/libgui/qterminal/libqterminal/win32/QWinTerminalImpl.h
@@ -86,6 +86,8 @@
   void mousePressEvent (QMouseEvent *event);
   void mouseReleaseEvent (QMouseEvent *event);
 
+  bool eventFilter(QObject *obj, QEvent *ev);
+
 private slots:
   void scrollValueChanged (int value);
   void monitorConsole (void);
--- a/libgui/src/main-window.cc
+++ b/libgui/src/main-window.cc
@@ -78,7 +78,10 @@
     find_files_dlg (0),
     _octave_main_thread (0),
     _octave_qt_link (0),
-    _clipboard (QApplication::clipboard ())
+    _clipboard (QApplication::clipboard ()),
+    _cmd_queue (new QStringList ()),  // no command pending
+    _cmd_processing (1),
+    _cmd_queue_mutex ()
 {
   // We have to set up all our windows, before we finally launch octave.
   construct ();
@@ -104,6 +107,7 @@
     }
   delete _octave_main_thread;
   delete _octave_qt_link;
+  delete _cmd_queue;
 }
 
 bool
@@ -198,9 +202,7 @@
 void
 main_window::execute_command_in_terminal (const QString& command)
 {
-  octave_link::post_event (this, &main_window::execute_command_callback,
-                           command.toStdString ());
-
+  queue_command (command);
   focus_command_window ();
 }
 
@@ -211,6 +213,28 @@
 }
 
 void
+main_window::run_file_callback (const QFileInfo& info)
+{
+  QString dir = info.absolutePath ();
+  QString function_name = info.fileName ();
+  function_name.chop (info.suffix ().length () + 1);
+  if (octave_qt_link::file_in_path (info.absoluteFilePath ().toStdString (),
+                                    dir.toStdString ()))
+    queue_command (function_name);
+}
+
+void
+main_window::queue_command (QString command)
+{
+  _cmd_queue_mutex.lock ();
+  _cmd_queue->append (command);   // queue command
+  _cmd_queue_mutex.unlock ();
+
+  if (_cmd_processing.tryAcquire ())   // if callback is not processing, post event
+    octave_link::post_event (this, &main_window::execute_command_callback);
+}
+
+void
 main_window::handle_new_figure_request (void)
 {
   octave_link::post_event (this, &main_window::new_figure_callback);
@@ -1482,29 +1506,34 @@
 }
 
 void
-main_window::execute_command_callback (const std::string& command)
+main_window::execute_command_callback ()
 {
-  std::string pending_input = command_editor::get_current_line ();
+  bool repost = false;          // flag for reposting event for this callback
 
-  command_editor::set_initial_input (pending_input);
-
-  command_editor::replace_line (command);
-  command_editor::redisplay ();
+  if (!_cmd_queue->isEmpty ())  // list can not be empty here, just to make sure
+    {
+      std::string pending_input = command_editor::get_current_line ();
+      command_editor::set_initial_input (pending_input);
 
-  // We are executing inside the command editor event loop.  Force
-  // the current line to be returned for processing.
-  command_editor::interrupt ();
-}
+      _cmd_queue_mutex.lock (); // critical path
+      std::string command = _cmd_queue->takeFirst ().toStdString ();
+      if (_cmd_queue->isEmpty ())
+        _cmd_processing.release ();  // command queue empty, processing will stop
+      else
+        repost = true;          // not empty, repost at end
+      _cmd_queue_mutex.unlock ();
+
+      command_editor::replace_line (command);
 
-void
-main_window::run_file_callback (const QFileInfo& info)
-{
-  QString dir = info.absolutePath ();
-  QString function_name = info.fileName ();
-  function_name.chop (info.suffix ().length () + 1);
-  if (octave_qt_link::file_in_path (info.absoluteFilePath ().toStdString (),
-                                    dir.toStdString ()))
-    execute_command_callback (function_name.toStdString ());
+      command_editor::redisplay ();
+      // We are executing inside the command editor event loop.  Force
+      // the current line to be returned for processing.
+      command_editor::interrupt ();
+    }
+
+  if (repost)  // queue not empty, so repost event for further processing
+    octave_link::post_event (this, &main_window::execute_command_callback);
+
 }
 
 void
--- a/libgui/src/main-window.h
+++ b/libgui/src/main-window.h
@@ -36,6 +36,7 @@
 #include <QCloseEvent>
 #include <QToolButton>
 #include <QComboBox>
+#include <QSemaphore>
 
 // Editor includes
 #include "file-editor-interface.h"
@@ -233,7 +234,7 @@
 
   void clear_history_callback (void);
 
-  void execute_command_callback (const std::string& command);
+  void execute_command_callback ();
   void run_file_callback (const QFileInfo& info);
 
   void new_figure_callback (void);
@@ -252,7 +253,8 @@
 
   void exit_callback (void);
 
-  // Data models.
+  void queue_command (QString command);  // Data models.
+
   workspace_model *_workspace_model;
 
   // Toolbars.
@@ -272,7 +274,9 @@
     list.append (static_cast<octave_dock_widget *> (history_window));
     list.append (static_cast<octave_dock_widget *> (file_browser_window));
     list.append (static_cast<octave_dock_widget *> (doc_browser_window));
+#ifdef HAVE_QSCINTILLA
     list.append (static_cast<octave_dock_widget *> (editor_window));
+#endif
     list.append (static_cast<octave_dock_widget *> (workspace_window));
     return list;
   }
@@ -315,6 +319,11 @@
 
   // Flag for closing whole application.
   bool _closing;
+
+  // semaphore to synchronize execution signals and related callback
+  QStringList *_cmd_queue;
+  QSemaphore   _cmd_processing;
+  QMutex       _cmd_queue_mutex;
 };
 
 #endif // MAINWINDOW_H
--- a/libinterp/Makefile.am
+++ b/libinterp/Makefile.am
@@ -53,6 +53,9 @@
   corefcn/defaults.h \
   corefcn/graphics-props.cc \
   corefcn/graphics.h \
+  corefcn/oct-tex-lexer.cc \
+  corefcn/oct-tex-parser.cc \
+  corefcn/oct-tex-symbols.cc \
   operators/ops.cc \
   parse-tree/lex.cc \
   parse-tree/oct-gperf.h \
@@ -64,6 +67,9 @@
   builtins.cc
 
 BUILT_DISTFILES = \
+  corefcn/oct-tex-lexer.ll \
+  corefcn/oct-tex-parser.h \
+  corefcn/oct-tex-symbols.cc \
   parse-tree/oct-gperf.h \
   parse-tree/oct-parse.h \
   parse-tree/oct-parse.yy
@@ -89,6 +95,8 @@
   Makefile.in \
   DOCSTRINGS \
   config-features.sh \
+  corefcn/oct-tex-lexer.in.ll \
+  corefcn/oct-tex-symbols.in \
   find-defun-files.sh \
   gendoc.pl \
   genprops.awk \
@@ -196,7 +204,7 @@
 ## Section for defining and creating DEF_FILES
 
 ULT_DIST_SRC := \
-  $(filter-out parse-tree/oct-parse.yy, $(DIST_SRC)) parse-tree/oct-parse.in.yy
+  $(filter-out corefcn/oct-tex-lexer.ll parse-tree/oct-parse.yy, $(DIST_SRC)) corefcn/oct-tex-lexer.in.ll parse-tree/oct-parse.in.yy
 
 SRC_DEF_FILES := $(shell $(srcdir)/find-defun-files.sh "$(srcdir)" $(ULT_DIST_SRC))
 
@@ -359,6 +367,7 @@
 CLEANFILES = \
   $(DLDFCN_PKG_ADD_FILE) \
   corefcn/graphics-props.cc \
+  corefcn/oct-tex-parser.output \
   parse-tree/oct-parse.output
 
 DISTCLEANFILES = \
--- a/libinterp/corefcn/balance.cc
+++ b/libinterp/corefcn/balance.cc
@@ -75,10 +75,10 @@
 The eigenvalue balancing option @var{opt} may be one of:\n\
 \n\
 @table @asis\n\
-@item \"noperm\", \"S\"\n\
+@item @qcode{\"noperm\"}, @qcode{\"S\"}\n\
 Scale only; do not permute.\n\
 \n\
-@item \"noscal\", \"P\"\n\
+@item @qcode{\"noscal\"}, @qcode{\"P\"}\n\
 Permute only; do not scale.\n\
 @end table\n\
 \n\
--- a/libinterp/corefcn/besselj.cc
+++ b/libinterp/corefcn/besselj.cc
@@ -649,11 +649,10 @@
 }
 
 /*
-%! # Test values computed with GP/PARI version 2.3.3
-%!
+## Test values computed with GP/PARI version 2.3.3
 %!shared alpha, x, jx, yx, ix, kx, nix
 %!
-%! # Bessel functions, even order, positive and negative x
+%! ## Bessel functions, even order, positive and negative x
 %! alpha = 2;  x = 1.25;
 %! jx = 0.1710911312405234823613091417;
 %! yx = -1.193199310178553861283790424;
@@ -706,7 +705,7 @@
 %!assert (besselh (alpha,1,x,1), (jx + I*yx)*exp(-I*x), 100*eps)
 %!assert (besselh (alpha,2,x,1), (jx - I*yx)*exp(I*x), 100*eps)
 %!
-%! # Bessel functions, odd order, positive and negative x
+%! ## Bessel functions, odd order, positive and negative x
 %! alpha = 3;  x = 2.5;
 %! jx = 0.2166003910391135247666890035;
 %! yx = -0.7560554967536709968379029772;
@@ -761,7 +760,7 @@
 %!assert (besselh (alpha,1,x,1), (jx + I*yx)*exp(-I*x), 100*eps)
 %!assert (besselh (alpha,2,x,1), (jx - I*yx)*exp(I*x), 100*eps)
 %!
-%! # Bessel functions, fractional order, positive and negative x
+%! ## Bessel functions, fractional order, positive and negative x
 %!
 %! alpha = 3.5;  x = 2.75;
 %! jx = 0.1691636439842384154644784389;
@@ -819,7 +818,7 @@
 %!assert (besselh (alpha,1,x,1), (jx + I*yx)*exp(-I*x), 100*eps)
 %!assert (besselh (alpha,2,x,1), (jx - I*yx)*exp(I*x), 100*eps)
 %!
-%! # Bessel functions, even order, complex x
+%! ## Bessel functions, even order, complex x
 %!
 %! alpha = 2;  x = 1.25 + 3.625 * I;
 %! jx = -1.299533366810794494030065917 + 4.370833116012278943267479589*I;
@@ -855,7 +854,7 @@
 %!assert (besselh (-alpha,1,x,1), (jx + I*yx)*exp(-I*x), 100*eps)
 %!assert (besselh (-alpha,2,x,1), (jx - I*yx)*exp(I*x), 100*eps)
 %!
-%! # Bessel functions, odd order, complex x
+%! ## Bessel functions, odd order, complex x
 %!
 %! alpha = 3; x = 2.5 + 1.875 * I;
 %! jx = 0.1330721523048277493333458596 + 0.5386295217249660078754395597*I;
@@ -891,7 +890,7 @@
 %!assert (besselh (-alpha,1,x,1), -(jx + I*yx)*exp(-I*x), 100*eps)
 %!assert (besselh (-alpha,2,x,1), -(jx - I*yx)*exp(I*x), 100*eps)
 %!
-%! # Bessel functions, fractional order, complex x
+%! ## Bessel functions, fractional order, complex x
 %!
 %! alpha = 3.5;  x = 1.75 + 4.125 * I;
 %! jx = -3.018566131370455929707009100 - 0.7585648436793900607704057611*I;
@@ -913,7 +912,7 @@
 %!assert (besselh (alpha,1,x,1), (jx + I*yx)*exp(-I*x), 100*eps)
 %!assert (besselh (alpha,2,x,1), (jx - I*yx)*exp(I*x), 100*eps)
 %!
-%!  nix = 0.09822388691172060573913739253 - 0.7110230642207380127317227407*I;
+%! nix = 0.09822388691172060573913739253 - 0.7110230642207380127317227407*I;
 %!
 %!assert (besselj (-alpha,x), yx, 100*eps)
 %!assert (bessely (-alpha,x), -jx, 100*eps)
--- a/libinterp/corefcn/bitfcns.cc
+++ b/libinterp/corefcn/bitfcns.cc
@@ -569,9 +569,10 @@
 @deftypefnx {Built-in Function} {} bitmax (\"single\")\n\
 @deftypefnx {Built-in Function} {} flintmax (@dots{})\n\
 Return the largest integer that can be represented within a floating point\n\
-value.  The default class is \"double\", but \"single\" is a valid option.\n\
-On IEEE-754 compatible systems, @code{bitmax} is @w{@math{2^{53} - 1}} for\n\
-\"double\" and @w{@math{2^{24} -1}} for \"single\".\n\
+value.  The default class is @qcode{\"double\"}, but @qcode{\"single\"} is a\n\
+valid option.  On IEEE-754 compatible systems, @code{bitmax} is\n\
+@w{@math{2^{53} - 1}} for @qcode{\"double\"} and @w{@math{2^{24} -1}} for\n\
+@qcode{\"single\"}.\n\
 \n\
 @code{flintmax} for FLoating point INTeger MAXimum is an alias for\n\
 @code{bitmax}.\n\
--- a/libinterp/corefcn/cellfun.cc
+++ b/libinterp/corefcn/cellfun.cc
@@ -347,10 +347,10 @@
 the input arguments.  Input arguments that are singleton (1x1) cells will be\n\
 automatically expanded to the size of the other arguments.\n\
 \n\
-If the parameter \"UniformOutput\" is set to true (the default), then the\n\
-function must return scalars which will be concatenated into the return\n\
-array(s).  If \"UniformOutput\" is false, the outputs are concatenated into a\n\
-cell array (or cell arrays).  For example:\n\
+If the parameter @qcode{\"UniformOutput\"} is set to true (the default),\n\
+then the function must return scalars which will be concatenated into the\n\
+return array(s).  If @qcode{\"UniformOutput\"} is false, the outputs are\n\
+concatenated into a cell array (or cell arrays).  For example:\n\
 \n\
 @example\n\
 @group\n\
@@ -360,8 +360,9 @@
 @end group\n\
 @end example\n\
 \n\
-Given the parameter \"ErrorHandler\", then @var{errfunc} defines a function\n\
-to call in case @var{func} generates an error.  The form of the function is\n\
+Given the parameter @qcode{\"ErrorHandler\"}, then @var{errfunc} defines a\n\
+function to call in case @var{func} generates an error.  The form of the\n\
+function is\n\
 \n\
 @example\n\
 function [@dots{}] = errfunc (@var{s}, @dots{})\n\
@@ -370,9 +371,9 @@
 @noindent\n\
 where there is an additional input argument to @var{errfunc} relative to\n\
 @var{func}, given by @var{s}.  This is a structure with the elements\n\
-'identifier', 'message' and 'index', giving respectively the error\n\
-identifier, the error message, and the index into the input arguments\n\
-of the element that caused the error.  For example:\n\
+@qcode{\"identifier\"}, @qcode{\"message\"} and @qcode{\"index\"}, giving\n\
+respectively the error identifier, the error message, and the index into the\n\
+input arguments of the element that caused the error.  For example:\n\
 \n\
 @example\n\
 @group\n\
@@ -1070,7 +1071,7 @@
 @end example\n\
 \n\
 If the parameter @var{val} after a further string input argument\n\
-\"UniformOutput\" is set @code{true} (the default), then the named\n\
+@qcode{\"UniformOutput\"} is set @code{true} (the default), then the named\n\
 function @var{func} must return a single element which then will be\n\
 concatenated into the return value and is of type matrix.  Otherwise,\n\
 if that parameter is set to @code{false}, then the outputs are\n\
@@ -1115,7 +1116,7 @@
 @end example\n\
 \n\
 If the parameter @var{errfunc} after a further string input argument\n\
-\"ErrorHandler\" is another string, a function handle, an inline\n\
+@qcode{\"ErrorHandler\"} is another string, a function handle, an inline\n\
 function, or an anonymous function, then @var{errfunc} defines a\n\
 function to call in the case that @var{func} generates an error.\n\
 The definition of the function must be of the form\n\
@@ -1127,11 +1128,11 @@
 @noindent\n\
 where there is an additional input argument to @var{errfunc}\n\
 relative to @var{func}, given by @var{s}.  This is a structure with\n\
-the elements \"identifier\", \"message\", and \"index\" giving,\n\
-respectively, the error identifier, the error message, and the index of\n\
-the array elements that caused the error.  The size of the output\n\
-argument of @var{errfunc} must have the same size as the output\n\
-argument of @var{func}, otherwise a real error is thrown.  For\n\
+the elements @qcode{\"identifier\"}, @qcode{\"message\"}, and\n\
+@qcode{\"index\"} giving, respectively, the error identifier, the error\n\
+message, and the index of the array elements that caused the error.  The\n\
+size of the output argument of @var{errfunc} must have the same size as the\n\
+output argument of @var{func}, otherwise a real error is thrown.  For\n\
 example:\n\
 \n\
 @example\n\
--- a/libinterp/corefcn/conv2.cc
+++ b/libinterp/corefcn/conv2.cc
@@ -44,15 +44,15 @@
 values\n\
 \n\
 @table @asis\n\
-@item @var{shape} = \"full\"\n\
+@item @var{shape} = @qcode{\"full\"}\n\
 Return the full convolution.  (default)\n\
 \n\
-@item @var{shape} = \"same\"\n\
+@item @var{shape} = @qcode{\"same\"}\n\
 Return the central part of the convolution with the same size as @var{A}.\n\
 The central part of the convolution begins at the indices\n\
 @code{floor ([size(@var{B})/2] + 1)}.\n\
 \n\
-@item @var{shape} = \"valid\"\n\
+@item @var{shape} = @qcode{\"valid\"}\n\
 Return only the parts which do not include zero-padded edges.\n\
 The size of the result is @code{max (size (A) - size (B) + 1, 0)}.\n\
 @end table\n\
@@ -277,7 +277,7 @@
 %! y = ones (5);
 %! A = conv2 (x, y)(5:end-4,5:end-4);
 %! B = conv2 (x, y, "valid");
-%! assert (B, A); ## Yes, this test is for *exact* equivalence.
+%! assert (B, A);   # Yes, this test is for *exact* equivalence.
 
 
 %% Test input validation
@@ -299,15 +299,15 @@
 values\n\
 \n\
 @table @asis\n\
-@item @var{shape} = \"full\"\n\
+@item @var{shape} = @qcode{\"full\"}\n\
 Return the full convolution.  (default)\n\
 \n\
-@item @var{shape} = \"same\"\n\
+@item @var{shape} = @qcode{\"same\"}\n\
 Return central part of the convolution with the same size as @var{A}.\n\
 The central part of the convolution begins at the indices\n\
 @code{floor ([size(@var{B})/2] + 1)}.\n\
 \n\
-@item @var{shape} = \"valid\"\n\
+@item @var{shape} = @qcode{\"valid\"}\n\
 Return only the parts which do not include zero-padded edges.\n\
 The size of the result is @code{max (size (A) - size (B) + 1, 0)}.\n\
 @end table\n\
--- a/libinterp/corefcn/data.cc
+++ b/libinterp/corefcn/data.cc
@@ -1095,8 +1095,8 @@
 Cumulative sum of elements along dimension @var{dim}.  If @var{dim}\n\
 is omitted, it defaults to the first non-singleton dimension.\n\
 \n\
-See @code{sum} for an explanation of the optional parameters \"native\",\n\
-\"double\", and \"extra\".\n\
+See @code{sum} for an explanation of the optional parameters\n\
+@qcode{\"native\"}, @qcode{\"double\"}, and @qcode{\"extra\"}.\n\
 @seealso{sum, cumprod}\n\
 @end deftypefn")
 {
@@ -2375,10 +2375,13 @@
 DEFUN (length, args, ,
   "-*- texinfo -*-\n\
 @deftypefn {Built-in Function} {} length (@var{a})\n\
-Return the \"length\" of the object @var{a}.  For matrix objects, the\n\
-length is the number of rows or columns, whichever is greater (this\n\
-odd definition is used for compatibility with @sc{matlab}).\n\
-@seealso{size}\n\
+Return the length of the object @var{a}.\n\
+\n\
+The length is 0 for empty objects, 1 for scalars, and the number of elements\n\
+for vectors.  For matrix objects, the length is the number of rows or\n\
+columns, whichever is greater (this odd definition is used for compatibility\n\
+with @sc{matlab}).\n\
+@seealso{numel, size}\n\
 @end deftypefn")
 {
   octave_value retval;
@@ -2671,9 +2674,9 @@
 Sum of elements along dimension @var{dim}.  If @var{dim} is\n\
 omitted, it defaults to the first non-singleton dimension.\n\
 \n\
-If the optional argument \"native\" is given, then the sum is performed\n\
-in the same type as the original argument, rather than in the default\n\
-double type.  For example:\n\
+If the optional argument @qcode{\"native\"} is given, then the sum is\n\
+performed in the same type as the original argument, rather than in the\n\
+default double type.  For example:\n\
 \n\
 @example\n\
 @group\n\
@@ -2684,13 +2687,13 @@
 @end group\n\
 @end example\n\
 \n\
-On the contrary, if \"double\" is given, the sum is performed in double\n\
-precision even for single precision inputs.\n\
-\n\
-For double precision inputs, \"extra\" indicates that a more accurate\n\
+On the contrary, if @qcode{\"double\"} is given, the sum is performed in\n\
+double precision even for single precision inputs.\n\
+\n\
+For double precision inputs, @qcode{\"extra\"} indicates that a more accurate\n\
 algorithm than straightforward summation is to be used.  For single precision\n\
-inputs, \"extra\" is the same as \"double\".  Otherwise, \"extra\" has no\n\
-effect.\n\
+inputs, @qcode{\"extra\"} is the same as @qcode{\"double\"}.  Otherwise,\n\
+@qcode{\"extra\"} has no effect.\n\
 @seealso{cumsum, sumsq, prod}\n\
 @end deftypefn")
 {
@@ -3970,7 +3973,7 @@
 arguments are taken as the number of rows and columns and any further\n\
 arguments specify additional matrix dimensions.\n\
 The optional argument @var{class} specifies the return type and may be\n\
-either \"double\" or \"single\".\n\
+either @qcode{\"double\"} or @qcode{\"single\"}.\n\
 @seealso{isinf, NaN}\n\
 @end deftypefn")
 {
@@ -4029,7 +4032,7 @@
 arguments are taken as the number of rows and columns and any further\n\
 arguments specify additional matrix dimensions.\n\
 The optional argument @var{class} specifies the return type and may be\n\
-either \"double\" or \"single\".\n\
+either @qcode{\"double\"} or @qcode{\"single\"}.\n\
 @seealso{isnan, Inf}\n\
 @end deftypefn")
 {
@@ -4078,7 +4081,7 @@
 arguments are taken as the number of rows and columns and any further\n\
 arguments specify additional matrix dimensions.\n\
 The optional argument @var{class} specifies the return type and may be\n\
-either \"double\" or \"single\".\n\
+either @qcode{\"double\"} or @qcode{\"single\"}.\n\
 @seealso{log, exp, pi, I}\n\
 @end deftypefn")
 {
@@ -4119,7 +4122,7 @@
 the number of rows and columns and any further\n\
 arguments specify additional matrix dimensions.\n\
 The optional argument @var{class} specifies the return type and may be\n\
-either \"double\" or \"single\".\n\
+either @qcode{\"double\"} or @qcode{\"single\"}.\n\
 @seealso{realmax, realmin, intmax, bitmax}\n\
 @end deftypefn")
 {
@@ -4243,7 +4246,7 @@
 arguments are taken as the number of rows and columns and any further\n\
 arguments specify additional matrix dimensions.\n\
 The optional argument @var{class} specifies the return type and may be\n\
-either \"double\" or \"single\".\n\
+either @qcode{\"double\"} or @qcode{\"single\"}.\n\
 @seealso{e, I}\n\
 @end deftypefn")
 {
@@ -4276,13 +4279,13 @@
 for single precision.\n\
 \n\
 When called with no arguments, return a scalar with the value\n\
-@code{realmax (\"double\")}.\n\
+@code{realmax (@qcode{\"double\"})}.\n\
 When called with a single argument, return a square matrix with the dimension\n\
 specified.  When called with more than one scalar argument the first two\n\
 arguments are taken as the number of rows and columns and any further\n\
 arguments specify additional matrix dimensions.\n\
 The optional argument @var{class} specifies the return type and may be\n\
-either \"double\" or \"single\".\n\
+either @qcode{\"double\"} or @qcode{\"single\"}.\n\
 @seealso{realmin, intmax, bitmax, eps}\n\
 @end deftypefn")
 {
@@ -4310,13 +4313,13 @@
 for single precision.\n\
 \n\
 When called with no arguments, return a scalar with the value\n\
-@code{realmin (\"double\")}.\n\
+@code{realmin (@qcode{\"double\"})}.\n\
 When called with a single argument, return a square matrix with the dimension\n\
 specified.  When called with more than one scalar argument the first two\n\
 arguments are taken as the number of rows and columns and any further\n\
 arguments specify additional matrix dimensions.\n\
 The optional argument @var{class} specifies the return type and may be\n\
-either \"double\" or \"single\".\n\
+either @qcode{\"double\"} or @qcode{\"single\"}.\n\
 @seealso{realmax, intmin, eps}\n\
 @end deftypefn")
 {
@@ -4354,7 +4357,7 @@
 arguments are taken as the number of rows and columns and any further\n\
 arguments specify additional matrix dimensions.\n\
 The optional argument @var{class} specifies the return type and may be\n\
-either \"double\" or \"single\".\n\
+either @qcode{\"double\"} or @qcode{\"single\"}.\n\
 @seealso{e, pi, log, exp}\n\
 @end deftypefn")
 {
@@ -4384,7 +4387,7 @@
 arguments are taken as the number of rows and columns and any further\n\
 arguments specify additional matrix dimensions.\n\
 The optional argument @var{class} specifies the return type and may be\n\
-either \"double\" or \"single\".\n\
+either @qcode{\"double\"} or @qcode{\"single\"}.\n\
 @seealso{isna}\n\
 @end deftypefn")
 {
@@ -5144,11 +5147,11 @@
 @item @var{p} = @code{2}\n\
 Largest singular value of @var{A}.\n\
 \n\
-@item @var{p} = @code{Inf} or @code{\"inf\"}\n\
+@item @var{p} = @code{Inf} or @qcode{\"inf\"}\n\
 @cindex infinity norm\n\
 Infinity norm, the largest row sum of the absolute values of @var{A}.\n\
 \n\
-@item @var{p} = @code{\"fro\"}\n\
+@item @var{p} = @qcode{\"fro\"}\n\
 @cindex Frobenius norm\n\
 Frobenius norm of @var{A}, @code{sqrt (sum (diag (@var{A}' * @var{A})))}.\n\
 \n\
@@ -5160,13 +5163,13 @@
 If @var{A} is a vector or a scalar:\n\
 \n\
 @table @asis\n\
-@item @var{p} = @code{Inf} or @code{\"inf\"}\n\
+@item @var{p} = @code{Inf} or @qcode{\"inf\"}\n\
 @code{max (abs (@var{A}))}.\n\
 \n\
 @item @var{p} = @code{-Inf}\n\
 @code{min (abs (@var{A}))}.\n\
 \n\
-@item @var{p} = @code{\"fro\"}\n\
+@item @var{p} = @qcode{\"fro\"}\n\
 Frobenius norm of @var{A}, @code{sqrt (sumsq (abs (A)))}.\n\
 \n\
 @item @var{p} = 0\n\
@@ -5179,10 +5182,10 @@
 the p-pseudonorm defined as above.\n\
 @end table\n\
 \n\
-If @var{opt} is the value @code{\"rows\"}, treat each row as a vector and\n\
+If @var{opt} is the value @qcode{\"rows\"}, treat each row as a vector and\n\
 compute its norm.  The result is returned as a column vector.\n\
-Similarly, if @var{opt} is @code{\"columns\"} or @code{\"cols\"} then compute\n\
-the norms of each column and return a row vector.\n\
+Similarly, if @var{opt} is @qcode{\"columns\"} or @qcode{\"cols\"} then\n\
+compute the norms of each column and return a row vector.\n\
 @seealso{cond, svd}\n\
 @end deftypefn")
 {
@@ -5369,7 +5372,7 @@
 DEFUN (uplus, args, ,
   "-*- texinfo -*-\n\
 @deftypefn {Built-in Function} {} uplus (@var{x})\n\
-This function and @w{@xcode{+ x}} are equivalent.\n\
+This function and @w{@tcode{+ x}} are equivalent.\n\
 @seealso{uminus, plus, minus}\n\
 @end deftypefn")
 {
@@ -5379,7 +5382,7 @@
 DEFUN (uminus, args, ,
   "-*- texinfo -*-\n\
 @deftypefn {Built-in Function} {} uminus (@var{x})\n\
-This function and @w{@xcode{- x}} are equivalent.\n\
+This function and @w{@tcode{- x}} are equivalent.\n\
 @seealso{uplus, minus}\n\
 @end deftypefn")
 {
@@ -5390,7 +5393,7 @@
   "-*- texinfo -*-\n\
 @deftypefn {Built-in Function} {} transpose (@var{x})\n\
 Return the transpose of @var{x}.\n\
-This function and @xcode{x.'} are equivalent.\n\
+This function and @tcode{x.'} are equivalent.\n\
 @seealso{ctranspose}\n\
 @end deftypefn")
 {
@@ -5421,7 +5424,7 @@
   "-*- texinfo -*-\n\
 @deftypefn {Built-in Function} {} ctranspose (@var{x})\n\
 Return the complex conjugate transpose of @var{x}.\n\
-This function and @xcode{x'} are equivalent.\n\
+This function and @tcode{x'} are equivalent.\n\
 @seealso{transpose}\n\
 @end deftypefn")
 {
@@ -5495,7 +5498,7 @@
   "-*- texinfo -*-\n\
 @deftypefn  {Built-in Function} {} plus (@var{x}, @var{y})\n\
 @deftypefnx {Built-in Function} {} plus (@var{x1}, @var{x2}, @dots{})\n\
-This function and @w{@xcode{x + y}} are equivalent.\n\
+This function and @w{@tcode{x + y}} are equivalent.\n\
 If more arguments are given, the summation is applied\n\
 cumulatively from left to right:\n\
 \n\
@@ -5514,7 +5517,7 @@
 DEFUN (minus, args, ,
   "-*- texinfo -*-\n\
 @deftypefn {Built-in Function} {} minus (@var{x}, @var{y})\n\
-This function and @w{@xcode{x - y}} are equivalent.\n\
+This function and @w{@tcode{x - y}} are equivalent.\n\
 @seealso{plus, uminus}\n\
 @end deftypefn")
 {
@@ -5526,7 +5529,7 @@
 @deftypefn  {Built-in Function} {} mtimes (@var{x}, @var{y})\n\
 @deftypefnx {Built-in Function} {} mtimes (@var{x1}, @var{x2}, @dots{})\n\
 Return the matrix multiplication product of inputs.\n\
-This function and @w{@xcode{x * y}} are equivalent.\n\
+This function and @w{@tcode{x * y}} are equivalent.\n\
 If more arguments are given, the multiplication is applied\n\
 cumulatively from left to right:\n\
 \n\
@@ -5546,7 +5549,7 @@
   "-*- texinfo -*-\n\
 @deftypefn {Built-in Function} {} mrdivide (@var{x}, @var{y})\n\
 Return the matrix right division of @var{x} and @var{y}.\n\
-This function and @w{@xcode{x / y}} are equivalent.\n\
+This function and @w{@tcode{x / y}} are equivalent.\n\
 @seealso{mldivide, rdivide, plus, minus}\n\
 @end deftypefn")
 {
@@ -5557,7 +5560,7 @@
   "-*- texinfo -*-\n\
 @deftypefn {Built-in Function} {} mpower (@var{x}, @var{y})\n\
 Return the matrix power operation of @var{x} raised to the @var{y} power.\n\
-This function and @w{@xcode{x ^ y}} are equivalent.\n\
+This function and @w{@tcode{x ^ y}} are equivalent.\n\
 @seealso{power, mtimes, plus, minus}\n\
 @end deftypefn")
 {
@@ -5568,7 +5571,7 @@
   "-*- texinfo -*-\n\
 @deftypefn {Built-in Function} {} mldivide (@var{x}, @var{y})\n\
 Return the matrix left division of @var{x} and @var{y}.\n\
-This function and @w{@xcode{x @xbackslashchar{} y}} are equivalent.\n\
+This function and @w{@tcode{x @xbackslashchar{} y}} are equivalent.\n\
 @seealso{mrdivide, ldivide, rdivide}\n\
 @end deftypefn")
 {
@@ -5642,7 +5645,7 @@
 @deftypefn  {Built-in Function} {} times (@var{x}, @var{y})\n\
 @deftypefnx {Built-in Function} {} times (@var{x1}, @var{x2}, @dots{})\n\
 Return the element-by-element multiplication product of inputs.\n\
-This function and @w{@xcode{x .* y}} are equivalent.\n\
+This function and @w{@tcode{x .* y}} are equivalent.\n\
 If more arguments are given, the multiplication is applied\n\
 cumulatively from left to right:\n\
 \n\
@@ -5662,7 +5665,7 @@
   "-*- texinfo -*-\n\
 @deftypefn {Built-in Function} {} rdivide (@var{x}, @var{y})\n\
 Return the element-by-element right division of @var{x} and @var{y}.\n\
-This function and @w{@xcode{x ./ y}} are equivalent.\n\
+This function and @w{@tcode{x ./ y}} are equivalent.\n\
 @seealso{ldivide, mrdivide, times, plus}\n\
 @end deftypefn")
 {
@@ -5678,7 +5681,7 @@
 @code{realpow}, @code{realsqrt}, @code{cbrt}, or @code{nthroot} if a\n\
 real result is preferred.\n\
 \n\
-This function and @w{@xcode{x .^ y}} are equivalent.\n\
+This function and @w{@tcode{x .^ y}} are equivalent.\n\
 @seealso{mpower, realpow, realsqrt, cbrt, nthroot}\n\
 @end deftypefn")
 {
@@ -5689,7 +5692,7 @@
   "-*- texinfo -*-\n\
 @deftypefn {Built-in Function} {} ldivide (@var{x}, @var{y})\n\
 Return the element-by-element left division of @var{x} and @var{y}.\n\
-This function and @w{@xcode{x .@xbackslashchar{} y}} are equivalent.\n\
+This function and @w{@tcode{x .@xbackslashchar{} y}} are equivalent.\n\
 @seealso{rdivide, mldivide, times, plus}\n\
 @end deftypefn")
 {
@@ -5965,7 +5968,7 @@
 If the optional argument @var{dim} is given, then the matrix is sorted\n\
 along the dimension defined by @var{dim}.  The optional argument @code{mode}\n\
 defines the order in which the values will be sorted.  Valid values of\n\
-@code{mode} are \"ascend\" or \"descend\".\n\
+@code{mode} are @qcode{\"ascend\"} or @qcode{\"descend\"}.\n\
 \n\
 The @code{sort} function may also be used to produce a matrix\n\
 containing the original row indices of the elements in the sorted\n\
@@ -6358,11 +6361,11 @@
 @deftypefnx {Built-in Function} {} issorted (@var{a}, @var{mode})\n\
 @deftypefnx {Built-in Function} {} issorted (@var{a}, \"rows\", @var{mode})\n\
 Return true if the array is sorted according to @var{mode}, which\n\
-may be either \"ascending\", \"descending\", or \"either\".  By default,\n\
- @var{mode} is \"ascending\".  NaNs are treated in the same manner as\n\
-@code{sort}.\n\
-\n\
-If the optional argument \"rows\" is supplied, check whether\n\
+may be either @qcode{\"ascending\"}, @qcode{\"descending\"}, or\n\
+@qcode{\"either\"}.  By default,  @var{mode} is @qcode{\"ascending\"}.  NaNs\n\
+are treated in the same manner as @code{sort}.\n\
+\n\
+If the optional argument @qcode{\"rows\"} is supplied, check whether\n\
 the array is sorted by rows as output by the function @code{sortrows}\n\
 (with no options).\n\
 \n\
--- a/libinterp/corefcn/debug.cc
+++ b/libinterp/corefcn/debug.cc
@@ -917,8 +917,8 @@
 \n\
 When called with no arguments in debugging mode, display the script file\n\
 currently being debugged.  An optional range specification can be used to\n\
-list only a portion of the file.  The special keyword \"end\" is a valid\n\
-line number specification for the last line of the file.\n\
+list only a portion of the file.  The special keyword @qcode{\"end\"} is a\n\
+valid line number specification for the last line of the file.\n\
 \n\
 When called with the name of a function, list that script file with line\n\
 numbers.\n\
--- a/libinterp/corefcn/defaults.cc
+++ b/libinterp/corefcn/defaults.cc
@@ -474,11 +474,11 @@
 use with the @code{edit_history} command.  The default value is taken from\n\
 the environment variable @w{@env{EDITOR}} when Octave starts.  If the\n\
 environment variable is not initialized, @w{@env{EDITOR}} will be set to\n\
-@code{\"emacs\"}.\n\
+@qcode{\"emacs\"}.\n\
 \n\
-When called from inside a function with the \"local\" option, the variable is\n\
-changed locally for the function and any subroutines it calls.  The original\n\
-variable value is restored when exiting the function.\n\
+When called from inside a function with the @qcode{\"local\"} option, the\n\
+variable is changed locally for the function and any subroutines it calls.  \n\
+The original variable value is restored when exiting the function.\n\
 \n\
 @seealso{edit_history}\n\
 @end deftypefn")
@@ -509,9 +509,9 @@
 @w{@env{OCTAVE_EXEC_PATH}}, but that value can be overridden by\n\
 the command line argument @option{--exec-path PATH}.\n\
 \n\
-When called from inside a function with the \"local\" option, the variable is\n\
-changed locally for the function and any subroutines it calls.  The original\n\
-variable value is restored when exiting the function.\n\
+When called from inside a function with the @qcode{\"local\"} option, the\n\
+variable is changed locally for the function and any subroutines it calls.  \n\
+The original variable value is restored when exiting the function.\n\
 \n\
 @seealso{IMAGE_PATH, OCTAVE_HOME}\n\
 @end deftypefn")
@@ -544,9 +544,9 @@
 Query or set the internal variable that specifies a colon separated\n\
 list of directories in which to search for image files.\n\
 \n\
-When called from inside a function with the \"local\" option, the variable is\n\
-changed locally for the function and any subroutines it calls.  The original\n\
-variable value is restored when exiting the function.\n\
+When called from inside a function with the @qcode{\"local\"} option, the\n\
+variable is changed locally for the function and any subroutines it calls.  \n\
+The original variable value is restored when exiting the function.\n\
 \n\
 @seealso{EXEC_PATH, OCTAVE_HOME}\n\
 @end deftypefn")
--- a/libinterp/corefcn/dirfns.cc
+++ b/libinterp/corefcn/dirfns.cc
@@ -304,7 +304,7 @@
 system-dependent error message, and @var{msgid} contains a unique\n\
 message identifier.\n\
 \n\
-If the optional second parameter is supplied with value @code{\"s\"},\n\
+If the optional second parameter is supplied with value @qcode{\"s\"},\n\
 recursively remove all subdirectories as well.\n\
 @seealso{mkdir, confirm_recursive_rmdir}\n\
 @end deftypefn")
@@ -696,8 +696,8 @@
 @deftypefnx {Built-in Function} {} filesep (\"all\")\n\
 Return the system-dependent character used to separate directory names.\n\
 \n\
-If \"all\" is given, the function returns all valid file separators in\n\
-the form of a string.  The list of file separators is system-dependent.\n\
+If @qcode{\"all\"} is given, the function returns all valid file separators\n\
+in the form of a string.  The list of file separators is system-dependent.\n\
 It is @samp{/} (forward slash) under UNIX or @w{Mac OS X}, @samp{/} and\n\
 @samp{\\} (forward and backward slashes) under Windows.\n\
 @seealso{pathsep}\n\
@@ -780,9 +780,9 @@
 Query or set the internal variable that controls whether Octave\n\
 will ask for confirmation before recursively removing a directory tree.\n\
 \n\
-When called from inside a function with the \"local\" option, the variable is\n\
-changed locally for the function and any subroutines it calls.  The original\n\
-variable value is restored when exiting the function.\n\
+When called from inside a function with the @qcode{\"local\"} option, the\n\
+variable is changed locally for the function and any subroutines it calls.  \n\
+The original variable value is restored when exiting the function.\n\
 @end deftypefn")
 {
   return SET_INTERNAL_VARIABLE (confirm_recursive_rmdir);
--- a/libinterp/corefcn/dlmread.cc
+++ b/libinterp/corefcn/dlmread.cc
@@ -173,14 +173,15 @@
 The @var{range} parameter may be a 4-element vector containing the upper\n\
 left and lower right corner @code{[@var{R0},@var{C0},@var{R1},@var{C1}]}\n\
 where the lowest index value is zero.  Alternatively, a spreadsheet style\n\
-range such as \"A2..Q15\" or \"T1:AA5\" can be used.  The lowest alphabetical\n\
-index 'A' refers to the first column.  The lowest row index is 1.\n\
+range such as @qcode{\"A2..Q15\"} or @qcode{\"T1:AA5\"} can be used.  The\n\
+lowest alphabetical index @qcode{'A'} refers to the first column.  The\n\
+lowest row index is 1.\n\
 \n\
 @var{file} should be a file name or file id given by @code{fopen}.  In the\n\
 latter case, the file is read until end of file is reached.\n\
 \n\
-The \"emptyvalue\" option may be used to specify the value used to fill empty\n\
-fields.  The default is zero.\n\
+The @qcode{\"emptyvalue\"} option may be used to specify the value used to\n\
+fill empty fields.  The default is zero.\n\
 @seealso{csvread, textscan, textread, dlmwrite}\n\
 @end deftypefn")
 {
--- a/libinterp/corefcn/ellipj.cc
+++ b/libinterp/corefcn/ellipj.cc
@@ -425,53 +425,53 @@
 
 %!demo
 %! N = 150;
-%! % m = [1-logspace(0,log(eps),N-1), 1]; ## m near 1
-%! % m = [0, logspace(log(eps),0,N-1)];   ## m near 0
-%!   m = linspace(0,1,N);                 ## m equally spaced
-%! u = linspace(-20,20,N);
-%! M = ones(length(u),1) * m;
-%! U = u' * ones(1, length(m));
-%! [sn, cn, dn] = ellipj(U,M);
+%! # m = [1-logspace(0,log(eps),N-1), 1]; # m near 1
+%! # m = [0, logspace(log(eps),0,N-1)];   # m near 0
+%!   m = linspace (0,1,N);                # m equally spaced
+%! u = linspace (-20, 20, N);
+%! M = ones (length (u), 1) * m;
+%! U = u' * ones (1, length (m));
+%! [sn, cn, dn] = ellipj (U,M);
 %!
-%! %% Plotting
-%! c = colormap(hot(64));
+%! ## Plotting
+%! c = colormap (hot (64));
 %! data = {sn,cn,dn};
 %! dname = {"sn","cn","dn"};
 %! for i=1:3
-%!   subplot(1,3,i);
+%!   subplot (1,3,i);
 %!   data{i}(data{i} > 1) = 1;
 %!   data{i}(data{i} < -1) = -1;
-%!   image(m,u,32*data{i}+32);
-%!   title(dname{i});
-%! end
-%! colormap(c);
+%!   image (m,u,32*data{i}+32);
+%!   title (dname{i});
+%! endfor
+%! colormap (c);
 
 %!demo
 %! N = 200;
-%! % m = [1-logspace(0,log(eps),N-1), 1]; ## m near 1
-%! % m = [0, logspace(log(eps),0,N-1)];   ## m near 0
-%!   m = linspace(0,1,N);                 ## m equally spaced
-%! u = linspace(0,20,5);
-%! M = ones(length(u),1) * m;
-%! U = u' * ones(1, length(m));
-%! [sn, cn, dn] = ellipj(U,M);
+%! # m = [1-logspace(0,log(eps),N-1), 1]; # m near 1
+%! # m = [0, logspace(log(eps),0,N-1)];   # m near 0
+%!   m = linspace (0,1,N);                # m equally spaced
+%! u = linspace (0,20,5);
+%! M = ones (length (u), 1) * m;
+%! U = u' * ones (1, length (m));
+%! [sn, cn, dn] = ellipj (U,M);
 %!
-%! %% Plotting
+%! ## Plotting
 %! data = {sn,cn,dn};
 %! dname = {"sn","cn","dn"};
 %! for i=1:3
-%!   subplot(1,3,i);
-%!   plot(m, data{i});
-%!   title(dname{i});
+%!   subplot (1,3,i);
+%!   plot (m, data{i});
+%!   title (dname{i});
 %!   grid on;
-%! end
+%! endfor
 */
 
 /*
 ## tests taken from inst/test_sncndn.m
 
 %!test
-%! k = (tan(pi/8.))^2; m = k*k;
+%! k = (tan(pi/8.))^2;  m = k*k;
 %! SN = [
 %! -1. + I * 0. ,  -0.8392965923 + 0. * I
 %! -1. + I * 0.2 ,  -0.8559363407 + 0.108250955 * I
@@ -848,9 +848,9 @@
 %!     ui =  y * 0.2;
 %!     ii = 1 + y + x*11;
 %!     [sn, cn, dn] = ellipj (ur + I * ui, m);
-%!     assert (SN (ii, 2), sn, tol);
-%!     assert (CN (ii, 2), cn, tol);
-%!     assert (DN (ii, 2), dn, tol);
+%!     assert (SN(ii, 2), sn, tol);
+%!     assert (CN(ii, 2), cn, tol);
+%!     assert (DN(ii, 2), dn, tol);
 %!   endfor
 %! endfor
 
@@ -858,58 +858,58 @@
 %!test
 %! u1 = pi/3; m1 = 0;
 %! res1 = [sin(pi/3), cos(pi/3), 1];
-%! [sn,cn,dn]=ellipj(u1,m1);
-%! assert([sn,cn,dn], res1, 10*eps);
+%! [sn,cn,dn] = ellipj (u1,m1);
+%! assert ([sn,cn,dn], res1, 10*eps);
 
 %!test
 %! u2 = log(2); m2 = 1;
 %! res2 = [ 3/5, 4/5, 4/5 ];
-%! [sn,cn,dn]=ellipj(u2,m2);
-%! assert([sn,cn,dn], res2, 10*eps);
+%! [sn,cn,dn] = ellipj (u2,m2);
+%! assert ([sn,cn,dn], res2, 10*eps);
 
 %!test
 %! u3 = log(2)*1i; m3 = 0;
 %! res3 = [3i/4,5/4,1];
-%! [sn,cn,dn]=ellipj(u3,m3);
-%! assert([sn,cn,dn], res3, 10*eps);
+%! [sn,cn,dn] = ellipj (u3,m3);
+%! assert ([sn,cn,dn], res3, 10*eps);
 
 %!test
-%! u4 = -1; m4 = tan(pi/8)^4;
+%! u4 = -1; m4 = tan (pi/8)^4;
 %! res4 = [-0.8392965923,0.5436738271,0.9895776106];
-%! [sn,cn,dn]=ellipj(u4, m4);
-%! assert([sn,cn,dn], res4, 1e-10);
+%! [sn,cn,dn] = ellipj (u4, m4);
+%! assert ([sn,cn,dn], res4, 1e-10);
 
 %!test
 %! u5 = -0.2 + 0.4i; m5 = tan(pi/8)^4;
 %! res5 = [ -0.2152524522 + 0.402598347i, ...
 %!           1.059453907  + 0.08179712295i, ...
 %!           1.001705496  + 0.00254669712i ];
-%! [sn,cn,dn]=ellipj(u5,m5);
-%! assert([sn,cn,dn], res5, 1e-9);
+%! [sn,cn,dn] = ellipj (u5,m5);
+%! assert ([sn,cn,dn], res5, 1e-9);
 
 %!test
 %! u6 = 0.2 + 0.6i; m6 = tan(pi/8)^4;
 %! res6 = [ 0.2369100139 + 0.624633635i, ...
 %!          1.16200643   - 0.1273503824i, ...
 %!          1.004913944 - 0.004334880912i ];
-%! [sn,cn,dn]=ellipj(u6,m6);
-%! assert([sn,cn,dn], res6, 1e-8);
+%! [sn,cn,dn] = ellipj (u6,m6);
+%! assert ([sn,cn,dn], res6, 1e-8);
 
 %!test
-%! u7 = 0.8 + 0.8i; m7 = tan(pi/8)^4;
+%! u7 = 0.8 + 0.8i; m7 = tan (pi/8)^4;
 %! res7 = [0.9588386397 + 0.6107824358i, ...
 %!         0.9245978896 - 0.6334016187i, ...
 %!         0.9920785856 - 0.01737733806i ];
-%! [sn,cn,dn]=ellipj(u7,m7);
-%! assert([sn,cn,dn], res7, 1e-10);
+%! [sn,cn,dn] = ellipj (u7,m7);
+%! assert ([sn,cn,dn], res7, 1e-10);
 
 %!test
 %! u=[0,pi/6,pi/4,pi/2]; m=0;
 %! res = [0,1/2,1/sqrt(2),1;1,cos(pi/6),1/sqrt(2),0;1,1,1,1];
-%! [sn,cn,dn]=ellipj(u,m);
-%! assert([sn;cn;dn],res, 100*eps);
-%! [sn,cn,dn]=ellipj(u',0);
-%! assert([sn,cn,dn],res', 100*eps);
+%! [sn,cn,dn] = ellipj (u,m);
+%! assert ([sn;cn;dn],res, 100*eps);
+%! [sn,cn,dn] = ellipj (u',0);
+%! assert ([sn,cn,dn],res', 100*eps);
 
 ## XXX FIXME XXX
 ## need to check [real,complex]x[scalar,rowvec,colvec,matrix]x[u,m]
@@ -922,24 +922,24 @@
 %! u = [ 0.25; 0.25; 0.20; 0.20; 0.672; 0.5];
 %! m = [ 0.0;  1.0;  0.19; 0.81; 0.36;  0.9999999999];
 %! S = [ sin(0.25); tanh(0.25);
-%!  0.19842311013970879516;
-%!  0.19762082367187648571;
-%!  0.6095196917919021945;
-%!  0.4621171572617320908 ];
+%!       0.19842311013970879516;
+%!       0.19762082367187648571;
+%!       0.6095196917919021945;
+%!       0.4621171572617320908 ];
 %! C = [ cos(0.25); sech(0.25);
-%!  0.9801164570409401062;
-%!  0.9802785369736752032;
-%!  0.7927709286533560550;
-%!  0.8868188839691764094 ];
+%!       0.9801164570409401062;
+%!       0.9802785369736752032;
+%!       0.7927709286533560550;
+%!       0.8868188839691764094 ];
 %! D = [ 1.0;  sech(0.25);
-%!  0.9962526643271134302;
-%!  0.9840560289645665155;
-%!  0.9307281387786906491;
-%!  0.8868188839812167635 ];
-%! [sn,cn,dn] = ellipj(u,m);
-%! assert(sn,S,8*eps);
-%! assert(cn,C,8*eps);
-%! assert(dn,D,8*eps);
+%!       0.9962526643271134302;
+%!       0.9840560289645665155;
+%!       0.9307281387786906491;
+%!       0.8868188839812167635 ];
+%! [sn,cn,dn] = ellipj (u,m);
+%! assert (sn,S,8*eps);
+%! assert (cn,C,8*eps);
+%! assert (dn,D,8*eps);
 
 %!error ellipj ()
 %!error ellipj (1)
--- a/libinterp/corefcn/error.cc
+++ b/libinterp/corefcn/error.cc
@@ -830,10 +830,10 @@
   "-*- texinfo -*-\n\
 @deftypefn {Built-in Function} {} rethrow (@var{err})\n\
 Reissue a previous error as defined by @var{err}.  @var{err} is a structure\n\
-that must contain at least the 'message' and 'identifier' fields.  @var{err}\n\
-can also contain a field 'stack' that gives information on the assumed\n\
-location of the error.  Typically @var{err} is returned from\n\
-@code{lasterror}.\n\
+that must contain at least the @qcode{\"message\"} and @qcode{\"identifier\"}\n\
+fields.  @var{err} can also contain a field @qcode{\"stack\"} that gives\n\
+information on the assumed location of the error.  Typically @var{err} is\n\
+returned from @code{lasterror}.\n\
 @seealso{lasterror, lasterr, error}\n\
 @end deftypefn")
 {
@@ -1091,7 +1091,7 @@
 which will only stop execution if an error has been found.\n\
 \n\
 Implementation Note: For compatibility with @sc{matlab}, escape\n\
-sequences (e.g., \"\\n\" => newline) are processed in @var{template}\n\
+sequences (e.g., @qcode{\"\\n\"} => newline) are processed in @var{template}\n\
 regardless of whether @var{template} has been defined within single quotes\n\
 as long as there are two or more input arguments.\n\
 Use a second backslash to stop interpolation of the escape sequence (e.g.,\n\
@@ -1235,17 +1235,17 @@
 \n\
 The optional message identifier allows users to enable or disable\n\
 warnings tagged by @var{id}.  A message identifier is of the form\n\
-\"NAMESPACE:WARNING-NAME\".  Octave's own warnings use the \"Octave\"\n\
-namespace (@pxref{XREFwarning_ids}).  The special identifier @samp{\"all\"}\n\
+\"NAMESPACE:WARNING-NAME\".  Octave's own warnings use the @qcode{\"Octave\"}\n\
+namespace (@pxref{XREFwarning_ids}).  The special identifier @qcode{\"all\"}\n\
 may be used to set the state of all warnings.\n\
 \n\
-If the first argument is @samp{\"on\"} or @samp{\"off\"}, set the state\n\
-of a particular warning using the identifier @var{id}.  If the first\n\
-argument is @samp{\"query\"}, query the state of this warning instead.\n\
-If the identifier is omitted, a value of @samp{\"all\"} is assumed.  If\n\
-you set the state of a warning to @samp{\"error\"}, the warning named by\n\
-@var{id} is handled as if it were an error instead.  So, for example, the\n\
-following handles all warnings as errors:\n\
+If the first argument is @qcode{\"on\"} or @qcode{\"off\"},\n\
+set the state of a particular warning using the identifier @var{id}.  If the\n\
+first argument is @qcode{\"query\"}, query the state of this warning\n\
+instead.  If the identifier is omitted, a value of @qcode{\"all\"} is\n\
+assumed.  If you set the state of a warning to @qcode{\"error\"}, the\n\
+warning named by @var{id} is handled as if it were an error instead.  So,\n\
+for example, the following handles all warnings as errors:\n\
 \n\
 @example\n\
 @group\n\
@@ -1253,17 +1253,17 @@
 @end group\n\
 @end example\n\
 \n\
-If the state is @samp{\"on\"}, @samp{\"off\"}, or @samp{\"error\"}\n\
-and the third argument is @samp{\"local\"}, then the warning state\n\
+If the state is @qcode{\"on\"}, @qcode{\"off\"}, or @qcode{\"error\"}\n\
+and the third argument is @qcode{\"local\"}, then the warning state\n\
 will be set temporarily, until the end of the current function.\n\
 Changes to warning states that are set locally affect the current\n\
 function and all functions called from the current scope.  The\n\
 previous warning state is restored on return from the current\n\
-function.  The \"local\" option is ignored if used in the top-level\n\
+function.  The @qcode{\"local\"} option is ignored if used in the top-level\n\
 workspace.\n\
 \n\
 Implementation Note: For compatibility with @sc{matlab}, escape\n\
-sequences (e.g., \"\\n\" => newline) are processed in @var{template}\n\
+sequences (e.g., @qcode{\"\\n\"} => newline) are processed in @var{template}\n\
 regardless of whether @var{template} has been defined within single quotes\n\
 as long as there are two or more input arguments.\n\
 Use a second backslash to stop interpolation of the escape sequence (e.g.,\n\
@@ -1654,29 +1654,29 @@
 arguments, return a structure containing the last error message and other\n\
 information related to this error.  The elements of the structure are:\n\
 \n\
-@table @asis\n\
-@item 'message'\n\
+@table @code\n\
+@item message\n\
 The text of the last error message\n\
 \n\
-@item 'identifier'\n\
+@item identifier\n\
 The message identifier of this error message\n\
 \n\
-@item 'stack'\n\
+@item stack\n\
 A structure containing information on where the message occurred.  This may\n\
 be an empty structure if the information cannot\n\
 be obtained.  The fields of the structure are:\n\
 \n\
-@table @asis\n\
-@item 'file'\n\
+@table @code\n\
+@item file\n\
 The name of the file where the error occurred\n\
 \n\
-@item 'name'\n\
+@item name\n\
 The name of function in which the error occurred\n\
 \n\
-@item 'line'\n\
+@item line\n\
 The line number at which the error occurred\n\
 \n\
-@item 'column'\n\
+@item column\n\
 An optional field with the column number at which the error occurred\n\
 @end table\n\
 @end table\n\
@@ -1685,8 +1685,8 @@
 as input.  Any fields of @var{err} that match those above are set while any\n\
 unspecified fields are initialized with default values.\n\
 \n\
-If @code{lasterror} is called with the argument \"reset\", all fields are\n\
-set to their default values.\n\
+If @code{lasterror} is called with the argument @qcode{\"reset\"}, all\n\
+fields are set to their default values.\n\
 @seealso{lasterr, error, lastwarn}\n\
 @end deftypefn")
 {
@@ -1956,9 +1956,9 @@
 Query or set the internal variable that controls whether Octave will try\n\
 to ring the terminal bell before printing an error message.\n\
 \n\
-When called from inside a function with the \"local\" option, the variable is\n\
-changed locally for the function and any subroutines it calls.  The original\n\
-variable value is restored when exiting the function.\n\
+When called from inside a function with the @qcode{\"local\"} option, the\n\
+variable is changed locally for the function and any subroutines it calls.  \n\
+The original variable value is restored when exiting the function.\n\
 @end deftypefn")
 {
   return SET_INTERNAL_VARIABLE (beep_on_error);
@@ -1974,9 +1974,9 @@
 inhibit printing of the normal traceback message (you will only see\n\
 the top-level error message).\n\
 \n\
-When called from inside a function with the \"local\" option, the variable is\n\
-changed locally for the function and any subroutines it calls.  The original\n\
-variable value is restored when exiting the function.\n\
+When called from inside a function with the @qcode{\"local\"} option, the\n\
+variable is changed locally for the function and any subroutines it calls.  \n\
+The original variable value is restored when exiting the function.\n\
 @seealso{debug_on_warning, debug_on_interrupt}\n\
 @end deftypefn")
 {
@@ -1991,9 +1991,9 @@
 Query or set the internal variable that controls whether Octave will try\n\
 to enter the debugger when a warning is encountered.\n\
 \n\
-When called from inside a function with the \"local\" option, the variable is\n\
-changed locally for the function and any subroutines it calls.  The original\n\
-variable value is restored when exiting the function.\n\
+When called from inside a function with the @qcode{\"local\"} option, the\n\
+variable is changed locally for the function and any subroutines it calls.  \n\
+The original variable value is restored when exiting the function.\n\
 @seealso{debug_on_error, debug_on_interrupt}\n\
 @end deftypefn")
 {
--- a/libinterp/corefcn/file-io.cc
+++ b/libinterp/corefcn/file-io.cc
@@ -647,14 +647,14 @@
 file.\n\
 @end table\n\
 \n\
-Append a \"t\" to the mode string to open the file in text mode or a\n\
-\"b\" to open in binary mode.  On Windows and Macintosh systems, text\n\
+Append a @qcode{\"t\"} to the mode string to open the file in text mode or a\n\
+@qcode{\"b\"} to open in binary mode.  On Windows and Macintosh systems, text\n\
 mode reading and writing automatically converts linefeeds to the\n\
 appropriate line end character for the system (carriage-return linefeed\n\
 on Windows, carriage-return on Macintosh).  The default if no mode is\n\
 specified is binary mode.\n\
 \n\
-Additionally, you may append a \"z\" to the mode string to open a\n\
+Additionally, you may append a @qcode{\"z\"} to the mode string to open a\n\
 gzipped file for reading or writing.  For this to be successful, you\n\
 must also open the file in binary mode.\n\
 \n\
@@ -825,8 +825,10 @@
 The pointer is positioned @var{offset} characters from the @var{origin},\n\
 which may be one of the predefined variables @w{@code{SEEK_CUR}} (current\n\
 position), @w{@code{SEEK_SET}} (beginning), or @w{@code{SEEK_END}} (end of\n\
-file) or strings \"cof\", \"bof\" or \"eof\".  If @var{origin} is omitted,\n\
-@w{@code{SEEK_SET}} is assumed.  @var{offset} may be positive, negative, or zero but not all combinations of @var{origin} and @var{offset} can be realized.\n\
+file) or strings @qcode{\"cof\"}, @qcode{\"bof\"} or @qcode{\"eof\"}.  If\n\
+@var{origin} is omitted, @w{@code{SEEK_SET}} is assumed.  @var{offset} may\n\
+be positive, negative, or zero but not all combinations of @var{origin} and\n\
+@var{offset} can be realized.\n\
 \n\
 Return 0 on success and -1 on error.\n\
 @seealso{fskipl, frewind, ftell, fopen}\n\
@@ -1440,84 +1442,84 @@
 data to read and may be one of\n\
 \n\
 @table @asis\n\
-@item  \"schar\"\n\
-@itemx \"signed char\"\n\
+@item  @qcode{\"schar\"}\n\
+@itemx @qcode{\"signed char\"}\n\
 Signed character.\n\
 \n\
-@item  \"uchar\"\n\
-@itemx \"unsigned char\"\n\
+@item  @qcode{\"uchar\"}\n\
+@itemx @qcode{\"unsigned char\"}\n\
 Unsigned character.\n\
 \n\
-@item  \"int8\"\n\
-@itemx \"integer*1\"\n\
+@item  @qcode{\"int8\"}\n\
+@itemx @qcode{\"integer*1\"}\n\
 \n\
 8-bit signed integer.\n\
 \n\
-@item  \"int16\"\n\
-@itemx \"integer*2\"\n\
+@item  @qcode{\"int16\"}\n\
+@itemx @qcode{\"integer*2\"}\n\
 16-bit signed integer.\n\
 \n\
-@item  \"int32\"\n\
-@itemx \"integer*4\"\n\
+@item  @qcode{\"int32\"}\n\
+@itemx @qcode{\"integer*4\"}\n\
 32-bit signed integer.\n\
 \n\
-@item  \"int64\"\n\
-@itemx \"integer*8\"\n\
+@item  @qcode{\"int64\"}\n\
+@itemx @qcode{\"integer*8\"}\n\
 64-bit signed integer.\n\
 \n\
-@item \"uint8\"\n\
+@item @qcode{\"uint8\"}\n\
 8-bit unsigned integer.\n\
 \n\
-@item \"uint16\"\n\
+@item @qcode{\"uint16\"}\n\
 16-bit unsigned integer.\n\
 \n\
-@item \"uint32\"\n\
+@item @qcode{\"uint32\"}\n\
 32-bit unsigned integer.\n\
 \n\
-@item \"uint64\"\n\
+@item @qcode{\"uint64\"}\n\
 64-bit unsigned integer.\n\
 \n\
-@item  \"single\"\n\
-@itemx \"float32\"\n\
-@itemx \"real*4\"\n\
+@item  @qcode{\"single\"}\n\
+@itemx @qcode{\"float32\"}\n\
+@itemx @qcode{\"real*4\"}\n\
 32-bit floating point number.\n\
 \n\
-@item  \"double\"\n\
-@itemx \"float64\"\n\
-@itemx \"real*8\"\n\
+@item  @qcode{\"double\"}\n\
+@itemx @qcode{\"float64\"}\n\
+@itemx @qcode{\"real*8\"}\n\
 64-bit floating point number.\n\
 \n\
-@item  \"char\"\n\
-@itemx \"char*1\"\n\
+@item  @qcode{\"char\"}\n\
+@itemx @qcode{\"char*1\"}\n\
 Single character.\n\
 \n\
-@item \"short\"\n\
+@item @qcode{\"short\"}\n\
 Short integer (size is platform dependent).\n\
 \n\
-@item \"int\"\n\
+@item @qcode{\"int\"}\n\
 Integer (size is platform dependent).\n\
 \n\
-@item \"long\"\n\
+@item @qcode{\"long\"}\n\
 Long integer (size is platform dependent).\n\
 \n\
-@item  \"ushort\"\n\
-@itemx \"unsigned short\"\n\
+@item  @qcode{\"ushort\"}\n\
+@itemx @qcode{\"unsigned short\"}\n\
 Unsigned short integer (size is platform dependent).\n\
 \n\
-@item  \"uint\"\n\
-@itemx \"unsigned int\"\n\
+@item  @qcode{\"uint\"}\n\
+@itemx @qcode{\"unsigned int\"}\n\
 Unsigned integer (size is platform dependent).\n\
 \n\
-@item  \"ulong\"\n\
-@itemx \"unsigned long\"\n\
+@item  @qcode{\"ulong\"}\n\
+@itemx @qcode{\"unsigned long\"}\n\
 Unsigned long integer (size is platform dependent).\n\
 \n\
-@item \"float\"\n\
+@item @qcode{\"float\"}\n\
 Single precision floating point number (size is platform dependent).\n\
 @end table\n\
 \n\
 @noindent\n\
-The default precision is @code{\"uchar\"}.\n\
+The default precision is @qcode{\"uchar\"}.\n\
 \n\
 The @var{precision} argument may also specify an optional repeat\n\
 count.  For example, @samp{32*single} causes @code{fread} to read\n\
@@ -1553,7 +1555,7 @@
 for the file.  Valid values are\n\
 \n\
 @table @code\n\
-@item \"native\"\n\
+@item @qcode{\"native\"}\n\
 The format of the current machine.\n\
 \n\
 @item \"ieee-be\"\n\
@@ -1562,19 +1564,19 @@
 @item \"ieee-le\"\n\
 IEEE little endian.\n\
 \n\
-@item \"vaxd\"\n\
+@item @qcode{\"vaxd\"}\n\
 VAX D floating format.\n\
 \n\
-@item \"vaxg\"\n\
+@item @qcode{\"vaxg\"}\n\
 VAX G floating format.\n\
 \n\
-@item \"cray\"\n\
+@item @qcode{\"cray\"}\n\
 Cray floating format.\n\
 @end table\n\
 \n\
 @noindent\n\
-Conversions are currently only supported for @code{\"ieee-be\"} and\n\
-@code{\"ieee-le\"} formats.\n\
+Conversions are currently only supported for @qcode{\"ieee-be\"} and\n\
+@qcode{\"ieee-le\"} formats.\n\
 \n\
 The data read from the file is returned in @var{val}, and the number of\n\
 values read is returned in @code{count}\n\
@@ -1827,11 +1829,11 @@
 @var{mode} may be\n\
 \n\
 @table @code\n\
-@item \"r\"\n\
+@item @qcode{\"r\"}\n\
 The pipe will be connected to the standard output of the process, and\n\
 open for reading.\n\
 \n\
-@item \"w\"\n\
+@item @qcode{\"w\"}\n\
 The pipe will be connected to the standard input of the process, and\n\
 open for writing.\n\
 @end table\n\
@@ -1922,7 +1924,7 @@
 @deftypefnx {Built-in Function} {} tmpnam (@var{dir}, @var{prefix})\n\
 Return a unique temporary file name as a string.\n\
 \n\
-If @var{prefix} is omitted, a value of @code{\"oct-\"} is used.\n\
+If @var{prefix} is omitted, a value of @qcode{\"oct-\"} is used.\n\
 If @var{dir} is also omitted, the default directory for temporary files\n\
 is used.  If @var{dir} is provided, it must exist, otherwise the default\n\
 directory for temporary files is used.  Since the named file is not\n\
@@ -1964,7 +1966,7 @@
   "-*- texinfo -*-\n\
 @deftypefn {Built-in Function} {[@var{fid}, @var{msg}] =} tmpfile ()\n\
 Return the file ID corresponding to a new temporary file with a unique\n\
-name.  The file is opened in binary read/write (@code{\"w+b\"}) mode.\n\
+name.  The file is opened in binary read/write (@qcode{\"w+b\"}) mode.\n\
 The file will be deleted automatically when it is closed or when Octave\n\
 exits.\n\
 \n\
--- a/libinterp/corefcn/find.cc
+++ b/libinterp/corefcn/find.cc
@@ -377,9 +377,10 @@
 If two inputs are given, @var{n} indicates the maximum number of\n\
 elements to find from the beginning of the matrix or vector.\n\
 \n\
-If three inputs are given, @var{direction} should be one of \"first\" or\n\
-\"last\", requesting only the first or last @var{n} indices, respectively.\n\
-However, the indices are always returned in ascending order.\n\
+If three inputs are given, @var{direction} should be one of\n\
+@qcode{\"first\"} or @qcode{\"last\"}, requesting only the first or last\n\
+@var{n} indices, respectively.  However, the indices are always returned in\n\
+ascending order.\n\
 \n\
 Note that this function is particularly useful for sparse matrices, as\n\
 it extracts the non-zero elements as vectors, which can then be used to\n\
--- a/libinterp/corefcn/gammainc.cc
+++ b/libinterp/corefcn/gammainc.cc
@@ -66,8 +66,8 @@
 @var{a} must agree, and @code{gammainc} is applied element-by-element.\n\
 \n\
 By default the incomplete gamma function integrated from 0 to @var{x} is\n\
-computed.  If \"upper\" is given then the complementary function integrated\n\
-from @var{x} to infinity is calculated.  It should be noted that\n\
+computed.  If @qcode{\"upper\"} is given then the complementary function\n\
+integrated from @var{x} to infinity is calculated.  It should be noted that\n\
 \n\
 @example\n\
 gammainc (@var{x}, @var{a}) @equiv{} 1 - gammainc (@var{x}, @var{a}, \"upper\")\n\
--- a/libinterp/corefcn/gl-render.cc
+++ b/libinterp/corefcn/gl-render.cc
@@ -3009,7 +3009,7 @@
                                  int halign, int valign, double rotation)
 {
   text_renderer.text_to_pixels (txt, pixels, bbox,
-                                halign, valign, rotation);
+                                halign, valign, rotation, "none");
 }
 
 Matrix
--- a/libinterp/corefcn/graphics.cc
+++ b/libinterp/corefcn/graphics.cc
@@ -4093,7 +4093,7 @@
 }
 
 /*
-%!test
+%!testif HAVE_FLTK
 %! hf = figure ("visible", "off");
 %! graphics_toolkit (hf, "fltk");
 %! unwind_protect
@@ -4112,7 +4112,7 @@
 %! unwind_protect_cleanup
 %!   close (hf);
 %! end_unwind_protect
-%!test
+%!testif HAVE_FLTK
 %! hf = figure ("visible", "off");
 %! graphics_toolkit (hf, "fltk");
 %! fpos = get (hf, "position");
@@ -4131,7 +4131,7 @@
 %! unwind_protect_cleanup
 %!   close (hf);
 %! end_unwind_protect
-%!test
+%!testif HAVE_FLTK
 %! hf = figure ("visible", "off");
 %! graphics_toolkit (hf, "fltk");
 %! fpos = get (hf, "position");
@@ -6293,7 +6293,7 @@
           label.erase (0, label.find_first_not_of (" "));
           label = label.substr (0, label.find_last_not_of (" ")+1);
 #ifdef HAVE_FREETYPE
-          ext = text_renderer.get_extent (label);
+          ext = text_renderer.get_extent (label, 0.0, "none");
           wmax = std::max (wmax, ext(0));
           hmax = std::max (hmax, ext(1));
 #else
@@ -7586,7 +7586,7 @@
   // FIXME: parsed content should be cached for efficiency
   // FIXME: support multiline text
 
-  elt = text_parser_none ().parse (get_string_string ());
+  elt = text_parser::parse (get_string_string (), "none");
 #ifdef HAVE_FONTCONFIG
   text_renderer.set_font (get_fontname (),
                           get_fontweight (),
@@ -8479,9 +8479,9 @@
   "-*- texinfo -*-\n\
 @deftypefn {Built-in Function} {} reset (@var{h}, @var{property})\n\
 Remove any defaults set for the handle @var{h}.  The default figure\n\
-properties of \"position\", \"units\", \"windowstyle\" and\n\
-\"paperunits\" and the default axes properties of \"position\" and \"units\"\n\
-are not reset.\n\
+properties of @qcode{\"position\"}, @qcode{\"units\"},\n\
+@qcode{\"windowstyle\"} and @qcode{\"paperunits\"} and the default axes\n\
+properties of @qcode{\"position\"} and @qcode{\"units\"} are not reset.\n\
 @end deftypefn")
 {
   int nargin = args.length ();
@@ -9563,7 +9563,7 @@
 @deftypefnx {Built-in Function} {} drawnow (@var{term}, @var{file}, @var{mono}, @var{debug_file})\n\
 Update figure windows and their children.  The event queue is flushed and\n\
 any callbacks generated are executed.  With the optional argument\n\
-@code{\"expose\"}, only graphic objects are updated and no other events or\n\
+@qcode{\"expose\"}, only graphic objects are updated and no other events or\n\
 callbacks are processed.\n\
 The third calling form of @code{drawnow} is for debugging and is\n\
 undocumented.\n\
--- a/libinterp/corefcn/help.cc
+++ b/libinterp/corefcn/help.cc
@@ -641,8 +641,8 @@
 
   pair_type ("parfor",
     "-*- texinfo -*-\n\
-@deftypefn  {Keyword} {} for @var{i} = @var{range}\n\
-@deftypefnx {Keyword} {} for (@var{i} = @var{range}, @var{maxproc})\n\
+@deftypefn  {Keyword} {} parfor @var{i} = @var{range}\n\
+@deftypefnx {Keyword} {} parfor (@var{i} = @var{range}, @var{maxproc})\n\
 Begin a for loop that may execute in parallel.\n\
 \n\
 @example\n\
@@ -1066,8 +1066,8 @@
 Return the raw help text of function @var{name}.\n\
 \n\
 The raw help text is returned in @var{text} and the format in @var{format}\n\
-The format is a string which is one of @t{\"texinfo\"}, @t{\"html\"}, or\n\
-@t{\"plain text\"}.\n\
+The format is a string which is one of @qcode{\"texinfo\"},\n\
+@qcode{\"html\"}, or @qcode{\"plain text\"}.\n\
 @end deftypefn")
 {
   octave_value_list retval;
@@ -1135,8 +1135,8 @@
 Return the raw help text from the file @var{fname}.\n\
 \n\
 The raw help text is returned in @var{text} and the format in @var{format}\n\
-The format is a string which is one of @t{\"texinfo\"}, @t{\"html\"}, or\n\
-@t{\"plain text\"}.\n\
+The format is a string which is one of @qcode{\"texinfo\"},\n\
+@qcode{\"html\"}, or @qcode{\"plain text\"}.\n\
 @end deftypefn")
 {
   octave_value_list retval;
@@ -1398,9 +1398,9 @@
 @w{@env{OCTAVE_DOC_CACHE_FILE}}, or the command line argument\n\
 @samp{--doc-cache-file FNAME}.\n\
 \n\
-When called from inside a function with the \"local\" option, the variable is\n\
-changed locally for the function and any subroutines it calls.  The original\n\
-variable value is restored when exiting the function.\n\
+When called from inside a function with the @qcode{\"local\"} option, the\n\
+variable is changed locally for the function and any subroutines it calls.  \n\
+The original variable value is restored when exiting the function.\n\
 @seealso{doc_cache_create, lookfor, info_program, doc, help, makeinfo_program}\n\
 @end deftypefn")
 {
@@ -1422,9 +1422,9 @@
 @w{@env{OCTAVE_TEXI_MACROS_FILE}}, or the command line argument\n\
 @samp{--texi-macros-file FNAME}.\n\
 \n\
-When called from inside a function with the \"local\" option, the variable is\n\
-changed locally for the function and any subroutines it calls.  The original\n\
-variable value is restored when exiting the function.\n\
+When called from inside a function with the @qcode{\"local\"} option, the\n\
+variable is changed locally for the function and any subroutines it calls.  \n\
+The original variable value is restored when exiting the function.\n\
 @seealso{makeinfo_program}\n\
 @end deftypefn")
 {
@@ -1444,9 +1444,9 @@
 @w{@env{OCTAVE_INFO_FILE}}, or the command line argument\n\
 @samp{--info-file FNAME}.\n\
 \n\
-When called from inside a function with the \"local\" option, the variable is\n\
-changed locally for the function and any subroutines it calls.  The original\n\
-variable value is restored when exiting the function.\n\
+When called from inside a function with the @qcode{\"local\"} option, the\n\
+variable is changed locally for the function and any subroutines it calls.  \n\
+The original variable value is restored when exiting the function.\n\
 @seealso{info_program, doc, help, makeinfo_program}\n\
 @end deftypefn")
 {
@@ -1468,9 +1468,9 @@
 @w{@env{OCTAVE_INFO_PROGRAM}}, or the command line argument\n\
 @samp{--info-program NAME}.\n\
 \n\
-When called from inside a function with the \"local\" option, the variable is\n\
-changed locally for the function and any subroutines it calls.  The original\n\
-variable value is restored when exiting the function.\n\
+When called from inside a function with the @qcode{\"local\"} option, the\n\
+variable is changed locally for the function and any subroutines it calls.  \n\
+The original variable value is restored when exiting the function.\n\
 @seealso{info_file, doc, help, makeinfo_program}\n\
 @end deftypefn")
 {
@@ -1486,9 +1486,9 @@
 program that Octave runs to format help text containing\n\
 Texinfo markup commands.  The default value is @code{makeinfo}.\n\
 \n\
-When called from inside a function with the \"local\" option, the variable is\n\
-changed locally for the function and any subroutines it calls.  The original\n\
-variable value is restored when exiting the function.\n\
+When called from inside a function with the @qcode{\"local\"} option, the\n\
+variable is changed locally for the function and any subroutines it calls.  \n\
+The original variable value is restored when exiting the function.\n\
 @seealso{texi_macros_file, info_file, info_program, doc, help}\n\
 @end deftypefn")
 {
@@ -1504,9 +1504,9 @@
 will add additional help information to the end of the output from\n\
 the @code{help} command and usage messages for built-in commands.\n\
 \n\
-When called from inside a function with the \"local\" option, the variable is\n\
-changed locally for the function and any subroutines it calls.  The original\n\
-variable value is restored when exiting the function.\n\
+When called from inside a function with the @qcode{\"local\"} option, the\n\
+variable is changed locally for the function and any subroutines it calls.  \n\
+The original variable value is restored when exiting the function.\n\
 @end deftypefn")
 {
   return SET_INTERNAL_VARIABLE (suppress_verbose_help_message);
--- a/libinterp/corefcn/hex2num.cc
+++ b/libinterp/corefcn/hex2num.cc
@@ -38,7 +38,7 @@
 @deftypefnx {Built-in Function} {@var{n} =} hex2num (@var{s}, @var{class})\n\
 Typecast the 16 character hexadecimal character string to an IEEE 754\n\
 double precision number.  If fewer than 16 characters are given the\n\
-strings are right padded with '0' characters.\n\
+strings are right padded with @qcode{'0'} characters.\n\
 \n\
 Given a string matrix, @code{hex2num} treats each row as a separate\n\
 number.\n\
@@ -50,10 +50,11 @@
 @end group\n\
 @end example\n\
 \n\
-The optional argument @var{class} can be passed as the string \"single\" to\n\
-specify that the given string should be interpreted as a single precision\n\
-number.  In this case, @var{s} should be an 8 character hexadecimal string.\n\
-For example:\n\
+The optional argument @var{class} can be passed as the string\n\
+@qcode{\"single\"} to specify that the given string should be interpreted as\n\
+a single precision number.  In this case, @var{s} should be an 8 character\n\
+hexadecimal string.  For example: \n\
+\n\
 @example\n\
 @group\n\
 hex2num ([\"402df854\"; \"41200000\"], \"single\")\n\
--- a/libinterp/corefcn/input.cc
+++ b/libinterp/corefcn/input.cc
@@ -147,7 +147,7 @@
 void
 octave_base_reader::do_input_echo (const std::string& input_string) const
 {
-  int do_echo = LEXER->reading_script_file ?
+  int do_echo = (LEXER && LEXER->reading_script_file) ?
     (Vecho_executing_commands & ECHO_SCRIPTS)
       : (Vecho_executing_commands & ECHO_CMD_LINE) && ! forced_interactive;
 
@@ -554,10 +554,10 @@
   VPS1 = prompt;
 
   if (! (interactive || forced_interactive)
-      || LEXER->reading_fcn_file
-      || LEXER->reading_classdef_file
-      || LEXER->reading_script_file
-      || LEXER->input_from_eval_string ())
+      || (LEXER && (LEXER->reading_fcn_file
+                    || LEXER->reading_classdef_file
+                    || LEXER->reading_script_file
+                    || LEXER->input_from_eval_string ())))
     {
       frame.protect_var (forced_interactive);
       forced_interactive = true;
@@ -739,7 +739,7 @@
 of values produced by the evaluation of the expression.\n\
 \n\
 If you are only interested in getting a literal string value, you can\n\
-call @code{input} with the character string @code{\"s\"} as the second\n\
+call @code{input} with the character string @qcode{\"s\"} as the second\n\
 argument.  This tells Octave to return the string entered by the user\n\
 directly, without evaluating it first.\n\
 \n\
@@ -1226,7 +1226,7 @@
 Query or set the primary prompt string.  When executing interactively,\n\
 Octave displays the primary prompt when it is ready to read a command.\n\
 \n\
-The default value of the primary prompt string is @code{\"\\s:\\#> \"}.\n\
+The default value of the primary prompt string is @qcode{\"\\s:\\#> \"}.\n\
 To change it, use a command like\n\
 \n\
 @example\n\
@@ -1249,9 +1249,9 @@
 @noindent\n\
 will give the default Octave prompt a red coloring.\n\
 \n\
-When called from inside a function with the \"local\" option, the variable is\n\
-changed locally for the function and any subroutines it calls.  The original\n\
-variable value is restored when exiting the function.\n\
+When called from inside a function with the @qcode{\"local\"} option, the\n\
+variable is changed locally for the function and any subroutines it calls.  \n\
+The original variable value is restored when exiting the function.\n\
 @seealso{PS2, PS4}\n\
 @end deftypefn")
 {
@@ -1268,11 +1268,11 @@
 command.  For example, if you are typing a @code{for} loop that spans several\n\
 lines, Octave will print the secondary prompt at the beginning of\n\
 each line after the first.  The default value of the secondary prompt\n\
-string is @code{\"> \"}.\n\
+string is @qcode{\"> \"}.\n\
 \n\
-When called from inside a function with the \"local\" option, the variable is\n\
-changed locally for the function and any subroutines it calls.  The original\n\
-variable value is restored when exiting the function.\n\
+When called from inside a function with the @qcode{\"local\"} option, the\n\
+variable is changed locally for the function and any subroutines it calls.  \n\
+The original variable value is restored when exiting the function.\n\
 @seealso{PS1, PS4}\n\
 @end deftypefn")
 {
@@ -1286,12 +1286,12 @@
 @deftypefnx {Built-in Function} {} PS4 (@var{new_val}, \"local\")\n\
 Query or set the character string used to prefix output produced\n\
 when echoing commands is enabled.\n\
-The default value is @code{\"+ \"}.\n\
+The default value is @qcode{\"+ \"}.\n\
 @xref{Diary and Echo Commands}, for a description of echoing commands.\n\
 \n\
-When called from inside a function with the \"local\" option, the variable is\n\
-changed locally for the function and any subroutines it calls.  The original\n\
-variable value is restored when exiting the function.\n\
+When called from inside a function with the @qcode{\"local\"} option, the\n\
+variable is changed locally for the function and any subroutines it calls.  \n\
+The original variable value is restored when exiting the function.\n\
 @seealso{echo, echo_executing_commands, PS1, PS2}\n\
 @end deftypefn")
 {
@@ -1305,11 +1305,11 @@
 @deftypefnx {Built-in Function} {} completion_append_char (@var{new_val}, \"local\")\n\
 Query or set the internal character variable that is appended to\n\
 successful command-line completion attempts.  The default\n\
-value is @code{\" \"} (a single space).\n\
+value is @qcode{\" \"} (a single space).\n\
 \n\
-When called from inside a function with the \"local\" option, the variable is\n\
-changed locally for the function and any subroutines it calls.  The original\n\
-variable value is restored when exiting the function.\n\
+When called from inside a function with the @qcode{\"local\"} option, the\n\
+variable is changed locally for the function and any subroutines it calls.  \n\
+The original variable value is restored when exiting the function.\n\
 @end deftypefn")
 {
   return SET_INTERNAL_VARIABLE (completion_append_char);
@@ -1340,9 +1340,9 @@
 The value of @code{echo_executing_commands} may be set by the @kbd{echo}\n\
 command or the command line option @option{--echo-commands}.\n\
 \n\
-When called from inside a function with the \"local\" option, the variable is\n\
-changed locally for the function and any subroutines it calls.  The original\n\
-variable value is restored when exiting the function.\n\
+When called from inside a function with the @qcode{\"local\"} option, the\n\
+variable is changed locally for the function and any subroutines it calls.  \n\
+The original variable value is restored when exiting the function.\n\
 @end deftypefn")
 {
   return SET_INTERNAL_VARIABLE (echo_executing_commands);
@@ -1415,9 +1415,9 @@
 @noindent\n\
 will set a breakpoint at the first line of the subfunction @code{mysubfunc}.\n\
 \n\
-When called from inside a function with the \"local\" option, the variable is\n\
-changed locally for the function and any subroutines it calls.  The original\n\
-variable value is restored when exiting the function.\n\
+When called from inside a function with the @qcode{\"local\"} option, the\n\
+variable is changed locally for the function and any subroutines it calls.  \n\
+The original variable value is restored when exiting the function.\n\
 @end deftypefn")
 {
   char tmp = Vfilemarker;
--- a/libinterp/corefcn/load-path.cc
+++ b/libinterp/corefcn/load-path.cc
@@ -2166,8 +2166,8 @@
 @deftypefn  {Built-in Function} {} addpath (@var{dir1}, @dots{})\n\
 @deftypefnx {Built-in Function} {} addpath (@var{dir1}, @dots{}, @var{option})\n\
 Add named directories to the function search path.  If\n\
-@var{option} is \"-begin\" or 0 (the default), prepend the\n\
-directory name to the current path.  If @var{option} is \"-end\"\n\
+@var{option} is @qcode{\"-begin\"} or 0 (the default), prepend the\n\
+directory name to the current path.  If @var{option} is @qcode{\"-end\"}\n\
 or 1, append the directory name to the current path.\n\
 Directories added to the path must exist.\n\
 \n\
--- a/libinterp/corefcn/load-save.cc
+++ b/libinterp/corefcn/load-save.cc
@@ -1772,12 +1772,12 @@
 @deftypefnx {Built-in Function} {@var{old_val} =} crash_dumps_octave_core (@var{new_val})\n\
 @deftypefnx {Built-in Function} {} crash_dumps_octave_core (@var{new_val}, \"local\")\n\
 Query or set the internal variable that controls whether Octave tries\n\
-to save all current variables to the file \"octave-workspace\" if it\n\
+to save all current variables to the file @file{octave-workspace} if it\n\
 crashes or receives a hangup, terminate or similar signal.\n\
 \n\
-When called from inside a function with the \"local\" option, the variable is\n\
-changed locally for the function and any subroutines it calls.  The original\n\
-variable value is restored when exiting the function.\n\
+When called from inside a function with the @qcode{\"local\"} option, the\n\
+variable is changed locally for the function and any subroutines it calls.  \n\
+The original variable value is restored when exiting the function.\n\
 @seealso{octave_core_file_limit, octave_core_file_name, octave_core_file_options}\n\
 @end deftypefn")
 {
@@ -1791,12 +1791,12 @@
 @deftypefnx {Built-in Function} {} save_default_options (@var{new_val}, \"local\")\n\
 Query or set the internal variable that specifies the default options\n\
 for the @code{save} command, and defines the default format.\n\
-Typical values include @code{\"-ascii\"}, @code{\"-text -zip\"}.\n\
+Typical values include @qcode{\"-ascii\"}, @qcode{\"-text -zip\"}.\n\
 The default value is @option{-text}.\n\
 \n\
-When called from inside a function with the \"local\" option, the variable is\n\
-changed locally for the function and any subroutines it calls.  The original\n\
-variable value is restored when exiting the function.\n\
+When called from inside a function with the @qcode{\"local\"} option, the\n\
+variable is changed locally for the function and any subroutines it calls.  \n\
+The original variable value is restored when exiting the function.\n\
 @seealso{save}\n\
 @end deftypefn")
 {
@@ -1817,9 +1817,9 @@
 size of the file.  If a text file format is used, then the file could\n\
 be much larger than the limit.  The default value is -1 (unlimited)\n\
 \n\
-When called from inside a function with the \"local\" option, the variable is\n\
-changed locally for the function and any subroutines it calls.  The original\n\
-variable value is restored when exiting the function.\n\
+When called from inside a function with the @qcode{\"local\"} option, the\n\
+variable is changed locally for the function and any subroutines it calls.  \n\
+The original variable value is restored when exiting the function.\n\
 @seealso{crash_dumps_octave_core, octave_core_file_name, octave_core_file_options}\n\
 @end deftypefn")
 {
@@ -1833,11 +1833,11 @@
 @deftypefnx {Built-in Function} {} octave_core_file_name (@var{new_val}, \"local\")\n\
 Query or set the internal variable that specifies the name of the file\n\
 used for saving data from the top-level workspace if Octave aborts.\n\
-The default value is @code{\"octave-workspace\"}\n\
+The default value is @qcode{\"octave-workspace\"}\n\
 \n\
-When called from inside a function with the \"local\" option, the variable is\n\
-changed locally for the function and any subroutines it calls.  The original\n\
-variable value is restored when exiting the function.\n\
+When called from inside a function with the @qcode{\"local\"} option, the\n\
+variable is changed locally for the function and any subroutines it calls.  \n\
+The original variable value is restored when exiting the function.\n\
 @seealso{crash_dumps_octave_core, octave_core_file_name, octave_core_file_options}\n\
 @end deftypefn")
 {
@@ -1855,9 +1855,9 @@
 options for the @code{save} function.  The default value is Octave's binary\n\
 format.\n\
 \n\
-When called from inside a function with the \"local\" option, the variable is\n\
-changed locally for the function and any subroutines it calls.  The original\n\
-variable value is restored when exiting the function.\n\
+When called from inside a function with the @qcode{\"local\"} option, the\n\
+variable is changed locally for the function and any subroutines it calls.  \n\
+The original variable value is restored when exiting the function.\n\
 @seealso{crash_dumps_octave_core, octave_core_file_name, octave_core_file_limit}\n\
 @end deftypefn")
 {
@@ -1883,9 +1883,9 @@
 \"# Created by Octave VERSION, %a %b %d %H:%M:%S %Y %Z <USER@@HOST>\"\n\
 @end smallexample\n\
 \n\
-When called from inside a function with the \"local\" option, the variable is\n\
-changed locally for the function and any subroutines it calls.  The original\n\
-variable value is restored when exiting the function.\n\
+When called from inside a function with the @qcode{\"local\"} option, the\n\
+variable is changed locally for the function and any subroutines it calls.  \n\
+The original variable value is restored when exiting the function.\n\
 @seealso{strftime, save}\n\
 @end deftypefn")
 {
--- a/libinterp/corefcn/ls-oct-ascii.cc
+++ b/libinterp/corefcn/ls-oct-ascii.cc
@@ -423,9 +423,9 @@
 Query or set the internal variable that specifies the number of\n\
 digits to keep when saving data in text format.\n\
 \n\
-When called from inside a function with the \"local\" option, the variable is\n\
-changed locally for the function and any subroutines it calls.  The original\n\
-variable value is restored when exiting the function.\n\
+When called from inside a function with the @qcode{\"local\"} option, the\n\
+variable is changed locally for the function and any subroutines it calls.\n\
+The original variable value is restored when exiting the function.\n\
 @end deftypefn")
 {
   return SET_INTERNAL_VARIABLE_WITH_LIMITS (save_precision, -1,
--- a/libinterp/corefcn/lu.cc
+++ b/libinterp/corefcn/lu.cc
@@ -125,10 +125,10 @@
 pivoting strategy and the second for the symmetric strategy.  By default,\n\
 the values defined by @code{spparms} are used ([0.1, 0.001]).\n\
 \n\
-Given the string argument \"vector\", @code{lu} returns the values of @var{P}\n\
-and @var{Q} as vector values, such that for full matrix, @code{@var{A}\n\
-(@var{P},:) = @var{L} * @var{U}}, and @code{@var{R}(@var{P},:) * @var{A}\n\
-(:, @var{Q}) = @var{L} * @var{U}}.\n\
+Given the string argument @qcode{\"vector\"}, @code{lu} returns the values\n\
+of @var{P} and @var{Q} as vector values, such that for full matrix,\n\
+@code{@var{A} (@var{P},:) = @var{L} * @var{U}}, and @code{@var{R}(@var{P},:)\n\
+* @var{A} (:, @var{Q}) = @var{L} * @var{U}}.\n\
 \n\
 With two output arguments, returns the permuted forms of the upper and\n\
 lower triangular matrices, such that @code{@var{A} = @var{L} * @var{U}}.\n\
@@ -615,7 +615,7 @@
 @end example\n\
 \n\
 @noindent\n\
-then a factorization of @xcode{@var{A}+@var{x}*@var{y}.'} can be obtained\n\
+then a factorization of @tcode{@var{A}+@var{x}*@var{y}.'} can be obtained\n\
 either as\n\
 \n\
 @example\n\
--- a/libinterp/corefcn/luinc.cc
+++ b/libinterp/corefcn/luinc.cc
@@ -47,7 +47,7 @@
 Two types of incomplete factorization are possible, and the type\n\
 is determined by the second argument to @code{luinc}.\n\
 \n\
-Called with a second argument of '0', the zero-level incomplete\n\
+Called with a second argument of @qcode{'0'}, the zero-level incomplete\n\
 LU@tie{}factorization is produced.  This creates a factorization of @var{A}\n\
 where the position of the non-zero arguments correspond to the same\n\
 positions as in the matrix @var{A}.\n\
@@ -91,8 +91,8 @@
 All other fields in @var{opts} are ignored.  The outputs from @code{luinc}\n\
 are the same as for @code{lu}.\n\
 \n\
-Given the string argument \"vector\", @code{luinc} returns the values of\n\
-@var{p} @var{q} as vector values.\n\
+Given the string argument @qcode{\"vector\"}, @code{luinc} returns the\n\
+values of @var{p} @var{q} as vector values.\n\
 @seealso{sparse, lu}\n\
 @end deftypefn")
 {
--- a/libinterp/corefcn/matrix_type.cc
+++ b/libinterp/corefcn/matrix_type.cc
@@ -50,48 +50,49 @@
 matrix and caches it for future use.  Called with more than one argument,\n\
 @code{matrix_type} allows the type of the matrix to be defined.\n\
 \n\
-If the option \"nocompute\" is given, the function will not attempt to guess\n\
-the type if it is still unknown.  This is useful for debugging purposes.\n\
+If the option @qcode{\"nocompute\"} is given, the function will not attempt\n\
+to guess the type if it is still unknown.  This is useful for debugging\n\
+purposes.\n\
 \n\
 The possible matrix types depend on whether the matrix is full or sparse, and\n\
 can be one of the following\n\
 \n\
 @table @asis\n\
-@item \"unknown\"\n\
+@item @qcode{\"unknown\"}\n\
 Remove any previously cached matrix type, and mark type as unknown.\n\
 \n\
-@item \"full\"\n\
+@item @qcode{\"full\"}\n\
 Mark the matrix as full.\n\
 \n\
-@item \"positive definite\"\n\
+@item @qcode{\"positive definite\"}\n\
 Probable full positive definite matrix.\n\
 \n\
-@item \"diagonal\"\n\
+@item @qcode{\"diagonal\"}\n\
 Diagonal matrix.  (Sparse matrices only)\n\
 \n\
-@item \"permuted diagonal\"\n\
+@item @qcode{\"permuted diagonal\"}\n\
 Permuted Diagonal matrix.  The permutation does not need to be specifically\n\
 indicated, as the structure of the matrix explicitly gives this.  (Sparse\n\
 matrices only)\n\
 \n\
-@item \"upper\"\n\
+@item @qcode{\"upper\"}\n\
 Upper triangular.  If the optional third argument @var{perm} is given, the\n\
 matrix is assumed to be a permuted upper triangular with the permutations\n\
 defined by the vector @var{perm}.\n\
 \n\
-@item \"lower\"\n\
+@item @qcode{\"lower\"}\n\
 Lower triangular.  If the optional third argument @var{perm} is given, the\n\
 matrix is assumed to be a permuted lower triangular with the permutations\n\
 defined by the vector @var{perm}.\n\
 \n\
-@item  \"banded\"\n\
-@itemx \"banded positive definite\"\n\
+@item  @qcode{\"banded\"}\n\
+@itemx @qcode{\"banded positive definite\"}\n\
 Banded matrix with the band size of @var{nl} below the diagonal and @var{nu}\n\
 above it.  If @var{nl} and @var{nu} are 1, then the matrix is tridiagonal and\n\
 treated with specialized code.  In addition the matrix can be marked as\n\
 probably a positive definite.  (Sparse matrices only)\n\
 \n\
-@item \"singular\"\n\
+@item @qcode{\"singular\"}\n\
 The matrix is assumed to be singular and will be treated with a minimum norm\n\
 solution.\n\
 \n\
--- a/libinterp/corefcn/module.mk
+++ b/libinterp/corefcn/module.mk
@@ -211,6 +211,8 @@
   corefcn/oct-procbuf.cc \
   corefcn/oct-stream.cc \
   corefcn/oct-strstrm.cc \
+  corefcn/oct-tex-lexer.ll \
+  corefcn/oct-tex-parser.yy \
   corefcn/octave-link.cc \
   corefcn/pager.cc \
   corefcn/pinv.cc \
@@ -242,6 +244,7 @@
   corefcn/time.cc \
   corefcn/toplev.cc \
   corefcn/tril.cc \
+  corefcn/txt-eng.cc \
   corefcn/txt-render.cc \
   corefcn/txt-latex.cc \
   corefcn/txt-eng-ft.cc \
@@ -299,3 +302,15 @@
 corefcn_libcorefcn_la_SOURCES = $(COREFCN_SRC)
 corefcn_libcorefcn_la_CPPFLAGS = $(liboctinterp_la_CPPFLAGS) $(FFTW_XCPPFLAGS)
 
+corefcn/oct-tex-lexer.cc: LEX_OUTPUT_ROOT := lex.octave_tex_
+corefcn/oct-tex-parser.h: corefcn/oct-tex-parser.yy
+
+corefcn/oct-tex-lexer.ll: corefcn/oct-tex-lexer.in.ll corefcn/oct-tex-symbols.in Makefile
+	$(AWK) 'BEGIN { print "/* DO NOT EDIT. AUTOMATICALLY GENERATED FROM oct-tex-lexer.in.ll and oct-tex-symbols.in. */"; } /^@SYMBOL_RULES@$$/ { count = 0; while (getline < "$(srcdir)/corefcn/oct-tex-symbols.in") { if ($$0 !~ /^#.*/ && NF == 3) { printf("\"\\\\%s\" { yylval->sym = %d; return SYM; }\n", $$1, count); count++; } } getline } ! /^@SYMBOL_RULES@$$/ { print }' $< > $@-t
+	mv $@-t $@
+
+corefcn/oct-tex-symbols.cc: corefcn/oct-tex-symbols.in Makefile
+	$(AWK) 'BEGIN { print "// DO NOT EDIT. AUTOMATICALLY GENERATED FROM oct-tex-symbols.in."; print "static uint32_t symbol_codes[][2] = {"; count = 0; } END { print "};"; printf("static int num_symbol_codes = %d;\n", count); } /^#/ { } { if (NF == 3) { printf("  { %s, %s },\n", $$2, $$3); count++; } }' $< > $@-t
+	mv $@-t $@
+
+corefcn/txt-eng.cc: corefcn/oct-tex-symbols.cc
--- a/libinterp/corefcn/oct-hist.cc
+++ b/libinterp/corefcn/oct-hist.cc
@@ -830,9 +830,9 @@
 \"# Octave VERSION, %a %b %d %H:%M:%S %Y %Z <USER@@HOST>\"\n\
 @end example\n\
 \n\
-When called from inside a function with the \"local\" option, the variable is\n\
-changed locally for the function and any subroutines it calls.  The original\n\
-variable value is restored when exiting the function.\n\
+When called from inside a function with the @qcode{\"local\"} option, the\n\
+variable is changed locally for the function and any subroutines it calls.  \n\
+The original variable value is restored when exiting the function.\n\
 @seealso{strftime, history_file, history_size, history_save}\n\
 @end deftypefn")
 {
@@ -847,9 +847,9 @@
 Query or set the internal variable that controls whether commands entered\n\
 on the command line are saved in the history file.\n\
 \n\
-When called from inside a function with the \"local\" option, the variable is\n\
-changed locally for the function and any subroutines it calls.  The original\n\
-variable value is restored when exiting the function.\n\
+When called from inside a function with the @qcode{\"local\"} option, the\n\
+variable is changed locally for the function and any subroutines it calls.  \n\
+The original variable value is restored when exiting the function.\n\
 @seealso{history_control, history_file, history_size, history_timestamp_format_string}\n\
 @end deftypefn")
 {
--- a/libinterp/corefcn/oct-stream.cc
+++ b/libinterp/corefcn/oct-stream.cc
@@ -2544,9 +2544,17 @@
                                 nsa--;
                             }
 
-                          const char *tval = xisinf (val)
-                            ? (val < 0 ? "-Inf" : "Inf")
-                            : (lo_ieee_is_NA (val) ? "NA" : "NaN");
+                          const char *tval;
+                          if (xisinf (val))
+                            if (elt->flags.find ('+') != std::string::npos)
+                              tval = (val < 0 ? "-Inf" : "+Inf");
+                            else
+                              tval = (val < 0 ? "-Inf" : "Inf");
+                          else
+                            if (elt->flags.find ('+') != std::string::npos)
+                              tval = (lo_ieee_is_NA (val) ? "+NA" : "+NaN");
+                            else
+                              tval = (lo_ieee_is_NA (val) ? "NA" : "NaN");
 
                           retval += do_printf_conv (os, tfmt.c_str (),
                                                     nsa, sa_1, sa_2,
new file mode 100644
--- /dev/null
+++ b/libinterp/corefcn/oct-tex-lexer.in.ll
@@ -0,0 +1,146 @@
+/*
+
+Copyright (C) 2013 Michael Goffioul
+
+This file is part of Octave.
+
+Octave is free software; you can redistribute it and/or modify it
+under the terms of the GNU General Public License as published by the
+Free Software Foundation; either version 3 of the License, or (at your
+option) any later version.
+
+Octave is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+for more details.
+
+You should have received a copy of the GNU General Public License
+along with Octave; see the file COPYING.  If not, see
+<http://www.gnu.org/licenses/>.
+
+*/
+
+%option prefix = "octave_tex_"
+%option noyywrap
+%option reentrant
+%option bison-bridge
+
+%top {
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "txt-eng.h"
+#include "oct-tex-parser.h"
+}
+
+%x	NUM_MODE
+%x	MAYBE_NUM_MODE
+
+D       [0-9]
+NUM	(({D}+\.?{D}*)|(\.{D}+))
+
+%%
+
+%{
+// Numeric values
+%}
+
+<NUM_MODE>{NUM}		{
+    int nread;
+
+    nread = sscanf (yytext, "%lf", &(yylval->num));
+    if (nread == 1)
+      return NUM;
+  }
+<NUM_MODE>[ \t]+	{ }
+<NUM_MODE>"\n"|.	{ yyless (0); BEGIN (INITIAL); }
+
+<MAYBE_NUM_MODE>"{"	{ BEGIN (NUM_MODE); return START; }
+<MAYBE_NUM_MODE>"\n"|.	{ yyless (0); BEGIN (INITIAL); }
+
+%{
+// Simple commands
+%}
+
+"\\bf"		{ return BF; }
+"\\it"		{ return IT; }
+"\\sl"		{ return SL; }
+"\\rm"		{ return RM; }
+
+%{
+// Generic font commands
+%}
+
+"\\fontname"	{ return FONTNAME; }
+"\\fontsize"	{ BEGIN (MAYBE_NUM_MODE); return FONTSIZE; }
+"\\color[rgb]"	{ BEGIN (MAYBE_NUM_MODE); return COLOR_RGB; }
+"\\color"	{ return COLOR; }
+
+%{
+// Special characters
+%}
+
+"{"	{ return START; }
+"}"	{ return END; }
+"^"	{ return SUPER; }
+"_"	{ return SUB; }
+
+"\\{"	|
+"\\}"	|
+"\\^"	|
+"\\_"	|
+"\\\\"	{ yylval->ch = yytext[1]; return CH; }
+
+%{
+// Symbols
+%}
+
+@SYMBOL_RULES@
+
+%{
+// Generic character
+%}
+
+"\n"	|
+.	{ yylval->ch = yytext[0]; return CH; }
+
+%%
+
+bool
+text_parser_tex::init_lexer (const std::string& s)
+{
+  if (! scanner)
+    octave_tex_lex_init (&scanner);
+
+  if (scanner)
+    {
+      if (buffer_state)
+        {
+          octave_tex__delete_buffer (reinterpret_cast<YY_BUFFER_STATE> (buffer_state),
+                                     scanner);
+          buffer_state = 0;
+        }
+
+      buffer_state = octave_tex__scan_bytes (s.data (), s.length (), scanner);
+    }
+
+  return (scanner && buffer_state);
+}
+
+void
+text_parser_tex::destroy_lexer (void)
+{
+  if (buffer_state)
+    {
+      octave_tex__delete_buffer (reinterpret_cast<YY_BUFFER_STATE> (buffer_state),
+                                 scanner);
+      buffer_state = 0;
+    }
+
+  if (scanner)
+    {
+      octave_tex_lex_destroy (scanner);
+      scanner = 0;
+    }
+}
new file mode 100644
--- /dev/null
+++ b/libinterp/corefcn/oct-tex-parser.yy
@@ -0,0 +1,210 @@
+/*
+
+Copyright (C) 2013 Michael Goffioul
+
+This file is part of Octave.
+
+Octave is free software; you can redistribute it and/or modify it
+under the terms of the GNU General Public License as published by the
+Free Software Foundation; either version 3 of the License, or (at your
+option) any later version.
+
+Octave is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+for more details.
+
+You should have received a copy of the GNU General Public License
+along with Octave; see the file COPYING.  If not, see
+<http://www.gnu.org/licenses/>.
+
+*/
+
+%{
+#define YYDEBUG 1
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "txt-eng.h"
+#include "oct-tex-parser.h"
+
+extern int octave_tex_lex (YYSTYPE *, void *);
+static void yyerror (text_parser_tex& parser, const char *s);
+
+#define scanner parser.get_scanner ()
+%}
+
+%name-prefix="octave_tex_"
+%define api.pure
+%parse-param { text_parser_tex& parser } 
+%lex-param { void *scanner }
+
+%code requires {#include <string>}
+
+%union {
+  /* Leaf symbols produced by the scanner */
+  char                       ch;
+  double                     num;
+  int                        sym;
+
+  /* Used for string buffering */
+  std::string*               str;
+
+  /* Objects produced by the parser */
+  text_element*              e_base;
+  text_element_list*         e_list;
+}
+
+%token BF IT SL RM
+%token FONTNAME FONTSIZE
+%token COLOR COLOR_RGB
+%token START END SUPER SUB
+%token<ch> CH
+%token<num> NUM
+%token<sym> SYM
+
+%type<str> simple_string
+%type<e_base> string_element symbol_element
+%type<e_base> superscript_element subscript_element combined_script_element
+%type<e_base> font_modifier_element fontname_element fontsize_element color_element
+%type<e_list> string_element_list scoped_string_element_list
+
+/* Make sure there's no memory leak on parse error. */
+%destructor { } <ch> <num> <sym>
+%destructor { delete $$; } <*>
+
+%nonassoc SCRIPT
+%nonassoc SUB SUPER
+
+%nonassoc STR
+%nonassoc CH
+
+%start string
+
+%%
+
+simple_string			: CH
+				  { $$ = new std::string (1, $1); }
+				| simple_string CH
+				  { $1->append (1, $2); $$ = $1; }
+				;
+
+symbol_element			: SYM
+				  { $$ = new text_element_symbol ($1); }
+				;
+
+font_modifier_element		: BF
+				  { $$ = new text_element_fontstyle (text_element_fontstyle::bold); }
+				| IT
+				  { $$ = new text_element_fontstyle (text_element_fontstyle::italic); }
+				| SL
+				  { $$ = new text_element_fontstyle (text_element_fontstyle::oblique); }
+				| RM
+				  { $$ = new text_element_fontstyle (text_element_fontstyle::normal); }
+				;
+
+fontsize_element		: FONTSIZE START NUM END
+				  { $$ = new text_element_fontsize ($3); }
+				;
+
+fontname_element		: FONTNAME START simple_string END
+				  {
+				    $$ = new text_element_fontname (*$3);
+				    delete $3;
+				  }
+				;
+
+color_element			: COLOR START simple_string END
+				  {
+				    $$ = new text_element_color (*$3);
+				    delete $3;
+				  }
+				| COLOR_RGB START NUM NUM NUM END
+				  {
+				    $$ = new text_element_color ($3, $4, $5);
+				  }
+				;
+
+string_element			: simple_string %prec STR
+				  {
+				    $$ = new text_element_string (*$1);
+				    delete $1;
+				  }
+				| scoped_string_element_list
+				  /* This is just to avoid a warning in bison. */
+				  { $$ = $1; }
+				| symbol_element
+				| font_modifier_element
+				| fontsize_element
+				| fontname_element
+				| color_element
+				| superscript_element %prec SCRIPT
+				| subscript_element %prec SCRIPT
+				| combined_script_element
+				;
+
+superscript_element		: SUPER CH
+				  { $$ = new text_element_superscript ($2); }
+				| SUPER scoped_string_element_list
+				  { $$ = new text_element_superscript ($2); }
+				| SUPER symbol_element
+				  { $$ = new text_element_superscript ($2); }
+				;
+
+subscript_element		: SUB CH
+				  { $$ = new text_element_subscript ($2); }
+				| SUB scoped_string_element_list
+				  { $$ = new text_element_subscript ($2); }
+				| SUB symbol_element
+				  { $$ = new text_element_subscript ($2); }
+				;
+
+combined_script_element		: subscript_element superscript_element
+				  { $$ = new text_element_combined ($1, $2); }
+				| superscript_element subscript_element
+				  { $$ = new text_element_combined ($1, $2); }
+				;
+
+string_element_list		: string_element
+				  { $$ = new text_element_list ($1); }
+				| string_element_list string_element
+				  { $1->push_back ($2); $$ = $1; }
+				;
+
+scoped_string_element_list	: START string_element_list END
+				  { $$ = $2; }
+				| START END
+				  { $$ = new text_element_list (); }
+				;
+
+string				: /* empty */
+				  { parser.set_parse_result (new text_element_string ("")); }
+				| string_element_list
+				  { parser.set_parse_result ($1); }
+				;
+
+%%
+
+text_element*
+text_parser_tex::parse (const std::string& s)
+{
+  octave_tex_debug = 0;
+
+  if (init_lexer (s))
+    {
+      result = 0;
+
+      if (octave_tex_parse (*this) == 0)
+        return result;
+    }
+
+  return new text_element_string (s);
+}
+
+static void
+yyerror (text_parser_tex&, const char *s)
+{
+  fprintf (stderr, "TeX parse error: %s\n", s);
+}
new file mode 100644
--- /dev/null
+++ b/libinterp/corefcn/oct-tex-symbols.in
@@ -0,0 +1,110 @@
+# List of supported symbols for the TeX interpreter
+# (http://www.mathworks.com/help/matlab/ref/text_props.html):
+# - symbol name
+# - Unicode code
+# - MS symbol code (http://www.kostis.net/charsets/symbol.htm)
+
+alpha           0x03B1  0xF061
+angle           0x2220  0xF0D0
+ast             0x2217  0xF02A
+beta            0x03B2  0xF062
+gamma           0x03B3  0xF067
+delta           0x03B4  0xF064
+epsilon         0x03B5  0xF065
+zeta            0x03B6  0xF07A
+eta             0x03B7  0xF068
+theta           0x03B8  0xF071
+vartheta        0x03D1  0xF04A
+iota            0x03B9  0xF069
+kappa           0x03BA  0xF06B
+lambda          0x03BB  0xF06C
+mu              0x03BC  0xF06D
+nu              0x03BD  0xF06E
+xi              0x03BE  0xF078
+pi              0x03C0  0xF070
+rho             0x03C1  0xF072
+sigma           0x03C3  0xF073
+varsigma        0x03C2  0xF056
+tau             0x03C4  0xF074
+equiv           0x2261  0xF0BA
+Im              0x2111  0xF0C1
+otimes          0x2297  0xF0C4
+cap             0x2229  0xF0C7
+supset          0x2283  0xF0C9
+int             0x222B  0xF0F2
+rfloor          0x230B  0xF0FB
+lfloor          0x230A  0xF0EB
+perp            0x22A5  0xF05E
+wedge           0x2227  0xF0D9
+rceil           0x2309  0xF0F9
+vee             0x2228  0xF0DA
+langle          0x27E8  0xF0E1
+
+upsilon         0x03C5  0xF075
+phi             0x03C6  0xF066
+chi             0x03C7  0xF063
+psi             0x03C8  0xF079
+omega           0x03C9  0xF077
+Gamma           0x0393  0xF047
+Delta           0x0394  0xF044
+Theta           0x0398  0xF051
+Lambda          0x039B  0xF04C
+Xi              0x039E  0xF058
+Pi              0x03A0  0xF050
+Sigma           0x03A3  0xF053
+Upsilon         0x03D2  0xF055
+Phi             0x03A6  0xF046
+Psi             0x03A8  0xF059
+Omega           0x03A9  0xF057
+forall          0x2200  0xF022
+exists          0x2203  0xF024
+ni              0x220B  0xF027
+cong            0x2245  0xF040
+approx          0x2248  0xF0BB
+Re              0x211C  0xF0C2
+oplus           0x2295  0xF0C5
+cup             0x222A  0xF0C8
+subseteq        0x2286  0xF0CD
+in              0x2208  0xF0CE
+lceil           0x2308  0xF0E9
+cdot            0x22C5  0xF0D7
+neg             0x00AC  0xF0D8
+times           0x00D7  0xF0B4
+surd            0x221A  0xF0D6
+varpi           0x03D6  0xF076
+rangle          0x27E9  0xF0F1
+
+sim             0x223C  0xF07E
+leq             0x2264  0xF0A3
+infty           0x221E  0xF0A5
+clubsuit        0x2663  0xF0A7
+diamondsuit     0x2666  0xF0A8
+heartsuit       0x2665  0xF0A9
+spadesuit       0x2660  0xF0AA
+leftrightarrow  0x2194  0xF0AB
+leftarrow       0x2190  0xF0AC
+Leftarrow       0x21D0  0xF0DC
+uparrow         0x2191  0xF0AD
+rightarrow      0x2192  0xF0AE
+Rightarrow      0x21D2  0xF0DE
+downarrow       0x2193  0xF0AF
+circ            0x00B0  0xF0B0
+pm              0x00B1  0xF0B1
+geq             0x2265  0xF0B3
+propto          0x221D  0xF0B5
+partial         0x2202  0xF0B6
+bullet          0x2022  0xF0B7
+div             0x00F7  0xF0B8
+neq             0x2260  0xF0B9
+aleph           0x2135  0xF0C0
+wp              0x2118  0xF0C3
+oslash          0x2298  0xF0C6
+supseteq        0x2287  0xF0CA
+subset          0x2282  0xF0CC
+o               0x03BF  0xF0B0
+nabla           0x2207  0xF0D1
+ldots           0x2026  0xF0BC
+prime           0x2032  0xF0A2
+0               0x2205  0xF0C6
+mid             0x2223  0xF0BD
+copyright       0x00A9  0xF0E3
--- a/libinterp/corefcn/pager.cc
+++ b/libinterp/corefcn/pager.cc
@@ -654,9 +654,9 @@
 buffers its output and waits until just before the prompt is printed to\n\
 flush it to the pager.\n\
 \n\
-When called from inside a function with the \"local\" option, the variable is\n\
-changed locally for the function and any subroutines it calls.  The original\n\
-variable value is restored when exiting the function.\n\
+When called from inside a function with the @qcode{\"local\"} option, the\n\
+variable is changed locally for the function and any subroutines it calls.  \n\
+The original variable value is restored when exiting the function.\n\
 @seealso{page_screen_output, more, PAGER, PAGER_FLAGS}\n\
 @end deftypefn")
 {
@@ -674,9 +674,9 @@
 (such as @code{less}---see @ref{Installation}) are also capable of moving\n\
 backward on the output.\n\
 \n\
-When called from inside a function with the \"local\" option, the variable is\n\
-changed locally for the function and any subroutines it calls.  The original\n\
-variable value is restored when exiting the function.\n\
+When called from inside a function with the @qcode{\"local\"} option, the\n\
+variable is changed locally for the function and any subroutines it calls.  \n\
+The original variable value is restored when exiting the function.\n\
 @seealso{more, page_output_immediately, PAGER, PAGER_FLAGS}\n\
 @end deftypefn")
 {
@@ -690,13 +690,13 @@
 @deftypefnx {Built-in Function} {} PAGER (@var{new_val}, \"local\")\n\
 Query or set the internal variable that specifies the program to use\n\
 to display terminal output on your system.  The default value is\n\
-normally @code{\"less\"}, @code{\"more\"}, or\n\
-@code{\"pg\"}, depending on what programs are installed on your system.\n\
+normally @qcode{\"less\"}, @qcode{\"more\"}, or\n\
+@qcode{\"pg\"}, depending on what programs are installed on your system.\n\
 @xref{Installation}.\n\
 \n\
-When called from inside a function with the \"local\" option, the variable is\n\
-changed locally for the function and any subroutines it calls.  The original\n\
-variable value is restored when exiting the function.\n\
+When called from inside a function with the @qcode{\"local\"} option, the\n\
+variable is changed locally for the function and any subroutines it calls.  \n\
+The original variable value is restored when exiting the function.\n\
 @seealso{PAGER_FLAGS, page_output_immediately, more, page_screen_output}\n\
 @end deftypefn")
 {
@@ -711,9 +711,9 @@
 Query or set the internal variable that specifies the options to pass\n\
 to the pager.\n\
 \n\
-When called from inside a function with the \"local\" option, the variable is\n\
-changed locally for the function and any subroutines it calls.  The original\n\
-variable value is restored when exiting the function.\n\
+When called from inside a function with the @qcode{\"local\"} option, the\n\
+variable is changed locally for the function and any subroutines it calls.  \n\
+The original variable value is restored when exiting the function.\n\
 @seealso{PAGER, more, page_screen_output, page_output_immediately}\n\
 @end deftypefn")
 {
--- a/libinterp/corefcn/pinv.cc
+++ b/libinterp/corefcn/pinv.cc
@@ -172,12 +172,12 @@
 
 /*
 %!shared a, b, tol, hitol, d, u, x, y
-%! a = reshape (rand*[1:16], 4, 4);   ## Rank 2 matrix
+%! a = reshape (rand*[1:16], 4, 4);  # Rank 2 matrix
 %! b = pinv (a);
 %! tol = 4e-14;
 %! hitol = 40*sqrt (eps);
 %! d = diag ([rand, rand, hitol, hitol]);
-%! u = rand (4);                      ## Could be singular by freak accident
+%! u = rand (4);                     # Could be singular by freak accident
 %! x = inv (u)*d*u;
 %! y = pinv (x, sqrt (eps));
 %!
--- a/libinterp/corefcn/pr-output.cc
+++ b/libinterp/corefcn/pr-output.cc
@@ -3982,9 +3982,9 @@
 this reason, you should be careful when setting\n\
 @code{fixed_point_format} to a nonzero value.\n\
 \n\
-When called from inside a function with the \"local\" option, the variable is\n\
-changed locally for the function and any subroutines it calls.  The original\n\
-variable value is restored when exiting the function.\n\
+When called from inside a function with the @qcode{\"local\"} option, the\n\
+variable is changed locally for the function and any subroutines it calls.  \n\
+The original variable value is restored when exiting the function.\n\
 @seealso{format, output_max_field_width, output_precision}\n\
 @end deftypefn")
 {
@@ -4011,9 +4011,9 @@
 ans = [](3x0)\n\
 @end example\n\
 \n\
-When called from inside a function with the \"local\" option, the variable is\n\
-changed locally for the function and any subroutines it calls.  The original\n\
-variable value is restored when exiting the function.\n\
+When called from inside a function with the @qcode{\"local\"} option, the\n\
+variable is changed locally for the function and any subroutines it calls.  \n\
+The original variable value is restored when exiting the function.\n\
 @seealso{format}\n\
 @end deftypefn")
 {
@@ -4049,9 +4049,9 @@
 @end group\n\
 @end example\n\
 \n\
-When called from inside a function with the \"local\" option, the variable is\n\
-changed locally for the function and any subroutines it calls.  The original\n\
-variable value is restored when exiting the function.\n\
+When called from inside a function with the @qcode{\"local\"} option, the\n\
+variable is changed locally for the function and any subroutines it calls.  \n\
+The original variable value is restored when exiting the function.\n\
 @seealso{format}\n\
 @end deftypefn")
 {
@@ -4066,9 +4066,9 @@
 Query or set the internal variable that specifies the maximum width\n\
 of a numeric output field.\n\
 \n\
-When called from inside a function with the \"local\" option, the variable is\n\
-changed locally for the function and any subroutines it calls.  The original\n\
-variable value is restored when exiting the function.\n\
+When called from inside a function with the @qcode{\"local\"} option, the\n\
+variable is changed locally for the function and any subroutines it calls.  \n\
+The original variable value is restored when exiting the function.\n\
 @seealso{format, fixed_point_format, output_precision}\n\
 @end deftypefn")
 {
@@ -4084,9 +4084,9 @@
 Query or set the internal variable that specifies the minimum number of\n\
 significant figures to display for numeric output.\n\
 \n\
-When called from inside a function with the \"local\" option, the variable is\n\
-changed locally for the function and any subroutines it calls.  The original\n\
-variable value is restored when exiting the function.\n\
+When called from inside a function with the @qcode{\"local\"} option, the\n\
+variable is changed locally for the function and any subroutines it calls.  \n\
+The original variable value is restored when exiting the function.\n\
 @seealso{format, fixed_point_format, output_max_field_width}\n\
 @end deftypefn")
 {
--- a/libinterp/corefcn/pt-jit.cc
+++ b/libinterp/corefcn/pt-jit.cc
@@ -2316,9 +2316,9 @@
 Query or set the internal variable that determines whether\n\
 debugging/tracing is enabled for Octave's JIT compiler.\n\
 \n\
-When called from inside a function with the \"local\" option, the variable is\n\
-changed locally for the function and any subroutines it calls.  The original\n\
-variable value is restored when exiting the function.\n\
+When called from inside a function with the @qcode{\"local\"} option, the\n\
+variable is changed locally for the function and any subroutines it calls.  \n\
+The original variable value is restored when exiting the function.\n\
 @seealso{jit_enable, jit_startcnt}\n\
 @end deftypefn")
 {
@@ -2337,9 +2337,9 @@
 @deftypefnx {Built-in Function} {} jit_enable (@var{new_val}, \"local\")\n\
 Query or set the internal variable that enables Octave's JIT compiler.\n\
 \n\
-When called from inside a function with the \"local\" option, the variable is\n\
-changed locally for the function and any subroutines it calls.  The original\n\
-variable value is restored when exiting the function.\n\
+When called from inside a function with the @qcode{\"local\"} option, the\n\
+variable is changed locally for the function and any subroutines it calls.  \n\
+The original variable value is restored when exiting the function.\n\
 @seealso{jit_startcnt, debug_jit}\n\
 @end deftypefn")
 {
@@ -2361,9 +2361,9 @@
 operation it does not make sense to employ JIT when the loop count is low.\n\
 By default only loops with greater than 1000 iterations will be accelerated.\n\
 \n\
-When called from inside a function with the \"local\" option, the variable is\n\
-changed locally for the function and any subroutines it calls.  The original\n\
-variable value is restored when exiting the function.\n\
+When called from inside a function with the @qcode{\"local\"} option, the\n\
+variable is changed locally for the function and any subroutines it calls.  \n\
+The original variable value is restored when exiting the function.\n\
 @seealso{jit_enable, debug_jit}\n\
 @end deftypefn")
 {
--- a/libinterp/corefcn/qz.cc
+++ b/libinterp/corefcn/qz.cc
@@ -346,20 +346,20 @@
 of the revised pencil contains all eigenvalues that satisfy:\n\
 \n\
 @table @asis\n\
-@item \"N\"\n\
+@item @qcode{\"N\"}\n\
 = unordered (default)\n\
 \n\
-@item \"S\"\n\
+@item @qcode{\"S\"}\n\
 = small: leading block has all |lambda| @leq{} 1\n\
 \n\
-@item \"B\"\n\
+@item @qcode{\"B\"}\n\
 = big: leading block has all |lambda| @geq{} 1\n\
 \n\
-@item \"-\"\n\
+@item @qcode{\"-\"}\n\
 = negative real part: leading block has all eigenvalues\n\
 in the open left half-plane\n\
 \n\
-@item \"+\"\n\
+@item @qcode{\"+\"}\n\
 = non-negative real part: leading block has all eigenvalues\n\
 in the closed right half-plane\n\
 @end table\n\
--- a/libinterp/corefcn/rand.cc
+++ b/libinterp/corefcn/rand.cc
@@ -49,7 +49,7 @@
 
 /*
 %!shared __random_statistical_tests__
-%! # Flag whether the statistical tests should be run in "make check" or not
+%! ## Flag whether the statistical tests should be run in "make check" or not
 %! __random_statistical_tests__ = 0;
 */
 
@@ -424,7 +424,7 @@
 random numbers with a significantly longer cycle time.  However, in\n\
 some circumstances it might be desirable to obtain the same random\n\
 sequences as used by the old generators.  To do this the keyword\n\
-\"seed\" is used to specify that the old generators should be use,\n\
+@qcode{\"seed\"} is used to specify that the old generators should be use,\n\
 as in\n\
 \n\
 @example\n\
@@ -442,13 +442,15 @@
 However, it should be noted that querying the seed will not cause\n\
 @code{rand} to use the old generators, only setting the seed will.\n\
 To cause @code{rand} to once again use the new generators, the\n\
-keyword \"state\" should be used to reset the state of the @code{rand}.\n\
+keyword @qcode{\"state\"} should be used to reset the state of the\n\
+@code{rand}.\n\
 \n\
 The state or seed of the generator can be reset to a new random value\n\
-using the \"reset\" keyword.\n\
+using the @qcode{\"reset\"} keyword.\n\
 \n\
-The class of the value returned can be controlled by a trailing \"double\"\n\
-or \"single\" argument.  These are the only valid classes.\n\
+The class of the value returned can be controlled by a trailing\n\
+@qcode{\"double\"} or @qcode{\"single\"} argument.  These are the only valid\n\
+classes.\n\
 @seealso{randn, rande, randg, randp}\n\
 @end deftypefn")
 {
@@ -500,16 +502,16 @@
 
 /*
 %!test
-%! # Test fixed state
+%! ## Test fixed state
 %! rand ("state", 1);
 %! assert (rand (1,6), [0.1343642441124013 0.8474337369372327 0.763774618976614 0.2550690257394218 0.495435087091941 0.4494910647887382], 1e-6);
 %!test
-%! # Test fixed seed
+%! ## Test fixed seed
 %! rand ("seed", 1);
 %! assert (rand (1,6), [0.8668024251237512 0.9126510815694928 0.09366085007786751 0.1664607301354408 0.7408077004365623 0.7615650338120759], 1e-6);
 %!test
 %! if (__random_statistical_tests__)
-%!   # statistical tests may fail occasionally.
+%!   ## statistical tests may fail occasionally.
 %!   rand ("state", 12);
 %!   x = rand (100000, 1);
 %!   assert (max (x) < 1);   #*** Please report this!!! ***
@@ -521,7 +523,7 @@
 %! endif
 %!test
 %! if (__random_statistical_tests__)
-%!   # statistical tests may fail occasionally.
+%!   ## statistical tests may fail occasionally.
 %!   rand ("seed", 12);
 %!   x = rand (100000, 1);
 %!   assert (max (x) < 1);   #*** Please report this!!! ***
@@ -568,8 +570,9 @@
 By default, @code{randn} uses the Marsaglia and Tsang ``Ziggurat technique''\n\
 to transform from a uniform to a normal distribution.\n\
 \n\
-The class of the value returned can be controlled by a trailing \"double\"\n\
-or \"single\" argument.  These are the only valid classes.\n\
+The class of the value returned can be controlled by a trailing\n\
+@qcode{\"double\"} or @qcode{\"single\"} argument.  These are the only valid\n\
+classes.\n\
 \n\
 Reference: G. Marsaglia and W.W. Tsang,\n\
 @cite{Ziggurat Method for Generating Random Variables},\n\
@@ -590,16 +593,16 @@
 
 /*
 %!test
-%! # Test fixed state
+%! ## Test fixed state
 %! randn ("state", 1);
 %! assert (randn (1, 6), [-2.666521678978671 -0.7381719971724564 1.507903992673601 0.6019427189162239 -0.450661261143348 -0.7054431351574116], 1e-6);
 %!test
-%! # Test fixed seed
+%! ## Test fixed seed
 %! randn ("seed", 1);
 %! assert (randn (1, 6), [-1.039402365684509 -1.25938892364502 0.1968704611063004 0.3874166905879974 -0.5976632833480835 -0.6615074276924133], 1e-6);
 %!test
 %! if (__random_statistical_tests__)
-%!   # statistical tests may fail occasionally.
+%!   ## statistical tests may fail occasionally.
 %!   randn ("state", 12);
 %!   x = randn (100000, 1);
 %!   assert (mean (x), 0, 0.01);
@@ -609,7 +612,7 @@
 %! endif
 %!test
 %! if (__random_statistical_tests__)
-%!   # statistical tests may fail occasionally.
+%!   ## statistical tests may fail occasionally.
 %!   randn ("seed", 12);
 %!   x = randn (100000, 1);
 %!   assert (mean (x), 0, 0.01);
@@ -638,8 +641,9 @@
 By default, @code{randn} uses the Marsaglia and Tsang ``Ziggurat technique''\n\
 to transform from a uniform to an exponential distribution.\n\
 \n\
-The class of the value returned can be controlled by a trailing \"double\"\n\
-or \"single\" argument.  These are the only valid classes.\n\
+The class of the value returned can be controlled by a trailing\n\
+@qcode{\"double\"} or @qcode{\"single\"} argument.  These are the only valid\n\
+classes.\n\
 \n\
 Reference: G. Marsaglia and W.W. Tsang,\n\
 @cite{Ziggurat Method for Generating Random Variables},\n\
@@ -660,16 +664,16 @@
 
 /*
 %!test
-%! # Test fixed state
+%! ## Test fixed state
 %! rande ("state", 1);
 %! assert (rande (1, 6), [3.602973885835625 0.1386190677555021 0.6743112889616958 0.4512830847258422 0.7255744741233175 0.3415969205292291], 1e-6);
 %!test
-%! # Test fixed seed
+%! ## Test fixed seed
 %! rande ("seed", 1);
 %! assert (rande (1, 6), [0.06492075175653866 1.717980206012726 0.4816154008731246 0.5231300676241517 0.103910739364359 1.668931916356087], 1e-6);
 %!test
 %! if (__random_statistical_tests__)
-%!   # statistical tests may fail occasionally
+%!   ## statistical tests may fail occasionally
 %!   rande ("state", 1);
 %!   x = rande (100000, 1);
 %!   assert (min (x) > 0);   # *** Please report this!!! ***
@@ -680,7 +684,7 @@
 %! endif
 %!test
 %! if (__random_statistical_tests__)
-%!   # statistical tests may fail occasionally
+%!   ## statistical tests may fail occasionally
 %!   rande ("seed", 1);
 %!   x = rande (100000, 1);
 %!   assert (min (x)>0);   # *** Please report this!!! ***
@@ -784,8 +788,9 @@
 \n\
 @end table\n\
 \n\
-The class of the value returned can be controlled by a trailing \"double\"\n\
-or \"single\" argument.  These are the only valid classes.\n\
+The class of the value returned can be controlled by a trailing\n\
+@qcode{\"double\"} or @qcode{\"single\"} argument.  These are the only valid\n\
+classes.\n\
 @seealso{rand, randn, rande, randp}\n\
 @end deftypefn")
 {
@@ -807,49 +812,49 @@
 %! assert (randg ([-inf, -1, 0, inf, nan]), [nan, nan, nan, nan, nan]); # *** Please report
 
 %!test
-%! # Test fixed state
+%! ## Test fixed state
 %! randg ("state", 1);
 %! assert (randg (0.1, 1, 6), [0.0103951513331241 8.335671459898252e-05 0.00138691397249762 0.000587308416993855 0.495590518784736 2.3921917414795e-12], 1e-6);
 %!test
-%! # Test fixed state
+%! ## Test fixed state
 %! randg ("state", 1);
 %! assert (randg (0.95, 1, 6), [3.099382433255327 0.3974529788871218 0.644367450750855 1.143261091802246 1.964111762696822 0.04011915547957939], 1e-6);
 %!test
-%! # Test fixed state
+%! ## Test fixed state
 %! randg ("state", 1);
 %! assert (randg (1, 1, 6), [0.2273389379645993 1.288822625058359 0.2406335209340746 1.218869553370733 1.024649860162554 0.09631230343599533], 1e-6);
 %!test
-%! # Test fixed state
+%! ## Test fixed state
 %! randg ("state", 1);
 %! assert (randg (10, 1, 6), [3.520369644331133 15.15369864472106 8.332112081991205 8.406211067432674 11.81193475187611 10.88792728177059], 1e-5);
 %!test
-%! # Test fixed state
+%! ## Test fixed state
 %! randg ("state", 1);
 %! assert (randg (100, 1, 6), [75.34570255262264 115.4911985594699 95.23493031356388 95.48926019250911 106.2397448229803 103.4813150404118], 1e-4);
 %!test
-%! # Test fixed seed
+%! ## Test fixed seed
 %! randg ("seed", 1);
 %! assert (randg (0.1, 1, 6), [0.07144210487604141 0.460641473531723 0.4749028384685516 0.06823389977216721 0.000293838675133884 1.802567535340305e-12], 1e-6);
 %!test
-%! # Test fixed seed
+%! ## Test fixed seed
 %! randg ("seed", 1);
 %! assert (randg (0.95, 1, 6), [1.664905071258545 1.879976987838745 1.905677795410156 0.9948706030845642 0.5606933236122131 0.0766092911362648], 1e-6);
 %!test
-%! # Test fixed seed
+%! ## Test fixed seed
 %! randg ("seed", 1);
 %! assert (randg (1, 1, 6), [0.03512085229158401 0.6488978862762451 0.8114678859710693 0.1666885763406754 1.60791552066803 1.90356981754303], 1e-6);
 %!test
-%! # Test fixed seed
+%! ## Test fixed seed
 %! randg ("seed", 1);
 %! assert (randg (10, 1, 6), [6.566435813903809 10.11648464202881 10.73162078857422 7.747178077697754 6.278522491455078 6.240195751190186], 1e-5);
 %!test
-%! # Test fixed seed
+%! ## Test fixed seed
 %! randg ("seed", 1);
 %! assert (randg (100, 1, 6), [89.40208435058594 101.4734725952148 103.4020004272461 93.62763214111328 88.33104705810547 88.1871337890625], 1e-4);
 
 %!test
 %! if (__random_statistical_tests__)
-%!   # statistical tests may fail occasionally.
+%!   ## statistical tests may fail occasionally.
 %!   randg ("state", 12);
 %!   a = 0.1;
 %!   x = randg (a, 100000, 1);
@@ -860,7 +865,7 @@
 %! endif
 %!test
 %! if (__random_statistical_tests__)
-%!   # statistical tests may fail occasionally.
+%!   ## statistical tests may fail occasionally.
 %!   randg ("state", 12);
 %!   a = 0.95;
 %!   x = randg (a, 100000, 1);
@@ -871,7 +876,7 @@
 %! endif
 %!test
 %! if (__random_statistical_tests__)
-%!   # statistical tests may fail occasionally.
+%!   ## statistical tests may fail occasionally.
 %!   randg ("state", 12);
 %!   a = 1;
 %!   x = randg (a, 100000, 1);
@@ -882,7 +887,7 @@
 %! endif
 %!test
 %! if (__random_statistical_tests__)
-%!   # statistical tests may fail occasionally.
+%!   ## statistical tests may fail occasionally.
 %!   randg ("state", 12);
 %!   a = 10;
 %!   x = randg (a, 100000, 1);
@@ -893,7 +898,7 @@
 %! endif
 %!test
 %! if (__random_statistical_tests__)
-%!   # statistical tests may fail occasionally.
+%!   ## statistical tests may fail occasionally.
 %!   randg ("state", 12);
 %!   a = 100;
 %!   x = randg (a, 100000, 1);
@@ -907,7 +912,7 @@
 %!assert (randg ([-inf, -1, 0, inf, nan]), [nan, nan, nan, nan, nan]) # *** Please report
 %!test
 %! if (__random_statistical_tests__)
-%!   # statistical tests may fail occasionally.
+%!   ## statistical tests may fail occasionally.
 %!   randg ("seed", 12);
 %!   a = 0.1;
 %!   x = randg (a, 100000, 1);
@@ -918,7 +923,7 @@
 %! endif
 %!test
 %! if (__random_statistical_tests__)
-%!   # statistical tests may fail occasionally.
+%!   ## statistical tests may fail occasionally.
 %!   randg ("seed", 12);
 %!   a = 0.95;
 %!   x = randg (a, 100000, 1);
@@ -929,7 +934,7 @@
 %! endif
 %!test
 %! if (__random_statistical_tests__)
-%!   # statistical tests may fail occasionally.
+%!   ## statistical tests may fail occasionally.
 %!   randg ("seed", 12);
 %!   a = 1;
 %!   x = randg (a, 100000, 1);
@@ -940,7 +945,7 @@
 %! endif
 %!test
 %! if (__random_statistical_tests__)
-%!   # statistical tests may fail occasionally.
+%!   ## statistical tests may fail occasionally.
 %!   randg ("seed", 12);
 %!   a = 10;
 %!   x = randg (a, 100000, 1);
@@ -951,7 +956,7 @@
 %! endif
 %!test
 %! if (__random_statistical_tests__)
-%!   # statistical tests may fail occasionally.
+%!   ## statistical tests may fail occasionally.
 %!   randg ("seed", 12);
 %!   a = 100;
 %!   x = randg (a, 100000, 1);
@@ -1006,8 +1011,9 @@
 D 50 p1284, 1994.\n\
 @end table\n\
 \n\
-The class of the value returned can be controlled by a trailing \"double\"\n\
-or \"single\" argument.  These are the only valid classes.\n\
+The class of the value returned can be controlled by a trailing\n\
+@qcode{\"double\"} or @qcode{\"single\"} argument.  These are the only valid\n\
+classes.\n\
 @seealso{rand, randn, rande, randg}\n\
 @end deftypefn")
 {
@@ -1028,33 +1034,33 @@
 %! randp ("state", 12);
 %! assert (randp ([-inf, -1, 0, inf, nan]), [nan, nan, 0, nan, nan]);   # *** Please report
 %!test
-%! # Test fixed state
+%! ## Test fixed state
 %! randp ("state", 1);
 %! assert (randp (5, 1, 6), [5 5 3 7 7 3])
 %!test
-%! # Test fixed state
+%! ## Test fixed state
 %! randp ("state", 1);
 %! assert (randp (15, 1, 6), [13 15 8 18 18 15])
 %!test
-%! # Test fixed state
+%! ## Test fixed state
 %! randp ("state", 1);
 %! assert (randp (1e9, 1, 6), [999915677 999976657 1000047684 1000019035 999985749 999977692], -1e-6)
 %!test
-%! # Test fixed state
+%! ## Test fixed state
 %! randp ("seed", 1);
 %! %%assert (randp (5, 1, 6), [8 2 3 6 6 8])
 %! assert (randp (5, 1, 5), [8 2 3 6 6])
 %!test
-%! # Test fixed state
+%! ## Test fixed state
 %! randp ("seed", 1);
 %! assert (randp (15, 1, 6), [15 16 12 10 10 12])
 %!test
-%! # Test fixed state
+%! ## Test fixed state
 %! randp ("seed", 1);
 %! assert (randp (1e9, 1, 6), [1000006208 1000012224 999981120 999963520 999963072 999981440], -1e-6)
 %!test
 %! if (__random_statistical_tests__)
-%!   # statistical tests may fail occasionally.
+%!   ## statistical tests may fail occasionally.
 %!   randp ("state", 12);
 %!   for a = [5, 15, 1e9; 0.03, 0.03, -5e-3; 0.03, 0.03, 0.03]
 %!     x = randp (a (1), 100000, 1);
@@ -1067,7 +1073,7 @@
 %! endif
 %!test
 %! if (__random_statistical_tests__)
-%!   # statistical tests may fail occasionally.
+%!   ## statistical tests may fail occasionally.
 %!   randp ("state", 12);
 %!   for a = [5, 15, 1e9; 0.03, 0.03, -5e-3; 0.03, 0.03, 0.03]
 %!     x = randp (a(1)*ones (100000, 1), 100000, 1);
@@ -1083,7 +1089,7 @@
 %! assert (randp ([-inf, -1, 0, inf, nan]), [nan, nan, 0, nan, nan]);   # *** Please report
 %!test
 %! if (__random_statistical_tests__)
-%!   # statistical tests may fail occasionally.
+%!   ## statistical tests may fail occasionally.
 %!   randp ("seed", 12);
 %!   for a = [5, 15, 1e9; 0.03, 0.03, -5e-3; 0.03, 0.03, 0.03]
 %!     x = randp (a(1), 100000, 1);
@@ -1096,7 +1102,7 @@
 %! endif
 %!test
 %! if (__random_statistical_tests__)
-%!   # statistical tests may fail occasionally.
+%!   ## statistical tests may fail occasionally.
 %!   randp ("seed", 12);
 %!   for a = [5, 15, 1e9; 0.03, 0.03, -5e-3; 0.03, 0.03, 0.03]
 %!     x = randp (a(1)*ones (100000, 1), 100000, 1);
--- a/libinterp/corefcn/regexp.cc
+++ b/libinterp/corefcn/regexp.cc
@@ -677,7 +677,7 @@
 @end table\n\
 \n\
 Implementation Note: For compatibility with @sc{matlab}, ordinary escape\n\
-sequences (e.g., \"\\n\" => newline) are processed in @var{pat}\n\
+sequences (e.g., @qcode{\"\\n\"} => newline) are processed in @var{pat}\n\
 regardless of whether @var{pat} has been defined within single quotes.  Use\n\
 a second backslash to stop interpolation of the escape sequence (e.g.,\n\
 \"\\\\n\") or use the @code{regexptranslate} function.\n\
@@ -717,13 +717,13 @@
 are\n\
 \n\
 @multitable @columnfractions 0.2 0.3 0.3 0.2\n\
-@item @tab 'start'        @tab @var{s}  @tab\n\
-@item @tab 'end'          @tab @var{e}  @tab\n\
-@item @tab 'tokenExtents' @tab @var{te} @tab\n\
-@item @tab 'match'        @tab @var{m}  @tab\n\
-@item @tab 'tokens'       @tab @var{t}  @tab\n\
-@item @tab 'names'        @tab @var{nm} @tab\n\
-@item @tab 'split'        @tab @var{sp} @tab\n\
+@item @tab @qcode{'start'}        @tab @var{s}  @tab\n\
+@item @tab @qcode{'end'}          @tab @var{e}  @tab\n\
+@item @tab @qcode{'tokenExtents'} @tab @var{te} @tab\n\
+@item @tab @qcode{'match'}        @tab @var{m}  @tab\n\
+@item @tab @qcode{'tokens'}       @tab @var{t}  @tab\n\
+@item @tab @qcode{'names'}        @tab @var{nm} @tab\n\
+@item @tab @qcode{'split'}        @tab @var{sp} @tab\n\
 @end multitable\n\
 \n\
 Additional arguments are summarized below.\n\
@@ -782,8 +782,8 @@
 @item emptymatch\n\
 Return zero-length matches.\n\
 \n\
-@code{regexp ('a', 'b*', 'emptymatch'} returns @code{[1 2]} because there are\n\
-zero or more 'b' characters at positions 1 and end-of-string.\n\
+@code{regexp ('a', 'b*', 'emptymatch')} returns @code{[1 2]} because there\n\
+are zero or more @qcode{'b'} characters at positions 1 and end-of-string.\n\
 \n\
 @end table\n\
 @seealso{regexpi, strfind, regexprep}\n\
@@ -925,7 +925,7 @@
 
 ## Tests for named tokens
 %!test
-%! # Parenthesis in named token (ie (int)) causes a problem
+%! ## Parenthesis in named token (ie (int)) causes a problem
 %! assert (regexp ('qwe int asd', ['(?<typestr>(int))'], 'names'), struct ('typestr', 'int'));
 
 %!test
@@ -1309,7 +1309,7 @@
 @end table\n\
 \n\
 Implementation Note: For compatibility with @sc{matlab}, ordinary escape\n\
-sequences (e.g., \"\\n\" => newline) are processed in both @var{pat}\n\
+sequences (e.g., @qcode{\"\\n\"} => newline) are processed in both @var{pat}\n\
 and @var{repstr} regardless of whether they were defined within single\n\
 quotes.  Use a second backslash to stop interpolation of the escape sequence\n\
 (e.g., \"\\\\n\") or use the @code{regexptranslate} function.\n\
--- a/libinterp/corefcn/schur.cc
+++ b/libinterp/corefcn/schur.cc
@@ -107,7 +107,8 @@
 blocks, when appropriate) are the eigenvalues of @var{A} and @var{S}.\n\
 \n\
 The default for real matrices is a real Schur@tie{}decomposition.\n\
-A complex decomposition may be forced by passing the flag \"complex\".\n\
+A complex decomposition may be forced by passing the flag\n\
+@qcode{\"complex\"}.\n\
 \n\
 The eigenvalues are optionally ordered along the diagonal according to\n\
 the value of @var{opt}.  @code{@var{opt} = \"a\"} indicates that all\n\
@@ -305,7 +306,7 @@
 $U^{\\dagger} U$ is the identity matrix I.\n\
 @end tex\n\
 @ifnottex\n\
-@xcode{@var{UR} * @var{TR} * @var{UR}' = @var{U} * @var{T} * @var{U}'} and\n\
+@tcode{@var{UR} * @var{TR} * @var{UR}' = @var{U} * @var{T} * @var{U}'} and\n\
 @code{@var{U}' * @var{U}} is the identity matrix I.\n\
 @end ifnottex\n\
 \n\
--- a/libinterp/corefcn/sighandlers.cc
+++ b/libinterp/corefcn/sighandlers.cc
@@ -908,9 +908,9 @@
 generated with @kbd{C-c}).  If a second interrupt signal is received\n\
 before reaching the debugging mode, a normal interrupt will occur.\n\
 \n\
-When called from inside a function with the \"local\" option, the variable is\n\
-changed locally for the function and any subroutines it calls.  The original\n\
-variable value is restored when exiting the function.\n\
+When called from inside a function with the @qcode{\"local\"} option, the\n\
+variable is changed locally for the function and any subroutines it calls.  \n\
+The original variable value is restored when exiting the function.\n\
 @seealso{debug_on_error, debug_on_warning}\n\
 @end deftypefn")
 {
@@ -935,12 +935,12 @@
 @deftypefnx {Built-in Function} {@var{old_val} =} sighup_dumps_octave_core (@var{new_val})\n\
 @deftypefnx {Built-in Function} {} sighup_dumps_octave_core (@var{new_val}, \"local\")\n\
 Query or set the internal variable that controls whether Octave tries\n\
-to save all current variables to the file \"octave-workspace\" if it receives\n\
-a hangup signal.\n\
+to save all current variables to the file @file{octave-workspace} if it\n\
+receives a hangup signal.\n\
 \n\
-When called from inside a function with the \"local\" option, the variable is\n\
-changed locally for the function and any subroutines it calls.  The original\n\
-variable value is restored when exiting the function.\n\
+When called from inside a function with the @qcode{\"local\"} option, the\n\
+variable is changed locally for the function and any subroutines it calls.  \n\
+The original variable value is restored when exiting the function.\n\
 @end deftypefn")
 {
   return SET_INTERNAL_VARIABLE (sighup_dumps_octave_core);
@@ -964,12 +964,12 @@
 @deftypefnx {Built-in Function} {@var{old_val} =} sigterm_dumps_octave_core (@var{new_val})\n\
 @deftypefnx {Built-in Function} {} sigterm_dumps_octave_core (@var{new_val}, \"local\")\n\
 Query or set the internal variable that controls whether Octave tries\n\
-to save all current variables to the file \"octave-workspace\" if it receives\n\
-a terminate signal.\n\
+to save all current variables to the file @file{octave-workspace} if it\n\
+receives a terminate signal.\n\
 \n\
-When called from inside a function with the \"local\" option, the variable is\n\
-changed locally for the function and any subroutines it calls.  The original\n\
-variable value is restored when exiting the function.\n\
+When called from inside a function with the @qcode{\"local\"} option, the\n\
+variable is changed locally for the function and any subroutines it calls.  \n\
+The original variable value is restored when exiting the function.\n\
 @end deftypefn")
 {
   return SET_INTERNAL_VARIABLE (sigterm_dumps_octave_core);
--- a/libinterp/corefcn/sparse.cc
+++ b/libinterp/corefcn/sparse.cc
@@ -91,8 +91,9 @@
 @end group\n\
 @end example\n\
 \n\
-Given the option \"unique\". if more than two values are specified for the\n\
-same @var{i}, @var{j} indices, the last specified value will be used.\n\
+Given the option @qcode{\"unique\"}, if more than two values are specified\n\
+for the same @var{i}, @var{j} indices, the last specified value will be\n\
+used.\n\
 \n\
 @code{sparse (@var{m}, @var{n})} is equivalent to\n\
 @code{sparse ([], [], [], @var{m}, @var{n}, 0)}\n\
--- a/libinterp/corefcn/spparms.cc
+++ b/libinterp/corefcn/spparms.cc
@@ -97,9 +97,9 @@
 The value of individual keys can be set with\n\
 @code{spparms (@var{key}, @var{val})}.\n\
 The default values can be restored with the special keyword\n\
-\"defaults\".  The special keyword \"tight\" can be used to set the mmd\n\
-solvers to attempt a sparser solution at the potential cost of longer\n\
-running time.\n\
+@qcode{\"defaults\"}.  The special keyword @qcode{\"tight\"} can be used to\n\
+set the mmd solvers to attempt a sparser solution at the potential cost of\n\
+longer running time.\n\
 @end deftypefn")
 {
   octave_value_list retval;
--- a/libinterp/corefcn/sqrtm.cc
+++ b/libinterp/corefcn/sqrtm.cc
@@ -272,5 +272,5 @@
 %! z = eye (4);  z(2,2) = z(3,3) = 2^-13;  z(1,4) = 0.5;
 %! [y, err] = sqrtm (x);
 %! assert (y, z);
-%! assert (err, 0);   ## Yes, this one has to hold exactly
+%! assert (err, 0);   # Yes, this one has to hold exactly
 */
--- a/libinterp/corefcn/str2double.cc
+++ b/libinterp/corefcn/str2double.cc
@@ -300,7 +300,7 @@
 Convert a string to a real or complex number.\n\
 \n\
 The string must be in one of the following formats where\n\
-a and b are real numbers and the complex unit is 'i' or 'j':\n\
+a and b are real numbers and the complex unit is @qcode{'i'} or @qcode{'j'}:\n\
 \n\
 @itemize\n\
 @item a + bi\n\
@@ -317,9 +317,9 @@
 @end itemize\n\
 \n\
 If present, a and/or b are of the form @nospell{[+-]d[,.]d[[eE][+-]d]} where\n\
-the brackets indicate optional arguments and 'd' indicates zero or more\n\
-digits.  The special input values @code{Inf}, @code{NaN}, and @code{NA} are\n\
-also accepted.\n\
+the brackets indicate optional arguments and @qcode{'d'} indicates zero or\n\
+more digits.  The special input values @code{Inf}, @code{NaN}, and @code{NA}\n\
+are also accepted.\n\
 \n\
 @var{s} may also be a character matrix, in which case the conversion is\n\
 repeated for each row.  Or @var{s} may be a cell array of strings, in which\n\
--- a/libinterp/corefcn/svd.cc
+++ b/libinterp/corefcn/svd.cc
@@ -408,12 +408,12 @@
 @deftypefnx {Built-in Function} {@var{old_val} =} svd_driver (@var{new_val})\n\
 @deftypefnx {Built-in Function} {} svd_driver (@var{new_val}, \"local\")\n\
 Query or set the underlying @sc{lapack} driver used by @code{svd}.\n\
-Currently recognized values are \"gesvd\" and \"gesdd\".  The default\n\
-is \"gesvd\".\n\
+Currently recognized values are @qcode{\"gesvd\"} and @qcode{\"gesdd\"}.  \n\
+The default is @qcode{\"gesvd\"}.\n\
 \n\
-When called from inside a function with the \"local\" option, the variable is\n\
-changed locally for the function and any subroutines it calls.  The original\n\
-variable value is restored when exiting the function.\n\
+When called from inside a function with the @qcode{\"local\"} option, the\n\
+variable is changed locally for the function and any subroutines it calls.  \n\
+The original variable value is restored when exiting the function.\n\
 @seealso{svd}\n\
 @end deftypefn")
 {
--- a/libinterp/corefcn/symtab.cc
+++ b/libinterp/corefcn/symtab.cc
@@ -1527,14 +1527,14 @@
 @deftypefnx {Built-in Function} {@var{old_val} =} ignore_function_time_stamp (@var{new_val})\n\
 Query or set the internal variable that controls whether Octave checks\n\
 the time stamp on files each time it looks up functions defined in\n\
-function files.  If the internal variable is set to @code{\"system\"},\n\
+function files.  If the internal variable is set to @qcode{\"system\"},\n\
 Octave will not automatically recompile function files in subdirectories of\n\
 @file{@var{octave-home}/lib/@var{version}} if they have changed since\n\
 they were last compiled, but will recompile other function files in the\n\
-search path if they change.  If set to @code{\"all\"}, Octave will not\n\
+search path if they change.  If set to @qcode{\"all\"}, Octave will not\n\
 recompile any function files unless their definitions are removed with\n\
-@code{clear}.  If set to \"none\", Octave will always check time stamps\n\
-on files to determine whether functions defined in function files\n\
+@code{clear}.  If set to @qcode{\"none\"}, Octave will always check time\n\
+stamps on files to determine whether functions defined in function files\n\
 need to recompiled.\n\
 @end deftypefn")
 {
--- a/libinterp/corefcn/syscalls.cc
+++ b/libinterp/corefcn/syscalls.cc
@@ -283,7 +283,7 @@
    @print{} are\n\
 @end example\n\
 \n\
-Note that @code{popen2}, unlike @code{popen}, will not \"reap\" the\n\
+Note that @code{popen2}, unlike @code{popen}, will not @qcode{\"reap\"} the\n\
 child process.  If you don't use @code{waitpid} to check the child's\n\
 exit status, it will linger until Octave exits.\n\
 @end deftypefn")
@@ -900,9 +900,9 @@
 \n\
 @item mode\n\
 File mode, as an integer.  Use the functions @w{@code{S_ISREG}},\n\
-@w{@code{S_ISDIR}}, @w{@code{S_ISCHR}}, @w{@code{S_ISBLK}}, @w{@code{S_ISFIFO}},\n\
-@w{@code{S_ISLNK}}, or @w{@code{S_ISSOCK}} to extract information from this\n\
-value.\n\
+@w{@code{S_ISDIR}}, @w{@code{S_ISCHR}}, @w{@code{S_ISBLK}},\n\
+@w{@code{S_ISFIFO}}, @w{@code{S_ISLNK}}, or @w{@code{S_ISSOCK}} to extract\n\
+information from this value.\n\
 \n\
 @item modestr\n\
 File mode, as a string of ten letters or dashes as would be returned by\n\
--- a/libinterp/corefcn/toplev.cc
+++ b/libinterp/corefcn/toplev.cc
@@ -916,11 +916,11 @@
 @deftypefnx {Built-in Function} {} system (\"@var{string}\", @var{return_output}, @var{type})\n\
 @deftypefnx {Built-in Function} {[@var{status}, @var{output}] =} system (@dots{})\n\
 Execute a shell command specified by @var{string}.\n\
-If the optional argument @var{type} is \"async\", the process\n\
+If the optional argument @var{type} is @qcode{\"async\"}, the process\n\
 is started in the background and the process ID of the child process\n\
 is returned immediately.  Otherwise, the child process is started and\n\
 Octave waits until it exits.  If the @var{type} argument is omitted, it\n\
-defaults to the value \"sync\".\n\
+defaults to the value @qcode{\"sync\"}.\n\
 \n\
 If @var{system} is called with one or more output arguments, or if the\n\
 optional argument @var{return_output} is true and the subprocess is started\n\
@@ -1142,7 +1142,7 @@
 @end example\n\
 \n\
 @noindent\n\
-will print the message \"Bye bye\" when Octave exits.\n\
+will print the message @qcode{\"Bye bye\"} when Octave exits.\n\
 \n\
 The additional argument @var{flag} will register or unregister\n\
 @var{fcn} from the list of functions to be called when Octave\n\
--- a/libinterp/corefcn/tril.cc
+++ b/libinterp/corefcn/tril.cc
@@ -386,9 +386,9 @@
 @end group\n\
 @end example\n\
 \n\
-If the option \"pack\" is given as third argument, the extracted elements\n\
-are not inserted into a matrix, but rather stacked column-wise one above\n\
-other.\n\
+If the option @qcode{\"pack\"} is given as third argument, the extracted\n\
+elements are not inserted into a matrix, but rather stacked column-wise one\n\
+above other.\n\
 @seealso{diag}\n\
 @end deftypefn")
 {
--- a/libinterp/corefcn/txt-eng-ft.cc
+++ b/libinterp/corefcn/txt-eng-ft.cc
@@ -10,7 +10,7 @@
 option) any later version.
 
 Octave is distributed in the hope that it will be useful, but WITHOUT
-ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or<
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 for more details.
 
@@ -31,6 +31,8 @@
 #endif
 
 #include <iostream>
+#include <map>
+#include <utility>
 
 #include "singleton-cleanup.h"
 
@@ -42,18 +44,18 @@
 // combination.
 
 static void
-gripe_missing_glyph (char c)
+gripe_missing_glyph (FT_ULong c)
 {
   warning_with_id ("Octave:missing-glyph",
-                   "ft_render: skipping missing glyph for character '%c'",
+                   "ft_render: skipping missing glyph for character '%x'",
                    c);
 }
 
 static void
-gripe_glyph_render (char c)
+gripe_glyph_render (FT_ULong c)
 {
   warning_with_id ("Octave:glyph-render",
-                   "ft_render: unable to render glyph for character '%c'",
+                   "ft_render: unable to render glyph for character '%x'",
                    c);
 }
 
@@ -65,6 +67,9 @@
 #include "PermMatrix.h"
 #endif
 
+// Forward declaration
+static void ft_face_destroyed (void* object);
+
 class
 ft_manager
 {
@@ -99,10 +104,24 @@
               ? instance->do_get_font (name, weight, angle, size)
               : 0); }
 
+  static void font_destroyed (FT_Face face)
+    {
+      if (instance_ok ())
+        instance->do_font_destroyed (face);
+    }
+
 private:
 
   static ft_manager *instance;
 
+  typedef std::pair<std::string, double> ft_key;
+  typedef std::map<ft_key, FT_Face> ft_cache;
+
+  // Cache the fonts loaded by freetype. This cache only contains
+  // weak references to the fonts, strong references are only present
+  // in class ft_render.
+  ft_cache cache;
+
 private:
 
   // No copying!
@@ -149,6 +168,20 @@
     {
       FT_Face retval = 0;
 
+#if HAVE_FT_REFERENCE_FACE
+      // Look first into the font cache, then use fontconfig. If the font
+      // is present in the cache, simply add a reference and return it.
+
+      ft_key key (name + ":" + weight + ":" + angle, size);
+      ft_cache::const_iterator it = cache.find (key);
+
+      if (it != cache.end ())
+        {
+          FT_Reference_Face (it->second);
+          return it->second;
+        }
+#endif
+
       std::string file;
 
 #if defined (HAVE_FONTCONFIG)
@@ -221,12 +254,43 @@
 #endif
         }
 
-      if (! file.empty () && FT_New_Face (library, file.c_str (), 0, &retval))
-        ::warning ("ft_manager: unable to load font: %s", file.c_str ());
+      if (! file.empty ())
+        {
+          if (FT_New_Face (library, file.c_str (), 0, &retval))
+            ::warning ("ft_manager: unable to load font: %s", file.c_str ());
+#if HAVE_FT_REFERENCE_FACE
+          else
+            {
+              // Install a finalizer to notify ft_manager that the font is
+              // being destroyed. The class ft_manager only keeps weak
+              // references to font objects.
+
+              retval->generic.data = new ft_key (key);
+              retval->generic.finalizer = ft_face_destroyed;
+
+              // Insert loaded font into the cache.
+
+              cache[key] = retval;
+            }
+#endif
+        }
 
       return retval;
     }
 
+  void do_font_destroyed (FT_Face face)
+    {
+      if (face->generic.data)
+        {
+          ft_key* pkey =
+            reinterpret_cast<ft_key*> (face->generic.data);
+
+          cache.erase (*pkey);
+          delete pkey;
+          face->generic.data = 0;
+        }
+    }
+
 private:
   FT_Library library;
   bool freetype_initialized;
@@ -235,39 +299,164 @@
 
 ft_manager* ft_manager::instance = 0;
 
+static void
+ft_face_destroyed (void* object)
+{ ft_manager::font_destroyed (reinterpret_cast<FT_Face> (object)); }
+
 // ---------------------------------------------------------------------------
 
 ft_render::ft_render (void)
-: text_processor (), face (0), bbox (1, 4, 0.0),
-  xoffset (0), yoffset (0), multiline_halign (0),
-  multiline_align_xoffsets (), mode (MODE_BBOX),
-  red (0), green (0), blue (0)
+    : text_processor (), font (), bbox (1, 4, 0.0), halign (0), xoffset (0),
+      line_yoffset (0), yoffset (0), mode (MODE_BBOX),
+      color (dim_vector (1, 3), 0)
 {
 }
 
 ft_render::~ft_render (void)
 {
-  if (face)
-    FT_Done_Face (face);
 }
 
 void
 ft_render::set_font (const std::string& name, const std::string& weight,
                      const std::string& angle, double size)
 {
-  if (face)
-    FT_Done_Face (face);
+  // FIXME: take "fontunits" into account
+
+  font = ft_font (name, weight, angle, size, 0);
+}
+
+void
+ft_render::push_new_line (void)
+{
+  switch (mode)
+    {
+    case MODE_BBOX:
+        {
+          // Create a new bbox entry based on the current font.
+
+          FT_Face face = font.get_face ();
+
+          if (face)
+            {
+              int asc = face->size->metrics.ascender >> 6;
+              int desc = face->size->metrics.descender >> 6;
+              int h = face->size->metrics.height >> 6;
+
+              Matrix bb (1, 5, 0.0);
+
+              bb(1) = desc;
+              bb(3) = asc - desc;
+              bb(4) = h;
+
+              line_bbox.push_back (bb);
 
-  // FIXME: take "fontunits" into account
-  face = ft_manager::get_font (name, weight, angle, size);
+              xoffset = yoffset = 0;
+            }
+        }
+      break;
+
+    case MODE_RENDER:
+        {
+          // Move to the next line bbox, adjust xoffset based on alignment
+          // and yoffset based on the old and new line bbox.
+
+          Matrix old_bbox = line_bbox.front ();
+          line_bbox.pop_front ();
+          Matrix new_bbox = line_bbox.front ();
+
+          xoffset = compute_line_xoffset (new_bbox);
+          line_yoffset += (old_bbox(1) - (new_bbox(1) + new_bbox(3)));
+          yoffset = 0;
+        }
+      break;
+    }
+}
+
+int
+ft_render::compute_line_xoffset (const Matrix& lb) const
+{
+  if (! bbox.is_empty ())
+    {
+      switch (halign)
+        {
+        case 0:
+          return 0;
+        case 1:
+          return (bbox(2) - lb(2)) / 2;
+        case 2:
+          return (bbox(2) - lb(2));
+        }
+    }
 
-  if (face)
+  return 0;
+}
+
+void
+ft_render::compute_bbox (void)
+{
+  // Stack the various line bbox together and compute the final
+  // bounding box for the entire text string.
+
+  bbox = Matrix ();
+
+  switch (line_bbox.size ())
     {
-      if (FT_Set_Char_Size (face, 0, size*64, 0, 0))
-        ::warning ("ft_render: unable to set font size to %d", size);
+    case 0:
+      break;
+    case 1:
+      bbox = line_bbox.front ().extract (0, 0, 0, 3);
+      break;
+    default:
+      for (std::list<Matrix>::const_iterator it = line_bbox.begin ();
+           it != line_bbox.end (); ++it)
+        {
+          if (bbox.is_empty ())
+            bbox = it->extract (0, 0, 0, 3);
+          else
+            {
+              bbox(1) -= (*it)(3);
+              bbox(3) += (*it)(3);
+              bbox(2) = xmax (bbox(2), (*it)(2));
+            }
+        }
+      break;
     }
-  else
-    ::warning ("ft_render: unable to load appropriate font");
+}
+
+void
+ft_render::update_line_bbox (void)
+{
+  // Called after a font change, when in MODE_BBOX mode, to update the
+  // current line bbox with the new font metrics. This also includes the
+  // current yoffset, that is the offset of the current glyph's baseline
+  // the line's baseline.
+
+  if (mode == MODE_BBOX)
+    {
+      int asc = font.get_face ()->size->metrics.ascender >> 6;
+      int desc = font.get_face ()->size->metrics.descender >> 6;
+
+      Matrix& bb = line_bbox.front ();
+
+      if ((yoffset + desc) < bb(1))
+        {
+          // The new font goes below the bottom of the current bbox.
+
+          int delta = bb(1) - (yoffset + desc);
+
+          bb(1) -= delta;
+          bb(3) += delta;
+        }
+
+      if ((yoffset + asc) > (bb(1) + bb(3)))
+        {
+          // The new font goes above the top of the current bbox.
+
+          int delta = (yoffset + asc) - (bb(1) + bb(3));
+
+          bb(3) += delta;
+        }
+    }
 }
 
 void
@@ -278,23 +467,26 @@
   switch (mode)
     {
     case MODE_BBOX:
-      xoffset = yoffset = 0;
+      xoffset = line_yoffset = yoffset = 0;
       bbox = Matrix (1, 4, 0.0);
+      line_bbox.clear ();
+      push_new_line ();
       break;
     case MODE_RENDER:
       if (bbox.numel () != 4)
         {
           ::warning ("ft_render: invalid bounding box, cannot render");
 
-          xoffset = yoffset = 0;
+          xoffset = line_yoffset = yoffset = 0;
           pixels = uint8NDArray ();
         }
       else
         {
           pixels = uint8NDArray (dim_vector (4, bbox(2), bbox(3)),
                                  static_cast<uint8_t> (0));
-          xoffset = 0;
-          yoffset = -bbox(1)-1;
+          xoffset = compute_line_xoffset (line_bbox.front ());
+          line_yoffset = -bbox(1)-1;
+          yoffset = 0;
         }
       break;
     default:
@@ -303,184 +495,313 @@
     }
 }
 
-void
-ft_render::visit (text_element_string& e)
+FT_UInt
+ft_render::process_character (FT_ULong code, FT_UInt previous)
 {
+  FT_Face face = font.get_face ();
+  FT_UInt glyph_index = 0;
+
   if (face)
     {
-      int line_index = 0;
-      FT_UInt box_line_width = 0;
-      std::string str = e.string_value ();
-      FT_UInt glyph_index, previous = 0;
-
-      if (mode == MODE_BBOX)
-        multiline_align_xoffsets.clear ();
-      else if (mode == MODE_RENDER)
-        xoffset += multiline_align_xoffsets[line_index];
+      glyph_index = FT_Get_Char_Index (face, code);
 
-      for (size_t i = 0; i < str.length (); i++)
+      if (code != '\n'
+          && (! glyph_index
+                  || FT_Load_Glyph (face, glyph_index, FT_LOAD_DEFAULT)))
         {
-          glyph_index = FT_Get_Char_Index (face, str[i]);
-
-          if (str[i] != '\n'
-              && (! glyph_index
-                  || FT_Load_Glyph (face, glyph_index, FT_LOAD_DEFAULT)))
-            gripe_missing_glyph (str[i]);
-          else
+          glyph_index = 0;
+          gripe_missing_glyph (code);
+        }
+      else
+        {
+          switch (mode)
             {
-              switch (mode)
+            case MODE_RENDER:
+              if (code == '\n')
                 {
-                case MODE_RENDER:
-                  if (str[i] == '\n')
+                  glyph_index = FT_Get_Char_Index (face, ' ');
+                  if (!glyph_index || FT_Load_Glyph (face, glyph_index, FT_LOAD_DEFAULT))
+                    {
+                      glyph_index = 0;
+                      gripe_missing_glyph (' ');
+                    }
+                  else
+                    push_new_line ();
+                }
+              else if (FT_Render_Glyph (face->glyph, FT_RENDER_MODE_NORMAL))
+                {
+                  glyph_index = 0;
+                  gripe_glyph_render (code);
+                }
+              else
+                {
+                  FT_Bitmap& bitmap = face->glyph->bitmap;
+                  int x0, y0;
+
+                  if (previous)
                     {
-                      glyph_index = FT_Get_Char_Index (face, ' ');
-                      if (!glyph_index || FT_Load_Glyph (face, glyph_index, FT_LOAD_DEFAULT))
-                        {
-                          gripe_missing_glyph (' ');
-                        }
-                      else
-                        {
-                          line_index++;
-                          xoffset = multiline_align_xoffsets[line_index];
-                          yoffset -= (face->size->metrics.height >> 6);
-                        }
+                      FT_Vector delta;
+
+                      FT_Get_Kerning (face, previous, glyph_index, FT_KERNING_DEFAULT, &delta);
+                      xoffset += (delta.x >> 6);
                     }
-                  else if (FT_Render_Glyph (face->glyph, FT_RENDER_MODE_NORMAL))
+
+                  x0 = xoffset + face->glyph->bitmap_left;
+                  y0 = line_yoffset + yoffset + face->glyph->bitmap_top;
+
+                  // 'w' seems to have a negative -1
+                  // face->glyph->bitmap_left, this is so we don't
+                  // index out of bound, and assumes we we allocated
+                  // the right amount of horizontal space in the bbox.
+                  if (x0 < 0)
+                    x0 = 0;
+
+                  for (int r = 0; r < bitmap.rows; r++)
+                    for (int c = 0; c < bitmap.width; c++)
+                      {
+                        unsigned char pix = bitmap.buffer[r*bitmap.width+c];
+                        if (x0+c < 0 || x0+c >= pixels.dim2 ()
+                            || y0-r < 0 || y0-r >= pixels.dim3 ())
+                          {
+                            //::warning ("ft_render: pixel out of bound (char=%d, (x,y)=(%d,%d), (w,h)=(%d,%d)",
+                            //           str[i], x0+c, y0-r, pixels.dim2 (), pixels.dim3 ());
+                          }
+                        else if (pixels(3, x0+c, y0-r).value () == 0)
+                          {
+                            pixels(0, x0+c, y0-r) = color(0);
+                            pixels(1, x0+c, y0-r) = color(1);
+                            pixels(2, x0+c, y0-r) = color(2);
+                            pixels(3, x0+c, y0-r) = pix;
+                          }
+                      }
+
+                  xoffset += (face->glyph->advance.x >> 6);
+                }
+              break;
+
+            case MODE_BBOX:
+              if (code == '\n')
+                {
+                  glyph_index = FT_Get_Char_Index (face, ' ');
+                  if (! glyph_index
+                      || FT_Load_Glyph (face, glyph_index, FT_LOAD_DEFAULT))
                     {
-                      gripe_glyph_render (str[i]);
+                      glyph_index = 0;
+                      gripe_missing_glyph (' ');
+                    }
+                  else
+                    push_new_line ();
+                }
+              else
+                {
                     }
                   else
                     {
-                      FT_Bitmap& bitmap = face->glyph->bitmap;
-                      int x0, y0;
-
-                      if (previous)
-                        {
-                          FT_Vector delta;
-
-                          FT_Get_Kerning (face, previous, glyph_index, FT_KERNING_DEFAULT, &delta);
-                          xoffset += (delta.x >> 6);
-                        }
-
-                      x0 = xoffset+face->glyph->bitmap_left;
-                      y0 = yoffset+face->glyph->bitmap_top;
-
-                      // 'w' seems to have a negative -1
-                      // face->glyph->bitmap_left, this is so we don't
-                      // index out of bound, and assumes we we allocated
-                      // the right amount of horizontal space in the bbox.
-                      if (x0 < 0)
-                        x0 = 0;
+                  Matrix& bb = line_bbox.back ();
 
-                      for (int r = 0; r < bitmap.rows; r++)
-                        for (int c = 0; c < bitmap.width; c++)
-                          {
-                            unsigned char pix = bitmap.buffer[r*bitmap.width+c];
-                            if (x0+c < 0 || x0+c >= pixels.dim2 ()
-                                || y0-r < 0 || y0-r >= pixels.dim3 ())
-                              {
-                                //::error ("out-of-bound indexing!!");
-                              }
-                            else if (pixels(3, x0+c, y0-r).value () == 0)
-                              {
-                                pixels(0, x0+c, y0-r) = red;
-                                pixels(1, x0+c, y0-r) = green;
-                                pixels(2, x0+c, y0-r) = blue;
-                                pixels(3, x0+c, y0-r) = pix;
-                              }
-                          }
-
-                      xoffset += (face->glyph->advance.x >> 6);
-                    }
-                  break;
-
-                case MODE_BBOX:
-                  if (str[i] == '\n')
-                    {
-                      glyph_index = FT_Get_Char_Index (face, ' ');
-                      if (! glyph_index
-                          || FT_Load_Glyph (face, glyph_index, FT_LOAD_DEFAULT))
-                        {
-                          gripe_missing_glyph (' ');
-                        }
-                      else
-                        {
-                          multiline_align_xoffsets.push_back (box_line_width);
-                          // Reset the pixel width for this newline, so we don't
-                          // allocate a bounding box larger than the horizontal
-                          // width of the multi-line
-                          box_line_width = 0;
-                          bbox(1) -= (face->size->metrics.height >> 6);
-                        }
-                    }
-                  else
+                  // If we have a previous glyph, use kerning information.
+                  // This usually means moving a bit backward before adding
+                  // the next glyph. That is, "delta.x" is usually < 0.
+                  if (previous)
                     {
-                      // width
-                      if (previous)
-                        {
-                          FT_Vector delta;
-
-                          FT_Get_Kerning (face, previous, glyph_index,
-                                          FT_KERNING_DEFAULT, &delta);
-
-                          box_line_width += (delta.x >> 6);
-                        }
-
-                      box_line_width += (face->glyph->advance.x >> 6);
+                      FT_Vector delta;
 
-                      int asc, desc;
+                      FT_Get_Kerning (face, previous, glyph_index,
+                                      FT_KERNING_DEFAULT, &delta);
 
-                      if (false /*tight*/)
-                        {
-                          desc = face->glyph->metrics.horiBearingY - face->glyph->metrics.height;
-                          asc = face->glyph->metrics.horiBearingY;
-                        }
-                      else
-                        {
-                          asc = face->size->metrics.ascender;
-                          desc = face->size->metrics.descender;
-                        }
-
-                      asc = yoffset + (asc >> 6);
-                      desc = yoffset + (desc >> 6);
+                      xoffset += (delta.x >> 6);
+                    }
 
-                      if (desc < bbox(1))
-                        {
-                          bbox(3) += (bbox(1) - desc);
-                          bbox(1) = desc;
-                        }
-                      if (asc > (bbox(3)+bbox(1)))
-                        bbox(3) = asc-bbox(1);
-                      if (bbox(2) < box_line_width)
-                        bbox(2) = box_line_width;
-                    }
-                  break;
+                  // Extend current X offset box by the width of the current
+                  // glyph. Then extend the line bounding box if necessary.
+
+                  xoffset += (face->glyph->advance.x >> 6);
+                  bb(2) = xmax (bb(2), xoffset);
                 }
-              if (str[i] == '\n')
-                previous = 0;
-              else
-                previous = glyph_index;
-            }
-        }
-      if (mode == MODE_BBOX)
-        {
-          /* Push last the width associated with the last line */
-          multiline_align_xoffsets.push_back (box_line_width);
-
-          for (unsigned int i = 0; i < multiline_align_xoffsets.size (); i++)
-            {
-              /* Center align */
-              if (multiline_halign == 1)
-                multiline_align_xoffsets[i] = (bbox(2) - multiline_align_xoffsets[i])/2;
-              /* Right align */
-              else if (multiline_halign == 2)
-                multiline_align_xoffsets[i] = (bbox(2) - multiline_align_xoffsets[i]);
-              /* Left align */
-              else
-                multiline_align_xoffsets[i] = 0;
+              break;
             }
         }
     }
+
+  return glyph_index;
+}
+
+void
+ft_render::visit (text_element_string& e)
+{
+  if (font.is_valid ())
+    {
+      std::string str = e.string_value ();
+      FT_UInt glyph_index, previous = 0;
+
+      for (size_t i = 0; i < str.length (); i++)
+        {
+          glyph_index = process_character (static_cast<unsigned char> (str[i]),
+                                           previous);
+
+          if (str[i] == '\n')
+            previous = 0;
+          else
+            previous = glyph_index;
+        }
+    }
+}
+
+void
+ft_render::visit (text_element_list& e)
+{
+  // Save and restore (after processing the list) the current font and color.
+
+  ft_font saved_font (font);
+  uint8NDArray saved_color (color);
+
+  text_processor::visit (e);
+
+  font = saved_font;
+  color = saved_color;
+}
+
+void
+ft_render::visit (text_element_subscript& e)
+{
+  ft_font saved_font (font);
+  int saved_line_yoffset = line_yoffset;
+  int saved_yoffset = yoffset;
+
+  set_font (font.get_name (), font.get_weight (), font.get_angle (),
+            font.get_size () - 2);
+
+  if (font.is_valid ())
+    {
+                        bbox(3) += (bbox(1) - desc);
+                        bbox(1) = desc;
+      // Shifting the baseline by 2/3 the font height seems to produce
+      // decent result.
+      yoffset -= (h * 2) / 3;
+
+      if (mode == MODE_BBOX)
+        update_line_bbox ();
+    }
+
+  text_processor::visit (e);
+
+  font = saved_font;
+  // If line_yoffset changed, this means we moved to a new line; hence yoffset
+  // cannot be restored, because the saved value is not relevant anymore.
+  if (line_yoffset == saved_line_yoffset)
+    yoffset = saved_yoffset;
+}
+
+void
+ft_render::visit (text_element_superscript& e)
+{
+  ft_font saved_font (font);
+  int saved_line_yoffset = line_yoffset;
+  int saved_yoffset = yoffset;
+
+  set_font (font.get_name (), font.get_weight (), font.get_angle (),
+            font.get_size () - 2);
+
+  if (saved_font.is_valid ())
+    {
+      int s_asc = saved_font.get_face ()->size->metrics.ascender >> 6;
+
+      // Shifting the baseline by 2/3 base font ascender seems to produce
+      // decent result.
+      yoffset += (s_asc * 2) / 3;
+
+      if (mode == MODE_BBOX)
+        update_line_bbox ();
+    }
+
+  text_processor::visit (e);
+
+  font = saved_font;
+  // If line_yoffset changed, this means we moved to a new line; hence yoffset
+  // cannot be restored, because the saved value is not relevant anymore.
+  if (line_yoffset == saved_line_yoffset)
+    yoffset = saved_yoffset;
+}
+
+void
+ft_render::visit (text_element_color& e)
+{
+  if (mode == MODE_RENDER)
+    set_color (e.get_color ());
+}
+
+void
+ft_render::visit (text_element_fontsize& e)
+{
+  double sz = e.get_fontsize ();
+
+  // FIXME: Matlab documentation says that the font size is expressed
+  //        in the text object FontUnit.
+
+  set_font (font.get_name (), font.get_weight (), font.get_angle (), sz);
+
+  if (mode == MODE_BBOX)
+    update_line_bbox ();
+}
+
+void
+ft_render::visit (text_element_fontname& e)
+{
+  set_font (e.get_fontname (), font.get_weight (), font.get_angle (),
+            font.get_size ());
+
+  if (mode == MODE_BBOX)
+    update_line_bbox ();
+}
+
+void
+ft_render::visit (text_element_fontstyle& e)
+{
+  switch (e.get_fontstyle ())
+    {
+    case text_element_fontstyle::normal:
+      set_font (font.get_name (), "normal", "normal", font.get_size ());
+      break;
+    case text_element_fontstyle::bold:
+      set_font (font.get_name (), "bold", "normal", font.get_size ());
+      break;
+    case text_element_fontstyle::italic:
+      set_font (font.get_name (), "normal", "italic", font.get_size ());
+      break;
+    case text_element_fontstyle::oblique:
+      set_font (font.get_name (), "normal", "oblique", font.get_size ());
+      break;
+    }
+
+  if (mode == MODE_BBOX)
+    update_line_bbox ();
+}
+
+void
+ft_render::visit (text_element_symbol& e)
+{
+  uint32_t code = e.get_symbol_code ();
+
+  if (code != text_element_symbol::invalid_code && font.is_valid ())
+    process_character (code);
+  else if (font.is_valid ())
+    ::warning ("ignoring unknown symbol: %d", e.get_symbol ());
+}
+
+void
+ft_render::visit (text_element_combined& e)
+{
+  int saved_xoffset = xoffset;
+  int max_xoffset = xoffset;
+
+  for (text_element_combined::iterator it = e.begin (); it != e.end (); ++it)
+    {
+      xoffset = saved_xoffset;
+      (*it)->accept (*this);
+      max_xoffset = xmax (xoffset, max_xoffset);
+    }
+
+  xoffset = max_xoffset;
 }
 
 void
@@ -495,9 +816,9 @@
 {
   if (c.numel () == 3)
     {
-      red = static_cast<uint8_t> (c(0)*255);
-      green = static_cast<uint8_t> (c(1)*255);
-      blue = static_cast<uint8_t> (c(2)*255);
+      color(0) = static_cast<uint8_t> (c(0)*255);
+      color(1) = static_cast<uint8_t> (c(1)*255);
+      color(2) = static_cast<uint8_t> (c(2)*255);
     }
   else
     ::warning ("ft_render::set_color: invalid color");
@@ -508,6 +829,7 @@
 {
   set_mode (MODE_BBOX);
   elt->accept (*this);
+  compute_bbox ();
   box = bbox;
 
   set_mode (MODE_RENDER);
@@ -574,6 +896,7 @@
 {
   set_mode (MODE_BBOX);
   elt->accept (*this);
+  compute_bbox ();
 
   Matrix extent (1, 2, 0.0);
 
@@ -594,9 +917,10 @@
 }
 
 Matrix
-ft_render::get_extent (const std::string& txt, double rotation)
+ft_render::get_extent (const std::string& txt, double rotation,
+                       const caseless_str& interpreter)
 {
-  text_element *elt = text_parser_none ().parse (txt);
+  text_element *elt = text_parser::parse (txt, interpreter);
   Matrix extent = get_extent (elt, rotation);
   delete elt;
 
@@ -621,14 +945,15 @@
 void
 ft_render::text_to_pixels (const std::string& txt,
                            uint8NDArray& pixels_, Matrix& box,
-                           int halign, int valign, double rotation)
+                           int _halign, int valign, double rotation,
+                           const caseless_str& interpreter)
 {
   // FIXME: clip "rotation" between 0 and 360
   int rot_mode = rotation_to_mode (rotation);
 
-  multiline_halign = halign;
+  halign = _halign;
 
-  text_element *elt = text_parser_none ().parse (txt);
+  text_element *elt = text_parser::parse (txt, interpreter);
   pixels_ = render (elt, box, rot_mode);
   delete elt;
 
@@ -672,4 +997,61 @@
     }
 }
 
+ft_render::ft_font::ft_font (const ft_font& ft)
+     : name (ft.name), weight (ft.weight), angle (ft.angle), size (ft.size),
+       face (0)
+{
+#if HAVE_FT_REFERENCE_FACE
+  FT_Face ft_face = ft.get_face ();
+
+  if (ft_face && FT_Reference_Face (ft_face) == 0)
+    face = ft_face;
+#endif
+}
+
+ft_render::ft_font&
+ft_render::ft_font::operator = (const ft_font& ft)
+{
+  if (&ft != this)
+    {
+      name = ft.name;
+      weight = ft.weight;
+      angle = ft.angle;
+      size = ft.size;
+      if (face)
+        {
+          FT_Done_Face (face);
+          face = 0;
+        }
+
+#if HAVE_FT_REFERENCE_FACE
+      FT_Face ft_face = ft.get_face ();
+
+      if (ft_face && FT_Reference_Face (ft_face) == 0)
+        face = ft_face;
+#endif
+    }
+
+  return *this;
+}
+
+FT_Face
+ft_render::ft_font::get_face (void) const
+{
+  if (! face && ! name.empty ())
+    {
+      face = ft_manager::get_font (name, weight, angle, size);
+
+      if (face)
+        {
+          if (FT_Set_Char_Size (face, 0, size*64, 0, 0))
+            ::warning ("ft_render: unable to set font size to %g", size);
+        }
+      else
+        ::warning ("ft_render: unable to load appropriate font");
+    }
+
+  return face;
+}
+
 #endif // HAVE_FREETYPE
--- a/libinterp/corefcn/txt-eng-ft.h
+++ b/libinterp/corefcn/txt-eng-ft.h
@@ -25,6 +25,7 @@
 
 #if HAVE_FREETYPE
 
+#include <list>
 #include <vector>
 
 #include <ft2build.h>
@@ -59,6 +60,24 @@
 
   void visit (text_element_string& e);
 
+  void visit (text_element_list& e);
+
+  void visit (text_element_subscript& e);
+
+  void visit (text_element_superscript& e);
+
+  void visit (text_element_color& e);
+
+  void visit (text_element_fontsize& e);
+
+  void visit (text_element_fontname& e);
+
+  void visit (text_element_fontstyle& e);
+
+  void visit (text_element_symbol& e);
+
+  void visit (text_element_combined& e);
+
   void reset (void);
 
   uint8NDArray get_pixels (void) const { return pixels; }
@@ -69,7 +88,8 @@
                        int rotation = ROTATION_0);
 
   Matrix get_extent (text_element *elt, double rotation = 0.0);
-  Matrix get_extent (const std::string& txt, double rotation = 0.0);
+  Matrix get_extent (const std::string& txt, double rotation = 0.0,
+                     const caseless_str& interpreter = "tex");
 
   void set_font (const std::string& name, const std::string& weight,
                  const std::string& angle, double size);
@@ -80,7 +100,8 @@
 
   void text_to_pixels (const std::string& txt,
                        uint8NDArray& pixels_, Matrix& bbox,
-                       int halign, int valign, double rotation);
+                       int halign, int valign, double rotation,
+                       const caseless_str& interpreter = "tex");
 
 private:
   int rotation_to_mode (double rotation) const;
@@ -91,16 +112,96 @@
 
   ft_render& operator = (const ft_render&);
 
+  // Class to hold information about fonts and a strong
+  // reference to the font objects loaded by freetype.
+  class ft_font
+    {
+    public:
+      ft_font (void)
+        : name (), weight (), angle (), size (0), face (0) { }
+
+      ft_font (const std::string& nm, const std::string& wt,
+               const std::string& ang, double sz, FT_Face f = 0)
+        : name (nm), weight (wt), angle (ang), size (sz), face (f) { }
+
+      ft_font (const ft_font& ft);
+
+      ~ft_font (void)
+        {
+          if (face)
+            FT_Done_Face (face);
+        }
+
+      ft_font& operator = (const ft_font& ft);
+
+      bool is_valid (void) const { return get_face (); }
+
+      std::string get_name (void) const { return name; }
+
+      std::string get_weight (void) const { return weight; }
+
+      std::string get_angle (void) const { return angle; }
+
+      double get_size (void) const { return size; }
+
+      FT_Face get_face (void) const;
+
+    private:
+      std::string name;
+      std::string weight;
+      std::string angle;
+      double size;
+      mutable FT_Face face;
+    };
+
+  void push_new_line (void);
+
+  void update_line_bbox (void);
+
+  void compute_bbox (void);
+
+  int compute_line_xoffset (const Matrix& lb) const;
+
+  FT_UInt process_character (FT_ULong code, FT_UInt previous = 0);
+
 private:
-  FT_Face face;
+  // The current font used by the renderer.
+  ft_font font;
+
+  // Used to stored the bounding box corresponding to the rendered text.
+  // The bounding box has the form [x, y, w, h] where x and y represent the
+  // coordinates of the bottom left corner relative to the anchor point of
+  // the text (== start of text on the baseline). Due to font descent or
+  // multiple lines, the value y is usually negative.
   Matrix bbox;
+
+  // Used to stored the rendered text. It's a 3D matrix with size MxNx4
+  // where M and N are the width and height of the bounding box.
   uint8NDArray pixels;
+
+  // Used to store the bounding box of each line. This is used to layout
+  // multiline text properly.
+  std::list<Matrix> line_bbox;
+
+  // The current horizontal alignment. This is used to align multi-line text.
+  int halign;
+
+  // The X offset for the next glyph.
   int xoffset;
+
+  // The Y offset of the baseline for the current line.
+  int line_yoffset;
+
+  // The Y offset of the baseline for the next glyph. The offset is relative
+  // to line_yoffset. The total Y offset is computed with:
+  // line_yoffset + yoffset.
   int yoffset;
-  int multiline_halign;
-  std::vector<int> multiline_align_xoffsets;
+
+  // The current mode of the rendering process (box computing or rendering).
   int mode;
-  uint8_t red, green, blue;
+
+  // The base color of the rendered text.
+  uint8NDArray color;
 };
 
 #endif // HAVE_FREETYPE
new file mode 100644
--- /dev/null
+++ b/libinterp/corefcn/txt-eng.cc
@@ -0,0 +1,39 @@
+/*
+
+Copyright (C) 2013 Michael Goffioul
+
+This file is part of Octave.
+
+Octave is free software; you can redistribute it and/or modify it
+under the terms of the GNU General Public License as published by the
+Free Software Foundation; either version 3 of the License, or (at your
+option) any later version.
+
+Octave is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+for more details.
+
+You should have received a copy of the GNU General Public License
+along with Octave; see the file COPYING.  If not, see
+<http://www.gnu.org/licenses/>.
+
+*/
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "txt-eng.h"
+#include "oct-tex-symbols.cc"
+
+uint32_t
+text_element_symbol::get_symbol_code (void) const
+{
+  uint32_t code = invalid_code;
+
+  if (0 <= symbol && symbol < num_symbol_codes)
+    code = symbol_codes[symbol][0];
+
+  return code;
+}
--- a/libinterp/corefcn/txt-eng.h
+++ b/libinterp/corefcn/txt-eng.h
@@ -23,13 +23,24 @@
 #if ! defined (txt_eng_h)
 #define txt_eng_h 1
 
+#include <memory>
+#include <string>
+
 #include "base-list.h"
+#include "caseless-str.h"
+#include "dMatrix.h"
 
 class text_element;
 class text_element_string;
+class text_element_symbol;
 class text_element_list;
-class text_subscript_element;
-class text_superscript_element;
+class text_element_subscript;
+class text_element_superscript;
+class text_element_combined;
+class text_element_fontname;
+class text_element_fontsize;
+class text_element_fontstyle;
+class text_element_color;
 
 class text_processor;
 
@@ -71,6 +82,29 @@
 
 class
 OCTINTERP_API
+text_element_symbol : public text_element
+{
+public:
+  enum { invalid_code = 0xFFFFFFFFU };
+
+public:
+  text_element_symbol (int sym)
+    : text_element (), symbol (sym) { }
+
+  ~text_element_symbol (void) { }
+
+  int get_symbol (void) const { return symbol; }
+
+  uint32_t get_symbol_code (void) const;
+
+  void accept (text_processor& p);
+
+private:
+  int symbol;
+};
+
+class
+OCTINTERP_API
 text_element_list :
   public text_element,
   public octave_base_list<text_element *>
@@ -79,6 +113,10 @@
   text_element_list (void)
     : text_element (), octave_base_list<text_element*> () { }
 
+  text_element_list (text_element* e)
+    : text_element (), octave_base_list<text_element*> ()
+    { push_back (e); }
+
   ~text_element_list (void)
     {
       while (! empty ())
@@ -94,28 +132,181 @@
 
 class
 OCTINTERP_API
-text_subscript_element : public text_element_list
+text_element_subscript : public text_element
+{
+public:
+  text_element_subscript (text_element* e)
+    : text_element (), elem (e) { }
+
+  text_element_subscript (char c)
+    : text_element ()
+    { elem = new text_element_string (std::string (1, c)); }
+
+  ~text_element_subscript (void)
+    { delete elem; }
+
+  void accept (text_processor& p);
+
+  text_element* get_element (void) { return elem; }
+
+private:
+  text_element* elem;
+
+private:
+  text_element_subscript (void);
+};
+
+class
+OCTINTERP_API
+text_element_superscript : public text_element
 {
 public:
-  text_subscript_element (void)
-    : text_element_list () { }
+  text_element_superscript (text_element* e)
+    : text_element (), elem (e) { }
+
+  text_element_superscript (char c)
+    : text_element ()
+    { elem = new text_element_string (std::string (1, c)); }
+
+  ~text_element_superscript (void)
+    { delete elem; }
+
+  void accept (text_processor& p);
+
+  text_element* get_element (void) { return elem; }
 
-  ~text_subscript_element (void) { }
+private:
+  text_element* elem;
+
+private:
+  text_element_superscript (void);
+};
+
+class
+OCTINTERP_API
+text_element_combined : public text_element_list
+{
+public:
+  text_element_combined (text_element* e)
+    : text_element_list (e) { }
+
+  text_element_combined (text_element* e1, text_element* e2)
+    : text_element_list(e1)
+    { push_back (e2); }
 
   void accept (text_processor& p);
 };
 
 class
 OCTINTERP_API
-text_superscript_element : public text_element_list
+text_element_fontstyle : public text_element
+{
+public:
+  enum fontstyle
+    {
+      normal,
+      bold,
+      italic,
+      oblique
+    };
+
+  text_element_fontstyle (fontstyle st)
+    : text_element (), style (st) { }
+
+  ~text_element_fontstyle (void) { }
+
+  fontstyle get_fontstyle (void) const { return style; }
+
+  void accept (text_processor& p);
+
+private:
+  fontstyle style;
+
+private:
+  text_element_fontstyle (void);
+};
+
+class
+OCTINTERP_API
+text_element_fontname : public text_element
+{
+public:
+  text_element_fontname (const std::string& fname)
+    : text_element (), name (fname) { }
+
+  ~text_element_fontname (void) { }
+
+  const std::string& get_fontname (void) const { return name; }
+
+  void accept (text_processor& p);
+
+private:
+  std::string name;
+
+private:
+  text_element_fontname (void);
+};
+
+class
+OCTINTERP_API
+text_element_fontsize : public text_element
 {
 public:
-  text_superscript_element (void)
-    : text_element_list () { }
+  text_element_fontsize (double fsize)
+    : text_element (), size (fsize) { }
 
-  ~text_superscript_element (void) { }
+  ~text_element_fontsize (void) { }
+
+  double get_fontsize (void) const { return size; }
 
   void accept (text_processor& p);
+
+private:
+  double size;
+
+private:
+  text_element_fontsize (void);
+};
+
+class
+OCTINTERP_API
+text_element_color : public text_element
+{
+public:
+  text_element_color (double r, double g, double b)
+    : text_element (), rgb (1, 3, 0.0)
+    {
+      rgb(0) = r;
+      rgb(1) = g;
+      rgb(2) = b;
+    }
+
+  text_element_color (const std::string& cname)
+    : text_element (), rgb (1, 3, 0.0)
+    {
+#define ASSIGN_COLOR(r,g,b) { rgb(0) = r; rgb(1) = g; rgb(2) = b; }
+      if (cname == "red") ASSIGN_COLOR(1, 0, 0)
+      else if (cname == "green") ASSIGN_COLOR(0, 1, 0)
+      else if (cname == "yellow") ASSIGN_COLOR(1, 1, 0)
+      else if (cname == "magenta") ASSIGN_COLOR(1, 0, 1)
+      else if (cname == "blue") ASSIGN_COLOR(0, 0, 1)
+      else if (cname == "black") ASSIGN_COLOR(0, 0, 0)
+      else if (cname == "white") ASSIGN_COLOR(1, 1, 1)
+      else if (cname == "gray") ASSIGN_COLOR(.5, .5, .5)
+      else if (cname == "darkGreen") ASSIGN_COLOR(0, .5, 0)
+      else if (cname == "orange") ASSIGN_COLOR(1, .65, 0)
+      else if (cname == "lightBlue") ASSIGN_COLOR(0.68, .85, .9)
+#undef ASSIGN_COLOR
+    }
+
+  ~text_element_color (void) { }
+
+  Matrix get_color (void) { return rgb; }
+
+  void accept (text_processor& p);
+
+private:
+  Matrix rgb;
 };
 
 class
@@ -125,6 +316,8 @@
 public:
   virtual void visit (text_element_string& e) = 0;
 
+  virtual void visit (text_element_symbol&) { }
+
   virtual void visit (text_element_list& e)
     {
       for (text_element_list::iterator it = e.begin ();
@@ -134,11 +327,21 @@
         }
     }
 
-  virtual void visit (text_subscript_element& e)
-    { visit (dynamic_cast<text_element_list&> (e)); }
+  virtual void visit (text_element_subscript& e)
+    { e.get_element ()->accept (*this); }
+
+  virtual void visit (text_element_superscript& e)
+    { e.get_element ()->accept (*this); }
+
+  virtual void visit (text_element_combined&) { }
 
-  virtual void visit (text_superscript_element& e)
-    { visit (dynamic_cast<text_element_list&> (e)); }
+  virtual void visit (text_element_fontstyle&) { }
+
+  virtual void visit (text_element_fontname&) { }
+
+  virtual void visit (text_element_fontsize&) { }
+
+  virtual void visit (text_element_color&) { }
 
   virtual void reset (void) { }
 
@@ -154,9 +357,15 @@
 { p.visit (*this); }
 
 TEXT_ELEMENT_ACCEPT(text_element_string)
+TEXT_ELEMENT_ACCEPT(text_element_symbol)
 TEXT_ELEMENT_ACCEPT(text_element_list)
-TEXT_ELEMENT_ACCEPT(text_subscript_element)
-TEXT_ELEMENT_ACCEPT(text_superscript_element)
+TEXT_ELEMENT_ACCEPT(text_element_subscript)
+TEXT_ELEMENT_ACCEPT(text_element_superscript)
+TEXT_ELEMENT_ACCEPT(text_element_combined)
+TEXT_ELEMENT_ACCEPT(text_element_fontstyle)
+TEXT_ELEMENT_ACCEPT(text_element_fontname)
+TEXT_ELEMENT_ACCEPT(text_element_fontsize)
+TEXT_ELEMENT_ACCEPT(text_element_color)
 
      class
      OCTINTERP_API
@@ -168,6 +377,10 @@
   virtual ~text_parser (void) { }
 
   virtual text_element* parse (const std::string& s) = 0;
+
+public:
+  static text_element* parse (const std::string& s,
+                              const caseless_str& interpreter);
 };
 
 class
@@ -190,4 +403,50 @@
     }
 };
 
+class
+OCTINTERP_API
+text_parser_tex : public text_parser
+{
+public:
+  text_parser_tex (void)
+    : text_parser (), scanner (0), buffer_state (0), result (0)
+    { }
+
+  ~text_parser_tex (void)
+    { destroy_lexer (); }
+
+  text_element* parse (const std::string& s);
+
+  void* get_scanner (void) { return scanner; }
+
+  void set_parse_result (text_element* e) { result = e; }
+
+  text_element* get_parse_result (void) { return result; }
+
+private:
+  bool init_lexer (const std::string& s);
+
+  void destroy_lexer (void);
+
+private:
+  void* scanner;
+
+  void* buffer_state;
+
+  text_element* result;
+};
+
+inline text_element*
+text_parser::parse (const std::string& s, const caseless_str& interpreter)
+{
+  std::auto_ptr<text_parser> parser;
+
+  if (interpreter.compare ("tex"))
+    parser.reset (new text_parser_tex ());
+  else
+    parser.reset (new text_parser_none ());
+
+  return parser->parse (s);
+}
+
 #endif
--- a/libinterp/corefcn/typecast.cc
+++ b/libinterp/corefcn/typecast.cc
@@ -121,10 +121,10 @@
 their bit counts.  Both logical and char are typically one byte wide;\n\
 however, this is not guaranteed by C++.  If your system is IEEE conformant,\n\
 single and double should be 4 bytes and 8 bytes wide, respectively.\n\
-\"logical\" is not allowed for @var{class}.  If the input is a row vector,\n\
-the return value is a row vector, otherwise it is a column vector.  If the\n\
-bit length of @var{x} is not divisible by that of @var{class}, an error\n\
-occurs.\n\
+@qcode{\"logical\"} is not allowed for @var{class}.  If the input is a row\n\
+vector, the return value is a row vector, otherwise it is a column vector.  \n\
+If the bit length of @var{x} is not divisible by that of @var{class}, an\n\
+error occurs.\n\
 \n\
 An example of the use of typecast on a little-endian machine is\n\
 \n\
--- a/libinterp/corefcn/utils.cc
+++ b/libinterp/corefcn/utils.cc
@@ -299,7 +299,7 @@
 directory of the loadpath for element of the cell array and return\n\
 the first that matches.\n\
 \n\
-If the second optional argument @code{\"all\"} is supplied, return\n\
+If the second optional argument @qcode{\"all\"} is supplied, return\n\
 a cell array containing the list of all files that have the same\n\
 name in the path.  If no files are found, return an empty cell array.\n\
 @seealso{file_in_path, path}\n\
@@ -375,7 +375,7 @@
 directory of the path for element of the cell array and return\n\
 the first that matches.\n\
 \n\
-If the third optional argument @code{\"all\"} is supplied, return\n\
+If the third optional argument @qcode{\"all\"} is supplied, return\n\
 a cell array containing the list of all files that have the same\n\
 name in the path.  If no files are found, return an empty cell array.\n\
 @seealso{file_in_loadpath}\n\
@@ -896,9 +896,10 @@
 @deftypefnx {Built-in Function} {} find_dir_in_path (@var{dir}, \"all\")\n\
 Return the full name of the path element matching @var{dir}.  The\n\
 match is performed at the end of each path element.  For example, if\n\
-@var{dir} is @code{\"foo/bar\"}, it matches the path element\n\
-@code{\"/some/dir/foo/bar\"}, but not @code{\"/some/dir/foo/bar/baz\"}\n\
-or @code{\"/some/dir/allfoo/bar\"}.\n\
+@var{dir} is @qcode{\"foo/bar\"}, it matches the path element\n\
+@nospell{@qcode{\"/some/dir/foo/bar\"}}, but not\n\
+@nospell{@qcode{\"/some/dir/foo/bar/baz\"}}\n\
+@nospell{@qcode{\"/some/dir/allfoo/bar\"}}.\n\
 \n\
 The second argument is optional.  If it is supplied, return a cell array\n\
 containing all name matches rather than just the first.\n\
--- a/libinterp/corefcn/variables.cc
+++ b/libinterp/corefcn/variables.cc
@@ -537,16 +537,16 @@
 symbols of the specified type.  Valid types are\n\
 \n\
 @table @asis\n\
-@item \"var\"\n\
+@item @qcode{\"var\"}\n\
 Check only for variables.\n\
 \n\
-@item \"builtin\"\n\
+@item @qcode{\"builtin\"}\n\
 Check only for built-in functions.\n\
 \n\
-@item \"file\"\n\
+@item @qcode{\"file\"}\n\
 Check only for files and directories.\n\
 \n\
-@item \"dir\"\n\
+@item @qcode{\"dir\"}\n\
 Check only for directories.\n\
 @end table\n\
 \n\
@@ -2530,11 +2530,11 @@
 left of the specified balance column.\n\
 \n\
 The default format is\n\
-@code{\"  %a:4; %ln:6; %cs:16:6:1;  %rb:12;  %lc:-1;\\n\"}.\n\
+@qcode{\"  %a:4; %ln:6; %cs:16:6:1;  %rb:12;  %lc:-1;\\n\"}.\n\
 \n\
-When called from inside a function with the \"local\" option, the variable is\n\
-changed locally for the function and any subroutines it calls.  The original\n\
-variable value is restored when exiting the function.\n\
+When called from inside a function with the @qcode{\"local\"} option, the\n\
+variable is changed locally for the function and any subroutines it calls.  \n\
+The original variable value is restored when exiting the function.\n\
 @seealso{whos}\n\
 @end deftypefn")
 {
@@ -2551,9 +2551,9 @@
 Query or set the internal variable that specifies the function to call when\n\
 an unknown identifier is requested.\n\
 \n\
-When called from inside a function with the \"local\" option, the variable is\n\
-changed locally for the function and any subroutines it calls.  The original\n\
-variable value is restored when exiting the function.\n\
+When called from inside a function with the @qcode{\"local\"} option, the\n\
+variable is changed locally for the function and any subroutines it calls.  \n\
+The original variable value is restored when exiting the function.\n\
 @end deftypefn")
 {
   return SET_INTERNAL_VARIABLE (missing_function_hook);
--- a/libinterp/dldfcn/__init_fltk__.cc
+++ b/libinterp/dldfcn/__init_fltk__.cc
@@ -2171,13 +2171,13 @@
 The @var{mode} argument can be one of the following strings:\n\
 \n\
 @table @asis\n\
-@item '2d'\n\
+@item @qcode{\"2d\"}\n\
 Allows panning and zooming of current axes.\n\
 \n\
-@item '3d'\n\
+@item @qcode{\"3d\"}\n\
 Allows rotating and zooming of current axes.\n\
 \n\
-@item 'none'\n\
+@item @qcode{\"none\"}\n\
 Mouse inputs have no effect.\n\
 @end table\n\
 \n\
--- a/libinterp/dldfcn/__magick_read__.cc
+++ b/libinterp/dldfcn/__magick_read__.cc
@@ -44,6 +44,27 @@
 #include <Magick++.h>
 #include <clocale>
 
+// We need this in case one of the sides of the image being read has
+// width 1. In those cases, the type will come as scalar instead of range
+// since that's the behaviour of the colon operator (1:1:1 will be a scalar,
+// not a range).
+static Range
+get_region_range (const octave_value& region)
+{
+  Range output;
+  if (region.is_range ())
+    output = region.range_value ();
+  else if (region.is_scalar_type ())
+    {
+      double value = region.scalar_value ();
+      output = Range (value, value);
+    }
+  else
+    error ("__magick_read__: unknow datatype for Region option");
+
+  return output;
+}
+
 static std::map<std::string, octave_idx_type>
 calculate_region (const octave_scalar_map& options)
 {
@@ -51,8 +72,8 @@
   const Cell pixel_region = options.getfield ("region").cell_value ();
 
   // Subtract 1 to account for 0 indexing.
-  const Range rows     = pixel_region (0).range_value ();
-  const Range cols     = pixel_region (1).range_value ();
+  const Range rows     = get_region_range (pixel_region (0));
+  const Range cols     = get_region_range (pixel_region (1));
   region["row_start"]  = rows.base () -1;
   region["col_start"]  = cols.base () -1;
   region["row_end"]    = rows.max ()  -1;
@@ -668,8 +689,28 @@
         }
     }
 
-  const Magick::ClassType klass = imvec[frameidx(0)].classType ();
-  const octave_idx_type depth   = imvec[frameidx(0)].depth ();
+  // FIXME: the depth here is not always correct for us but seems to be the best
+  //        value we can get. For example, a grayscale png image with 1 bit
+  //        per channel should return a depth of 1 but instead we get 8.
+  //        We could check channelDepth() but then, which channel has the data
+  //        is not straightforward. So we'd have to check all
+  //        the channels and select the highest value. But then, I also
+  //        have a 16bit TIFF whose depth returns 16 (correct), but all of the
+  //        channels gives 8 (wrong). No idea why, maybe a bug in GM?
+  //        Anyway, using depth() seems that only causes problems for binary
+  //        images, and the problem with channelDepth() is not making set them
+  //        all to 1. So we will guess that if all channels have depth of 1,
+  //        then we must have a binary image.
+  //        Note that we can't use AllChannels it doesn't work for this.
+  //        Instead of checking all of the individual channels, we check one
+  //        from RGB, CMYK, grayscale, and transparency.
+  octave_idx_type depth = imvec[frameidx(0)].depth ();
+  if (depth != 1
+      && imvec[frameidx(0)].channelDepth (Magick::RedChannel)     == 1
+      && imvec[frameidx(0)].channelDepth (Magick::CyanChannel)    == 1
+      && imvec[frameidx(0)].channelDepth (Magick::OpacityChannel) == 1
+      && imvec[frameidx(0)].channelDepth (Magick::GrayChannel)    == 1)
+    depth = 1;
 
   // Magick::ClassType
   // PseudoClass:
@@ -677,6 +718,7 @@
   // DirectClass:
   // Image is composed of pixels which represent literal color values.
 
+  Magick::ClassType klass = imvec[frameidx(0)].classType ();
   // FIXME: GraphicsMagick does not really distinguishes between indexed and
   //        normal images. After reading a file, it decides itself the optimal
   //        way to store the image in memory, independently of the how the
@@ -684,11 +726,23 @@
   //        it seems to match the original file most of the times, this is
   //        not necessarily true all the times. See
   //          https://sourceforge.net/mailarchive/message.php?msg_id=31180507
-  //        A grayscale jpeg image reports being indexed even though the JPEG
-  //        format has no support for indexed images. So we can skip at least
-  //        for that.
+  //        In addition to the ClassType, there is also ImageType which has a
+  //        type for indexed images (PaletteType and PaletteMatteType). However,
+  //        they also don't represent the original image. Interestingly, one
+  //        would at least guess that PseudoClass would include only the Palette
+  //        types but that does not happen.
+  //
+  //        We can't do better without having format specific code which is
+  //        what we are trying to avoid by using a library such as GM. We at
+  //        least create workarounds for the most common problems.
 
-  if (klass == Magick::PseudoClass && imvec[0].magick () != "JPEG")
+  // 1) A grayscale jpeg image can report being indexed even though the
+  //    JPEG format has no support for indexed images. We can at least
+  //    fix this one.
+  if (klass == Magick::PseudoClass && imvec[0].magick () == "JPEG")
+    klass = Magick::DirectClass;
+
+  if (klass == Magick::PseudoClass)
     {
       if (depth <= 1)
         output = read_indexed_images<boolNDArray>   (imvec, frameidx,
@@ -752,6 +806,49 @@
   return out;
 }
 
+// Gets the bitdepth to be used for an Octave class, i.e, returns 8 for
+// uint8, 16 for uint16, and 32 for uint32
+template <class T>
+static octave_idx_type
+bitdepth_from_class ()
+{
+  typedef typename T::element_type P;
+  const octave_idx_type bitdepth =
+    sizeof (P) * std::numeric_limits<unsigned char>::digits;
+  return bitdepth;
+}
+
+static Magick::Image
+init_enconde_image (const octave_idx_type& nCols, const octave_idx_type& nRows,
+                    const octave_idx_type& bitdepth,
+                    const Magick::ImageType& type,
+                    const Magick::ClassType& klass)
+{
+  Magick::Image img (Magick::Geometry (nCols, nRows), "black");
+  // Ensure that there are no other references to this image.
+  img.modifyImage ();
+
+  img.classType (klass);
+  img.type (type);
+  // FIXME: for some reason, setting bitdepth doesn't seem to work for
+  //        indexed images.
+  img.depth (bitdepth);
+  switch (type)
+    {
+      case Magick::GrayscaleMatteType:
+      case Magick::TrueColorMatteType:
+      case Magick::ColorSeparationMatteType:
+      case Magick::PaletteMatteType:
+        img.matte (true);
+        break;
+
+      default:
+        img.matte (false);
+    }
+
+  return img;
+}
+
 template <class T>
 static void
 encode_indexed_images (std::vector<Magick::Image>& imvec,
@@ -763,8 +860,7 @@
   const octave_idx_type nRows     = img.rows ();
   const octave_idx_type nCols     = img.columns ();
   const octave_idx_type cmap_size = cmap.rows ();
-  const octave_idx_type bitdepth  =
-    sizeof (P) * std::numeric_limits<unsigned char>::digits;
+  const octave_idx_type bitdepth  = bitdepth_from_class<T> ();
 
   // There is no colormap object, we need to build a new one for each frame,
   // even if it's always the same. We can least get a vector for the Colors.
@@ -781,16 +877,9 @@
 
   for (octave_idx_type frame = 0; frame < nFrames; frame++)
     {
-      Magick::Image m_img (Magick::Geometry (nCols, nRows), "black");
-
-      // Ensure that there are no other references to this image.
-      m_img.modifyImage ();
-
-      m_img.classType (Magick::PseudoClass);
-      m_img.type (Magick::PaletteType);
-      // FIXME: for some reason, setting bitdepth doesn't seem to work for
-      //        indexed images.
-      m_img.depth (bitdepth);
+      Magick::Image m_img = init_enconde_image (nCols, nRows, bitdepth,
+                                                Magick::PaletteType,
+                                                Magick::PseudoClass);
 
       // Insert colormap.
       m_img.colorMapSize (cmap_size);
@@ -830,183 +919,316 @@
 }
 
 static void
-encode_bool_image (std::vector<Magick::Image>& imvec, const octave_value& img)
+encode_bool_image (std::vector<Magick::Image>& imvec, const boolNDArray& img)
 {
-  unsigned int nframes = 1;
-  boolNDArray m = img.bool_array_value ();
+  const octave_idx_type nFrames   = img.ndims () < 4 ? 1 : img.dims ()(3);
+  const octave_idx_type nRows     = img.rows ();
+  const octave_idx_type nCols     = img.columns ();
 
-  dim_vector dsizes = m.dims ();
-  if (dsizes.length () == 4)
-    nframes = dsizes(3);
-
-  Array<octave_idx_type> idx (dim_vector (dsizes.length (), 1));
+  // The initialized image will be black, this is for the other pixels
+  const Magick::Color white ("white");
 
-  octave_idx_type rows = m.rows ();
-  octave_idx_type columns = m.columns ();
-
-  for (unsigned int ii = 0; ii < nframes; ii++)
+  const bool *img_fvec = img.fortran_vec ();
+  octave_idx_type img_idx = 0;
+  for (octave_idx_type frame = 0; frame < nFrames; frame++)
     {
-      Magick::Image im (Magick::Geometry (columns, rows), "black");
-      im.classType (Magick::DirectClass);
-      im.depth (1);
+      // For some reason, we can't set the type to Magick::BilevelType or
+      // the output image will be black, changing to white has no effect.
+      // However, this will still work fine and a binary image will be
+      // saved because we are setting the bitdepth to 1.
+      Magick::Image m_img = init_enconde_image (nCols, nRows, 1,
+                                                Magick::GrayscaleType,
+                                                Magick::DirectClass);
 
-      for (int y = 0; y < columns; y++)
+      Magick::PixelPacket *pix = m_img.getPixels (0, 0, nCols, nRows);
+      octave_idx_type GM_idx = 0;
+      for (octave_idx_type col = 0; col < nCols; col++)
         {
-          idx(1) = y;
-
-          for (int x = 0; x < rows; x++)
+          for (octave_idx_type row = 0; row < nRows; row++)
             {
-              if (nframes > 1)
-                {
-                  idx(2) = 0;
-                  idx(3) = ii;
-                }
+              if (img_fvec[img_idx])
+                pix[GM_idx] = white;
 
-              idx(0) = x;
-
-              if (m(idx))
-                im.pixelColor (y, x, "white");
+              img_idx++;
+              GM_idx += nCols;
             }
+          GM_idx -= nCols * nRows - 1;
         }
-
-      im.quantizeColorSpace (Magick::GRAYColorspace);
-      im.quantizeColors (2);
-      im.quantize ();
-
-      imvec.push_back (im);
+      // Save changes to underlying image.
+      m_img.syncPixels ();
+      // While we could not set it to Bilevel at the start, we can do it
+      // here otherwise some coders won't save it as binary.
+      m_img.type (Magick::BilevelType);
+      imvec.push_back (m_img);
     }
 }
 
 template <class T>
 static void
 encode_uint_image (std::vector<Magick::Image>& imvec,
-                   const octave_value& img)
+                   const T& img, const T& alpha)
 {
-  unsigned int bitdepth = 0;
-  T m;
+  typedef typename T::element_type P;
+  const octave_idx_type channels  = img.ndims () < 3 ? 1 : img.dims ()(2);
+  const octave_idx_type nFrames   = img.ndims () < 4 ? 1 : img.dims ()(3);
+  const octave_idx_type nRows     = img.rows ();
+  const octave_idx_type nCols     = img.columns ();
+  const octave_idx_type bitdepth  = bitdepth_from_class<T> ();
 
-  if (img.is_uint8_type ())
+  Magick::ImageType type;
+  const bool has_alpha = ! alpha.is_empty ();
+  switch (channels)
     {
-      bitdepth = 8;
-      m = img.uint8_array_value ();
-    }
-  else if (img.is_uint16_type ())
-    {
-      bitdepth = 16;
-      m = img.uint16_array_value ();
+    case 1:
+      if (has_alpha)
+        type = Magick::GrayscaleMatteType;
+      else
+        type = Magick::GrayscaleType;
+      break;
+
+    case 3:
+      if (has_alpha)
+        type = Magick::TrueColorMatteType;
+      else
+        type = Magick::TrueColorType;
+      break;
+
+    case 4:
+      if (has_alpha)
+        type = Magick::ColorSeparationMatteType;
+      else
+        type = Magick::ColorSeparationType;
+      break;
+
+    default:
+      {
+        // __imwrite should have already filtered this cases
+        error ("__magick_write__: wrong size on 3rd dimension");
+        return;
+      }
     }
-  else if (img.is_uint32_type ())
-    {
-      bitdepth = 32;
-      m = img.uint32_array_value ();
-    }
-  else
-    error ("__magick_write__: invalid image class");
 
-  const dim_vector dsizes = m.dims ();
-  unsigned int nframes = 1;
-  if (dsizes.length () == 4)
-    nframes = dsizes(3);
-
-  const bool is_color = ((dsizes.length () > 2) && (dsizes(2) > 2));
-  const bool has_alpha = (dsizes.length () > 2 && (dsizes(2) == 2 || dsizes(2) == 4));
+  // We will be passing the values as integers with depth as specified
+  // by QuantumDepth (maximum value specified by MaxRGB). This is independent
+  // of the actual depth of the image. GM will then convert the values but
+  // while in memory, it always keeps the values as specified by QuantumDepth.
+  // From GM documentation:
+  //  Color arguments are must be scaled to fit the Quantum size according to
+  //  the range of MaxRGB
+  const double divisor = (pow (2, bitdepth) - 1) / MaxRGB;
 
-  Array<octave_idx_type> idx (dim_vector (dsizes.length (), 1));
-  octave_idx_type rows = m.rows ();
-  octave_idx_type columns = m.columns ();
-
-  double div_factor = (uint64_t(1) << bitdepth) - 1;
+  const P *img_fvec = img.fortran_vec ();
+  const P *a_fvec   = alpha.fortran_vec ();
+  switch (type)
+    {
+    case Magick::GrayscaleType:
+      {
+        octave_idx_type GM_idx = 0;
+        for (octave_idx_type frame = 0; frame < nFrames; frame++)
+          {
+            Magick::Image m_img = init_enconde_image (nCols, nRows, bitdepth,
+                                                      type,
+                                                      Magick::DirectClass);
 
-  for (unsigned int ii = 0; ii < nframes; ii++)
-    {
-      Magick::Image im (Magick::Geometry (columns, rows), "black");
-
-      im.depth (bitdepth);
-
-      im.classType (Magick::DirectClass);
+            Magick::PixelPacket *pix = m_img.getPixels (0, 0, nCols, nRows);
+            for (octave_idx_type col = 0; col < nCols; col++)
+              {
+                for (octave_idx_type row = 0; row < nRows; row++)
+                  {
+                    Magick::Color c;
+                    c.redQuantum (double (*img_fvec) / divisor);
+                    pix[GM_idx] = c;
+                    img_fvec++;
+                    GM_idx += nCols;
+                  }
+                GM_idx -= nCols * nRows - 1;
+              }
+            // Save changes to underlying image.
+            m_img.syncPixels ();
+            imvec.push_back (m_img);
+          }
+        break;
+      }
 
-      if (is_color)
-        {
-          if (has_alpha)
-            im.type (Magick::TrueColorMatteType);
-          else
-            im.type (Magick::TrueColorType);
+    case Magick::GrayscaleMatteType:
+      {
+        octave_idx_type GM_idx = 0;
+        for (octave_idx_type frame = 0; frame < nFrames; frame++)
+          {
+            Magick::Image m_img = init_enconde_image (nCols, nRows, bitdepth,
+                                                      type,
+                                                      Magick::DirectClass);
 
-          Magick::ColorRGB c;
+            Magick::PixelPacket *pix = m_img.getPixels (0, 0, nCols, nRows);
+            for (octave_idx_type col = 0; col < nCols; col++)
+              {
+                for (octave_idx_type row = 0; row < nRows; row++)
+                  {
+                    Magick::Color c;
+                    c.redQuantum   (double (*img_fvec) / divisor);
+                    c.alphaQuantum (MaxRGB - (double (*a_fvec) / divisor));
+                    pix[GM_idx] = c;
+                    img_fvec++;
+                    a_fvec++;
+                    GM_idx += nCols;
+                  }
+                GM_idx -= nCols * nRows - 1;
+              }
+            // Save changes to underlying image.
+            m_img.syncPixels ();
+            imvec.push_back (m_img);
+          }
+        break;
+      }
 
-          for (int y = 0; y < columns; y++)
-            {
-              idx(1) = y;
-
-              for (int x = 0; x < rows; x++)
-                {
-                  idx(0) = x;
+    case Magick::TrueColorType:
+      {
+        // The fortran_vec offset for the green and blue channels
+        const octave_idx_type G_offset = nCols * nRows;
+        const octave_idx_type B_offset = nCols * nRows * 2;
+        octave_idx_type GM_idx = 0;
+        for (octave_idx_type frame = 0; frame < nFrames; frame++)
+          {
+            Magick::Image m_img = init_enconde_image (nCols, nRows, bitdepth,
+                                                      type,
+                                                      Magick::DirectClass);
 
-                  if (nframes > 1)
-                    idx(3) = ii;
-
-                  idx(2) = 0;
-                  c.red (static_cast<double>(m(idx)) / div_factor);
-
-                  idx(2) = 1;
-                  c.green (static_cast<double>(m(idx)) / div_factor);
-
-                  idx(2) = 2;
-                  c.blue (static_cast<double>(m(idx)) / div_factor);
+            Magick::PixelPacket *pix = m_img.getPixels (0, 0, nCols, nRows);
+            for (octave_idx_type col = 0; col < nCols; col++)
+              {
+                for (octave_idx_type row = 0; row < nRows; row++)
+                  {
+                    Magick::Color c (double (*img_fvec)          / divisor,
+                                     double (img_fvec[G_offset]) / divisor,
+                                     double (img_fvec[B_offset]) / divisor);
+                    pix[GM_idx] = c;
+                    img_fvec++;
+                    GM_idx += nCols;
+                  }
+                GM_idx -= nCols * nRows - 1;
+              }
+            // Save changes to underlying image.
+            m_img.syncPixels ();
+            imvec.push_back (m_img);
+          }
+        break;
+      }
 
-                  if (has_alpha)
-                    {
-                      idx(2) = 3;
-                      c.alpha (static_cast<double>(m(idx)) / div_factor);
-                    }
+    case Magick::TrueColorMatteType:
+      {
+        // The fortran_vec offset for the green and blue channels
+        const octave_idx_type G_offset = nCols * nRows;
+        const octave_idx_type B_offset = nCols * nRows * 2;
+        octave_idx_type GM_idx = 0;
+        for (octave_idx_type frame = 0; frame < nFrames; frame++)
+          {
+            Magick::Image m_img = init_enconde_image (nCols, nRows, bitdepth,
+                                                      type,
+                                                      Magick::DirectClass);
 
-                  im.pixelColor (y, x, c);
-                }
-            }
-        }
-      else
-        {
-          if (has_alpha)
-            im.type (Magick::GrayscaleMatteType);
-          else
-            im.type (Magick::GrayscaleType);
-
-          Magick::ColorGray c;
+            Magick::PixelPacket *pix = m_img.getPixels (0, 0, nCols, nRows);
+            for (octave_idx_type col = 0; col < nCols; col++)
+              {
+                for (octave_idx_type row = 0; row < nRows; row++)
+                  {
+                    Magick::Color c (double (*img_fvec)          / divisor,
+                                     double (img_fvec[G_offset]) / divisor,
+                                     double (img_fvec[B_offset]) / divisor,
+                                     MaxRGB - (double (*a_fvec) / divisor));
+                    pix[GM_idx] = c;
+                    img_fvec++;
+                    a_fvec++;
+                    GM_idx += nCols;
+                  }
+                GM_idx -= nCols * nRows - 1;
+              }
+            // Save changes to underlying image.
+            m_img.syncPixels ();
+            imvec.push_back (m_img);
+          }
+        break;
+      }
 
-          for (int y = 0; y < columns; y++)
-            {
-              idx(1) = y;
+    case Magick::ColorSeparationType:
+      {
+        // The fortran_vec offset for the Magenta, Yellow, and blacK channels
+        const octave_idx_type M_offset = nCols * nRows;
+        const octave_idx_type Y_offset = nCols * nRows * 2;
+        const octave_idx_type K_offset = nCols * nRows * 3;
+        octave_idx_type GM_idx = 0;
+        for (octave_idx_type frame = 0; frame < nFrames; frame++)
+          {
+            Magick::Image m_img = init_enconde_image (nCols, nRows, bitdepth,
+                                                      type,
+                                                      Magick::DirectClass);
 
-              for (int x=0; x < rows; x++)
-                {
-                  idx(0) = x;
-
-                  if (nframes > 1)
-                    {
-                      idx(2) = 0;
-                      idx(3) = ii;
-                    }
+            Magick::PixelPacket *pix = m_img.getPixels (0, 0, nCols, nRows);
+            for (octave_idx_type col = 0; col < nCols; col++)
+              {
+                for (octave_idx_type row = 0; row < nRows; row++)
+                  {
+                    Magick::Color c (double (*img_fvec)          / divisor,
+                                     double (img_fvec[M_offset]) / divisor,
+                                     double (img_fvec[Y_offset]) / divisor,
+                                     double (img_fvec[K_offset]) / divisor);
+                    pix[GM_idx] = c;
+                    img_fvec++;
+                    GM_idx += nCols;
+                  }
+                GM_idx -= nCols * nRows - 1;
+              }
+            // Save changes to underlying image.
+            m_img.syncPixels ();
+            imvec.push_back (m_img);
+          }
+        break;
+      }
 
-                  if (has_alpha)
-                    {
-                      idx(2) = 1;
-                      c.alpha (static_cast<double>(m(idx)) / div_factor);
-                      idx(2) = 0;
-                    }
-
-                  c.shade (static_cast<double>(m(idx)) / div_factor);
+    case Magick::ColorSeparationMatteType:
+      {
+        // The fortran_vec offset for the Magenta, Yellow, and blacK channels
+        const octave_idx_type M_offset = nCols * nRows;
+        const octave_idx_type Y_offset = nCols * nRows * 2;
+        const octave_idx_type K_offset = nCols * nRows * 3;
+        octave_idx_type GM_idx = 0;
+        for (octave_idx_type frame = 0; frame < nFrames; frame++)
+          {
+            Magick::Image m_img = init_enconde_image (nCols, nRows, bitdepth,
+                                                      type,
+                                                      Magick::DirectClass);
 
-                  im.pixelColor (y, x, c);
-                }
-            }
+            Magick::PixelPacket *pix = m_img.getPixels (0, 0, nCols, nRows);
+            Magick::IndexPacket *ind = m_img.getIndexes ();
+            for (octave_idx_type col = 0; col < nCols; col++)
+              {
+                for (octave_idx_type row = 0; row < nRows; row++)
+                  {
+                    Magick::Color c (double (*img_fvec)          / divisor,
+                                     double (img_fvec[M_offset]) / divisor,
+                                     double (img_fvec[Y_offset]) / divisor,
+                                     double (img_fvec[K_offset]) / divisor);
+                    pix[GM_idx] = c;
+                    ind[GM_idx] = MaxRGB - (double (*a_fvec) / divisor);
+                    img_fvec++;
+                    a_fvec++;
+                    GM_idx += nCols;
+                  }
+                GM_idx -= nCols * nRows - 1;
+              }
+            // Save changes to underlying image.
+            m_img.syncPixels ();
+            imvec.push_back (m_img);
+          }
+        break;
+      }
 
-          im.quantizeColorSpace (Magick::GRAYColorspace);
-          im.quantizeColors (1 << bitdepth);
-          im.quantize ();
-        }
-
-      imvec.push_back (im);
+    default:
+      {
+        error ("__magick_write__: unrecognized Magick::ImageType");
+        return;
+      }
     }
+  return;
 }
 
 void static
@@ -1081,14 +1303,18 @@
 
   if (cmap.is_empty ())
     {
+      const octave_value alpha = options.getfield ("alpha");
       if (img.is_bool_type ())
-        encode_bool_image (imvec, img);
+        encode_bool_image (imvec, img.bool_array_value ());
       else if (img.is_uint8_type ())
-        encode_uint_image<uint8NDArray> (imvec, img);
+        encode_uint_image<uint8NDArray>  (imvec, img.uint8_array_value (),
+                                          alpha.uint8_array_value ());
       else if (img.is_uint16_type ())
-        encode_uint_image<uint16NDArray> (imvec, img);
+        encode_uint_image<uint16NDArray> (imvec, img.uint16_array_value (),
+                                          alpha.uint16_array_value ());
       else if (img.is_uint32_type ())
-        encode_uint_image<uint32NDArray> (imvec, img);
+        encode_uint_image<uint32NDArray> (imvec, img.uint32_array_value (),
+                                          alpha.uint32_array_value ());
       else if (img.is_float_type ())
         {
           // For image formats that support floating point values, we write
@@ -1097,12 +1323,18 @@
           // But here, even for formats that would support floating point
           // values, GM seems unable to do that so we at least make them uint32.
           uint32NDArray clip_img;
+          uint32NDArray clip_alpha;
           if (img.is_single_type ())
-            clip_img = img_float2uint<FloatNDArray> (img.float_array_value ());
+            {
+              clip_img   = img_float2uint<FloatNDArray> (img.float_array_value ());
+              clip_alpha = img_float2uint<FloatNDArray> (alpha.float_array_value ());
+            }
           else
-            clip_img = img_float2uint<NDArray> (img.array_value ());
-
-          encode_uint_image<uint32NDArray> (imvec, octave_value (clip_img));
+            {
+              clip_img   = img_float2uint<NDArray> (img.array_value ());
+              clip_alpha = img_float2uint<NDArray> (alpha.array_value ());
+            }
+          encode_uint_image<uint32NDArray> (imvec, clip_img, clip_alpha);
         }
       else
         {
--- a/libinterp/dldfcn/chol.cc
+++ b/libinterp/dldfcn/chol.cc
@@ -103,8 +103,8 @@
 @end ifnottex\n\
 \n\
 The sparsity preserving permutation is generally returned as a matrix.\n\
-However, given the flag \"vector\", @var{Q} will be returned as a vector\n\
-such that\n\
+However, given the flag @qcode{\"vector\"}, @var{Q} will be returned as a\n\
+vector such that\n\
 @tex\n\
 $ R^T R = A (Q, Q)$.\n\
 @end tex\n\
@@ -116,8 +116,8 @@
 \n\
 @end ifnottex\n\
 \n\
-Called with either a sparse or full matrix and using the \"lower\" flag,\n\
-@code{chol} returns the lower triangular factorization such that\n\
+Called with either a sparse or full matrix and using the @qcode{\"lower\"}\n\
+flag, @code{chol} returns the lower triangular factorization such that\n\
 @tex\n\
 $ L L^T = A $.\n\
 @end tex\n\
@@ -129,9 +129,9 @@
 \n\
 @end ifnottex\n\
 \n\
-For full matrices, if the \"lower\" flag is set only the lower triangular\n\
-part of the matrix is used for the factorization, otherwise the upper\n\
-triangular part is used.\n\
+For full matrices, if the @qcode{\"lower\"} flag is set only the lower\n\
+triangular part of the matrix is used for the factorization, otherwise the\n\
+upper triangular part is used.\n\
 \n\
 In general the lower triangular factorization is significantly faster for\n\
 sparse matrices.\n\
@@ -631,14 +631,14 @@
 @itemize @bullet\n\
 @item\n\
 @var{R1}'*@var{R1} = @var{R}'*@var{R} + @var{u}*@var{u}'\n\
-if @var{op} is \"+\"\n\
+if @var{op} is @qcode{\"+\"}\n\
 \n\
 @item\n\
 @var{R1}'*@var{R1} = @var{R}'*@var{R} - @var{u}*@var{u}'\n\
-if @var{op} is \"-\"\n\
+if @var{op} is @qcode{\"-\"}\n\
 @end itemize\n\
 \n\
-If @var{op} is \"-\", @var{info} is set to\n\
+If @var{op} is @qcode{\"-\"}, @var{info} is set to\n\
 \n\
 @itemize\n\
 @item 0 if the downdate was successful,\n\
--- a/libinterp/dldfcn/colamd.cc
+++ b/libinterp/dldfcn/colamd.cc
@@ -651,7 +651,8 @@
 is assumed to be symmetric and the symmetric elimination tree is\n\
 returned.  The argument @var{typ} controls whether a symmetric or\n\
 column elimination tree is returned.  Valid values of @var{typ} are\n\
-\"sym\" or \"col\", for symmetric or column elimination tree respectively\n\
+@qcode{\"sym\"} or @qcode{\"col\"}, for symmetric or column elimination tree\n\
+respectively.\n\
 \n\
 Called with a second argument, @code{etree} also returns the postorder\n\
 permutations on the tree.\n\
--- a/libinterp/dldfcn/fftw.cc
+++ b/libinterp/dldfcn/fftw.cc
@@ -70,31 +70,32 @@
 wisdom can be treated:\n\
 \n\
 @table @asis\n\
-@item \"estimate\"\n\
+@item @qcode{\"estimate\"}\n\
 Specifies that no run-time measurement of the optimal means of\n\
 calculating a particular is performed, and a simple heuristic is used\n\
 to pick a (probably sub-optimal) plan.  The advantage of this method is\n\
 that there is little or no overhead in the generation of the plan, which\n\
 is appropriate for a Fourier transform that will be calculated once.\n\
 \n\
-@item \"measure\"\n\
+@item @qcode{\"measure\"}\n\
 In this case a range of algorithms to perform the transform is considered\n\
 and the best is selected based on their execution time.\n\
 \n\
-@item \"patient\"\n\
-Similar to \"measure\", but a wider range of algorithms is considered.\n\
+@item @qcode{\"patient\"}\n\
+Similar to @qcode{\"measure\"}, but a wider range of algorithms is\n\
+considered.\n\
 \n\
-@item \"exhaustive\"\n\
-Like \"measure\", but all possible algorithms that may be used to\n\
+@item @qcode{\"exhaustive\"}\n\
+Like @qcode{\"measure\"}, but all possible algorithms that may be used to\n\
 treat the transform are considered.\n\
 \n\
-@item \"hybrid\"\n\
+@item @qcode{\"hybrid\"}\n\
 As run-time measurement of the algorithm can be expensive, this is a\n\
-compromise where \"measure\" is used for transforms up to the size of 8192\n\
-and beyond that the \"estimate\" method is used.\n\
+compromise where @qcode{\"measure\"} is used for transforms up to the size\n\
+of 8192 and beyond that the @qcode{\"estimate\"} method is used.\n\
 @end table\n\
 \n\
-The default method is \"estimate\".  The current method can\n\
+The default method is @qcode{\"estimate\"}.  The current method can\n\
 be queried with\n\
 \n\
 @example\n\
--- a/libinterp/dldfcn/qr.cc
+++ b/libinterp/dldfcn/qr.cc
@@ -133,7 +133,7 @@
 @var{R} is upper triangular.\n\
 @end ifnottex\n\
 \n\
-If given a second argument of '0', @code{qr} returns an economy-sized\n\
+If given a second argument of @qcode{'0'}, @code{qr} returns an economy-sized\n\
 QR@tie{}factorization, omitting zero rows of @var{R} and the corresponding\n\
 columns of @var{Q}.\n\
 \n\
@@ -942,13 +942,13 @@
 @w{@var{A} = @var{Q}*@var{R}}, @var{Q}@tie{}unitary and\n\
 @var{R}@tie{}upper trapezoidal, return the QR@tie{}factorization of\n\
 @w{[A(:,1:j-1) x A(:,j:n)]}, where @var{u} is a column vector to be\n\
-inserted into @var{A} (if @var{orient} is @code{\"col\"}), or the\n\
+inserted into @var{A} (if @var{orient} is @qcode{\"col\"}), or the\n\
 QR@tie{}factorization of @w{[A(1:j-1,:);x;A(:,j:n)]}, where @var{x}\n\
 is a row vector to be inserted into @var{A} (if @var{orient} is\n\
-@code{\"row\"}).\n\
+@qcode{\"row\"}).\n\
 \n\
-The default value of @var{orient} is @code{\"col\"}.\n\
-If @var{orient} is @code{\"col\"},\n\
+The default value of @var{orient} is @qcode{\"col\"}.\n\
+If @var{orient} is @qcode{\"col\"},\n\
 @var{u} may be a matrix and @var{j} an index vector\n\
 resulting in the QR@tie{}factorization of a matrix @var{B} such that\n\
 @w{B(:,@var{j})} gives @var{u} and @w{B(:,@var{j}) = []} gives @var{A}.\n\
@@ -956,11 +956,11 @@
 thus, for k large enough, it will be both faster and more accurate to\n\
 recompute the factorization from scratch.\n\
 \n\
-If @var{orient} is @code{\"col\"},\n\
+If @var{orient} is @qcode{\"col\"},\n\
 the QR@tie{}factorization supplied may be either full\n\
 (Q is square) or economized (R is square).\n\
 \n\
-If @var{orient} is @code{\"row\"}, full factorization is needed.\n\
+If @var{orient} is @qcode{\"row\"}, full factorization is needed.\n\
 @seealso{qr, qrupdate, qrdelete, qrshift}\n\
 @end deftypefn")
 {
@@ -1161,13 +1161,13 @@
 @w{@var{A} = @var{Q}*@var{R}}, @var{Q}@tie{}unitary and\n\
 @var{R}@tie{}upper trapezoidal, return the QR@tie{}factorization of\n\
 @w{[A(:,1:j-1) A(:,j+1:n)]}, i.e., @var{A} with one column deleted\n\
-(if @var{orient} is \"col\"), or the QR@tie{}factorization of\n\
+(if @var{orient} is @qcode{\"col\"}), or the QR@tie{}factorization of\n\
 @w{[A(1:j-1,:);A(j+1:n,:)]}, i.e., @var{A} with one row deleted (if\n\
-@var{orient} is \"row\").\n\
+@var{orient} is @qcode{\"row\"}).\n\
 \n\
-The default value of @var{orient} is \"col\".\n\
+The default value of @var{orient} is @qcode{\"col\"}.\n\
 \n\
-If @var{orient} is @code{\"col\"},\n\
+If @var{orient} is @qcode{\"col\"},\n\
 @var{j} may be an index vector\n\
 resulting in the QR@tie{}factorization of a matrix @var{B} such that\n\
 @w{A(:,@var{j}) = []} gives @var{B}.\n\
@@ -1175,11 +1175,11 @@
 thus, for k large enough, it will be both faster and more accurate to\n\
 recompute the factorization from scratch.\n\
 \n\
-If @var{orient} is @code{\"col\"},\n\
+If @var{orient} is @qcode{\"col\"},\n\
 the QR@tie{}factorization supplied may be either full\n\
 (Q is square) or economized (R is square).\n\
 \n\
-If @var{orient} is @code{\"row\"}, full factorization is needed.\n\
+If @var{orient} is @qcode{\"row\"}, full factorization is needed.\n\
 @seealso{qr, qrupdate, qrinsert, qrshift}\n\
 @end deftypefn")
 {
@@ -1392,7 +1392,7 @@
 %! assert (norm (vec (triu (R) - R), Inf) == 0);
 %! assert (norm (vec (Q*R - [AA(1:2,:);AA(4:5,:)]), Inf) < norm (AA)*1e1*eps ("single"));
 %!testif HAVE_QRUPDATE
-%! # Same test as above but with more precicision
+%! ## Same test as above but with more precicision
 %! AA = single ([0.091364  0.613038  0.027504  0.999083;
 %!               0.594638  0.425302  0.562834  0.603537;
 %!               0.383594  0.291238  0.742073  0.085574;
--- a/libinterp/dldfcn/symbfact.cc
+++ b/libinterp/dldfcn/symbfact.cc
@@ -63,18 +63,18 @@
 Factorize @code{@var{S}' * @var{S}}.\n\
 \n\
 @item row\n\
-Factorize @xcode{@var{S} * @var{S}'}.\n\
+Factorize @tcode{@var{S} * @var{S}'}.\n\
 \n\
 @item lo\n\
-Factorize @xcode{@var{S}'}\n\
+Factorize @tcode{@var{S}'}\n\
 @end table\n\
 \n\
 @item mode\n\
 The default is to return the Cholesky@tie{}factorization for @var{r}, and if\n\
-@var{mode} is 'L', the conjugate transpose of the Cholesky@tie{}factorization\n\
-is returned.  The conjugate transpose version is faster and uses less\n\
-memory, but returns the same values for @var{count}, @var{h}, @var{parent}\n\
-and @var{post} outputs.\n\
+@var{mode} is @qcode{'L'}, the conjugate transpose of the\n\
+Cholesky@tie{}factorization is returned.  The conjugate transpose version is\n\
+faster and uses less memory, but returns the same values for @var{count},\n\
+@var{h}, @var{parent} and @var{post} outputs.\n\
 @end table\n\
 \n\
 The output variables are\n\
--- a/libinterp/dldfcn/urlwrite.cc
+++ b/libinterp/dldfcn/urlwrite.cc
@@ -48,6 +48,7 @@
 #include "oct-map.h"
 #include "oct-refcount.h"
 #include "unwind-prot.h"
+#include "gripes.h"
 
 #ifdef HAVE_CURL
 
@@ -843,7 +844,7 @@
     error ("urlwrite: curl: %s", curl.lasterror ().c_str ());
 
 #else
-  error ("urlwrite: not available in this version of Octave");
+  gripe_disabled_feature ("urlwrite", "urlwrite");
 #endif
 
   return retval;
@@ -962,7 +963,7 @@
     error ("urlread: curl: %s", curl.lasterror().c_str());
 
 #else
-  error ("urlread: not available in this version of Octave");
+  gripe_disabled_feature ("urlread", "urlread");
 #endif
 
   return retval;
@@ -1004,7 +1005,7 @@
         }
     }
 #else
-  error ("__ftp__: not available in this version of Octave");
+  gripe_disabled_feature ("__ftp__", "FTP");
 #endif
 
   return octave_value ();
@@ -1037,7 +1038,7 @@
         }
     }
 #else
-  error ("__ftp_pwd__: not available in this version of Octave");
+  gripe_disabled_feature ("__ftp_pwd__", "FTP");
 #endif
 
   return retval;
@@ -1073,7 +1074,7 @@
         }
     }
 #else
-  error ("__ftp_cwd__: not available in this version of Octave");
+  gripe_disabled_feature ("__ftp_cwd__", "FTP");
 #endif
 
   return octave_value ();
@@ -1153,7 +1154,7 @@
         }
     }
 #else
-  error ("__ftp_dir__: not available in this version of Octave");
+  gripe_disabled_feature ("__ftp_dir__", "FTP");
 #endif
 
   return retval;
@@ -1185,7 +1186,7 @@
         }
     }
 #else
-  error ("__ftp_ascii__: not available in this version of Octave");
+  gripe_disabled_feature ("__ftp_ascii__", "FTP");
 #endif
 
   return octave_value ();
@@ -1217,7 +1218,7 @@
         }
     }
 #else
-  error ("__ftp_binary__: not available in this version of Octave");
+  gripe_disabled_feature ("__ftp_binary__", "FTP");
 #endif
 
   return octave_value ();
@@ -1226,46 +1227,46 @@
 DEFUN_DLD (__ftp_close__, args, ,
   "-*- texinfo -*-\n\
 @deftypefn {Loadable Function} {} __ftp_close__ (@var{handle})\n\
- Undocumented internal function\n\
- @end deftypefn")
- {
- #ifdef HAVE_CURL
-   int nargin = args.length ();
+Undocumented internal function\n\
+@end deftypefn")
+{
+#ifdef HAVE_CURL
+  int nargin = args.length ();
 
-   if (nargin != 1)
-     error ("__ftp_close__: incorrect number of arguments");
-   else
-     {
-       std::string handle = args(0).string_value ();
+  if (nargin != 1)
+    error ("__ftp_close__: incorrect number of arguments");
+  else
+    {
+      std::string handle = args(0).string_value ();
 
-       if (!error_state)
-         handles.del (handle);
-     }
- #else
-   error ("__ftp_close__: not available in this version of Octave");
- #endif
+      if (! error_state)
+        handles.del (handle);
+    }
+#else
+  gripe_disabled_feature ("__ftp_close__", "FTP");
+#endif
 
-   return octave_value ();
- }
+  return octave_value ();
+}
 
 DEFUN_DLD (__ftp_mode__, args, ,
   "-*- texinfo -*-\n\
 @deftypefn {Loadable Function} {} __ftp_mode__ (@var{handle})\n\
- Undocumented internal function\n\
- @end deftypefn")
- {
-   octave_value retval;
- #ifdef HAVE_CURL
-   int nargin = args.length ();
+Undocumented internal function\n\
+@end deftypefn")
+{
+  octave_value retval;
+#ifdef HAVE_CURL
+  int nargin = args.length ();
 
-   if (nargin != 1)
-     error ("__ftp_mode__: incorrect number of arguments");
-   else
-     {
-       std::string handle = args(0).string_value ();
+  if (nargin != 1)
+    error ("__ftp_mode__: incorrect number of arguments");
+  else
+    {
+      std::string handle = args(0).string_value ();
 
 
-      if (!error_state)
+      if (! error_state)
         {
           const curl_handle curl = handles.contents (handle);
 
@@ -1274,13 +1275,13 @@
           else
             error ("__ftp_binary__: invalid ftp handle");
         }
-     }
- #else
-   error ("__ftp_mode__: not available in this version of Octave");
- #endif
+    }
+#else
+  gripe_disabled_feature ("__ftp_mode__", "FTP");
+#endif
 
-   return retval;
- }
+  return retval;
+}
 
 DEFUN_DLD (__ftp_delete__, args, ,
   "-*- texinfo -*-\n\
@@ -1309,7 +1310,7 @@
         }
     }
 #else
-  error ("__ftp_delete__: not available in this version of Octave");
+  gripe_disabled_feature ("__ftp_delete__", "FTP");
 #endif
 
   return octave_value ();
@@ -1342,7 +1343,7 @@
         }
     }
 #else
-  error ("__ftp_rmdir__: not available in this version of Octave");
+  gripe_disabled_feature ("__ftp_rmdir__", "FTP");
 #endif
 
   return octave_value ();
@@ -1375,7 +1376,7 @@
         }
     }
 #else
-  error ("__ftp_mkdir__: not available in this version of Octave");
+  gripe_disabled_feature ("__ftp_mkdir__", "FTP");
 #endif
 
   return octave_value ();
@@ -1409,7 +1410,7 @@
         }
     }
 #else
-  error ("__ftp_rename__: not available in this version of Octave");
+  gripe_disabled_feature ("__ftp_rename__", "FTP");
 #endif
 
   return octave_value ();
@@ -1574,7 +1575,7 @@
         }
     }
 #else
-  error ("__ftp_mput__: not available in this version of Octave");
+  gripe_disabled_feature ("__ftp_mput__", "FTP");
 #endif
 
   return (nargout > 0 ? octave_value (retval) : octave_value ());
@@ -1735,7 +1736,7 @@
         }
     }
 #else
-  error ("__ftp_mget__: not available in this version of Octave");
+  gripe_disabled_feature ("__ftp_mget__", "FTP");
 #endif
 
   return octave_value ();
--- a/libinterp/octave-value/ov-base.cc
+++ b/libinterp/octave-value/ov-base.cc
@@ -1565,9 +1565,9 @@
 @end group\n\
 @end example\n\
 \n\
-When called from inside a function with the \"local\" option, the variable is\n\
-changed locally for the function and any subroutines it calls.  The original\n\
-variable value is restored when exiting the function.\n\
+When called from inside a function with the @qcode{\"local\"} option, the\n\
+variable is changed locally for the function and any subroutines it calls.  \n\
+The original variable value is restored when exiting the function.\n\
 @end deftypefn")
 {
   return SET_INTERNAL_VARIABLE (sparse_auto_mutate);
--- a/libinterp/octave-value/ov-fcn-handle.cc
+++ b/libinterp/octave-value/ov-fcn-handle.cc
@@ -1792,8 +1792,8 @@
 @deftypefn  {Built-in Function} {} str2func (@var{fcn_name})\n\
 @deftypefnx {Built-in Function} {} str2func (@var{fcn_name}, \"global\")\n\
 Return a function handle constructed from the string @var{fcn_name}.\n\
-If the optional \"global\" argument is passed, locally visible functions\n\
-are ignored in the lookup.\n\
+If the optional @qcode{\"global\"} argument is passed, locally visible\n\
+functions are ignored in the lookup.\n\
 @end deftypefn")
 {
   octave_value retval;
--- a/libinterp/octave-value/ov-fcn-inline.cc
+++ b/libinterp/octave-value/ov-fcn-inline.cc
@@ -652,7 +652,7 @@
 they are the names of the arguments of the function.\n\
 \n\
 If the second argument is an integer @var{n}, the arguments are\n\
-@code{\"x\"}, @code{\"P1\"}, @dots{}, @code{\"P@var{N}\"}.\n\
+@qcode{\"x\"}, @qcode{\"P1\"}, @dots{}, @qcode{\"P@var{N}\"}.\n\
 @seealso{argnames, formula, vectorize}\n\
 @end deftypefn")
 {
--- a/libinterp/octave-value/ov-java.cc
+++ b/libinterp/octave-value/ov-java.cc
@@ -2304,9 +2304,9 @@
 Query or set the internal variable that controls whether Java arrays are\n\
 automatically converted to Octave matrices.  The default value is false.\n\
 \n\
-When called from inside a function with the \"local\" option, the variable is\n\
-changed locally for the function and any subroutines it calls.  The original\n\
-variable value is restored when exiting the function.\n\
+When called from inside a function with the @qcode{\"local\"} option, the\n\
+variable is changed locally for the function and any subroutines it calls.  \n\
+The original variable value is restored when exiting the function.\n\
 @seealso{java_unsigned_autoconversion, debug_java}\n\
 @end deftypefn")
 {
@@ -2328,9 +2328,9 @@
 Java arrays of class Byte or Integer are converted to matrices of class\n\
 uint8 or uint32 respectively.  The default value is true.\n\
 \n\
-When called from inside a function with the \"local\" option, the variable is\n\
-changed locally for the function and any subroutines it calls.  The original\n\
-variable value is restored when exiting the function.\n\
+When called from inside a function with the @qcode{\"local\"} option, the\n\
+variable is changed locally for the function and any subroutines it calls.  \n\
+The original variable value is restored when exiting the function.\n\
 @seealso{java_matrix_autoconversion, debug_java}\n\
 @end deftypefn")
 {
@@ -2351,9 +2351,9 @@
 information regarding the initialization of the JVM and any Java exceptions\n\
 is printed.\n\
 \n\
-When called from inside a function with the \"local\" option, the variable is\n\
-changed locally for the function and any subroutines it calls.  The original\n\
-variable value is restored when exiting the function.\n\
+When called from inside a function with the @qcode{\"local\"} option, the\n\
+variable is changed locally for the function and any subroutines it calls.  \n\
+The original variable value is restored when exiting the function.\n\
 @seealso{java_matrix_autoconversion, java_unsigned_autoconversion}\n\
 @end deftypefn")
 {
--- a/libinterp/octave-value/ov-range.cc
+++ b/libinterp/octave-value/ov-range.cc
@@ -688,9 +688,9 @@
 compatibility; however, it is still not entirely compatible because\n\
 @sc{matlab} treats the range expression differently in different contexts.\n\
 \n\
-When called from inside a function with the \"local\" option, the variable is\n\
-changed locally for the function and any subroutines it calls.  The original\n\
-variable value is restored when exiting the function.\n\
+When called from inside a function with the @qcode{\"local\"} option, the\n\
+variable is changed locally for the function and any subroutines it calls.  \n\
+The original variable value is restored when exiting the function.\n\
 @end deftypefn")
 {
   return SET_INTERNAL_VARIABLE (allow_noninteger_range_as_index);
--- a/libinterp/octave-value/ov-struct.cc
+++ b/libinterp/octave-value/ov-struct.cc
@@ -2285,9 +2285,9 @@
 Query or set the internal variable that specifies the number of\n\
 structure levels to display.\n\
 \n\
-When called from inside a function with the \"local\" option, the variable is\n\
-changed locally for the function and any subroutines it calls.  The original\n\
-variable value is restored when exiting the function.\n\
+When called from inside a function with the @qcode{\"local\"} option, the\n\
+variable is changed locally for the function and any subroutines it calls.  \n\
+The original variable value is restored when exiting the function.\n\
 @end deftypefn")
 {
   return SET_INTERNAL_VARIABLE_WITH_LIMITS (struct_levels_to_print, -1,
@@ -2305,9 +2305,9 @@
 are always printed.  In both cases, however, printing will be limited to\n\
 the number of levels specified by @var{struct_levels_to_print}.\n\
 \n\
-When called from inside a function with the \"local\" option, the variable is\n\
-changed locally for the function and any subroutines it calls.  The original\n\
-variable value is restored when exiting the function.\n\
+When called from inside a function with the @qcode{\"local\"} option, the\n\
+variable is changed locally for the function and any subroutines it calls.  \n\
+The original variable value is restored when exiting the function.\n\
 @end deftypefn")
 {
   return SET_INTERNAL_VARIABLE (print_struct_array_contents);
--- a/libinterp/octave-value/ov-usr-fcn.cc
+++ b/libinterp/octave-value/ov-usr-fcn.cc
@@ -978,9 +978,9 @@
 If true, Octave will attempt to eliminate the redundant copying when calling\n\
 subsasgn method of a user-defined class.\n\
 \n\
-When called from inside a function with the \"local\" option, the variable is\n\
-changed locally for the function and any subroutines it calls.  The original\n\
-variable value is restored when exiting the function.\n\
+When called from inside a function with the @qcode{\"local\"} option, the\n\
+variable is changed locally for the function and any subroutines it calls.  \n\
+The original variable value is restored when exiting the function.\n\
 @end deftypefn")
 {
   return SET_INTERNAL_VARIABLE (optimize_subsasgn_calls);
--- a/libinterp/parse-tree/lex.ll
+++ b/libinterp/parse-tree/lex.ll
@@ -987,6 +987,8 @@
       warning_with_id ("Octave:deprecated-syntax",
                        "%s; near line %d of file '%s'", msg,
                        curr_lexer->input_line_number, nm.c_str ());
+
+    curr_lexer->handle_continuation ();
   }
 
 %{
--- a/libinterp/parse-tree/oct-parse.in.yy
+++ b/libinterp/parse-tree/oct-parse.in.yy
@@ -240,7 +240,7 @@
 %type <tree_expression_type> matrix cell
 %type <tree_expression_type> primary_expr oper_expr
 %type <tree_expression_type> simple_expr colon_expr assign_expr expression
-%type <tree_identifier_type> identifier fcn_name magic_tilde opt_identifier
+%type <tree_identifier_type> identifier fcn_name magic_tilde
 %type <tree_identifier_type> superclass_identifier meta_identifier
 %type <octave_user_function_type> function1 function2 classdef1
 %type <tree_index_expression_type> word_list_cmd
@@ -259,12 +259,12 @@
 %type <tree_switch_command_type> switch_command
 %type <tree_switch_case_type> switch_case default_case
 %type <tree_switch_case_list_type> case_list1 case_list
-%type <tree_decl_elt_type> decl2
+%type <tree_decl_elt_type> decl2 param_list_elt
 %type <tree_decl_init_list_type> decl1
 %type <tree_decl_command_type> declaration
 %type <tree_statement_type> statement function_end classdef_end
 %type <tree_statement_list_type> simple_list simple_list1 list list1
-%type <tree_statement_list_type> opt_list input1
+%type <tree_statement_list_type> opt_list
 // These types need to be specified.
 %type <dummy_type> attr
 %type <dummy_type> class_event
@@ -307,33 +307,24 @@
 // Statements and statement lists
 // ==============================
 
-input           : input1
+input           : simple_list '\n'
                   {
                     parser.stmt_list = $1;
                     YYACCEPT;
                   }
-                | simple_list parse_error
-                  { ABORT_PARSE; }
+                | simple_list END_OF_INPUT
+                  {
+                    lexer.end_of_input = true;
+                    parser.stmt_list = $1;
+                    YYACCEPT;
+                  }
                 | parse_error
                   { ABORT_PARSE; }
                 ;
 
-input1          : '\n'
+simple_list     : opt_sep_no_nl
                   { $$ = 0; }
-                | END_OF_INPUT
-                  {
-                    lexer.end_of_input = true;
-                    $$ = 0;
-                  }
-                | simple_list
-                  { $$ = $1; }
-                | simple_list '\n'
-                  { $$ = $1; }
-                | simple_list END_OF_INPUT
-                  { $$ = $1; }
-                ;
-
-simple_list     : simple_list1 opt_sep_no_nl
+                | simple_list1 opt_sep_no_nl
                   { $$ = parser.set_stmt_print_flag ($1, $2, false); }
                 ;
 
@@ -798,10 +789,6 @@
                     lexer.looking_at_initializer_expression = false;
                     $$ = new tree_decl_elt ($1, $4);
                   }
-                | magic_tilde
-                  {
-                    $$ = new tree_decl_elt ($1);
-                  }
                 ;
 
 // ====================
@@ -975,15 +962,10 @@
                     if (! ($$ = parser.make_unwind_command ($1, $4, $8, $9, $2, $6)))
                       ABORT_PARSE;
                   }
-                | TRY stash_comment opt_sep opt_list CATCH list END
+                | TRY stash_comment opt_sep opt_list CATCH stash_comment
+                  opt_sep opt_list END
                   {
-                    if (! ($$ = parser.make_try_command ($1, $4, $6, 0, $7, $2, 0)))
-                      ABORT_PARSE;
-                  }
-                | TRY stash_comment opt_sep opt_list CATCH opt_identifier
-                  stash_comment opt_sep opt_list END
-                  {
-                    if (! ($$ = parser.make_try_command ($1, $4, $9, $6, $10, $2, $7)))
+                    if (! ($$ = parser.make_try_command ($1, $4, $7, $8, $9, $2, $6)))
                       ABORT_PARSE;
                   }
                 | TRY stash_comment opt_sep opt_list END
@@ -993,12 +975,6 @@
                   }
                 ;
 
-opt_identifier: // empty
-                  { $$ = 0; }
-                | identifier sep
-                  { $$ = $1; }
-                ;
-
 // ===========================================
 // Some 'subroutines' for function definitions
 // ===========================================
@@ -1081,15 +1057,21 @@
                   }
                 ;
 
-param_list2     : decl2
+param_list2     : param_list_elt
                   { $$ = new tree_parameter_list ($1); }
-                | param_list2 ',' decl2
+                | param_list2 ',' param_list_elt
                   {
                     $1->append ($3);
                     $$ = $1;
                   }
                 ;
 
+param_list_elt  : decl2
+                  { $$ = $1; }
+                | magic_tilde
+                  { $$ = new tree_decl_elt ($1); }
+                ;
+
 // ===================================
 // List of function return value names
 // ===================================
@@ -1097,19 +1079,31 @@
 return_list     : '[' ']'
                   {
                     lexer.looking_at_return_list = false;
+
                     $$ = new tree_parameter_list ();
                   }
-                | return_list1
+                | identifier
                   {
                     lexer.looking_at_return_list = false;
-                    if ($1->validate (tree_parameter_list::out))
-                      $$ = $1;
+
+                    tree_parameter_list *tmp = new tree_parameter_list ($1);
+
+                    // Even though this parameter list can contain only
+                    // a single identifier, we still need to validate it
+                    // to check for varargin or varargout.
+
+                    if (tmp->validate (tree_parameter_list::out))
+                      $$ = tmp;
                     else
                       ABORT_PARSE;
                   }
                 | '[' return_list1 ']'
                   {
                     lexer.looking_at_return_list = false;
+
+                    // Check for duplicate parameter names, varargin,
+                    // or varargout.
+
                     if ($2->validate (tree_parameter_list::out))
                       $$ = $2;
                     else
@@ -2201,8 +2195,8 @@
 tree_command *
 octave_base_parser::make_try_command (token *try_tok,
                                       tree_statement_list *body,
+                                      char catch_sep,
                                       tree_statement_list *cleanup_stmts,
-                                      tree_identifier *id,
                                       token *end_tok,
                                       octave_comment_list *lc,
                                       octave_comment_list *mc)
@@ -2216,6 +2210,25 @@
       int l = try_tok->line ();
       int c = try_tok->column ();
 
+      tree_identifier *id = 0;
+
+      if (! catch_sep && cleanup_stmts && ! cleanup_stmts->empty ())
+        {
+          tree_statement *stmt = cleanup_stmts->front ();
+
+          if (stmt)
+            {
+              tree_expression *expr = stmt->expression ();
+
+              if (expr && expr->is_identifier ())
+                {
+                  id = dynamic_cast<tree_identifier *> (expr);
+
+                  cleanup_stmts->pop_front ();
+                }
+            }
+        }
+
       retval = new tree_try_catch_command (body, cleanup_stmts, id,
                                            lc, mc, tc, l, c);
     }
@@ -3763,9 +3776,9 @@
 @deftypefnx {Built-in Function} {} mfilename (\"fullpath\")\n\
 @deftypefnx {Built-in Function} {} mfilename (\"fullpathext\")\n\
 Return the name of the currently executing file.  At the top-level,\n\
-return the empty string.  Given the argument @code{\"fullpath\"},\n\
+return the empty string.  Given the argument @qcode{\"fullpath\"},\n\
 include the directory part of the file name, but not the extension.\n\
-Given the argument @code{\"fullpathext\"}, include the directory part\n\
+Given the argument @qcode{\"fullpathext\"}, include the directory part\n\
 of the file name and the extension.\n\
 @end deftypefn")
 {
@@ -4284,7 +4297,7 @@
   "-*- texinfo -*-\n\
 @deftypefn {Built-in Function} {} assignin (@var{context}, @var{varname}, @var{value})\n\
 Assign @var{value} to @var{varname} in context @var{context}, which\n\
-may be either @code{\"base\"} or @code{\"caller\"}.\n\
+may be either @qcode{\"base\"} or @qcode{\"caller\"}.\n\
 @seealso{evalin}\n\
 @end deftypefn")
 {
@@ -4338,8 +4351,8 @@
 @deftypefn  {Built-in Function} {} evalin (@var{context}, @var{try})\n\
 @deftypefnx {Built-in Function} {} evalin (@var{context}, @var{try}, @var{catch})\n\
 Like @code{eval}, except that the expressions are evaluated in the\n\
-context @var{context}, which may be either @code{\"caller\"} or\n\
-@code{\"base\"}.\n\
+context @var{context}, which may be either @qcode{\"caller\"} or\n\
+@qcode{\"base\"}.\n\
 @seealso{eval, assignin}\n\
 @end deftypefn")
 {
@@ -4422,3 +4435,54 @@
 
   return retval;
 }
+
+DEFUN (__parse_file__, args, nargout,
+  "-*- texinfo -*-\n\
+@deftypefn {Built-in Function} {} __parse_file__ (@var{file}, @var{verbose})\n\
+Undocumented internal function.\n\
+@end deftypefn")
+{
+  octave_value retval;
+
+  int nargin = args.length ();
+
+  if (nargin == 1 || nargin == 2)
+    {
+      std::string file = args(0).string_value ();
+      
+      std::string full_file = octave_env::make_absolute (file);
+
+      size_t file_len = file.length ();
+
+      if ((file_len > 4 && file.substr (file_len-4) == ".oct")
+          || (file_len > 4 && file.substr (file_len-4) == ".mex")
+          || (file_len > 2 && file.substr (file_len-2) == ".m"))
+        {
+          file = octave_env::base_pathname (file);
+          file = file.substr (0, file.find_last_of ('.'));
+
+          size_t pos = file.find_last_of (file_ops::dir_sep_str ());
+          if (pos != std::string::npos)
+            file = file.substr (pos+1);
+        }
+
+      if (! error_state)
+        {
+          if (nargin == 2)
+            octave_stdout << "parsing " << full_file << std::endl;
+
+          octave_function *fcn = parse_fcn_file (full_file, file, "",
+                                                 true, false, false,
+                                                 false, "__parse_file__");
+
+          if (fcn)
+            delete fcn;
+        }
+      else
+        error ("__parse_file__: expecting file name as argument");
+    }
+  else
+    print_usage ();
+
+  return retval;
+}
--- a/libinterp/parse-tree/parse.h
+++ b/libinterp/parse-tree/parse.h
@@ -201,8 +201,9 @@
   // Build a try-catch command.
   tree_command *
   make_try_command (token *try_tok, tree_statement_list *body,
-                    tree_statement_list *cleanup, tree_identifier *id, token *end_tok,
-                    octave_comment_list *lc, octave_comment_list *mc);
+                    char catch_sep, tree_statement_list *cleanup,
+                    token *end_tok, octave_comment_list *lc,
+                    octave_comment_list *mc);
 
   // Build a while command.
   tree_command *
--- a/libinterp/parse-tree/pt-binop.cc
+++ b/libinterp/parse-tree/pt-binop.cc
@@ -293,9 +293,9 @@
 To obtain short-circuit behavior for logical expressions in new programs,\n\
 you should always use the @samp{&&} and @samp{||} operators.\n\
 \n\
-When called from inside a function with the \"local\" option, the variable is\n\
-changed locally for the function and any subroutines it calls.  The original\n\
-variable value is restored when exiting the function.\n\
+When called from inside a function with the @qcode{\"local\"} option, the\n\
+variable is changed locally for the function and any subroutines it calls.  \n\
+The original variable value is restored when exiting the function.\n\
 @end deftypefn")
 {
   return SET_INTERNAL_VARIABLE (do_braindead_shortcircuit_evaluation);
--- a/libinterp/parse-tree/pt-eval.cc
+++ b/libinterp/parse-tree/pt-eval.cc
@@ -810,18 +810,18 @@
                 break;
               else
                 {
-                  // Clear preivous values before next statement is
+                  // Clear previous values before next statement is
                   // evaluated so that we aren't holding an extra
                   // reference to a value that may be used next.  For
                   // example, in code like this:
                   //
-                  //   X = rand (N);  ## refcount for X should be 1
-                  //                  ## after this statement
+                  //   X = rand (N);  # refcount for X should be 1
+                  //                  # after this statement
                   //
-                  //   X(idx) = val;  ## no extra copy of X should be
-                  //                  ## needed, but we will be faked
-                  //                  ## out if retval is not cleared
-                  //                  ## between statements here
+                  //   X(idx) = val;  # no extra copy of X should be
+                  //                  # needed, but we will be faked
+                  //                  # out if retval is not cleared
+                  //                  # between statements here
 
                   //              result_values = empty_list;
                 }
@@ -1259,9 +1259,9 @@
 be called recursively.  If the limit is exceeded, an error message is\n\
 printed and control returns to the top level.\n\
 \n\
-When called from inside a function with the \"local\" option, the variable is\n\
-changed locally for the function and any subroutines it calls.  The original\n\
-variable value is restored when exiting the function.\n\
+When called from inside a function with the @qcode{\"local\"} option, the\n\
+variable is changed locally for the function and any subroutines it calls.\n\
+The original variable value is restored when exiting the function.\n\
 @end deftypefn")
 {
   return SET_INTERNAL_VARIABLE (max_recursion_depth);
@@ -1289,9 +1289,9 @@
 Octave will display the results produced by evaluating expressions\n\
 within a function body that are not terminated with a semicolon.\n\
 \n\
-When called from inside a function with the \"local\" option, the variable is\n\
-changed locally for the function and any subroutines it calls.  The original\n\
-variable value is restored when exiting the function.\n\
+When called from inside a function with the @qcode{\"local\"} option, the\n\
+variable is changed locally for the function and any subroutines it calls.\n\
+The original variable value is restored when exiting the function.\n\
 @end deftypefn")
 {
   return SET_INTERNAL_VARIABLE (silent_functions);
--- a/libinterp/parse-tree/pt-mat.cc
+++ b/libinterp/parse-tree/pt-mat.cc
@@ -1373,7 +1373,7 @@
 @deftypefnx {Built-in Function} {} string_fill_char (@var{new_val}, \"local\")\n\
 Query or set the internal variable used to pad all rows of a character\n\
 matrix to the same length.  It must be a single character.  The default\n\
-value is @code{\" \"} (a single space).  For example:\n\
+value is @qcode{\" \"} (a single space).  For example:\n\
 \n\
 @example\n\
 @group\n\
@@ -1385,9 +1385,9 @@
 @end group\n\
 @end example\n\
 \n\
-When called from inside a function with the \"local\" option, the variable is\n\
-changed locally for the function and any subroutines it calls.  The original\n\
-variable value is restored when exiting the function.\n\
+When called from inside a function with the @qcode{\"local\"} option, the\n\
+variable is changed locally for the function and any subroutines it calls.  \n\
+The original variable value is restored when exiting the function.\n\
 @end deftypefn")
 {
   return SET_INTERNAL_VARIABLE (string_fill_char);
--- a/libinterp/parse-tree/pt-misc.h
+++ b/libinterp/parse-tree/pt-misc.h
@@ -59,6 +59,9 @@
   tree_parameter_list (tree_decl_elt *t)
     : marked_for_varargs (0) { append (t); }
 
+  tree_parameter_list (tree_identifier *id)
+    : marked_for_varargs (0) { append (new tree_decl_elt (id)); }
+
   ~tree_parameter_list (void);
 
   void mark_as_formal_parameters (void);
--- a/liboctave/Makefile.am
+++ b/liboctave/Makefile.am
@@ -125,7 +125,8 @@
   $(array_libarray_la_SOURCES) \
   $(numeric_libnumeric_la_SOURCES) \
   $(system_libsystem_la_SOURCES) \
-  $(util_libutil_la_SOURCES)
+  $(util_libutil_la_SOURCES) \
+  $(TEMPLATE_SRC)
 
 TST_FILES_SRC := $(shell $(top_srcdir)/build-aux/find-files-with-tests.sh "$(srcdir)" $(LIBOCTAVE_TST_SRC))
 
--- a/liboctave/array/Sparse.cc
+++ b/liboctave/array/Sparse.cc
@@ -2793,6 +2793,23 @@
 %! s(1,:) = [];
 %! assert (s, sparse ([], [], [], 0, 1));
 
+## Test (bug #37321)
+%!test a=sparse (0,0); assert (all (a) == sparse ([1]));
+%!test a=sparse (0,1); assert (all (a) == sparse ([1]));
+%!test a=sparse (1,0); assert (all (a) == sparse ([1]));
+%!test a=sparse (1,0); assert (all (a,2) == sparse ([1]));
+%!test a=sparse (1,0); assert (size (all (a,1)), [1 0]);
+%!test a=sparse (1,1);
+%! assert (all (a) == sparse ([0]));
+%! assert (size (all (a)), [1 1]);
+%!test a=sparse (2,1);
+%! assert (all (a) == sparse ([0]));
+%! assert (size (all (a)), [1 1]);
+%!test a=sparse (1,2);
+%! assert (all (a) == sparse ([0]));
+%! assert (size (all (a)), [1 1]);
+%!test a=sparse (2,2); assert (isequal (all (a), sparse ([0 0])));
+
 */
 
 template <class T>
--- a/liboctave/operators/Sparse-op-defs.h
+++ b/liboctave/operators/Sparse-op-defs.h
@@ -1766,7 +1766,7 @@
           for (octave_idx_type i = 0; i < nc ; i++) \
             { \
               retval.ridx (i) = 0; \
-              retval.cidx (i+1) = i; \
+              retval.cidx (i+1) = i+1; \
               retval.data (i) = MT_RESULT; \
             } \
         } \
--- a/scripts/@ftp/ascii.m
+++ b/scripts/@ftp/ascii.m
@@ -29,3 +29,4 @@
 function ascii (f)
   __ftp_ascii__ (f.curlhandle);
 endfunction
+
--- a/scripts/@ftp/binary.m
+++ b/scripts/@ftp/binary.m
@@ -28,3 +28,4 @@
 function binary (f)
   __ftp_binary__ (f.curlhandle);
 endfunction
+
--- a/scripts/@ftp/cd.m
+++ b/scripts/@ftp/cd.m
@@ -41,3 +41,4 @@
   endif
   path = __ftp_pwd__ (f.curlhandle);
 endfunction
+
--- a/scripts/@ftp/close.m
+++ b/scripts/@ftp/close.m
@@ -26,3 +26,4 @@
 function dir (f)
   __ftp_close__ (f.curlhandle);
 endfunction
+
--- a/scripts/@ftp/delete.m
+++ b/scripts/@ftp/delete.m
@@ -26,3 +26,4 @@
 function delete (f, file)
   __ftp_delete__ (f.curlhandle, file);
 endfunction
+
--- a/scripts/@ftp/dir.m
+++ b/scripts/@ftp/dir.m
@@ -31,3 +31,4 @@
     lst = __ftp_dir__ (f.curlhandle);
   endif
 endfunction
+
--- a/scripts/@ftp/display.m
+++ b/scripts/@ftp/display.m
@@ -22,4 +22,5 @@
   printf (" user: %s\n", obj.username);
   printf ("  dir: %s\n", __ftp_pwd__ (obj.curlhandle));
   printf (" mode: %s\n", __ftp_mode__ (obj.curlhandle));
-endfunction
\ No newline at end of file
+endfunction
+
--- a/scripts/@ftp/ftp.m
+++ b/scripts/@ftp/ftp.m
@@ -20,9 +20,9 @@
 ## @deftypefn  {Function File} {@var{f} =} ftp (@var{host})
 ## @deftypefnx {Function File} {@var{f} =} ftp (@var{host}, @var{username}, @var{password})
 ## Connect to the FTP server @var{host} with @var{username} and @var{password}.
-## If @var{username} and @var{password} are not specified, user "anonymous"
-## with no password is used.  The returned FTP object @var{f} represents the
-## established FTP connection.
+## If @var{username} and @var{password} are not specified, user
+## @qcode{"anonymous"} with no password is used.  The returned FTP object
+## @var{f} represents the established FTP connection.
 ##
 ## The list of actions for an FTP object are shown below.  All functions
 ## require an FTP object as the first argument.
@@ -58,3 +58,4 @@
     obj = class (p, "ftp");
   endif
 endfunction
+
--- a/scripts/@ftp/loadobj.m
+++ b/scripts/@ftp/loadobj.m
@@ -34,3 +34,4 @@
     b = rmfield (b, "remotePwd");
   endif
 endfunction
+
--- a/scripts/@ftp/mget.m
+++ b/scripts/@ftp/mget.m
@@ -35,3 +35,4 @@
 function mget (f, file)
   __ftp_mget__ (f.curlhandle, file);
 endfunction
+
--- a/scripts/@ftp/mkdir.m
+++ b/scripts/@ftp/mkdir.m
@@ -26,3 +26,4 @@
 function mkdir (f, path)
   __ftp_mkdir__ (f.curlhandle, path);
 endfunction
+
--- a/scripts/@ftp/mput.m
+++ b/scripts/@ftp/mput.m
@@ -33,3 +33,4 @@
     retval = __ftp_mput__ (f.curlhandle, file);
   endif
 endfunction
+
--- a/scripts/@ftp/rename.m
+++ b/scripts/@ftp/rename.m
@@ -27,3 +27,4 @@
 function rename (f, oldname, newname)
   __ftp_rename__ (f.curlhandle, oldname, newname);
 endfunction
+
--- a/scripts/@ftp/rmdir.m
+++ b/scripts/@ftp/rmdir.m
@@ -26,3 +26,4 @@
 function rmdir (f, path)
   __ftp_rmdir__ (f.curlhandle, path);
 endfunction
+
--- a/scripts/@ftp/saveobj.m
+++ b/scripts/@ftp/saveobj.m
@@ -21,3 +21,4 @@
   b = rmfield (b, "curlhandle");
   b.dir = __ftp_pwd (a.curlhandle);
 endfunction
+
--- a/scripts/audio/lin2mu.m
+++ b/scripts/audio/lin2mu.m
@@ -74,3 +74,4 @@
   y = 64 * sig - 16 * e - fix (32 * f) + 335;
 
 endfunction
+
--- a/scripts/audio/loadaudio.m
+++ b/scripts/audio/loadaudio.m
@@ -79,3 +79,4 @@
   fclose (num);
 
 endfunction
+
--- a/scripts/audio/mu2lin.m
+++ b/scripts/audio/mu2lin.m
@@ -80,3 +80,4 @@
   endif
 
 endfunction
+
--- a/scripts/audio/record.m
+++ b/scripts/audio/record.m
@@ -63,3 +63,4 @@
   X = Y - 127;
 
 endfunction
+
--- a/scripts/audio/saveaudio.m
+++ b/scripts/audio/saveaudio.m
@@ -86,3 +86,4 @@
   fclose (num);
 
 endfunction
+
--- a/scripts/audio/setaudio.m
+++ b/scripts/audio/setaudio.m
@@ -41,3 +41,4 @@
   endif
 
 endfunction
+
--- a/scripts/deprecated/__error_text__.m
+++ b/scripts/deprecated/__error_text__.m
@@ -34,3 +34,4 @@
   [msg, msgid] = lasterr (varargin{:});
 
 endfunction
+
--- a/scripts/deprecated/cut.m
+++ b/scripts/deprecated/cut.m
@@ -69,3 +69,4 @@
   endif
 
 endfunction
+
--- a/scripts/deprecated/error_text.m
+++ b/scripts/deprecated/error_text.m
@@ -34,3 +34,4 @@
   [msg, msgid] = lasterr (varargin{:});
 
 endfunction
+
--- a/scripts/deprecated/isstr.m
+++ b/scripts/deprecated/isstr.m
@@ -38,3 +38,4 @@
   retval = ischar (varargin{:});
 
 endfunction
+
--- a/scripts/deprecated/java_convert_matrix.m
+++ b/scripts/deprecated/java_convert_matrix.m
@@ -23,9 +23,9 @@
 ## Query or set the internal variable that controls whether Java arrays are
 ## automatically converted to Octave matrices.  The default value is false.
 ## 
-## When called from inside a function with the "local" option, the variable is
-## changed locally for the function and any subroutines it calls.  The original
-## variable value is restored when exiting the function.
+## When called from inside a function with the @qcode{"local"} option, the
+## variable is changed locally for the function and any subroutines it calls.
+##  The original variable value is restored when exiting the function.
 ## @seealso{java_matrix_autoconversion, java_unsigned_conversion, java_debug}
 ## @end deftypefn
 
--- a/scripts/deprecated/java_debug.m
+++ b/scripts/deprecated/java_debug.m
@@ -24,9 +24,9 @@
 ## information regarding the initialization of the JVM and any Java exceptions
 ## is printed.
 ## 
-## When called from inside a function with the "local" option, the variable is
-## changed locally for the function and any subroutines it calls.  The original
-## variable value is restored when exiting the function.
+## When called from inside a function with the @qcode{"local"} option, the
+## variable is changed locally for the function and any subroutines it calls.
+##  The original variable value is restored when exiting the function.
 ## @seealso{debug_java, java_convert_matrix, java_unsigned_conversion}
 ## @end deftypefn
 
--- a/scripts/deprecated/java_unsigned_conversion.m
+++ b/scripts/deprecated/java_unsigned_conversion.m
@@ -25,9 +25,9 @@
 ## arrays of class Byte or Integer are converted to matrices of class uint8 or
 ## uint32 respectively.
 ## 
-## When called from inside a function with the "local" option, the variable is
-## changed locally for the function and any subroutines it calls.  The original
-## variable value is restored when exiting the function.
+## When called from inside a function with the @qcode{"local"} option, the
+## variable is changed locally for the function and any subroutines it calls.
+##  The original variable value is restored when exiting the function.
 ## @seealso{java_unsigned_autoconversion, java_convert_matrix, debug_java}
 ## @end deftypefn
 
--- a/scripts/deprecated/polyderiv.m
+++ b/scripts/deprecated/polyderiv.m
@@ -98,6 +98,7 @@
 
 endfunction
 
+
 %!assert(all (all (polyderiv ([1, 2, 3]) == [2, 2])));
 
 %!assert(polyderiv (13) == 0);
--- a/scripts/deprecated/shell_cmd.m
+++ b/scripts/deprecated/shell_cmd.m
@@ -23,11 +23,11 @@
 ## @deftypefnx {Built-in Function} {[@var{status}, @var{output}] =} shell_cmd (@dots{})
 ## @deftypefnx {Built-in Function} {[@var{status}, @var{output}] =} shell_cmd (@var{string}, @var{return_output}, @var{type})
 ## Execute a shell command specified by @var{string}.
-## If the optional argument @var{type} is "async", the process
+## If the optional argument @var{type} is @qcode{"async"}, the process
 ## is started in the background and the process id of the child process
 ## is returned immediately.  Otherwise, the process is started and
 ## Octave waits until it exits.  If the @var{type} argument is omitted, it
-## defaults to a value of "sync".
+## defaults to a value of @qcode{"sync"}.
 ## 
 ## If the optional argument @var{return_output} is true and the subprocess
 ## is started synchronously, or if @var{shell_cmd} is called with one input
--- a/scripts/deprecated/studentize.m
+++ b/scripts/deprecated/studentize.m
@@ -78,6 +78,7 @@
 
 endfunction
 
+
 %!assert(studentize ([1,2,3]), [-1,0,1])
 %!assert(studentize (int8 ([1,2,3])), [-1,0,1])
 #%!assert(studentize (ones (3,2,0,2)), zeros (3,2,0,2))
--- a/scripts/deprecated/sylvester_matrix.m
+++ b/scripts/deprecated/sylvester_matrix.m
@@ -57,6 +57,7 @@
 
 endfunction
 
+
 %!assert((sylvester_matrix (1) == [1, 1; 1, -1]
 %! && (sylvester_matrix (2)
 %! == [1, 1, 1, 1; 1, -1, 1, -1; 1, 1, -1, -1; 1, -1, -1, 1])));
--- a/scripts/general/accumdim.m
+++ b/scripts/general/accumdim.m
@@ -108,7 +108,7 @@
       subsc{dim} = mask;
       A(subsc{:}) = fillval;
     endif
-    return
+    return;
   endif
 
   ## The general case.
--- a/scripts/general/bicubic.m
+++ b/scripts/general/bicubic.m
@@ -221,6 +221,7 @@
 
 endfunction
 
+
 %!demo
 %! clf;
 %! colormap ("default");
--- a/scripts/general/celldisp.m
+++ b/scripts/general/celldisp.m
@@ -89,3 +89,4 @@
 %!error celldisp ()
 %!error celldisp ({}, "name", 1)
 %!error <C must be a cell array> celldisp (1)
+
--- a/scripts/general/colon.m
+++ b/scripts/general/colon.m
@@ -43,3 +43,4 @@
 %!error colon (1)
 
 ## FIXME -- what does colon () mean since it doesn't set a return value?
+
--- a/scripts/general/cplxpair.m
+++ b/scripts/general/cplxpair.m
@@ -161,6 +161,6 @@
 %!assert (cplxpair ([z(randperm(7)),z(randperm(7))],[],1), [z,z])
 %!assert (cplxpair ([z(randperm(7)).';z(randperm(7)).'],[],2), [z.';z.'])
 
-%!## tolerance test
+## tolerance test
 %!assert (cplxpair ([1i, -1i, 1+(1i*eps)],2*eps), [-1i, 1i, 1+(1i*eps)])
- 
+
--- a/scripts/general/dblquad.m
+++ b/scripts/general/dblquad.m
@@ -40,7 +40,8 @@
 ## is @code{quadcc}.
 ##
 ## Additional arguments, are passed directly to @var{f}.  To use the default
-## value for @var{tol} or @var{quadf} one may pass ':' or an empty matrix ([]).
+## value for @var{tol} or @var{quadf} one may pass @qcode{':'} or an empty
+## matrix ([]).
 ## @seealso{triplequad, quad, quadv, quadl, quadgk, quadcc, trapz}
 ## @end deftypefn
 
--- a/scripts/general/del2.m
+++ b/scripts/general/del2.m
@@ -157,3 +157,4 @@
 
   D = D ./ nd;
 endfunction
+
--- a/scripts/general/display.m
+++ b/scripts/general/display.m
@@ -19,7 +19,7 @@
 ## -*- texinfo -*-
 ## @deftypefn {Function File} {} display (@var{a})
 ## Display the contents of an object.  If @var{a} is an object of the
-## class "myclass", then @code{display} is called in a case like
+## class @qcode{"myclass"}, then @code{display} is called in a case like
 ##
 ## @example
 ## myclass (@dots{})
@@ -27,7 +27,7 @@
 ##
 ## @noindent
 ## where Octave is required to display the contents of a variable of the
-## type "myclass".
+## type @qcode{"myclass"}.
 ##
 ## @seealso{class, subsref, subsasgn}
 ## @end deftypefn
@@ -48,3 +48,4 @@
   endif
 
 endfunction
+
--- a/scripts/general/genvarname.m
+++ b/scripts/general/genvarname.m
@@ -82,14 +82,15 @@
 ## an underscore.  Also, variables may not begin with a digit; in this
 ## case an underscore is added before the variable name.
 ##
-## Variable names beginning and ending with two underscores "__" are valid but
-## they are used internally by octave and should generally be avoided, therefore
-## genvarname will not generate such names.
+## Variable names beginning and ending with two underscores @qcode{"__"} are
+## valid but they are used internally by octave and should generally be
+## avoided, therefore genvarname will not generate such names.
 ##
 ## genvarname will also make sure that returned names do not clash with
-## keywords such as "for" and "if".  A number will be appended if necessary.
-## Note, however, that this does @strong{not} include function names,
-## such as "sin".  Such names should be included in @var{avoid} if necessary.
+## keywords such as @qcode{"for"} and @qcode{"if"}.  A number will be
+## appended if necessary.  Note, however, that this does @strong{not} include
+## function names, such as @qcode{"sin"}.  Such names should be included in
+## @var{avoid} if necessary.
 ## @seealso{isvarname, exist, tmpnam, eval}
 ## @end deftypefn
 
--- a/scripts/general/idivide.m
+++ b/scripts/general/idivide.m
@@ -28,25 +28,25 @@
 ## a string with one of the values:
 ##
 ## @table @asis
-## @item "fix"
+## @item @qcode{"fix"}
 ## Calculate @code{@var{a} ./ @var{b}} with the fractional part rounded
 ## towards zero.
 ##
-## @item "round"
+## @item @qcode{"round"}
 ## Calculate @code{@var{a} ./ @var{b}} with the fractional part rounded
 ## towards the nearest integer.
 ##
-## @item "floor"
+## @item @qcode{"floor"}
 ## Calculate @code{@var{a} ./ @var{b}} with the fractional part rounded
 ## towards negative infinity.
 ##
-## @item "ceil"
+## @item @qcode{"ceil"}
 ## Calculate @code{@var{a} ./ @var{b}} with the fractional part rounded
 ## towards positive infinity.
 ## @end table
 ##
 ## @noindent
-## If @var{op} is not given it defaults to @code{"fix"}.
+## If @var{op} is not given it defaults to @qcode{"fix"}.
 ## An example demonstrating these rounding rules is
 ##
 ## @example
--- a/scripts/general/interp1.m
+++ b/scripts/general/interp1.m
@@ -32,19 +32,19 @@
 ## Method is one of:
 ##
 ## @table @asis
-## @item "nearest"
+## @item @qcode{"nearest"}
 ## Return the nearest neighbor.
 ##
-## @item "linear"
+## @item @qcode{"linear"}
 ## Linear interpolation from nearest neighbors
 ##
-## @item "pchip"
+## @item @qcode{"pchip"}
 ## Piecewise cubic Hermite interpolating polynomial
 ##
-## @item "cubic"
+## @item @qcode{"cubic"}
 ## Cubic interpolation (same as @code{pchip})
 ##
-## @item "spline"
+## @item @qcode{"spline"}
 ## Cubic spline interpolation---smooth first and second derivatives
 ## throughout the curve
 ## @end table
@@ -52,18 +52,18 @@
 ## Appending '*' to the start of the above method forces @code{interp1}
 ## to assume that @var{x} is uniformly spaced, and only @code{@var{x}(1)}
 ## and @code{@var{x}(2)} are referenced.  This is usually faster,
-## and is never slower.  The default method is "linear".
+## and is never slower.  The default method is @qcode{"linear"}.
 ##
-## If @var{extrap} is the string "extrap", then extrapolate values beyond
-## the endpoints.  If @var{extrap} is a number, replace values beyond the
-## endpoints with that number.  If @var{extrap} is missing, assume NA.
+## If @var{extrap} is the string @qcode{"extrap"}, then extrapolate values
+## beyond the endpoints.  If @var{extrap} is a number, replace values beyond
+## the endpoints with that number.  If @var{extrap} is missing, assume NA.
 ##
-## If the string argument "pp" is specified, then @var{xi} should not be
+## If the string argument @qcode{"pp"} is specified, then @var{xi} should not be
 ## supplied and @code{interp1} returns the piecewise polynomial that
 ## can later be used with @code{ppval} to evaluate the interpolation.
 ## There is an equivalence, such that @code{ppval (interp1 (@var{x},
-## @var{y}, @var{method}, "pp"), @var{xi}) == interp1 (@var{x}, @var{y},
-## @var{xi}, @var{method}, "extrap")}.
+## @var{y}, @var{method}, @qcode{"pp"}), @var{xi}) == interp1 (@var{x}, @var{y},
+## @var{xi}, @var{method}, @qcode{"extrap"})}.
 ##
 ## Duplicate points in @var{x} specify a discontinuous interpolant.  There
 ## may be at most 2 consecutive points with the same value.
@@ -71,10 +71,11 @@
 ## right-continuous.  If @var{x} is decreasing, the default discontinuous
 ## interpolant is left-continuous.
 ## The continuity condition of the interpolant may be specified by using
-## the options, "-left" or "-right", to select a left-continuous
+## the options, @qcode{"-left"} or @qcode{"-right"}, to select a left-continuous
 ## or right-continuous interpolant, respectively.
-## Discontinuous interpolation is only allowed for "nearest" and "linear"
-## methods; in all other cases, the @var{x}-values must be unique.
+## Discontinuous interpolation is only allowed for @qcode{"nearest"} and
+## @qcode{"linear"} methods; in all other cases, the @var{x}-values must be
+## unique.
 ##
 ## An example of the use of @code{interp1} is
 ##
@@ -186,15 +187,15 @@
       rightcontinuous = false;
     else
       rightcontinuous = true;
-    end
+    endif
   endif
 
   if ((rightcontinuous && (x(end) < x(1)))
-      || (~ rightcontinuous && (x(end) > x(1))))
+      || (! rightcontinuous && (x(end) > x(1))))
     ## Switch between left-continuous and right-continuous
     x = flipud (x);
     y = flipud (y);
-  end
+  endif
 
   starmethod = method(1) == "*";
 
--- a/scripts/general/interp2.m
+++ b/scripts/general/interp2.m
@@ -36,8 +36,9 @@
 ## matrices @var{xi}, @var{yi}.
 ##
 ## If the last argument is a string, the interpolation method can
-## be specified.  The method can be "linear", "nearest" or "cubic".
-## If it is omitted "linear" interpolation is assumed.
+## be specified.  The method can be @qcode{"linear"}, @qcode{"nearest"} or
+## @qcode{"cubic"}.  If it is omitted @qcode{"linear"} interpolation is
+## assumed.
 ##
 ## @item interp2 (@var{z}, @var{xi}, @var{yi})
 ## Assumes @code{@var{x} = 1:rows (@var{z})} and @code{@var{y} =
@@ -52,19 +53,19 @@
 ## interpolation.  It can take one of the following values
 ##
 ## @table @asis
-## @item "nearest"
+## @item @qcode{"nearest"}
 ## Return the nearest neighbor.
 ##
-## @item "linear"
+## @item @qcode{"linear"}
 ## Linear interpolation from nearest neighbors.
 ##
-## @item "pchip"
+## @item @qcode{"pchip"}
 ## Piecewise cubic Hermite interpolating polynomial.
 ##
-## @item "cubic"
+## @item @qcode{"cubic"}
 ## Cubic interpolation from four nearest neighbors.
 ##
-## @item "spline"
+## @item @qcode{"spline"}
 ## Cubic spline interpolation---smooth first and second derivatives
 ## throughout the curve.
 ## @end table
--- a/scripts/general/interp3.m
+++ b/scripts/general/interp3.m
@@ -28,9 +28,9 @@
 ## array @var{v} represents a value at a location given by the parameters
 ## @var{x}, @var{y}, and @var{z}.  The parameters @var{x}, @var{x}, and
 ## @var{z} are either 3-dimensional arrays of the same size as the array
-## @var{v} in the "meshgrid" format or vectors.  The parameters @var{xi}, etc.
-## respect a similar format to @var{x}, etc., and they represent the points
-## at which the array @var{vi} is interpolated.
+## @var{v} in the @qcode{"meshgrid"} format or vectors.  The parameters
+## @var{xi}, etc. respect a similar format to @var{x}, etc., and they
+## represent the points at which the array @var{vi} is interpolated.
 ##
 ## If @var{x}, @var{y}, @var{z} are omitted, they are assumed to be
 ## @code{x = 1 : size (@var{v}, 2)}, @code{y = 1 : size (@var{v}, 1)} and
@@ -42,25 +42,25 @@
 ## Method is one of:
 ##
 ## @table @asis
-## @item "nearest"
+## @item @qcode{"nearest"}
 ## Return the nearest neighbor.
 ##
-## @item "linear"
+## @item @qcode{"linear"}
 ## Linear interpolation from nearest neighbors.
 ##
-## @item "cubic"
+## @item @qcode{"cubic"}
 ## Cubic interpolation from four nearest neighbors (not implemented yet).
 ##
-## @item "spline"
+## @item @qcode{"spline"}
 ## Cubic spline interpolation---smooth first and second derivatives
 ## throughout the curve.
 ## @end table
 ##
-## The default method is "linear".
+## The default method is @qcode{"linear"}.
 ##
-## If @var{extrap} is the string "extrap", then extrapolate values beyond
-## the endpoints.  If @var{extrap} is a number, replace values beyond the
-## endpoints with that number.  If @var{extrap} is missing, assume NA.
+## If @var{extrap} is the string @qcode{"extrap"}, then extrapolate values
+## beyond the endpoints.  If @var{extrap} is a number, replace values beyond
+## the endpoints with that number.  If @var{extrap} is missing, assume NA.
 ## @seealso{interp1, interp2, spline, meshgrid}
 ## @end deftypefn
 
--- a/scripts/general/interpft.m
+++ b/scripts/general/interpft.m
@@ -127,10 +127,10 @@
 %! assert (interpft (x, 6), y, 10*eps);
 
 %% Test for correct spectral symmetry with even/odd lengths
-%!assert (max (abs (imag (interpft ([1:8], 20)))), 0, 2*eps);
-%!assert (max (abs (imag (interpft ([1:8], 21)))), 0, 2*eps);
-%!assert (max (abs (imag (interpft ([1:9], 20)))), 0, 2*eps);
-%!assert (max (abs (imag (interpft ([1:9], 21)))), 0, 2*eps);
+%!assert (max (abs (imag (interpft ([1:8], 20)))), 0, 20*eps);
+%!assert (max (abs (imag (interpft ([1:8], 21)))), 0, 21*eps);
+%!assert (max (abs (imag (interpft ([1:9], 20)))), 0, 20*eps);
+%!assert (max (abs (imag (interpft ([1:9], 21)))), 0, 21*eps);
 
 %% Test input validation
 %!error interpft ()
--- a/scripts/general/interpn.m
+++ b/scripts/general/interpn.m
@@ -29,9 +29,9 @@
 ## at a location given by the parameters @var{x1}, @var{x2}, @dots{}, @var{xn}.
 ## The parameters @var{x1}, @var{x2}, @dots{}, @var{xn} are either
 ## @var{n}-dimensional arrays of the same size as the array @var{v} in
-## the "ndgrid" format or vectors.  The parameters @var{y1}, etc. respect a
-## similar format to @var{x1}, etc., and they represent the points at which
-## the array @var{vi} is interpolated.
+## the @qcode{"ndgrid"} format or vectors.  The parameters @var{y1}, etc.
+## respect a similar format to @var{x1}, etc., and they represent the points
+## at which the array @var{vi} is interpolated.
 ##
 ## If @var{x1}, @dots{}, @var{xn} are omitted, they are assumed to be
 ## @code{x1 = 1 : size (@var{v}, 1)}, etc.  If @var{m} is specified, then
@@ -42,21 +42,21 @@
 ## Method is one of:
 ##
 ## @table @asis
-## @item "nearest"
+## @item @qcode{"nearest"}
 ## Return the nearest neighbor.
 ##
-## @item "linear"
+## @item @qcode{"linear"}
 ## Linear interpolation from nearest neighbors.
 ##
-## @item "cubic"
+## @item @qcode{"cubic"}
 ## Cubic interpolation from four nearest neighbors (not implemented yet).
 ##
-## @item "spline"
+## @item @qcode{"spline"}
 ## Cubic spline interpolation---smooth first and second derivatives
 ## throughout the curve.
 ## @end table
 ##
-## The default method is "linear".
+## The default method is @qcode{"linear"}.
 ##
 ## If @var{extrapval} is the scalar value, use it to replace the values
 ## beyond the endpoints with that number.  If @var{extrapval} is missing,
--- a/scripts/general/isa.m
+++ b/scripts/general/isa.m
@@ -23,13 +23,14 @@
 ## @var{classname} may also be one of the following class categories: 
 ##
 ## @table @asis
-## @item "float"
-## Floating point value comprising classes "double" and "single".
+## @item @qcode{"float"}
+## Floating point value comprising classes @qcode{"double"} and
+## @qcode{"single"}.
 ##
-## @item "integer"
+## @item @qcode{"integer"}
 ## Integer value comprising classes (u)int8, (u)int16, (u)int32, (u)int64.
 ##
-## @item "numeric"
+## @item @qcode{"numeric"}
 ## Numeric value comprising either a floating point or integer value.
 ## @end table
 ## @seealso{class, typeinfo}
--- a/scripts/general/isdir.m
+++ b/scripts/general/isdir.m
@@ -32,6 +32,7 @@
 
 endfunction
 
+
 %!assert (isdir (pwd ()))
 %!assert (! isdir ("this is highly unlikely to be a directory name"))
 
--- a/scripts/general/isequal.m
+++ b/scripts/general/isequal.m
@@ -74,6 +74,11 @@
 ## test for inequality (struct)
 %!assert (isequal (struct ('a',NaN,'b',2),struct ('a',NaN,'b',2),struct ('a',NaN,'b',2)), false)
 
+## test for sparse matrices
+%!assert (isequal (sparse (0,1), sparse (0,1)), true)
+%!assert (isequal (sparse (0,1), sparse (1,0)), false)
+%!assert (isequal (sparse (2, 2), sparse (2, 2)), true)
+
 ## Input validation
 %!error isequal ()
 %!error isequal (1)
--- a/scripts/general/isequaln.m
+++ b/scripts/general/isequaln.m
@@ -48,3 +48,4 @@
 ## Input validation
 %!error isequaln ()
 %!error isequaln (1)
+
--- a/scripts/general/loadobj.m
+++ b/scripts/general/loadobj.m
@@ -39,3 +39,4 @@
 function b = loadobj (a)
   error ('loadobj: not defined for class "%s"', class (a));
 endfunction
+
--- a/scripts/general/num2str.m
+++ b/scripts/general/num2str.m
@@ -92,10 +92,9 @@
       if (isnumeric (x))
         ## Setup a suitable format string, ignoring inf entries
         dgt = floor (log10 (max (abs (x(!isinf (x(:)))))));
-
-        ## If the whole input array is inf...
         if (isempty (dgt))
-          dgt = 0;
+          ## If the whole input array is inf...
+          dgt = 1;
         endif
 
         if (any (x(:) != fix (x(:))))
@@ -130,8 +129,13 @@
       endif
     else
       ## Setup a suitable format string
-      dgt = floor (log10 (max (max (abs (real (x(:)))),
-                               max (abs (imag (x(:)))))));
+      dgt = floor (log10 (max (max (abs (real (x(!isinf (real (x(:))))))),
+                               max (abs (imag (x(!isinf (imag (x(:))))))))));
+      if (isempty (dgt))
+        ## If the whole input array is inf...
+        dgt = 1;
+      endif
+
       if (any (x(:) != fix (x(:))))
         ## Floating point input
           dgt = max (dgt + 4, 5);   # Keep 4 sig. figures after decimal point
@@ -183,7 +187,16 @@
 %!assert (num2str (2^33+1i), "8589934592+1i")
 %!assert (num2str (-2^33+1i), "-8589934592+1i")
 %!assert (num2str (inf), "Inf")
+%!assert (num2str ([inf -inf]), "Inf -Inf")
+%!assert (num2str ([complex(Inf,0), complex(0,-Inf)]), "Inf+0i   0-Infi")
+%!assert (num2str (complex(Inf,1)), "Inf+1i")
+%!assert (num2str (complex(1,Inf)), "1+Infi")
 %!assert (num2str (nan), "NaN")
+%!assert (num2str (complex (NaN, 1)), "NaN+1i")
+%!assert (num2str (complex (1, NaN)), "1+NaNi")
+%!assert (num2str (NA), "NA")
+%!assert (num2str (complex (NA, 1)), "NA+1i")
+%!assert (num2str (complex (1, NA)), "1+NAi")
 
 ## FIXME: Integers greater than bitmax() should be masked to show just
 ##        16 digits of precision.
--- a/scripts/general/private/__isequal__.m
+++ b/scripts/general/private/__isequal__.m
@@ -156,7 +156,7 @@
 
         t = (l_f_x == length (f_y)) && all (f_x == f_y);
         if (!t)
-          return;
+          break;
         endif
 
         y = y(f_y);
@@ -168,11 +168,18 @@
         endif
 
         if (!t)
-          return;
+          break;
         endif
       endfor
 
     endif
   endif
 
+  if (!t)
+    t = false;
+  else
+    t = true;
+  endif
+
 endfunction
+
--- a/scripts/general/private/__splinen__.m
+++ b/scripts/general/private/__splinen__.m
@@ -44,3 +44,4 @@
   endfor
   yi(idx) = extrapval;
 endfunction
+
--- a/scripts/general/profexplore.m
+++ b/scripts/general/profexplore.m
@@ -17,14 +17,14 @@
 ## <http://www.gnu.org/licenses/>.
 
 ## -*- texinfo -*-
-## @deftypefn {Function File} {} profexplore ()
+## @deftypefn  {Function File} {} profexplore ()
 ## @deftypefnx {Function File} {} profexplore (@var{data})
 ## Interactively explore hierarchical profiler output.
 ##
 ## Assuming @var{data} is the structure with profile data returned by
-## @code{profile ("info")}, this command opens an interactive prompt
+## @code{profile (@qcode{"info"})}, this command opens an interactive prompt
 ## that can be used to explore the call-tree.  Type @kbd{help} to get a list
-## of possible commands. If @var{data} is omitted, @code{profile ("info")}
+## of possible commands.  If @var{data} is omitted, @code{profile ("info")}
 ## is called and used in its place.
 ## @seealso{profile, profshow}
 ## @end deftypefn
@@ -135,3 +135,4 @@
 
   endwhile
 endfunction
+
--- a/scripts/general/profile.m
+++ b/scripts/general/profile.m
@@ -44,7 +44,7 @@
 ## @item @var{S} = profile ("status")
 ## Return a structure filled with certain information about the current status
 ## of the profiler.  At the moment, the only field is @code{ProfilerStatus}
-## which is either "on" or "off".
+## which is either @qcode{"on"} or @qcode{"off"}.
 ##
 ## @item @var{T} = profile ("info")
 ## Return the collected profiling statistics in the structure @var{T}.
--- a/scripts/general/quadgk.m
+++ b/scripts/general/quadgk.m
@@ -61,7 +61,7 @@
 ## for the integral @var{q}.
 ##
 ## Alternatively, properties of @code{quadgk} can be passed to the function as
-## pairs @code{"@var{prop}", @var{val}}.  Valid properties are
+## pairs @qcode{"@var{prop}", @var{val}}.  Valid properties are
 ##
 ## @table @code
 ## @item AbsTol
@@ -78,12 +78,12 @@
 ## unacceptable error are subdivided and re-evaluated.  If the number of
 ## subintervals exceeds 650 subintervals at any point then a poor
 ## convergence is signaled and the current estimate of the integral is
-## returned.  The property "MaxIntervalCount" can be used to alter the
+## returned.  The property @qcode{"MaxIntervalCount"} can be used to alter the
 ## number of subintervals that can exist before exiting.
 ##
 ## @item WayPoints
 ## Discontinuities in the first derivative of the function to integrate can be
-## flagged with the  @code{"WayPoints"} property.  This forces the ends of
+## flagged with the @qcode{"WayPoints"} property.  This forces the ends of
 ## a subinterval to fall on the breakpoints of the function and can result in
 ## significantly improved estimation of the error in the integral, faster
 ## computation, or both.  For example,
@@ -457,3 +457,4 @@
 %!error (quadgk (@sin))
 %!error (quadgk (@sin, -pi))
 %!error (quadgk (@sin, -pi, pi, "DummyArg"))
+
--- a/scripts/general/randi.m
+++ b/scripts/general/randi.m
@@ -34,8 +34,8 @@
 ## with a lower and upper bound in which case the returned integers will be
 ## on the interval @w{[@var{imin}, @var{imax}]}.
 ##
-## The optional argument "@var{class}" will return a matrix of the requested
-## type.  The default is "double".
+## The optional argument @var{class} will return a matrix of the requested
+## type.  The default is @qcode{"double"}.
 ##
 ## The following example returns 150 integers in the range 1-10.
 ##
@@ -44,7 +44,7 @@
 ## @end example
 ##
 ## Implementation Note: @code{randi} relies internally on @code{rand} which
-## uses class "double" to represent numbers.  This limits the maximum
+## uses class @qcode{"double"} to represent numbers.  This limits the maximum
 ## integer (@var{imax}) and range (@var{imax} - @var{imin}) to the value
 ## returned by the @code{bitmax} function.  For IEEE floating point numbers
 ## this value is @w{@math{2^{53} - 1}}.
@@ -111,6 +111,7 @@
 
 endfunction
 
+
 %!test
 %! ri = randi (10, 1000, 1);
 %! assert (ri, fix (ri));
--- a/scripts/general/repmat.m
+++ b/scripts/general/repmat.m
@@ -117,7 +117,7 @@
       cidx{2,i} = ones (1, idx (i));
     endfor
     aaidx = aidx;
-    # add singleton dims
+    ## add singleton dims
     aaidx(2,:) = 1;
     A = reshape (A, aaidx(:));
     x = reshape (A (cidx{:}), idx .* aidx);
@@ -125,6 +125,7 @@
 
 endfunction
 
+
 # Tests for ML compatibility
 %!shared x
 %! x = [1 2 3];
--- a/scripts/general/saveobj.m
+++ b/scripts/general/saveobj.m
@@ -42,3 +42,4 @@
 function b = saveobj (a)
   error ('saveobj: not defined for class "%s"', class (a));
 endfunction
+
--- a/scripts/general/structfun.m
+++ b/scripts/general/structfun.m
@@ -34,12 +34,11 @@
 ## a string value.  If the function returns more than one argument, they are
 ## returned as separate output variables.
 ##
-## If the parameter "UniformOutput" is set to true (the default), then the
-## function
-## must return a single element which will be concatenated into the
-## return value.  If "UniformOutput" is false, the outputs are placed into a
-## structure
-## with the same fieldnames as the input structure.
+## If the parameter @qcode{"UniformOutput"} is set to true (the default),
+## then the function must return a single element which will be concatenated
+## into the return value.  If @qcode{"UniformOutput"} is false, the outputs
+## are placed into a structure with the same fieldnames as the input
+## structure.
 ##
 ## @example
 ## @group
@@ -55,8 +54,9 @@
 ## @end group
 ## @end example
 ##
-## Given the parameter "ErrorHandler", @var{errfunc} defines a function to
-## call in case @var{func} generates an error.  The form of the function is
+## Given the parameter @qcode{"ErrorHandler"}, @var{errfunc} defines a
+## function to call in case @var{func} generates an error.  The form of the
+## function is
 ##
 ## @example
 ## function [@dots{}] = errfunc (@var{se}, @dots{})
@@ -65,10 +65,10 @@
 ## @noindent
 ## where there is an additional input argument to @var{errfunc} relative to
 ## @var{func}, given by @nospell{@var{se}}.  This is a structure with the
-## elements "identifier", "message" and "index", giving respectively the error
-## identifier, the error message, and the index into the input arguments
-## of the element that caused the error.  For an example on how to use
-## an error handler, @pxref{XREFcellfun,,cellfun}.
+## elements @qcode{"identifier"}, @qcode{"message"} and @qcode{"index"},
+## giving respectively the error identifier, the error message, and the index
+## into the input arguments of the element that caused the error.  For an
+## example on how to use an error handler, @pxref{XREFcellfun,,cellfun}.
 ##
 ## @seealso{cellfun, arrayfun, spfun}
 ## @end deftypefn
--- a/scripts/general/subsindex.m
+++ b/scripts/general/subsindex.m
@@ -23,7 +23,7 @@
 ## overloading method that allows the conversion of this class object to
 ## a valid indexing vector.  It is important to note that
 ## @code{subsindex} must return a zero-based real integer vector of the
-## class "double".  For example, if the class constructor
+## class @qcode{"double"}.  For example, if the class constructor
 ##
 ## @example
 ## @group
--- a/scripts/general/triplequad.m
+++ b/scripts/general/triplequad.m
@@ -40,7 +40,8 @@
 ## is @code{quadcc}.
 ##
 ## Additional arguments, are passed directly to @var{f}.  To use the default
-## value for @var{tol} or @var{quadf} one may pass ':' or an empty matrix ([]).
+## value for @var{tol} or @var{quadf} one may pass @qcode{':'} or an empty
+## matrix ([]).
 ## @seealso{dblquad, quad, quadv, quadl, quadgk, quadcc, trapz}
 ## @end deftypefn
 
--- a/scripts/geometry/delaunay.m
+++ b/scripts/geometry/delaunay.m
@@ -166,3 +166,4 @@
 %! assert (sortrows (sort (delaunay (x, y), 2)), [1,2,4;1,3,4;1,3,5;3,4,6]);
 
 %% FIXME: Need input validation tests
+
--- a/scripts/geometry/griddata.m
+++ b/scripts/geometry/griddata.m
@@ -29,8 +29,8 @@
 ## The interpolation points are all @code{(@var{xi}, @var{yi})}.  If
 ## @var{xi}, @var{yi} are vectors then they are made into a 2-D mesh.
 ##
-## The interpolation method can be @code{"nearest"}, @code{"cubic"} or
-## @code{"linear"}.  If method is omitted it defaults to @code{"linear"}.
+## The interpolation method can be @qcode{"nearest"}, @qcode{"cubic"} or
+## @qcode{"linear"}.  If method is omitted it defaults to @qcode{"linear"}.
 ## @seealso{griddata3, griddatan, delaunay}
 ## @end deftypefn
 
--- a/scripts/geometry/griddata3.m
+++ b/scripts/geometry/griddata3.m
@@ -25,8 +25,8 @@
 ## The function is defined by @code{@var{v} = f (@var{x}, @var{y}, @var{z})}.
 ## The interpolation points are specified by @var{xi}, @var{yi}, @var{zi}.
 ##
-## The interpolation method can be @code{"nearest"} or @code{"linear"}.
-## If method is omitted it defaults to @code{"linear"}.
+## The interpolation method can be @qcode{"nearest"} or @qcode{"linear"}.
+## If method is omitted it defaults to @qcode{"linear"}.
 ##
 ## The optional argument @var{options} is passed directly to Qhull when
 ## computing the Delaunay triangulation used for interpolation.  See
--- a/scripts/geometry/griddatan.m
+++ b/scripts/geometry/griddatan.m
@@ -25,8 +25,8 @@
 ## The function is defined by @code{@var{y} = f (@var{x})}.
 ## The interpolation points are all @var{xi}.
 ##
-## The interpolation method can be @code{"nearest"} or @code{"linear"}.
-## If method is omitted it defaults to @code{"linear"}.
+## The interpolation method can be @qcode{"nearest"} or @qcode{"linear"}.
+## If method is omitted it defaults to @qcode{"linear"}.
 ## 
 ## The optional argument @var{options} is passed directly to Qhull when
 ## computing the Delaunay triangulation used for interpolation.  See
--- a/scripts/geometry/voronoi.m
+++ b/scripts/geometry/voronoi.m
@@ -26,9 +26,10 @@
 ## Plot the Voronoi diagram of points @code{(@var{x}, @var{y})}.
 ## The Voronoi facets with points at infinity are not drawn.
 ## 
-## If "linespec" is given it is used to set the color and line style of the
-## plot.  If an axis graphics handle @var{hax} is supplied then the Voronoi
-## diagram is drawn on the specified axis rather than in a new figure.
+## If @qcode{"linespec"} is given it is used to set the color and line style
+## of the plot.  If an axis graphics handle @var{hax} is supplied then the
+## Voronoi diagram is drawn on the specified axis rather than in a new
+## figure.
 ##
 ## The @var{options} argument, which must be a string or cell array of strings,
 ## contains options passed to the underlying qhull command.
--- a/scripts/help/__makeinfo__.m
+++ b/scripts/help/__makeinfo__.m
@@ -17,50 +17,28 @@
 ## <http://www.gnu.org/licenses/>.
 
 ## -*- texinfo -*-
-## @deftypefn  {Function File} {[@var{retval}, @var{status}] =} __makeinfo__ (@var{text}, @var{output_type})
-## @deftypefnx {Function File} {[@var{retval}, @var{status}] =} __makeinfo__ (@var{text}, @var{output_type}, @var{see_also})
+## @deftypefn  {Function File} {[@var{retval}, @var{status}] =} __makeinfo__ (@var{text})
+## @deftypefnx {Function File} {[@var{retval}, @var{status}] =} __makeinfo__ (@var{text}, @var{output_type})
 ## Undocumented internal function.
 ## @end deftypefn
 
 ## Run @code{makeinfo} on a given text.
 ##
 ## The string @var{text} is run through the @code{__makeinfo__} program
-## to generate output in various formats. This string must contain valid
+## to generate output in various formats.  This string must contain valid
 ## Texinfo formatted text.
 ##
-## The @var{output_type} selects the format of the output. This can be either
-## @t{"html"}, @t{"texinfo"}, or @t{"plain text"}. By default this is
-## @t{"plain text"}. If @var{output_type} is @t{"texinfo"}, the @t{@@seealso}
-## macro is expanded, but otherwise the text is unaltered.
-##
-## If the optional argument @var{see_also} is present, it is used to expand the
-## Octave specific @t{@@seealso} macro. This argument must be a function handle,
-## that accepts a cell array of strings as input argument (each elements of the
-## array corresponds to the arguments to the @t{@@seealso} macro), and return
-## the expanded string. If this argument is not given, the @t{@@seealso} macro
-## will be expanded to the text
-##
-## @example
-## See also: arg1, arg2, ...
-## @end example
-##
-## @noindent
-## for @t{"plain text"} output, and
-##
-## @example
-## See also: @@ref@{arg1@}, @@ref@{arg2@}, ...
-## @end example
-##
-## @noindent
-## otherwise.
+## The @var{output_type} selects the format of the output.  This can be either
+## @qcode{"html"}, @qcode{"texinfo"}, or @qcode{"plain text"}.  By default this
+## is @qcode{"plain text"}. 
 ##
 ## The optional output argument @var{status} contains the exit status of the
 ## @code{makeinfo} program as returned by @code{system}.
 
-function [retval, status] = __makeinfo__ (text, output_type = "plain text", fsee_also)
+function [retval, status] = __makeinfo__ (text, output_type = "plain text")
 
   ## Check input
-  if (nargin < 1 || nargin > 3)
+  if (nargin < 1 || nargin > 2)
     print_usage ();
   endif
 
@@ -69,21 +47,7 @@
   endif
 
   if (! ischar (output_type))
-    error ("__makeinfo__: second input argument must be a string");
-  endif
-
-  if (nargin < 3)
-    if (strcmpi (output_type, "plain text"))
-      fsee_also = @(T) strcat ...
-          ("\nSee also:", sprintf (" %s,", T{:})(1:end-1), "\n");
-    else
-      fsee_also = @(T) strcat ...
-          ("\nSee also:", sprintf (" @ref{%s},", T{:})(1:end-1), "\n");
-    endif
-  endif
-
-  if (! isa (fsee_also, "function_handle"))
-    error ("__makeinfo__: third input argument must be a function handle");
+    error ("__makeinfo__: OUTPUT_TYPE must be a string");
   endif
 
   ## Formatting in m-files has an extra space at the beginning of every line.
@@ -126,10 +90,10 @@
     ## Take action depending on output type
     switch (lower (output_type))
       case "plain text"
-        cmd = sprintf ("%s --no-headers --no-warn --force --no-validate %s",
+        cmd = sprintf ("%s --no-headers --no-warn --no-validate --force %s",
                        makeinfo_program (), name);
       case "html"
-        cmd = sprintf ("%s --no-headers --html --no-warn --no-validate --force %s",
+        cmd = sprintf ("%s --html --no-headers --no-warn --no-validate --force %s",
                        makeinfo_program (), name);
       otherwise
         error ("__makeinfo__: unsupported output type: '%s'", output_type);
--- a/scripts/help/__unimplemented__.m
+++ b/scripts/help/__unimplemented__.m
@@ -442,3 +442,4 @@
 %! assert (str(1:51), "quad2d is not implemented.  Consider using dblquad.");
 %! str = __unimplemented__ ("MException");
 %! assert (str(1:58), "the 'MException' function is not yet implemented in Octave");
+
--- a/scripts/help/doc.m
+++ b/scripts/help/doc.m
@@ -53,7 +53,7 @@
       fname = "";
     endif
 
-    # if GUI is running, let it display the function
+    ## if GUI is running, let it display the function
     if isguirunning ()
       __octave_link_show_doc__ (fname);
     else
--- a/scripts/help/doc_cache_create.m
+++ b/scripts/help/doc_cache_create.m
@@ -119,25 +119,25 @@
   ## If 'directory' is not in the current path, add it so we search it
   dir_in_path = ismember (directory, ostrsplit (path (), pathsep ()));
 
-  # dirs not in path
+  ## dirs not in path
   if (! iscell (directory))
     directory = {directory};
   endif
   dirs_notpath = {directory{!dir_in_path}};
 
-  # add them
+  ## add them
   if (! isempty (dirs_notpath))
     cellfun (@addpath, dirs_notpath);
   endif
 
-  # create cache
+  ## create cache
   func = @(s_) create_cache (__list_functions__ (s_));
   cache = cellfun (func, directory, 'UniformOutput', false);
 
-  # concatenate results
+  ## concatenate results
   cache = [cache{:}];
 
-  #remove dirs form path
+  ## remove dirs form path
   if (! isempty (dirs_notpath))
     cellfun (@rmpath, dirs_notpath);
   endif
@@ -157,3 +157,4 @@
 %% No true tests desirable for this function.
 %% Test input validation
 %!error doc_cache_create (1)
+
--- a/scripts/help/get_first_help_sentence.m
+++ b/scripts/help/get_first_help_sentence.m
@@ -157,7 +157,8 @@
 endfunction
 
 
-%!assert (get_first_help_sentence ('get_first_help_sentence'), "Return the first sentence of a function's help text.")
+%!assert (get_first_help_sentence ('get_first_help_sentence'), ...
+%!        "Return the first sentence of a function's help text.")
 
 %% Test input validation
 %!error get_first_help_sentence ()
--- a/scripts/help/help.m
+++ b/scripts/help/help.m
@@ -20,7 +20,7 @@
 ## @deftypefn  {Command} {} help @var{name}
 ## @deftypefnx {Command} {} help @code{--list}
 ## @deftypefnx {Command} {} help @code{.}
-## Display the help text for @var{name}.   For example, the command
+## Display the help text for @var{name}.  For example, the command
 ## @kbd{help help} prints a short message describing the @code{help}
 ## command.
 ##
@@ -209,4 +209,3 @@
 %!assert (! isempty (strfind (help ("ls"), "List directory contents")))
 %!error <invalid input> help (42)
 
-
--- a/scripts/help/lookfor.m
+++ b/scripts/help/lookfor.m
@@ -24,7 +24,7 @@
 ## Search for the string @var{str} in all functions found in the current
 ## function search path.  By default, @code{lookfor} searches for @var{str}
 ## in the first sentence of the help string of each function found.  The entire
-## help text of each function can be searched if the "-all" argument is
+## help text of each function can be searched if the @qcode{"-all"} argument is
 ## supplied.  All searches are case insensitive.
 ##
 ## Called with no output arguments, @code{lookfor} prints the list of
@@ -36,8 +36,9 @@
 ## sentence of the help text is dependent on the format of the
 ## function's help.  All Octave core functions are correctly
 ## formatted, but the same can not be guaranteed for external packages and
-## user-supplied functions.  Therefore, the use of the "-all" argument may
-## be necessary to find related functions that are not a part of Octave.
+## user-supplied functions.  Therefore, the use of the @qcode{"-all"}
+## argument may be necessary to find related functions that are not a part of
+## Octave.
 ## @seealso{help, doc, which}
 ## @end deftypefn
 
--- a/scripts/help/print_usage.m
+++ b/scripts/help/print_usage.m
@@ -139,3 +139,4 @@
 
 ## Stop reporting function as missing tests.  No good tests possible.
 %!assert (1)
+
--- a/scripts/help/private/__additional_help_message__.m
+++ b/scripts/help/private/__additional_help_message__.m
@@ -37,3 +37,4 @@
   endif
 
 endfunction
+
--- a/scripts/help/private/__strip_html_tags__.m
+++ b/scripts/help/private/__strip_html_tags__.m
@@ -79,3 +79,4 @@
   ## Actually remove the elements
   text = text (keep);
 endfunction
+
--- a/scripts/help/type.m
+++ b/scripts/help/type.m
@@ -124,3 +124,4 @@
 %!assert (type ("end"){1}, "end is a keyword")
 %!error (type ('NO_NAME'))
  
+
--- a/scripts/image/cmpermute.m
+++ b/scripts/image/cmpermute.m
@@ -25,7 +25,7 @@
 ## When called with only two arguments, @code{cmpermute} randomly rearranges
 ## the colormap @var{map} and returns a new colormap @var{newmap}.  It also
 ## returns the indexed image @var{Y} which is the equivalent of the original
-## input image @var{X} when displayed using @var{newmap}.  
+## input image @var{X} when displayed using @var{newmap}.
 ##
 ## When called with an optional third argument the order of colors in the
 ## new colormap is defined by @var{index}.
--- a/scripts/image/colorcube.m
+++ b/scripts/image/colorcube.m
@@ -46,12 +46,12 @@
     return;
   endif
 
-  # Create colorcube of evenly spaced points with side length of n^1/3
+  ## Create colorcube of evenly spaced points with side length of n^1/3
   cubelen = fix (cbrt (n));
   reserve = n - cubelen^3; 
 
   if (reserve == 0)
-    # Steal space from blue to put the gray gradient
+    ## Steal space from blue to put the gray gradient
     [r, g, b] = meshgrid (linspace (0,1,cubelen),
                           linspace (0,1,cubelen),
                           linspace (0,1,cubelen-1));
@@ -61,16 +61,16 @@
                           linspace (0,1,cubelen));
   endif
 
-  # Create map and weed out grays
+  ## Create map and weed out grays
   map = [r(:), g(:), b(:)];
   idx = any (bsxfun (@ne, map(:, 1), map(:, 2:3)), 2);
   map = map(idx, :);
 
-  # Weed out pure colors
+  ## Weed out pure colors
   idx = sum (map == 0, 2);
   map = map(idx != 2, :);
 
-  # Put in remaining gradients of pure red, green, blue, and gray
+  ## Put in remaining gradients of pure red, green, blue, and gray
   reserve = n - rows (map) - 1;
   csteps = fix (reserve/4);
   cstepsz = 1 / csteps;
--- a/scripts/image/colormap.m
+++ b/scripts/image/colormap.m
@@ -21,10 +21,12 @@
 ## @deftypefn  {Function File} {@var{cmap} =} colormap ()
 ## @deftypefnx {Function File} {@var{cmap} =} colormap (@var{map})
 ## @deftypefnx {Function File} {@var{cmap} =} colormap ("default")
-## @deftypefnx {Function File} {@var{cmap} =} colormap ("list")
-## @deftypefnx {Function File} {@var{cmap} =} colormap ("register", "@var{name}")
-## @deftypefnx {Function File} {@var{cmap} =} colormap ("unregister", "@var{name}")
+## @deftypefnx {Function File} {@var{cmap} =} colormap ("@var{map_name}")
+## @deftypefnx {Function File} {@var{cmap} =} colormap (@var{hax}, @dots{})
 ## @deftypefnx {Command} {} colormap @var{map_name}
+## @deftypefnx {Function File} {@var{cmaps} =} colormap ("list")
+## @deftypefnx {Function File} {} colormap ("register", "@var{name}")
+## @deftypefnx {Function File} {} colormap ("unregister", "@var{name}")
 ## Query or set the current colormap.
 ##
 ## With no input arguments, @code{colormap} returns the current color map.
@@ -37,13 +39,18 @@
 ## @code{colormap ("default")} restores the default colormap (the
 ## @code{jet} map with 64 entries).  The default colormap is returned.
 ##
-## @code{colormap ("list")} returns a cell array with all of the available
-## colormaps.  The options "register" and "unregister" will add or remove
-## the colormap @var{name} from this list.
+## The map may also be specified by a string, @qcode{"@var{map_name}"}, where
+## @var{map_name} is the name of a function that returns a colormap.
+##
+## If the first argument @var{hax} is an axes handle, then the colormap for
+## the parent figure of @var{hax} is queried or set.
 ##
 ## For convenience, it is also possible to use this function with the
-## command form, where @var{map_name} must be the name of a function
-## that returns a colormap.
+## command form, @code{colormap @var{map_name}}.
+##
+## @code{colormap ("list")} returns a cell array with all of the available
+## colormaps.  The options @qcode{"register"} and @qcode{"unregister"}
+## add or remove the colormap @var{name} from this list.
 ##
 ## @seealso{jet}
 ## @end deftypefn
@@ -52,16 +59,23 @@
 ## Created: July 1994
 ## Adapted-By: jwe
 
-function cmap = colormap (map, name)
+function cmap = colormap (varargin)
+  persistent map_list = cell ();
+
+  [hax, varargin, nargin] = __plt_get_axis_arg__ ("colormap", varargin{:});
 
   if (nargin > 2)
     print_usage ();
   endif
 
-  persistent map_list = cell ();
+  if (! isempty (hax))
+    cf = ancestor (hax, "figure");
+  else
+    cf = get (0, "currentfigure");
+  endif
 
   if (nargin == 1)
-
+    map = varargin{1};
     if (ischar (map))
       if (strcmp (map, "default"))
         map = jet (64);
@@ -81,25 +95,33 @@
       if (any (map(:) < 0) || any (map(:) > 1))
         error ("colormap: all MAP values must be in the range [0,1]");
       endif
+      if (isempty (cf))
+        cf = gcf ();
+      endif
       ## Set the new color map
-      set (gcf (), "colormap", map);
+      set (cf, "colormap", map);
     endif
 
   elseif (nargin == 2)
-    if (! ischar (map) || ! any (strcmp (map, {"register", "unregister"})))
+    opt = varargin{1};
+    name = varargin{2};
+    if (! ischar (opt) || ! any (strcmp (opt, {"register", "unregister"})))
       print_usage ();
     elseif (! ischar (name))
       error ("colormap: to register/unregister a colormap, NAME must be a string");
-    elseif (strcmp (map, "register"))
+    elseif (strcmp (opt, "register"))
       map_list{end+1} = name;
-    elseif (strcmp (map, "unregister"))
+    elseif (strcmp (opt, "unregister"))
       map_list(strcmp (name, map_list)) = [];
     endif
   endif
 
   ## Return current color map.
   if (nargout > 0 || (nargout == 0 && nargin == 0))
-    cmap = get (gcf (), "colormap");
+    if (isempty (cf))
+      cf = gcf ();
+    endif
+    cmap = get (cf, "colormap");
   endif
 
 endfunction
@@ -119,7 +141,7 @@
 %! title "colormap (colorcube (64))"
 
 %!test
-%! figure ("visible", "off");
+%! hf = figure ("visible", "off");
 %! cmaptst = [0 1 0; 1 0 1; 1 1 1];
 %! cmap = colormap (cmaptst);
 %! assert (cmap, cmaptst);
@@ -131,7 +153,7 @@
 %! assert (colormap (), jet (64));
 %! colormap ("ocean");
 %! assert (colormap, ocean (64));
-%! close ();  # done with temp. figure
+%! close (hf);  # done with temp. figure
 
 %!test
 %! cmaplst = colormap ("list");
--- a/scripts/image/hsv2rgb.m
+++ b/scripts/image/hsv2rgb.m
@@ -75,8 +75,8 @@
   ##        are outside range [0, 1].  We could also simply allow those values
   ##        and re-instate this code to produce saturating semantics.
   ## Trim map to range [0, 1]
-  #hsv_map(hsv_map < 0) = 0;
-  #hsv_map(hsv_map > 1) = 1;
+  ## hsv_map(hsv_map < 0) = 0;
+  ## hsv_map(hsv_map > 1) = 1;
 
   h = hsv_map(:,1);
   s = hsv_map(:,2);
--- a/scripts/image/image.m
+++ b/scripts/image/image.m
@@ -39,7 +39,7 @@
 ## upper left.  For ordinary plots, the origin is located in the lower
 ## left.  Octave handles this inversion by plotting the data normally,
 ## and then reversing the direction of the y-axis by setting the
-## @code{ydir} property to "reverse".  This has implications whenever
+## @code{ydir} property to @qcode{"reverse"}.  This has implications whenever
 ## an image and an ordinary plot need to be overlaid.  The recommended
 ## solution is to display the image and then plot the reversed ydata
 ## using, for example, @code{flipud (ydata)}.
@@ -170,7 +170,7 @@
   set (hax, "view", [0, 90]);
 
   if (strcmp (get (hax, "nextplot"), "replace"))
-    # Always reverse y-axis for images, unless hold is on
+    ## Always reverse y-axis for images, unless hold is on
     set (hax, "ydir", "reverse");
   endif
 
--- a/scripts/image/imagesc.m
+++ b/scripts/image/imagesc.m
@@ -25,7 +25,7 @@
 ## Display a scaled version of the matrix @var{img} as a color image.  The
 ## colormap is scaled so that the entries of the matrix occupy the entire
 ## colormap.  If @code{@var{climits} = [@var{lo}, @var{hi}]} is given, then that
-## range is set to the "clim" of the current axes.
+## range is set to the @qcode{"clim"} of the current axes.
 ##
 ## The axis values corresponding to the matrix elements are specified in
 ## @var{x} and @var{y}, either as pairs giving the minimum and maximum
--- a/scripts/image/imfinfo.m
+++ b/scripts/image/imfinfo.m
@@ -49,7 +49,7 @@
 ## Number of bits per channel per pixel.
 ##
 ## @item Format
-## Image format (e.g., @code{"jpeg"}).
+## Image format (e.g., @qcode{"jpeg"}).
 ##
 ## @item LongFormat
 ## Long form image format description.
@@ -75,8 +75,8 @@
 ## for.
 ##
 ## @item ByteOrder
-## Endian option for formats that support it.  Value is @code{"little-endian"},
-## @code{"big-endian"}, or @code{"undefined"}.
+## Endian option for formats that support it.  Value is @qcode{"little-endian"},
+## @qcode{"big-endian"}, or @qcode{"undefined"}.
 ##
 ## @item Gamma
 ## Gamma level of the image.  The same color image displayed on two different
@@ -96,12 +96,12 @@
 ## Preferred number of colors in the image.
 ##
 ## @item ResolutionUnits
-## Units of image resolution.  Value is @code{"pixels per inch"},
-## @code{"pixels per centimeter"}, or @code{"undefined"}.
+## Units of image resolution.  Value is @qcode{"pixels per inch"},
+## @qcode{"pixels per centimeter"}, or @qcode{"undefined"}.
 ##
 ## @item ColorType
-## Image type.  Value is @code{"grayscale"}, @code{"indexed"},
-## @code{"truecolor"}, or @code{"undefined"}.
+## Image type.  Value is @qcode{"grayscale"}, @qcode{"indexed"},
+## @qcode{"truecolor"}, or @qcode{"undefined"}.
 ##
 ## @item View
 ## FlashPix viewing parameters.
@@ -122,3 +122,4 @@
   endif
   info = imageIO (@__imfinfo__, "info", varargin, varargin{:});
 endfunction
+
--- a/scripts/image/imformats.m
+++ b/scripts/image/imformats.m
@@ -58,9 +58,9 @@
 ## @end table
 ##
 ## It is possible to change the way Octave manages file formats with the options
-## @code{"add"}, @code{"remove"}, and @code{"update"}, and supplying a
+## @qcode{"add"}, @qcode{"remove"}, and @qcode{"update"}, and supplying a
 ## structure @var{format} with the required fields.  The option
-## @code{"factory"} resets the configuration to the default.
+## @qcode{"factory"} resets the configuration to the default.
 ##
 ## This can be used by Octave packages to extend the image reading capabilities
 ## Octave, through use of the PKG_ADD and PKG_DEL commands.
@@ -175,7 +175,7 @@
   ## there's no need to go and calculate it all over again if we are
   ## requested to reset back to factory.
   if (! isempty (formats))
-    return
+    return;
   endif
 
   ##      Building the formats info
@@ -282,6 +282,7 @@
   end_try_catch
 endfunction
 
+
 ## changing the function to read
 %!testif HAVE_MAGICK
 %! fmt = imformats ("jpg");
--- a/scripts/image/imread.m
+++ b/scripts/image/imread.m
@@ -40,8 +40,8 @@
 ## of size @nospell{MxN}.  Multipage images will have an additional 4th
 ## dimension.
 ## The bit depth of the image determines the
-## class of the output: "uint8" or "uint16" for gray
-## and color, and "logical" for black and white.
+## class of the output: @qcode{"uint8"} or @qcode{"uint16"} for gray
+## and color, and @qcode{"logical"} for black and white.
 ## Note that indexed images always return the indexes for a colormap,
 ## independent if @var{map} is a requested output.  To obtain the actual
 ## RGB image, use @code{ind2rgb}.
@@ -57,16 +57,16 @@
 ## are supported:
 ##
 ## @table @samp
-## @item "Frames" or "Index"
+## @item @qcode{"Frames"} or @qcode{"Index"}
 ## This is an alternative method to specify @var{idx}.  When specifying it
-## in this way, its value can also be the string "all".
+## in this way, its value can also be the string @qcode{"all"}.
 ##
-## @item "Info"
+## @item @qcode{"Info"}
 ## This option exists for @sc{matlab} compatibility and has no effect.  For
 ## maximum performance while reading multiple images from a single file,
 ## use the Index option.
 ##
-## @item "PixelRegion"
+## @item @qcode{"PixelRegion"}
 ## Controls the image region that is read.  Takes as value a cell array
 ## with two arrays of 3 elements @code{@{@var{rows} @var{cols}@}}.  The
 ## elements in the array are the start, increment and end pixel to be
@@ -102,6 +102,7 @@
   [varargout{1:nargout}] = imageIO (@__imread__, "read", filename, varargin{:});
 endfunction
 
+
 %!testif HAVE_MAGICK
 %! vpng = [ ...
 %!  137,  80,  78,  71,  13,  10,  26,  10,   0,   0, ...
--- a/scripts/image/imshow.m
+++ b/scripts/image/imshow.m
@@ -43,7 +43,7 @@
 ## @var{value1}.  @var{string_param1} can be any of the following:
 ##
 ## @table @asis
-## @item "displayrange"
+## @item @qcode{"displayrange"}
 ## @var{value1} is the display range as described above.
 ## @end table
 ##
--- a/scripts/image/imwrite.m
+++ b/scripts/image/imwrite.m
@@ -40,6 +40,13 @@
 ## are supported:
 ##
 ## @table @samp
+## @item Alpha
+## Alpha (transparency) channel for the image.  This must be a matrix with
+## same class, and number of rows and columns of @var{img}.  In case of a
+## multipage image, the size of the 4th dimension must also match and the third
+## dimension must be a singleton.  By default, image will be completely
+## opaque.
+##
 ## @item Quality
 ## Set the quality of the compression.  The value should be an
 ## integer between 0 and 100, with larger values indicating higher visual
@@ -50,12 +57,12 @@
 ## images in a single file.  This option specifies if @var{img} should be
 ## appended to the file (if it exists) or if a new file should be created
 ## for it (possibly overwriting an existing file).  The value should be
-## the string "Overwrite" (default), or "Append".
+## the string @qcode{"Overwrite"} (default), or @qcode{"Append"}.
 ##
 ## Despite this option, the most efficient method of writing a multipage
 ## image is to pass a 4 dimensional @var{img} to @code{imwrite}, the
 ## same matrix that could be expected when using @code{imread} with the
-## option "Index" set to "all".
+## option @qcode{"Index"} set to @qcode{"all"}.
 ##
 ## @end table
 ##
@@ -85,6 +92,7 @@
 
 endfunction
 
+
 %% Test input validation
 %!error imwrite ()                            # Wrong # of args
 %!error imwrite (1)                           # Wrong # of args
@@ -96,3 +104,14 @@
 %!error imwrite ([], "filename.jpg")          # Empty img matrix
 %!error imwrite (spones (2), "filename.jpg")  # Invalid sparse img
 
+%!testif HAVE_MAGICK
+%! imw = randi (255, 100, "uint8");
+%! filename = [tmpnam() ".png"];
+%! unwind_protect
+%!   imwrite (imw, filename);
+%!   imr = imread (filename);
+%! unwind_protect_cleanup
+%!   unlink (filename);
+%! end_unwind_protect
+%! assert (imw, imr)
+
--- a/scripts/image/ind2gray.m
+++ b/scripts/image/ind2gray.m
@@ -30,7 +30,7 @@
 ##
 ## Implementation Note: There are several ways of converting colors to
 ## grayscale intensities.  This functions uses the luminance value obtained
-## from @code{rgb2ntsc} which is @code{I = 0.299*R + 0.587*G + 0.114*B}.  
+## from @code{rgb2ntsc} which is @code{I = 0.299*R + 0.587*G + 0.114*B}.
 ## Other possibilities include the value component from @code{rgb2hsv} or
 ## using a single color channel from @code{ind2rgb}.
 ## @seealso{gray2ind, ind2rgb}
--- a/scripts/image/lines.m
+++ b/scripts/image/lines.m
@@ -20,7 +20,7 @@
 ## @deftypefn  {Function File} {@var{map} =} lines ()
 ## @deftypefnx {Function File} {@var{map} =} lines (@var{n})
 ## Create color colormap.  This colormap is composed of the list of colors
-## in the current axes "ColorOrder" property.  The default is blue,
+## in the current axes @qcode{"ColorOrder"} property.  The default is blue,
 ## green, red, cyan, pink, yellow, and gray.
 ## The argument @var{n} must be a scalar.
 ## If unspecified, the length of the current colormap, or 64, is used.
--- a/scripts/image/private/__imfinfo__.m
+++ b/scripts/image/private/__imfinfo__.m
@@ -69,3 +69,4 @@
   end_unwind_protect
 
 endfunction
+
--- a/scripts/image/private/__imread__.m
+++ b/scripts/image/private/__imread__.m
@@ -204,3 +204,4 @@
     bool = true;
   endif
 endfunction
+
--- a/scripts/image/private/__imwrite__.m
+++ b/scripts/image/private/__imwrite__.m
@@ -26,26 +26,44 @@
 
   if (nargin < 2 || ! (isnumeric (img) || islogical (img)))
     print_usage ("imwrite");
-  elseif (isempty (img))
+  endif
+
+  [filename, ext, map, param_list] = imwrite_filename (varargin{:});
+
+  if (isempty (img))
     error ("imwrite: invalid empty image");
   elseif (issparse (img) || issparse (map))
     error ("imwrite: sparse images are not supported");
   endif
 
-  [filename, ext, map, param_list] = imwrite_filename (varargin{:});
-
   if (rem (numel (param_list), 2) != 0)
     error ("imwrite: no pair for all arguments (odd number left)");
   endif
 
   ## set default for options
   options = struct ("writemode", "overwrite",
-                    "quality", 75);
+                    "quality",   75,
+                    "alpha",     cast ([], class (img)));
 
   for idx = 1:2:numel (param_list)
 
     switch (tolower (param_list{idx}))
 
+      case "alpha"
+        options.alpha = param_list{idx+1};
+        if (! isnumeric (options.alpha))
+          error ("imwrite: value for %s option must be a numeric matrix",
+                 param_list{idx});
+        elseif (size (options.alpha, 3) != 1)
+          error ("imwrite: 3rd dimension of matrix for %s must be singleton",
+                 param_list{idx});
+        elseif (ndims (options.alpha) > 4 ||
+                any (size (options.alpha)([1 2]) != size (img)([1 2])) ||
+                size (options.alpha, 4) != size (img, 4))
+          error ("imwrite: matrix for %s must have same dimension as image",
+                 param_list{idx});
+        endif
+
       case "writemode",
         options.writemode = param_list{idx+1};
         if (! ischar (options.writemode)
@@ -98,3 +116,4 @@
   __magick_write__ (filename, ext, img, map, options);
 
 endfunction
+
--- a/scripts/image/private/imageIO.m
+++ b/scripts/image/private/imageIO.m
@@ -66,3 +66,4 @@
     [varargout{1:nargout}] = fmt.(fieldname) (varargin{:});
   endif
 endfunction
+
--- a/scripts/image/private/imwrite_filename.m
+++ b/scripts/image/private/imwrite_filename.m
@@ -66,3 +66,4 @@
   options = varargin(options_idx:end);
 
 endfunction
+
--- a/scripts/image/private/ind2x.m
+++ b/scripts/image/private/ind2x.m
@@ -57,3 +57,4 @@
   endif
 
 endfunction
+
--- a/scripts/image/rgb2ind.m
+++ b/scripts/image/rgb2ind.m
@@ -49,7 +49,7 @@
 ## @var{tol} must be >0 and @leq{}1.
 ##
 ## @var{dither_option} is a string which enables or disables dithering:
-## 'dither' (default) or 'nodither'.
+## @qcode{"dither"} (default) or @qcode{"nodither"}.
 ##
 ## @seealso{ind2rgb, rgb2hsv, rgb2ntsc}
 ## @end deftypefn
@@ -145,7 +145,7 @@
     ## before processing it with Graphicsmagick
     if (numel (sz) > 3)
      rgb = reshape (rgb, [prod(sz(1:end-2)), sz(end-1), 3]);
-    end
+    endif
 
     ## Prepare the Graphicsmagick dithering option
     if (strcmp (dither_option, "nodither"))
@@ -167,7 +167,7 @@
   ## Conversion of rgb image to x,map
   pr = prod (sz(1:end-1));
   x = zeros (sz(1:end-1));
-  [map,~,x(:)] = unique (reshape(rgb, [pr, 3]), "rows");
+  [map,~,x(:)] = unique (reshape (rgb, [pr, 3]), "rows");
 
   ## a colormap is of class double and values between 0 and 1
   switch (class (rgb))
--- a/scripts/image/spinmap.m
+++ b/scripts/image/spinmap.m
@@ -23,7 +23,7 @@
 ## @deftypefnx {Function File} {} spinmap ("inf")
 ## Cycle the colormap for @var{t} seconds with a color increment of @var{inc}.
 ## Both parameters are optional.  The default cycle time is 5 seconds and the
-## default increment is 2.  If the option "inf" is given then cycle
+## default increment is 2.  If the option @qcode{"inf"} is given then cycle
 ## continuously until @kbd{Control-C} is pressed.
 ##
 ## When rotating the original color 1 becomes color 2, color 2 becomes
--- a/scripts/io/beep.m
+++ b/scripts/io/beep.m
@@ -36,3 +36,4 @@
 
 
 %!error (beep (1))
+
--- a/scripts/io/dlmwrite.m
+++ b/scripts/io/dlmwrite.m
@@ -35,32 +35,32 @@
 ## The value of @var{c} specifies the number of delimiters to prepend to
 ## each line of data.
 ##
-## If the argument @code{"-append"} is given, append to the end of
+## If the argument @qcode{"-append"} is given, append to the end of
 ## @var{file}.
 ##
 ## In addition, the following keyword value pairs may appear at the end
 ## of the argument list:
 ##
 ## @table @asis
-## @item "append"
-## Either @samp{"on"} or @samp{"off"}.  See @samp{"-append"} above.
+## @item @qcode{"append"}
+## Either @qcode{"on"} or @qcode{"off"}.  See @qcode{"-append"} above.
 ##
-## @item "delimiter"
+## @item @qcode{"delimiter"}
 ## See @var{delim} above.
 ##
-## @item "newline"
+## @item @qcode{"newline"}
 ## The character(s) to use to separate each row.  Three special cases
-## exist for this option.  @samp{"unix"} is changed into "\n",
-## @samp{"pc"} is changed into "\r\n", and @samp{"mac"} is changed
-## into "\r".  Other values for this option are kept as is.
+## exist for this option.  @qcode{"unix"} is changed into @qcode{"\n"},
+## @qcode{"pc"} is changed into @qcode{"\r\n"}, and @qcode{"mac"} is changed
+## into @qcode{"\r"}.  Other values for this option are kept as is.
 ##
-## @item "roffset"
+## @item @qcode{"roffset"}
 ## See @var{r} above.
 ##
-## @item "coffset"
+## @item @qcode{"coffset"}
 ## See @var{c} above.
 ##
-## @item "precision"
+## @item @qcode{"precision"}
 ## The precision to use when writing the file.  It can either be a
 ## format string (as used by fprintf) or a number of significant digits.
 ## @end table
--- a/scripts/io/importdata.m
+++ b/scripts/io/importdata.m
@@ -311,7 +311,7 @@
 ########################################
 
 %!test
-%! # Comma separated values
+%! ## Comma separated values
 %! A = [3.1 -7.2 0; 0.012 6.5 128];
 %! fn  = tmpnam ();
 %! fid = fopen (fn, "w");
@@ -324,25 +324,24 @@
 %! assert (h, 0);
 
 %!test
-%! # Tab separated values
+%! ## Tab separated values
 %! A = [3.1 -7.2 0; 0.012 6.5 128];
 %! fn  = tmpnam ();
 %! fid = fopen (fn, "w");
 %! fputs (fid, "3.1\t-7.2\t0\n0.012\t6.5\t128");
 %! fclose (fid);
-%! [a,d,h] = importdata (fn, "\\t");
+%! [a,d,h] = importdata (fn, "\t");
 %! unlink (fn);
 %! assert (a, A);
 %! assert (d, "\t");
 %! assert (h, 0);
 
 %!test
-%! # Space separated values, using multiple spaces to align in columns.
+%! ## Space separated values, using multiple spaces to align in columns.
 %! A = [3.1 -7.2 0; 0.012 6.5 128];
 %! fn  = tmpnam ();
 %! fid = fopen (fn, "w");
-%! fprintf (fid, "%10.3f %10.3f %10.3f\n", A(1,:));
-%! fprintf (fid, "%10.3f %10.3f %10.3f\n", A(2,:));
+%! fprintf (fid, "%10.3f %10.3f %10.3f\n", A');
 %! fclose (fid);
 %! [a,d,h] = importdata (fn, " ");
 %! unlink (fn);
@@ -351,24 +350,74 @@
 %! assert (h, 0);
 
 %!test
-%! # Header
+%! ## Header text
 %! A.data = [3.1 -7.2 0; 0.012 6.5 128];
 %! A.textdata = {"This is a header row."; ...
 %!               "this row does not contain any data, but the next one does."};
 %! fn  = tmpnam ();
 %! fid = fopen (fn, "w");
-%! fputs (fid, [A.textdata{1} "\n"]);
-%! fputs (fid, [A.textdata{2} "\n"]);
+%! fprintf (fid, "%s\n", A.textdata{:});
 %! fputs (fid, "3.1\t-7.2\t0\n0.012\t6.5\t128");
 %! fclose (fid);
-%! [a,d,h] = importdata (fn, "\\t");
+%! [a,d,h] = importdata (fn, '\t');
+%! unlink (fn);
+%! assert (a, A);
+%! assert (d, "\t");
+%! assert (h, 2);
+
+%!test
+%! ## Column headers, only last row is returned in colheaders
+%! A.data = [3.1 -7.2 0; 0.012 6.5 128];
+%! A.textdata = {"Label1 Label2 Label3";
+%!               "col1 col2 col3"};
+%! A.colheaders = {"col1", "col2", "col3"};
+%! fn  = tmpnam ();
+%! fid = fopen (fn, "w");
+%! fprintf (fid, "%s\n", A.textdata{:});
+%! fputs (fid, "3.1\t-7.2\t0\n0.012\t6.5\t128");
+%! fclose (fid);
+%! [a,d,h] = importdata (fn, '\t');
 %! unlink (fn);
 %! assert (a, A);
 %! assert (d, "\t");
 %! assert (h, 2);
 
 %!test
-%! # Ignore empty rows containing only spaces
+%! ## Row headers
+%! A.data = [3.1 -7.2 0; 0.012 6.5 128];
+%! ## FIXME: Does Matlab even create field "textdata" if it is null?
+%! A.textdata = {""};
+%! A.rowheaders = {"row1", "row2"};
+%! fn  = tmpnam ();
+%! fid = fopen (fn, "w");
+%! fputs (fid, "row1\t3.1\t-7.2\t0\nrow2\t0.012\t6.5\t128");
+%! fclose (fid);
+%! [a,d,h] = importdata (fn, '\t');
+%! unlink (fn);
+%! assert (a, A);
+%! assert (d, "\t");
+%! assert (h, 2);
+
+%!test
+%! ## Row/Column headers and Header Text
+%! A.data = [3.1 -7.2 0; 0.012 6.5 128];
+%! A.textdata = {"This is introductory header text"
+%!               "      col1 col2 col3"
+%!               "row1"
+%!               "row2"};
+%! fn  = tmpnam ();
+%! fid = fopen (fn, "w");
+%! fprintf (fid, "%s\n", A.textdata{1:2});
+%! fputs (fid, "row1\t3.1\t-7.2\t0\nrow2\t0.012\t6.5\t128");
+%! fclose (fid);
+%! [a,d,h] = importdata (fn, '\t');
+%! unlink (fn);
+%! assert (a, A);
+%! assert (d, "\t");
+%! assert (h, 2);
+
+%!test
+%! ## Ignore empty rows containing only spaces
 %! A = [3.1 -7.2 0; 0.012 6.5 128];
 %! fn  = tmpnam ();
 %! fid = fopen (fn, "w");
@@ -383,65 +432,80 @@
 %! assert (h, 0);
 
 %!test
-%! # Exponentials
+%! ## Exponentials
 %! A = [3.1 -7.2 0; 0.012 6.5 128];
 %! fn  = tmpnam ();
 %! fid = fopen (fn, "w");
 %! fputs (fid, "+3.1e0\t-72E-1\t0\n12e-3\t6.5\t128");
 %! fclose (fid);
-%! [a,d,h] = importdata (fn, "\\t");
-%! unlink (fn);
-%! assert (a, A);
-%! assert (d, "\t");
-%! assert (h, 0);
-
-%!test
-%! # Complex numbers
-%! A = [3.1 -7.2 0-3.4i; 0.012 -6.5+7.2i 128];
-%! fn  = tmpnam ();
-%! fid = fopen (fn, "w");
-%! fputs (fid, "3.1\t-7.2\t0-3.4i\n0.012\t-6.5+7.2i\t128");
-%! fclose (fid);
-%! [a,d,h] = importdata (fn, "\\t");
+%! [a,d,h] = importdata (fn, '\t');
 %! unlink (fn);
 %! assert (a, A);
 %! assert (d, "\t");
 %! assert (h, 0);
 
 %!test
-%! # Missing values
-%! A = [3.1 NaN 0; 0.012 6.5 128];
+%! ## Complex numbers
+%! A = [3.1 -7.2 0-3.4i; 0.012 -6.5+7.2i 128];
 %! fn  = tmpnam ();
 %! fid = fopen (fn, "w");
-%! fputs (fid, "3.1\t\t0\n0.012\t6.5\t128");
+%! fputs (fid, "3.1\t-7.2\t0-3.4i\n0.012\t-6.5+7.2i\t128");
 %! fclose (fid);
-%! [a,d,h] = importdata (fn, "\\t");
+%! [a,d,h] = importdata (fn, '\t');
+%! unlink (fn);
+%! assert (a, A);
+%! assert (d, "\t");
+%! assert (h, 0);
+
+## FIXME: Currently commented out (8/23/13) because I can't determine whether
+## Matlab processes exceptional values.
+%!#test
+%! ## Exceptional values (Inf, NaN, NA)
+%! A = [3.1 Inf NA; -Inf NaN 128];
+%! fn  = tmpnam ();
+%! fid = fopen (fn, "w");
+%! fputs (fid, "3.1\tInf\tNA\n-Inf\tNaN\t128");
+%! fclose (fid);
+%! [a,d,h] = importdata (fn, '\t');
 %! unlink (fn);
 %! assert (a, A);
 %! assert (d, "\t");
 %! assert (h, 0);
 
 %!test
-%! # CRLF for line breaks
-%! A = [3.1 -7.2 0; 0.012 6.5 128];
+%! ## Missing values
+%! A = [3.1 NaN 0; 0.012 6.5 128];
 %! fn  = tmpnam ();
 %! fid = fopen (fn, "w");
-%! fputs (fid, "3.1\t-7.2\t0\r\n0.012\t6.5\t128");
+%! fputs (fid, "3.1\t\t0\n0.012\t6.5\t128");
 %! fclose (fid);
-%! [a,d,h] = importdata (fn, "\\t");
+%! [a,d,h] = importdata (fn, '\t');
 %! unlink (fn);
 %! assert (a, A);
 %! assert (d, "\t");
 %! assert (h, 0);
 
 %!test
-%! # CR for line breaks
+%! ## CRLF for line breaks
+%! A = [3.1 -7.2 0; 0.012 6.5 128];
+%! fn  = tmpnam ();
+%! fid = fopen (fn, "w");
+%! fputs (fid, "3.1\t-7.2\t0\r\n0.012\t6.5\t128");
+%! fclose (fid);
+%! [a,d,h] = importdata (fn, '\t');
+%! unlink (fn);
+%! assert (a, A);
+%! assert (d, "\t");
+%! assert (h, 0);
+
+%!test
+%! ## CR for line breaks
 %! A = [3.1 -7.2 0; 0.012 6.5 128];
 %! fn  = tmpnam ();
 %! fid = fopen (fn, "w");
 %! fputs (fid, "3.1\t-7.2\t0\r0.012\t6.5\t128");
 %! fclose (fid);
-%! [a,d,h] = importdata (fn, "\\t");
+%! [a,d,h] = importdata (fn, '\t');
 %! unlink (fn);
 %! assert (a, A);
 %! assert (d, "\t");
--- a/scripts/io/strread.m
+++ b/scripts/io/strread.m
@@ -99,21 +99,21 @@
 ## pairs.  The following properties are recognized:
 ##
 ## @table @asis
-## @item "commentstyle"
+## @item @qcode{"commentstyle"}
 ## Parts of @var{str} are considered comments and will be skipped.
 ## @var{value} is the comment style and can be any of the following.
 ##
 ## @itemize
-## @item "shell"
+## @item @qcode{"shell"}
 ## Everything from @code{#} characters to the nearest end-of-line is skipped.
 ##
-## @item "c"
+## @item @qcode{"c"}
 ## Everything between @code{/*} and @code{*/} is skipped.
 ##
-## @item "c++"
+## @item @qcode{"c++"}
 ## Everything from @code{//} characters to the nearest end-of-line is skipped.
 ##
-## @item "matlab"
+## @item @qcode{"matlab"}
 ## Everything from @code{%} characters to the nearest end-of-line is skipped.
 ##
 ## @item user-supplied.  Two options:
@@ -122,34 +122,34 @@
 ## is skipped.
 ## @end itemize
 ##
-## @item "delimiter"
+## @item @qcode{"delimiter"}
 ## Any character in @var{value} will be used to split @var{str} into words
 ## (default value = any whitespace).
 ##
-## @item "emptyvalue":
+## @item @qcode{"emptyvalue"}:
 ## Value to return for empty numeric values in non-whitespace delimited data.
 ## The default is NaN@.  When the data type does not support NaN
 ## (int32 for example), then default is zero.
 ##
-## @item "multipledelimsasone"
+## @item @qcode{"multipledelimsasone"}
 ## Treat a series of consecutive delimiters, without whitespace in between,
 ## as a single delimiter.  Consecutive delimiter series need not be vertically
-## "aligned".
+## @qcode{"aligned"}.
 ##
-## @item "treatasempty"
+## @item @qcode{"treatasempty"}
 ## Treat single occurrences (surrounded by delimiters or whitespace) of the
 ## string(s) in @var{value} as missing values.
 ##
-## @item "returnonerror"
+## @item @qcode{"returnonerror"}
 ## If @var{value} true (1, default), ignore read errors and return normally.
 ## If false (0), return an error.
 ##
-## @item "whitespace"
+## @item @qcode{"whitespace"}
 ## Any character in @var{value} will be interpreted as whitespace and
 ## trimmed; the string defining whitespace must be enclosed in double
 ## quotes for proper processing of special characters like \t.
-## The default value for whitespace = " \b\r\n\t" (note the space).
-## Unless whitespace is set to '' (empty) AND at least one "%s" format
+## The default value for whitespace = @qcode{" \b\r\n\t"} (note the space).
+## Unless whitespace is set to '' (empty) AND at least one @qcode{"%s"} format
 ## conversion specifier is supplied, a space is always part of whitespace.
 ##
 ## @end table
@@ -159,11 +159,11 @@
 ## depends on the last character of @var{str}:
 ##
 ## @table @asis
-## @item last character = "\n"
+## @item last character = @qcode{"\n"}
 ## Data columns are padded with empty fields or Nan so that all columns
 ## have equal length 
 ##
-## @item last character is not "\n"
+## @item last character is not @qcode{"\n"}
 ## Data columns are not padded; strread returns columns of unequal length
 ##
 ## @end table
@@ -840,14 +840,14 @@
 %! assert (a, {"a b c"; "d e"; ""; "f"});
 
 %!test
-%! # Bug #33536
+%! ## Bug #33536
 %! [a, b, c] = strread ("1,,2", "%s%s%s", "delimiter", ",");
 %! assert (a{1}, "1");
 %! assert (b{1}, "");
 %! assert (c{1}, "2");
 
 %!test
-%! # Bug #33536
+%! ## Bug #33536
 %! a = strread ("[SomeText]", "[%s", "delimiter", "]");
 %! assert (a{1}, "SomeText");
 
@@ -868,7 +868,7 @@
 %! assert (d, int32 ([0; 0]));
 
 %!test
-%! # Default format (= %f)
+%! ## Default format (= %f)
 %1 [a, b, c] = strread ("0.12 0.234 0.3567");
 %1 assert (a, 0.12);
 %1 assert (b, 0.234);
@@ -879,13 +879,13 @@
 %1 assert (a, [0.41; 3.57]);
 
 %!test
-%! # TreatAsEmpty
+%! ## TreatAsEmpty
 %! [a, b, c, d] = strread ("1,2,3,NN,5,6\n", "%d%d%d%f", "delimiter", ",", "TreatAsEmpty", "NN");
 %! assert (c, int32 ([3; 0]));
 %! assert (d, [NaN; NaN]);
 
 %!test
-%! # No delimiters at all besides EOL.  Plain reading numbers & strings
+%! ## No delimiters at all besides EOL.  Plain reading numbers & strings
 %! str = "Text1Text2Text\nText398Text4Text\nText57Text";
 %! [a, b] = strread (str, "Text%dText%1sText");
 %! assert (a, int32 ([1; 398; 57]));
@@ -958,14 +958,14 @@
 %! assert (b, NaN);
 
 %!test
-%! # Bug #35999
+%! ## Bug #35999
 %! [a, b, c] = strread ("", "%f");
 %! assert (isempty (a));
 %! assert (isempty (b));
 %! assert (isempty (c));
 
-%% bug #37023
 %!test
+%! ## bug #37023
 %! [a, b] = strread (" 1. 1 \n  2 3 \n", "%f %f", "endofline", "\n");
 %! assert (a, [1; 2], 1e-15);
 %! assert (b, [1; 3], 1e-15);
@@ -994,3 +994,4 @@
 %% Illegal format specifiers
 %!test
 %!error <unknown format specifier> strread ("1.0", "%z")
+
--- a/scripts/io/textread.m
+++ b/scripts/io/textread.m
@@ -32,13 +32,13 @@
 ## supports two more:
 ##
 ## @itemize
-## @item "headerlines":
+## @item @qcode{"headerlines"}:
 ## The first @var{value} number of lines of @var{filename} are skipped.
 ##
-## @item "endofline":
-## Specify a single character or "\r\n".  If no value is given, it will be
-## inferred from the file.  If set to "" (empty string) EOLs are ignored as
-## delimiters.
+## @item @qcode{"endofline"}:
+## Specify a single character or @qcode{"\r\n"}.  If no value is given, it
+## will be inferred from the file.  If set to "" (empty string) EOLs are
+## ignored as delimiters.
 ## @end itemize
 ##
 ## The optional input @var{n} specifies the number of data lines to read; in
@@ -73,7 +73,7 @@
   if (nlines < 1)
     printf ("textread: N = 0, no data read\n");
     varargout = cell (1, nargout);
-    return
+    return;
   endif
 
   ## Read file
@@ -219,6 +219,7 @@
 
 endfunction
 
+
 %!test
 %! f = tmpnam ();
 %! d = rand (5, 3);
@@ -315,3 +316,4 @@
 %!error <missing or illegal value for> textread (file_in_loadpath ("textread.m"), "", "headerlines")
 %!error <missing or illegal value for> textread (file_in_loadpath ("textread.m"), "", "headerlines", 'hh')
 %!error <character value required for> textread (file_in_loadpath ("textread.m"), "%s", "endofline", true)
+
--- a/scripts/io/textscan.m
+++ b/scripts/io/textscan.m
@@ -34,20 +34,21 @@
 ## supports a few more:
 ##
 ## @itemize
-## @item "collectoutput":
+## @item @qcode{"collectoutput"}:
 ## A value of 1 or true instructs textscan to concatenate consecutive columns
 ## of the same class in the output cell array.  A value of 0 or false (default)
 ## leaves output in distinct columns.
 ##
-## @item "endofline":
-## Specify "\r", "\n" or "\r\n" (for CR, LF, or CRLF).  If no value is given,
-## it will be inferred from the file.  If set to "" (empty string) EOLs are
-## ignored as delimiters and added to whitespace.
+## @item @qcode{"endofline"}:
+## Specify @qcode{"\r"}, @qcode{"\n"} or @qcode{"\r\n"} (for CR, LF, or
+## CRLF).  If no value is given, it will be inferred from the file.  If set
+## to "" (empty string) EOLs are ignored as delimiters and added to
+## whitespace.
 ##
-## @item "headerlines":
+## @item @qcode{"headerlines"}:
 ## The first @var{value} number of lines of @var{fid} are skipped.
 ##
-## @item "returnonerror":
+## @item @qcode{"returnonerror"}:
 ## If set to numerical 1 or true (default), return normally when read errors
 ## have been encountered.  If set to 0 or false, return an error and no data.
 ## As the string or file is read by columns rather than by rows, and because
@@ -79,8 +80,8 @@
 
 function [C, position] = textscan (fid, format = "%f", varargin)
 
-  BUFLENGTH = 4096;               ## Read buffer
-  emptfmt = 0;                    ## Signals deliberately empty format string
+  BUFLENGTH = 4096;               # Read buffer
+  emptfmt = 0;                    # Signals deliberately empty format string
 
   ## Check input
   if (nargin < 1)
@@ -112,8 +113,7 @@
   endif
   if (nlines < 1)
     printf ("textscan: N = 0, no data read\n");
-    return
-  endif
+    return;  endif
 
   if (! any (strcmpi (args, "emptyvalue")))
     ## Matlab returns NaNs for missing values
@@ -439,7 +439,7 @@
 %! assert (int8 (c{:}{:}), int8 ([ 76,  49,  10,  76,  50 ]));
 
 %!test
-%! # No delimiters at all besides EOL.  Skip fields, even empty fields
+%! ## No delimiters at all besides EOL.  Skip fields, even empty fields
 %! str = "Text1Text2Text\nTextText4Text\nText57Text";
 %! c = textscan (str, "Text%*dText%dText");
 %! assert (c{1}, int32 ([2; 4; 0]));
@@ -660,3 +660,4 @@
 %! fclose (fid);
 %! unlink (f);
 %! assert (msg1, lasterr);
+
--- a/scripts/java/javaclasspath.m
+++ b/scripts/java/javaclasspath.m
@@ -42,13 +42,13 @@
 ## If called with a single input parameter @var{what}:
 ##
 ## @table @asis
-## @item "-dynamic"
+## @item @qcode{"-dynamic"}
 ## Return the dynamic classpath.
 ##
-## @item "-static"
+## @item @qcode{"-static"}
 ## Return the static classpath.
 ##
-## @item "-all"
+## @item @qcode{"-all"}
 ## Return both the static and dynamic classpath in a single cellstr.
 ## @end table
 ## @seealso{javaaddpath, javarmpath}
--- a/scripts/java/usejava.m
+++ b/scripts/java/usejava.m
@@ -24,25 +24,25 @@
 ## Possible features are:
 ##
 ## @table @asis
-## @item "awt"
+## @item @qcode{"awt"}
 ## Abstract Window Toolkit for GUIs.
 ##
-## @item "desktop"
+## @item @qcode{"desktop"}
 ## Interactive desktop is running.
 ##
-## @item "jvm"
+## @item @qcode{"jvm"}
 ## Java Virtual Machine.
 ##
-## @item "swing"
+## @item @qcode{"swing"}
 ## Swing components for lightweight GUIs.
 ## @end table
 ##
 ## @code{usejava} determines if specific Java features are available in an
 ## Octave session.  This function is provided for scripts which may alter
-## their behavior based on the availability of Java.  The feature "desktop"
-## always returns @code{false} as Octave has no Java-based desktop.  Other
-## features may be available if Octave was compiled with the Java Interface
-## and Java is installed.
+## their behavior based on the availability of Java.  The feature
+## @qcode{"desktop"} always returns @code{false} as Octave has no Java-based
+## desktop.  Other features may be available if Octave was compiled with the
+## Java Interface and Java is installed.
 ## @end deftypefn
 
 ## Author: Rik Wehbring
--- a/scripts/linear-algebra/expm.m
+++ b/scripts/linear-algebra/expm.m
@@ -83,10 +83,10 @@
 
   if (isscalar (A))
     r = exp (A);
-    return
+    return;
   elseif (strfind (typeinfo (A), "diagonal matrix"))
     r = diag (exp (diag (A)));
-    return
+    return;
   endif
 
   n = rows (A);
--- a/scripts/linear-algebra/krylov.m
+++ b/scripts/linear-algebra/krylov.m
@@ -28,8 +28,8 @@
 ## Using Householder reflections to guard against loss of orthogonality.
 ##
 ## If @var{V} is a vector, then @var{h} contains the Hessenberg matrix
-## such that @nospell{@xcode{a*u == u*h+rk*ek'}}, in which @code{rk =
-## a*u(:,k)-u*h(:,k)}, and @nospell{@xcode{ek'}} is the vector
+## such that @nospell{@tcode{a*u == u*h+rk*ek'}}, in which @code{rk =
+## a*u(:,k)-u*h(:,k)}, and @nospell{@tcode{ek'}} is the vector
 ## @code{[0, 0, @dots{}, 1]} of length @code{k}.  Otherwise, @var{h} is
 ## meaningless.
 ##
@@ -244,3 +244,4 @@
   b1 = a;
 
 endfunction
+
--- a/scripts/linear-algebra/subspace.m
+++ b/scripts/linear-algebra/subspace.m
@@ -59,3 +59,4 @@
   endif
 
 endfunction
+
--- a/scripts/miscellaneous/bug_report.m
+++ b/scripts/miscellaneous/bug_report.m
@@ -47,3 +47,4 @@
 
 ## Mark file as being tested.  No real test needed for this function.
 %!assert (1)
+
--- a/scripts/miscellaneous/bunzip2.m
+++ b/scripts/miscellaneous/bunzip2.m
@@ -40,3 +40,4 @@
   endif
 
 endfunction
+
--- a/scripts/miscellaneous/bzip2.m
+++ b/scripts/miscellaneous/bzip2.m
@@ -21,10 +21,10 @@
 ## @deftypefn  {Function File} {@var{entries} =} bzip2 (@var{files})
 ## @deftypefnx {Function File} {@var{entries} =} bzip2 (@var{files}, @var{outdir})
 ## Compress the list of files specified in @var{files}.
-## Each file is compressed separately and a new file with a ".bz2" extension
-## is created.  The original files are not modified.  Existing compressed files
-## are silently overwritten.  If @var{outdir} is defined the compressed
-## files are placed in this directory.
+## Each file is compressed separately and a new file with a @file{".bz2"}
+## extension is created.  The original files are not modified.  Existing
+## compressed files are silently overwritten.  If @var{outdir} is defined the
+## compressed files are placed in this directory.
 ## @seealso{bunzip2, gzip, zip, tar}
 ## @end deftypefn
 
@@ -44,7 +44,7 @@
 
 
 %!xtest
-%! # test for correct cleanup of temporary files
+%! ## test for correct cleanup of temporary files
 %! unwind_protect
 %!   filename = tmpnam;
 %!   dummy    = 1;
--- a/scripts/miscellaneous/cast.m
+++ b/scripts/miscellaneous/cast.m
@@ -43,3 +43,4 @@
   endif
 
 endfunction
+
--- a/scripts/miscellaneous/compare_versions.m
+++ b/scripts/miscellaneous/compare_versions.m
@@ -22,51 +22,51 @@
 ##
 ## This function assumes that versions @var{v1} and @var{v2} are
 ## arbitrarily long strings made of numeric and period characters
-## possibly followed by an arbitrary string (e.g., "1.2.3", "0.3",
-## "0.1.2+", or "1.2.3.4-test1").
+## possibly followed by an arbitrary string (e.g., @qcode{"1.2.3"},
+## @qcode{"0.3"}, @qcode{"0.1.2+"}, or @qcode{"1.2.3.4-test1"}).
 ##
 ## The version is first split into numeric and character portions
-## and then the parts are padded to be the same length (i.e., "1.1" would be
-## padded to be "1.1.0" when being compared with "1.1.1", and
-## separately, the character parts of the strings are padded with
-## nulls).
+## and then the parts are padded to be the same length (i.e., @qcode{"1.1"}
+## would be padded to be @qcode{"1.1.0"} when being compared with
+## @qcode{"1.1.1"}, and separately, the character parts of the strings are
+## padded with nulls).
 ##
 ## The operator can be any logical operator from the set
 ##
 ## @itemize @bullet
 ## @item
-## "=="
+## @qcode{"=="}
 ## equal
 ##
 ## @item
-## "<"
+## @qcode{"<"}
 ## less than
 ##
 ## @item
-## "<="
+## @qcode{"<="}
 ## less than or equal to
 ##
 ## @item
-## ">"
+## @qcode{">"}
 ## greater than
 ##
 ## @item
-## ">="
+## @qcode{">="}
 ## greater than or equal to
 ##
 ## @item
-## "!="
+## @qcode{"!="}
 ## not equal
 ##
 ## @item
-## "~="
+## @qcode{"~="}
 ## not equal
 ## @end itemize
 ##
-## Note that version "1.1-test2" will compare as greater than
-## "1.1-test10".  Also, since the numeric part is compared first, "a"
-## compares less than "1a" because the second string starts with a
-## numeric part even though @code{double ("a")} is greater than
+## Note that version @qcode{"1.1-test2"} will compare as greater than
+## @qcode{"1.1-test10"}.  Also, since the numeric part is compared first,
+## @qcode{"a"} compares less than @qcode{"1a"} because the second string
+## starts with a numeric part even though @code{double ("a")} is greater than
 ## @code{double ("1").}
 ## @end deftypefn
 
--- a/scripts/miscellaneous/computer.m
+++ b/scripts/miscellaneous/computer.m
@@ -38,10 +38,10 @@
 ## of elements for an array.
 ##
 ## If three output arguments are requested, also return the byte order
-## of the current system as a character (@code{"B"} for big-endian or
-## @code{"L"} for little-endian).
+## of the current system as a character (@qcode{"B"} for big-endian or
+## @qcode{"L"} for little-endian).
 ##
-## If the argument @code{"arch"} is specified, return a string
+## If the argument @qcode{"arch"} is specified, return a string
 ## indicating the architecture of the computer on which Octave is
 ## running.
 ## @end deftypefn
--- a/scripts/miscellaneous/copyfile.m
+++ b/scripts/miscellaneous/copyfile.m
@@ -21,8 +21,9 @@
 ## @deftypefnx {Function File} {[@var{status}, @var{msg}, @var{msgid}] =} copyfile (@var{f1}, @var{f2}, 'f')
 ## Copy the file @var{f1} to the new name @var{f2}.  The name @var{f1}
 ## may contain globbing patterns.  If @var{f1} expands to multiple file
-## names, @var{f2} must be a directory.  If the force flag 'f' is given then
-## existing destination files will be overwritten without prompting.
+## names, @var{f2} must be a directory.  If the force flag @qcode{'f'} is
+## given then existing destination files will be overwritten without
+## prompting.
 ##
 ## If successful, @var{status} is 1, with @var{msg} and @var{msgid} empty
 ## character strings.  Otherwise, @var{status} is 0, @var{msg} contains a
@@ -128,3 +129,4 @@
   endif
 
 endfunction
+
--- a/scripts/miscellaneous/debug.m
+++ b/scripts/miscellaneous/debug.m
@@ -79,15 +79,16 @@
 ##
 ## @noindent
 ## When Octave encounters a breakpoint, or other reason to enter debug
-## mode, the prompt changes to @code{"debug>"}.  The workspace of the function
+## mode, the prompt changes to @qcode{"debug>"}.  The workspace of the function
 ## where the breakpoint was encountered becomes available and any Octave
 ## command that is valid in that workspace context may be executed.
 ##
 ## @seealso{dbstop, dbclear, dbstatus, dbwhere, dbtype, dbcont, dbquit,
-##          dbstack, dbup, dbdown, keyboard, debug_on_error, debug_on_warning,
-##          debug_on_interrupt, isdebugmode}
+## dbstack, dbup, dbdown, keyboard, debug_on_error, debug_on_warning,
+## debug_on_interrupt, isdebugmode}
 ## @end deftypefn
 
 function debug ()
   help ("debug");
 endfunction
+
new file mode 100644
--- /dev/null
+++ b/scripts/miscellaneous/desktop.m
@@ -0,0 +1,50 @@
+## Copyright (C) 2013 John W. Eaton
+##
+## This file is part of Octave.
+##
+## Octave is free software; you can redistribute it and/or modify it
+## under the terms of the GNU General Public License as published by
+## the Free Software Foundation; either version 3 of the License, or (at
+## your option) any later version.
+##
+## Octave is distributed in the hope that it will be useful, but
+## WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+## General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License
+## along with Octave; see the file COPYING.  If not, see
+## <http://www.gnu.org/licenses/>.
+
+## -*- texinfo -*-
+## @deftypefn {Function File} {} @var{used} = desktop ("-inuse")
+## Return true if the desktop (GUI) is currently in use.
+## @seealso{isguirunning}
+## @end deftypefn
+
+function retval = desktop (arg)
+
+  if (nargin == 0)
+    if (isguirunning ())
+      return;  # desktop() is a NOP when GUI running
+    else
+      print_usage ();
+    endif
+  elseif (nargin > 1)
+    error ('desktop: only one argument, "-inuse", is allowed');
+  endif
+  
+  switch (tolower (arg))
+    case "-inuse"
+      retval = isguirunning ();
+    otherwise
+      print_usage ();
+  endswitch
+
+endfunction
+
+
+## Test input validation
+%!error <only one argument, "-inuse", is allowed> desktop (1,2)
+%!error desktop ("-invalid_option")
+
--- a/scripts/miscellaneous/dir.m
+++ b/scripts/miscellaneous/dir.m
@@ -140,3 +140,4 @@
   endif
 
 endfunction
+
--- a/scripts/miscellaneous/dos.m
+++ b/scripts/miscellaneous/dos.m
@@ -24,7 +24,7 @@
 ## Execute a system command if running under a Windows-like operating
 ## system, otherwise do nothing.  Return the exit status of the program
 ## in @var{status} and any output from the command in @var{text}.
-## When called with no output argument, or the "-echo" argument is
+## When called with no output argument, or the @qcode{"-echo"} argument is
 ## given, then @var{text} is also sent to standard output.
 ## @seealso{unix, system, isunix, ispc}
 ## @end deftypefn
--- a/scripts/miscellaneous/dump_prefs.m
+++ b/scripts/miscellaneous/dump_prefs.m
@@ -96,3 +96,4 @@
   endfor
 
 endfunction
+
--- a/scripts/miscellaneous/edit.m
+++ b/scripts/miscellaneous/edit.m
@@ -87,7 +87,8 @@
 ## Send it to current Emacs; must have @code{(gnuserv-start)} in @file{.emacs}.
 ## @end table
 ##
-## See also field 'mode', which controls how the editor is run by Octave.
+## See also field @qcode{"mode"}, which controls how the editor is run by
+## Octave.
 ##
 ## On Cygwin, you will need to convert the Cygwin path to a Windows
 ## path if you are using a native Windows editor.  For example:
@@ -133,8 +134,9 @@
 ## @item mode
 ## This value determines whether the editor should be started in async mode
 ## (editor is started in the background and Octave continues) or sync mode
-## (Octave waits until the editor exits).  Set it to "sync" to start the editor
-## in sync mode.  The default is "async" (@pxref{XREFsystem,,system}).
+## (Octave waits until the editor exits).  Set it to @qcode{"sync"} to start
+## the editor in sync mode.  The default is @qcode{"async"}
+## (@pxref{XREFsystem,,system}).
 ##
 ## @item editinplace
 ## Determines whether files should be edited in place, without regard to
@@ -159,7 +161,7 @@
                                 "MODE", "async",
                                 "EDITINPLACE", false);
   ## Make sure the stateval variables survive "clear functions".
-  #mlock;
+  mlock;
 
   if (nargin == 1)
     ## User has supplied one arg, this can be a single file name
@@ -206,7 +208,7 @@
         else
           error ('edit: expected "edit MODE sync|async"');
         endif
-        return
+        return;
       case "EDITINPLACE"
         if (ischar (stateval))
           if (strcmpi (stateval, "true"))
@@ -218,14 +220,14 @@
           endif
         endif
         FUNCTION.EDITINPLACE = stateval;
-        return
+        return;
       case "GET"
         if (isfield (FUNCTION, toupper (stateval)))
           ret = FUNCTION.(toupper (stateval));
         else
           ret = FUNCTION;
         endif
-        return
+        return;
       otherwise
         ## If none of the states match, assume both inputs are
         ## actually both file names to be opened
--- a/scripts/miscellaneous/error_ids.m
+++ b/scripts/miscellaneous/error_ids.m
@@ -54,3 +54,4 @@
 
 ## Remove from test statistics.  No real tests possible
 %!assert (1)
+
--- a/scripts/miscellaneous/fileattrib.m
+++ b/scripts/miscellaneous/fileattrib.m
@@ -143,3 +143,4 @@
   endif
 
 endfunction
+
--- a/scripts/miscellaneous/gunzip.m
+++ b/scripts/miscellaneous/gunzip.m
@@ -41,3 +41,4 @@
   endif
 
 endfunction
+
--- a/scripts/miscellaneous/gzip.m
+++ b/scripts/miscellaneous/gzip.m
@@ -20,10 +20,10 @@
 ## @deftypefn  {Function File} {@var{entries} =} gzip (@var{files})
 ## @deftypefnx {Function File} {@var{entries} =} gzip (@var{files}, @var{outdir})
 ## Compress the list of files and/or directories specified in @var{files}.
-## Each file is compressed separately and a new file with a ".gz" extension
-## is created.  The original files are not modified.  Existing compressed
-## files are silently overwritten.  If @var{outdir} is defined the compressed
-## files are placed in this directory.
+## Each file is compressed separately and a new file with a @file{".gz"}
+## extension is created.  The original files are not modified.  Existing
+## compressed files are silently overwritten.  If @var{outdir} is defined the
+## compressed files are placed in this directory.
 ## @seealso{gunzip, bzip2, zip, tar}
 ## @end deftypefn
 
@@ -42,7 +42,7 @@
 
 
 %!xtest
-%! # test gzip together with gunzip
+%! ## test gzip together with gunzip
 %! unwind_protect
 %!   filename = tmpnam;
 %!   dummy    = 1;
--- a/scripts/miscellaneous/isdeployed.m
+++ b/scripts/miscellaneous/isdeployed.m
@@ -30,3 +30,4 @@
 
 
 %!assert (isdeployed (), false)
+
--- a/scripts/miscellaneous/ismac.m
+++ b/scripts/miscellaneous/ismac.m
@@ -36,3 +36,4 @@
 %!assert (islogical (ismac ()))
 
 %!error ismac (1)
+
--- a/scripts/miscellaneous/license.m
+++ b/scripts/miscellaneous/license.m
@@ -46,11 +46,11 @@
 ## @var{toggle}, which may be one of:
 ##
 ## @table @asis
-## @item "enable"
+## @item @qcode{"enable"}
 ## Future tests for the specified license of @var{feature} are conducted
 ## as usual.
 ##
-## @item "disable"
+## @item @qcode{"disable"}
 ## Future tests for the specified license of @var{feature} return 0.
 ## @end table
 ##
--- a/scripts/miscellaneous/mex.m
+++ b/scripts/miscellaneous/mex.m
@@ -27,3 +27,4 @@
   args = {"--mex", varargin{:}};
   mkoctfile (args{:});
 endfunction
+
--- a/scripts/miscellaneous/mexext.m
+++ b/scripts/miscellaneous/mexext.m
@@ -28,3 +28,4 @@
 
 
 %!assert (mexext (), "mex")
+
--- a/scripts/miscellaneous/mkoctfile.m
+++ b/scripts/miscellaneous/mkoctfile.m
@@ -87,18 +87,18 @@
 ##    CFLAGS                    LD_CXX
 ##    CPICFLAG                  LD_STATIC_FLAG
 ##    CPPFLAGS                  LFLAGS
-##    CXX                       LIBOCTAVE       
-##    CXXFLAGS                  LIBOCTINTERP    
-##    CXXPICFLAG                LIBS            
-##    DEPEND_EXTRA_SED_PATTERN  OCTAVE_LIBS     
+##    CXX                       LIBOCTAVE
+##    CXXFLAGS                  LIBOCTINTERP
+##    CXXPICFLAG                LIBS
+##    DEPEND_EXTRA_SED_PATTERN  OCTAVE_LIBS
 ##    DEPEND_FLAGS              OCTAVE_LINK_DEPS
-##    DL_LD                     OCT_LINK_DEPS   
-##    DL_LDFLAGS                RDYNAMIC_FLAG   
-##    EXEEXT                    READLINE_LIBS   
-##    F77                       SED             
-##    F77_INTEGER_8_FLAG        XTRA_CFLAGS     
-##    FFLAGS                    XTRA_CXXFLAGS   
-##    FFTW3_LDFLAGS             
+##    DL_LD                     OCT_LINK_DEPS
+##    DL_LDFLAGS                RDYNAMIC_FLAG
+##    EXEEXT                    READLINE_LIBS
+##    F77                       SED
+##    F77_INTEGER_8_FLAG        XTRA_CFLAGS
+##    FFLAGS                    XTRA_CXXFLAGS
+##    FFTW3_LDFLAGS
 ##    FFTW3_LIBS
 ##    FFTW3F_LDFLAGS
 ##
@@ -167,3 +167,4 @@
   endif
 
 endfunction
+
--- a/scripts/miscellaneous/module.mk
+++ b/scripts/miscellaneous/module.mk
@@ -18,6 +18,7 @@
   miscellaneous/copyfile.m \
   miscellaneous/debug.m \
   miscellaneous/delete.m \
+  miscellaneous/desktop.m \
   miscellaneous/dir.m \
   miscellaneous/dos.m \
   miscellaneous/dump_prefs.m \
--- a/scripts/miscellaneous/movefile.m
+++ b/scripts/miscellaneous/movefile.m
@@ -21,7 +21,7 @@
 ## @deftypefnx {Function File} {[@var{status}, @var{msg}, @var{msgid}] =} movefile (@var{f1}, @var{f2}, 'f')
 ## Move the file @var{f1} to the new name @var{f2}.  The name @var{f1}
 ## may contain globbing patterns.  If @var{f1} expands to multiple file
-## names, @var{f2} must be a directory.  If the force flag 'f' is given
+## names, @var{f2} must be a directory.  If the force flag @qcode{'f'} is given
 ## then any existing files will be overwritten without prompting.
 ##
 ## If successful, @var{status} is 1, with @var{msg} and @var{msgid} empty
@@ -126,3 +126,4 @@
     print_usage ();
   endif
 endfunction
+
--- a/scripts/miscellaneous/namelengthmax.m
+++ b/scripts/miscellaneous/namelengthmax.m
@@ -32,3 +32,4 @@
 
 
 %!assert (namelengthmax (), 63)
+
--- a/scripts/miscellaneous/news.m
+++ b/scripts/miscellaneous/news.m
@@ -40,3 +40,4 @@
 %!error news (1, 2)
 %!error <news: PACKAGE must be a string> news (1)
 %!error <news: package .* is not installed> news ("__NOT_A_VALID_PKG_NAME__")
+
--- a/scripts/miscellaneous/pack.m
+++ b/scripts/miscellaneous/pack.m
@@ -27,3 +27,4 @@
 function pack ()
 
 endfunction
+
--- a/scripts/miscellaneous/parseparams.m
+++ b/scripts/miscellaneous/parseparams.m
@@ -40,8 +40,8 @@
 ## @end group
 ## @end example
 ##
-## The parseparams function may be used to separate "regular"
-## arguments and additional arguments given as property/value pairs of
+## The parseparams function may be used to separate regular numeric
+## arguments from additional arguments given as property/value pairs of
 ## the @var{varargin} cell array.
 ##
 ## In the second form of the call, available options are specified directly
--- a/scripts/miscellaneous/perl.m
+++ b/scripts/miscellaneous/perl.m
@@ -48,3 +48,4 @@
   endif
 
 endfunction
+
--- a/scripts/miscellaneous/private/__xzip__.m
+++ b/scripts/miscellaneous/private/__xzip__.m
@@ -108,6 +108,7 @@
   f(idx) = files(idx);
 endfunction
 
+
 ## FIXME -- reinstate these tests if we invent a way to test private
 ## functions directly.
 ##
@@ -129,3 +130,4 @@
 ## %!    delete (filename);
 ## %!    rmdir (dirname);
 ## %!  end_unwind_protect
+
--- a/scripts/miscellaneous/private/display_info_file.m
+++ b/scripts/miscellaneous/private/display_info_file.m
@@ -53,3 +53,4 @@
   fclose (fid);
 
 endfunction
+
--- a/scripts/miscellaneous/python.m
+++ b/scripts/miscellaneous/python.m
@@ -47,3 +47,4 @@
   endif
 
 endfunction
+
--- a/scripts/miscellaneous/rmappdata.m
+++ b/scripts/miscellaneous/rmappdata.m
@@ -45,6 +45,7 @@
 
 endfunction
 
+
 %!test
 %! setappdata (0, "hello", "world");
 %! rmappdata (0, "hello");
--- a/scripts/miscellaneous/run.m
+++ b/scripts/miscellaneous/run.m
@@ -59,3 +59,4 @@
     endif
   endif
 endfunction
+
--- a/scripts/miscellaneous/tar.m
+++ b/scripts/miscellaneous/tar.m
@@ -64,3 +64,4 @@
   endif
 
 endfunction
+
--- a/scripts/miscellaneous/tempname.m
+++ b/scripts/miscellaneous/tempname.m
@@ -33,3 +33,4 @@
 
 %% No tests needed for alias.
 %!assert (1)
+
--- a/scripts/miscellaneous/unix.m
+++ b/scripts/miscellaneous/unix.m
@@ -24,7 +24,7 @@
 ## Execute a system command if running under a Unix-like operating
 ## system, otherwise do nothing.  Return the exit status of the program
 ## in @var{status} and any output from the command in @var{text}.
-## When called with no output argument, or the "-echo" argument is
+## When called with no output argument, or the @qcode{"-echo"} argument is
 ## given, then @var{text} is also sent to standard output.
 ## @seealso{dos, system, isunix, ispc}
 ## @end deftypefn
--- a/scripts/miscellaneous/untar.m
+++ b/scripts/miscellaneous/untar.m
@@ -41,3 +41,4 @@
   endif
 
 endfunction
+
--- a/scripts/miscellaneous/unzip.m
+++ b/scripts/miscellaneous/unzip.m
@@ -41,3 +41,4 @@
   endif
 
 endfunction
+
--- a/scripts/miscellaneous/what.m
+++ b/scripts/miscellaneous/what.m
@@ -108,3 +108,4 @@
     endfor
   endif
 endfunction
+
--- a/scripts/miscellaneous/zip.m
+++ b/scripts/miscellaneous/zip.m
@@ -66,3 +66,4 @@
   endif
 
 endfunction
+
--- a/scripts/optimization/__all_opts__.m
+++ b/scripts/optimization/__all_opts__.m
@@ -49,7 +49,7 @@
         fn = fieldnames (opts).';
         names = [names, fn];
       catch
-        # throw the error as a warning.
+        ## throw the error as a warning.
         warning (lasterr ());
       end_try_catch
     endfor
--- a/scripts/optimization/fminbnd.m
+++ b/scripts/optimization/fminbnd.m
@@ -25,8 +25,9 @@
 ## @var{fun} should be a function handle or name.  @var{a}, @var{b} specify a
 ## starting interval.  @var{options} is a structure specifying additional
 ## options.  Currently, @code{fminbnd} recognizes these options:
-## "FunValCheck", "OutputFcn", "TolX", "MaxIter", "MaxFunEvals".  For a
-## description of these options, see @ref{XREFoptimset,,optimset}.
+## @qcode{"FunValCheck"}, @qcode{"OutputFcn"}, @qcode{"TolX"},
+## @qcode{"MaxIter"}, @qcode{"MaxFunEvals"}.  For a description of these
+## options, see @ref{XREFoptimset,,optimset}.
 ##
 ## On exit, the function returns @var{x}, the approximate minimum point
 ## and @var{fval}, the function value thereof.
@@ -268,7 +269,7 @@
       printf ("         - increase MaxIter option.\n");
       printf ("         Current function value: %.6f\n", opt.fx);
     case -1
-      "FIXME"; ## FIXME: what's the message MATLAB prints for this case?
+      "FIXME"; # FIXME: what's the message MATLAB prints for this case?
     otherwise
       error ("internal error - fminbnd() is bug, sorry!");
   endswitch
--- a/scripts/optimization/fminsearch.m
+++ b/scripts/optimization/fminsearch.m
@@ -30,8 +30,9 @@
 ##
 ## Options for the search are provided in the parameter @var{options} using 
 ## the function @code{optimset}.  Currently, @code{fminsearch} accepts the
-## options: "TolX", "MaxFunEvals", "MaxIter", "Display".  For a description of
-## these options, see @code{optimset}.
+## options: @qcode{"TolX"}, @qcode{"MaxFunEvals"}, @qcode{"MaxIter"},
+## @qcode{"Display"}.  For a description of these options, see
+## @code{optimset}.
 ##
 ## On exit, the function returns @var{x}, the minimum point,
 ## and @var{fval}, the function value thereof.
--- a/scripts/optimization/fminunc.m
+++ b/scripts/optimization/fminunc.m
@@ -33,17 +33,17 @@
 ## in all calls to @var{fcn}, but otherwise is treated as a column vector.
 ## @var{options} is a structure specifying additional options.
 ## Currently, @code{fminunc} recognizes these options:
-## @code{"FunValCheck"}, @code{"OutputFcn"}, @code{"TolX"},
-## @code{"TolFun"}, @code{"MaxIter"}, @code{"MaxFunEvals"},
-## @code{"GradObj"}, @code{"FinDiffType"},
-## @code{"TypicalX"}, @code{"AutoScaling"}.
+## @qcode{"FunValCheck"}, @qcode{"OutputFcn"}, @qcode{"TolX"},
+## @qcode{"TolFun"}, @qcode{"MaxIter"}, @qcode{"MaxFunEvals"},
+## @qcode{"GradObj"}, @qcode{"FinDiffType"},
+## @qcode{"TypicalX"}, @qcode{"AutoScaling"}.
 ##
-## If @code{"GradObj"} is @code{"on"}, it specifies that @var{fcn},
+## If @qcode{"GradObj"} is @qcode{"on"}, it specifies that @var{fcn},
 ## called with 2 output arguments, also returns the Jacobian matrix
-## of right-hand sides at the requested point.  @code{"TolX"} specifies
+## of right-hand sides at the requested point.  @qcode{"TolX"} specifies
 ## the termination tolerance in the unknown variables, while
-## @code{"TolFun"} is a tolerance for equations.  Default is @code{1e-7}
-## for both @code{"TolX"} and @code{"TolFun"}.
+## @qcode{"TolFun"} is a tolerance for equations.  Default is @code{1e-7}
+## for both @qcode{"TolX"} and @qcode{"TolFun"}.
 ##
 ## For description of the other options, see @code{optimset}.
 ##
@@ -427,3 +427,4 @@
     x = alpha * x + ((1-alpha) * min (snm, delta)) * s;
   endif
 endfunction
+
--- a/scripts/optimization/fsolve.m
+++ b/scripts/optimization/fsolve.m
@@ -31,31 +31,30 @@
 ## in all calls to @var{fcn}, but otherwise it is treated as a column vector.
 ## @var{options} is a structure specifying additional options.
 ## Currently, @code{fsolve} recognizes these options:
-## @code{"FunValCheck"}, @code{"OutputFcn"}, @code{"TolX"},
-## @code{"TolFun"}, @code{"MaxIter"}, @code{"MaxFunEvals"},
-## @code{"Jacobian"}, @code{"Updating"}, @code{"ComplexEqn"}
-## @code{"TypicalX"}, @code{"AutoScaling"} and @code{"FinDiffType"}.
+## @qcode{"FunValCheck"}, @qcode{"OutputFcn"}, @qcode{"TolX"},
+## @qcode{"TolFun"}, @qcode{"MaxIter"}, @qcode{"MaxFunEvals"},
+## @qcode{"Jacobian"}, @qcode{"Updating"}, @qcode{"ComplexEqn"}
+## @qcode{"TypicalX"}, @qcode{"AutoScaling"} and @qcode{"FinDiffType"}.
 ##
-## If @code{"Jacobian"} is @code{"on"}, it specifies that @var{fcn},
+## If @qcode{"Jacobian"} is @qcode{"on"}, it specifies that @var{fcn},
 ## called with 2 output arguments, also returns the Jacobian matrix
-## of right-hand sides at the requested point.  @code{"TolX"} specifies
+## of right-hand sides at the requested point.  @qcode{"TolX"} specifies
 ## the termination tolerance in the unknown variables, while
-## @code{"TolFun"} is a tolerance for equations.  Default is @code{1e-7}
-## for both @code{"TolX"} and @code{"TolFun"}.
+## @qcode{"TolFun"} is a tolerance for equations.  Default is @code{1e-7}
+## for both @qcode{"TolX"} and @qcode{"TolFun"}.
 ##
-## If @code{"AutoScaling"} is on, the variables will be automatically scaled
+## If @qcode{"AutoScaling"} is on, the variables will be automatically scaled
 ## according to the column norms of the (estimated) Jacobian.  As a result,
 ## TolF becomes scaling-independent.  By default, this option is off, because
 ## it may sometimes deliver unexpected (though mathematically correct) results.
 ##
-## If @code{"Updating"} is "on", the function will attempt to use Broyden
-## updates to update the Jacobian, in order to reduce the amount of Jacobian
-## calculations.
-## If your user function always calculates the Jacobian (regardless of number
-## of output arguments), this option provides no advantage and should be set to
-## false.
+## If @qcode{"Updating"} is @qcode{"on"}, the function will attempt to use
+## @nospell{Broyden} updates to update the Jacobian, in order to reduce the
+## amount of Jacobian calculations.  If your user function always calculates the
+## Jacobian (regardless of number of output arguments), this option provides
+## no advantage and should be set to false.
 ##
-## @code{"ComplexEqn"} is @code{"on"}, @code{fsolve} will attempt to solve
+## @qcode{"ComplexEqn"} is @qcode{"on"}, @code{fsolve} will attempt to solve
 ## complex equations in complex variables, assuming that the equations possess a
 ## complex derivative (i.e., are holomorphic).  If this is not what you want,
 ## should unpack the real and imaginary parts of the system to get a real
@@ -462,6 +461,7 @@
   endif
 endfunction
 
+
 %!function retval = __f (p)
 %!  x = p(1);
 %!  y = p(2);
--- a/scripts/optimization/fzero.m
+++ b/scripts/optimization/fzero.m
@@ -40,8 +40,8 @@
 ## is not successful, the function fails.
 ## @var{options} is a structure specifying additional options.
 ## Currently, @code{fzero}
-## recognizes these options: @code{"FunValCheck"}, @code{"OutputFcn"},
-## @code{"TolX"}, @code{"MaxIter"}, @code{"MaxFunEvals"}.
+## recognizes these options: @qcode{"FunValCheck"}, @qcode{"OutputFcn"},
+## @qcode{"TolX"}, @qcode{"MaxIter"}, @qcode{"MaxFunEvals"}.
 ## For a description of these options, see @ref{XREFoptimset,,optimset}.
 ##
 ## On exit, the function returns @var{x}, the approximate zero point
@@ -357,6 +357,7 @@
   endif
 endfunction
 
+
 %!shared opt0
 %! opt0 = optimset ("tolx", 0);
 %!assert (fzero (@cos, [0, 3], opt0), pi/2, 10*eps)
--- a/scripts/optimization/glpk.m
+++ b/scripts/optimization/glpk.m
@@ -109,19 +109,19 @@
 ## following values
 ##
 ## @table @asis
-## @item "F"
+## @item @qcode{"F"}
 ## A free (unbounded) constraint (the constraint is ignored).
 ##
-## @item "U"
+## @item @qcode{"U"}
 ## An inequality constraint with an upper bound (@code{A(i,:)*x <= b(i)}).
 ##
-## @item "S"
+## @item @qcode{"S"}
 ## An equality constraint (@code{A(i,:)*x = b(i)}).
 ##
-## @item "L"
+## @item @qcode{"L"}
 ## An inequality with a lower bound (@code{A(i,:)*x >= b(i)}).
 ##
-## @item "D"
+## @item @qcode{"D"}
 ## An inequality constraint with both upper and lower bounds
 ## (@code{A(i,:)*x >= -b(i)} @emph{and} (@code{A(i,:)*x <= b(i)}).
 ## @end table
@@ -130,10 +130,10 @@
 ## A column array containing the types of the variables.
 ##
 ## @table @asis
-## @item "C"
+## @item @qcode{"C"}
 ## A continuous variable.
 ##
-## @item "I"
+## @item @qcode{"I"}
 ## An integer variable.
 ## @end table
 ##
@@ -168,7 +168,7 @@
 ## @end table
 ##
 ## @item scale (default: 16)
-## Scaling option. The values can be combined with the bitwise OR operator and
+## Scaling option.  The values can be combined with the bitwise OR operator and
 ## may be the following:
 ##
 ## @table @asis
@@ -185,8 +185,9 @@
 ## Skip if problem is well scaled.
 ## @end table
 ##
-## Alternatively, a value of 128 (@code{GLP_SF_AUTO}) may be also specified, in which case the
-## routine chooses the scaling options automatically.
+## Alternatively, a value of 128 (@w{@env{GLP_SF_AUTO}}) may be also
+## specified, in which case the routine chooses the scaling options
+## automatically.
 ##
 ## @item dual (default: 1)
 ## Simplex method option:
@@ -240,7 +241,7 @@
 ## Heuristic by Driebeck and Tomlin.
 ##
 ## @item 5 (@w{@code{GLP_BR_PCH}})
-## Hybrid pseudocost heuristic.
+## Hybrid @nospell{pseudocost} heuristic.
 ## @end table
 ##
 ## @item btrack (default: 4)
@@ -612,3 +613,4 @@
     __glpk__ (c, A, b, lb, ub, ctype, vartype, sense, param);
 
 endfunction
+
--- a/scripts/optimization/lsqnonneg.m
+++ b/scripts/optimization/lsqnonneg.m
@@ -31,7 +31,7 @@
 ## @code{@var{x} >= 0}.  @var{c} and @var{d} must be real.  @var{x0} is an
 ## optional initial guess for @var{x}.
 ## Currently, @code{lsqnonneg}
-## recognizes these options: @code{"MaxIter"}, @code{"TolX"}.
+## recognizes these options: @qcode{"MaxIter"}, @qcode{"TolX"}.
 ## For a description of these options, see @ref{XREFoptimset,,optimset}.
 ##
 ## Outputs:
@@ -57,9 +57,9 @@
 ## A structure with two fields:
 ##
 ## @itemize @bullet
-## @item "algorithm": The algorithm used ("nnls")
+## @item @qcode{"algorithm"}: The algorithm used (@qcode{"nnls"})
 ##
-## @item "iterations": The number of iterations taken.
+## @item @qcode{"iterations"}: The number of iterations taken.
 ## @end itemize
 ##
 ## @item lambda
@@ -79,7 +79,7 @@
 
   if (nargin == 1 && ischar (c) && strcmp (c, 'defaults'))
     x = optimset ("MaxIter", 1e5);
-    return
+    return;
   endif
 
   if (! (nargin >= 2 && nargin <= 4 && ismatrix (c) && ismatrix (d) && isstruct (options)))
--- a/scripts/optimization/optimget.m
+++ b/scripts/optimization/optimget.m
@@ -56,6 +56,7 @@
 
 endfunction
 
+
 %!error optimget ()
 
 %!shared opts
@@ -65,3 +66,4 @@
 %!assert (optimget (opts, "MaxITer"), 100);
 %!warning (optimget (opts, "Max"));
 %!warning (optimget (opts, "foobar"));
+
--- a/scripts/optimization/optimset.m
+++ b/scripts/optimization/optimset.m
@@ -35,16 +35,16 @@
 ## Request verbose display of results from optimizations.  Values are:
 ##
 ## @table @asis
-## @item "off" [default]
+## @item @qcode{"off"} [default]
 ## No display.
 ##
-## @item "iter"
+## @item @qcode{"iter"}
 ## Display intermediate results for every loop iteration.
 ##
-## @item "final"
+## @item @qcode{"final"}
 ## Display the result of the final loop iteration.
 ##
-## @item "notify"
+## @item @qcode{"notify"}
 ## Display the result of the final loop iteration if the function has
 ## failed to converge.
 ## @end table
@@ -53,22 +53,22 @@
 ##
 ## @item FunValCheck
 ## When enabled, display an error if the objective function returns an invalid
-## value (a complex number, NaN, or Inf).  Must be set to "on" or "off"
-## [default].  Note: the functions @code{fzero} and @code{fminbnd} correctly
-## handle Inf values and only complex values or NaN will cause an error in this
-## case. 
+## value (a complex number, NaN, or Inf).  Must be set to @qcode{"on"} or
+## @qcode{"off"} [default].  Note: the functions @code{fzero} and
+## @code{fminbnd} correctly handle Inf values and only complex values or NaN
+## will cause an error in this case. 
 ##
 ## @item GradObj
-## When set to "on", the function to be minimized must return a second argument
-## which is the gradient, or first derivative, of the function at the point
-## @var{x}.  If set to "off" [default], the gradient is computed via finite
-## differences.
+## When set to @qcode{"on"}, the function to be minimized must return a
+## second argument which is the gradient, or first derivative, of the
+## function at the point @var{x}.  If set to @qcode{"off"} [default], the
+## gradient is computed via finite differences.
 ##
 ## @item Jacobian
-## When set to "on", the function to be minimized must return a second argument
-## which is the Jacobian, or first derivative, of the function at the point
-## @var{x}.  If set to "off" [default], the Jacobian is computed via finite
-## differences.
+## When set to @qcode{"on"}, the function to be minimized must return a
+## second argument which is the Jacobian, or first derivative, of the
+## function at the point @var{x}.  If set to @qcode{"off"} [default], the
+## Jacobian is computed via finite differences.
 ##
 ## @item MaxFunEvals
 ## Maximum number of function evaluations before optimization stops.
@@ -172,3 +172,4 @@
 %!warning (optimset ("foobar", 13));
 
 %!error (optimset ("%NOT_A_REAL_FUNCTION_NAME%"))
+
--- a/scripts/optimization/pqpnonneg.m
+++ b/scripts/optimization/pqpnonneg.m
@@ -48,9 +48,9 @@
 ## A structure with two fields:
 ##
 ## @itemize @bullet
-## @item "algorithm": The algorithm used ("nnls")
+## @item @qcode{"algorithm"}: The algorithm used (@qcode{"nnls"})
 ##
-## @item "iterations": The number of iterations taken.
+## @item @qcode{"iterations"}: The number of iterations taken.
 ## @end itemize
 ##
 ## @item lambda
@@ -72,7 +72,7 @@
 
   if (nargin == 1 && ischar (c) && strcmp (c, 'defaults'))
     x = optimset ("MaxIter", 1e5);
-    return
+    return;
   endif
 
   if (! (nargin >= 2 && nargin <= 4 && ismatrix (c) && ismatrix (d) && isstruct (options)))
--- a/scripts/optimization/qp.m
+++ b/scripts/optimization/qp.m
@@ -405,3 +405,4 @@
   endif
 
 endfunction
+
--- a/scripts/optimization/sqp.m
+++ b/scripts/optimization/sqp.m
@@ -186,8 +186,7 @@
 
 function [x, obj, info, iter, nf, lambda] = sqp (x0, objf, cef, cif, lb, ub, maxiter, tolerance)
 
-  globals = struct (); # data and handles, needed and changed by
-                       # subfunctions
+  globals = struct (); # data and handles, needed and changed by subfunctions
 
   if (nargin < 2 || nargin > 8 || nargin == 5)
     print_usage ();
@@ -768,3 +767,4 @@
 %!error sqp (1, cell (3,1), cell (2,1), cell (2,1),[],[],1.5)
 %!error sqp (1, cell (3,1), cell (2,1), cell (2,1),[],[],[], ones (2,2))
 %!error sqp (1, cell (3,1), cell (2,1), cell (2,1),[],[],[],-1)
+
--- a/scripts/path/pathdef.m
+++ b/scripts/path/pathdef.m
@@ -124,3 +124,4 @@
   endif
 
 endfunction
+
--- a/scripts/pkg/pkg.m
+++ b/scripts/pkg/pkg.m
@@ -137,8 +137,9 @@
 ## [user_packages, system_packages] = pkg ("list")
 ## @end example
 ##
-## The option "-forge" lists packages available at the Octave-Forge repository.
-## This requires an internet connection and the cURL library.  For example:
+## The option @qcode{"-forge"} lists packages available at the Octave-Forge
+## repository.  This requires an internet connection and the cURL library. 
+## For example:
 ##
 ## @example
 ## oct_forge_pkgs = pkg ("list", "-forge")
@@ -146,7 +147,7 @@
 ##
 ## @item describe
 ## Show a short description of the named installed packages, with the option
-## "-verbose" also list functions provided by the package.  For example,
+## @qcode{"-verbose"} also list functions provided by the package.  For example,
 ##
 ## @example
 ## pkg describe -verbose all
@@ -171,8 +172,9 @@
 ## @end example
 ##
 ## @noindent
-## @var{flag} will take one of the values "Not installed", "Loaded" or
-## "Not loaded" for each of the named packages.
+## @var{flag} will take one of the values @qcode{"Not installed"},
+## @qcode{"Loaded"}, or
+## @qcode{"Not loaded"} for each of the named packages.
 ##
 ## @item prefix
 ## Set the installation prefix directory.  For example,
@@ -554,3 +556,4 @@
       error ("you must specify a valid action for 'pkg'. See 'help pkg' for details");
   endswitch
 endfunction
+
--- a/scripts/pkg/private/build.m
+++ b/scripts/pkg/private/build.m
@@ -61,3 +61,4 @@
     endif
   end_unwind_protect
 endfunction
+
--- a/scripts/pkg/private/describe.m
+++ b/scripts/pkg/private/describe.m
@@ -84,3 +84,4 @@
   endif
 
 endfunction
+
--- a/scripts/pkg/private/dirempty.m
+++ b/scripts/pkg/private/dirempty.m
@@ -40,7 +40,7 @@
       endfor
       if (! found)
         emp = false;
-        return
+        return;
       endif
     endfor
     emp = true;
@@ -48,3 +48,4 @@
     emp = true;
   endif
 endfunction
+
--- a/scripts/pkg/private/get_forge_download.m
+++ b/scripts/pkg/private/get_forge_download.m
@@ -26,3 +26,4 @@
   [ver, url] = get_forge_pkg (name);
   local_file = [name, "-", ver, ".tar.gz"];
 endfunction
+
--- a/scripts/pkg/private/get_forge_pkg.m
+++ b/scripts/pkg/private/get_forge_pkg.m
@@ -49,7 +49,7 @@
     else
       ver = t{1}{1};
       if (nargout > 1)
-        # Build download string.
+        ## Build download string.
         pkg_file = sprintf ("%s-%s.tar.gz", name, ver);
         url = ["http://packages.octave.org/download/" pkg_file];
         ## Verify that the package string exists on the page.
@@ -78,3 +78,4 @@
   endif
 
 endfunction
+
--- a/scripts/pkg/private/get_unsatisfied_deps.m
+++ b/scripts/pkg/private/get_unsatisfied_deps.m
@@ -52,3 +52,4 @@
     endif
   endfor
 endfunction
+
--- a/scripts/pkg/private/install.m
+++ b/scripts/pkg/private/install.m
@@ -341,3 +341,4 @@
   endif
 
 endfunction
+
--- a/scripts/pkg/private/is_architecture_dependent.m
+++ b/scripts/pkg/private/is_architecture_dependent.m
@@ -44,3 +44,4 @@
     endif
   endfor
 endfunction
+
--- a/scripts/pkg/private/list_forge_packages.m
+++ b/scripts/pkg/private/list_forge_packages.m
@@ -42,3 +42,4 @@
     endfor
   endif
 endfunction
+
--- a/scripts/pkg/private/rebuild.m
+++ b/scripts/pkg/private/rebuild.m
@@ -97,3 +97,4 @@
     endif
   endif
 endfunction
+
--- a/scripts/pkg/private/shell.m
+++ b/scripts/pkg/private/shell.m
@@ -54,3 +54,4 @@
     [status, output] = system (cmd);
   endif
 endfunction
+
--- a/scripts/pkg/private/uninstall.m
+++ b/scripts/pkg/private/uninstall.m
@@ -144,3 +144,4 @@
   endif
 
 endfunction
+
--- a/scripts/plot/__gnuplot_drawnow__.m
+++ b/scripts/plot/__gnuplot_drawnow__.m
@@ -302,7 +302,7 @@
                               "pslatex", "pstext", "svg", "tgif", "x11"})))
         term_str = [term_str " dashed"];
       endif
-    end
+    endif
     if (any (strcmp (term, {"aqua", "wxt"})))
       term_str = [term_str, " ", "dashlength 1"];
     elseif (any (strcmp (term, {"epslatex", "postscript", "pslatex"})))
--- a/scripts/plot/allchild.m
+++ b/scripts/plot/allchild.m
@@ -21,9 +21,10 @@
 ## Find all children, including hidden children, of a graphics object.
 ##
 ## This function is similar to @code{get (h, "children")}, but also returns
-## hidden objects ("HandleVisibility" = "off").  If @var{handles} is a scalar,
-## @var{h} will be a vector.  Otherwise, @var{h} will be a cell matrix of the
-## same size as @var{handles} and each cell will contain a vector of handles.
+## hidden objects (HandleVisibility = @qcode{"off"}).  If @var{handles} is a
+## scalar, @var{h} will be a vector.  Otherwise, @var{h} will be a cell
+## matrix of the same size as @var{handles} and each cell will contain a
+## vector of handles.
 ## @seealso{findall, findobj, get, set}
 ## @end deftypefn
 
--- a/scripts/plot/ancestor.m
+++ b/scripts/plot/ancestor.m
@@ -26,7 +26,7 @@
 ##
 ## If the handle object @var{h} itself is of type @var{type}, return @var{h}.
 ##
-## If @code{"toplevel"} is given as a third argument, return the highest
+## If @qcode{"toplevel"} is given as a third argument, return the highest
 ## parent in the object hierarchy that matches the condition, instead
 ## of the first (nearest) one.
 ## @seealso{findobj, findall, allchild}
--- a/scripts/plot/area.m
+++ b/scripts/plot/area.m
@@ -41,7 +41,7 @@
 ## rather than the current axes returned by @code{gca}.
 ##
 ## The optional return value @var{h} is a graphics handle to the hggroup
-## object comprising the area patch objects.  The "BaseValue" property
+## object comprising the area patch objects.  The @qcode{"BaseValue"} property
 ## of the hggroup can be used to adjust the level where shading begins.
 ##
 ## Example: Verify identity sin^2 + cos^2 = 1
@@ -51,7 +51,7 @@
 ## t = linspace (0, 2*pi, 100)';
 ## y = [sin(t).^2, cos(t).^2)];
 ## area (t, y);
-## legend ("sin^2", "cos^2", "location", "NorthEastOutside");  
+## legend ("sin^2", "cos^2", "location", "NorthEastOutside");
 ## @end group
 ## @end example
 ## @seealso{plot, patch}
@@ -104,7 +104,7 @@
   endif
 
   oldfig = [];
-  if (isempty (hax))
+  if (! isempty (hax))
     oldfig = get (0, "currentfigure");
   endif
   unwind_protect
@@ -229,7 +229,7 @@
 
 
 %!demo
-%! # Verify identity sin^2 + cos^2 = 1
+%! ## Verify identity sin^2 + cos^2 = 1
 %! clf;
 %! t = linspace (0, 2*pi, 100)';
 %! y = [sin(t).^2, cos(t).^2];
@@ -239,7 +239,7 @@
 %! title ('area() plot');
 
 %!demo
-%! # Show effects of setting BaseValue
+%! ## Show effects of setting BaseValue
 %! clf;
 %! x = [-2:0.1:2]';
 %! y = x.^2 - 1;
@@ -258,3 +258,4 @@
 %! h = area (x, y);
 %! set (h, 'ydata', sort (get (h, 'ydata')))
 %! title ('area() plot of sorted data');
+
--- a/scripts/plot/axes.m
+++ b/scripts/plot/axes.m
@@ -79,3 +79,4 @@
   endif
 
 endfunction
+
--- a/scripts/plot/axis.m
+++ b/scripts/plot/axis.m
@@ -60,13 +60,13 @@
 ## The following options control the aspect ratio of the axes.
 ##
 ## @table @asis
-## @item "square"
+## @item @qcode{"square"}
 ## Force a square aspect ratio.
 ##
-## @item "equal"
+## @item @qcode{"equal"}
 ## Force x distance to equal y-distance.
 ##
-## @item "normal"
+## @item @qcode{"normal"}
 ## Restore default aspect ratio.
 ## @end table
 ##
@@ -74,39 +74,39 @@
 ## The following options control the way axis limits are interpreted.
 ##
 ## @table @asis
-## @item "auto"
+## @item @qcode{"auto"}
 ## Set the specified axes to have nice limits around the data
 ## or all if no axes are specified.
 ##
-## @item "manual"
+## @item @qcode{"manual"}
 ## Fix the current axes limits.
 ##
-## @item "tight"
+## @item @qcode{"tight"}
 ## Fix axes to the limits of the data.
 ##
-## @item "image"
-## Equivalent to "tight" and "equal".
+## @item @qcode{"image"}
+## Equivalent to @qcode{"tight"} and @qcode{"equal"}.
 ## @end table
 ##
 ## @noindent
 ## The following options affect the appearance of tic marks.
 ##
 ## @table @asis
-## @item "on"
+## @item @qcode{"on"}
 ## Turn tic marks and labels on for all axes.
 ##
-## @item "off"
+## @item @qcode{"off"}
 ## Turn tic marks off for all axes.
 ##
-## @item "tic[xyz]"
+## @item @qcode{"tic[xyz]"}
 ## Turn tic marks on for all axes, or turn them on for the
 ## specified axes and off for the remainder.
 ##
-## @item "label[xyz]"
+## @item @qcode{"label[xyz]"}
 ## Turn tic labels on for all axes, or turn them on for the
 ## specified axes and off for the remainder.
 ##
-## @item "nolabel"
+## @item @qcode{"nolabel"}
 ## Turn tic labels off for all axes.
 ## @end table
 ##
@@ -116,10 +116,10 @@
 ## The following options affect the direction of increasing values on the axes.
 ##
 ## @table @asis
-## @item "ij"
+## @item @qcode{"ij"}
 ## Reverse y-axis, so lower values are nearer the top.
 ##
-## @item "xy"
+## @item @qcode{"xy"}
 ## Restore y-axis, so higher values are nearer the top.
 ## @end table
 ##
@@ -136,7 +136,7 @@
   [hax, varargin, nargin] = __plt_get_axis_arg__ ("axis", varargin{:});
 
   oldfig = [];
-  if (isempty (hax))
+  if (! isempty (hax))
     oldfig = get (0, "currentfigure");
   endif
   unwind_protect
--- a/scripts/plot/bar.m
+++ b/scripts/plot/bar.m
@@ -36,8 +36,8 @@
 ## If @var{y} is a matrix, then each column of @var{y} is taken to be a
 ## separate bar graph plotted on the same graph.  By default the columns
 ## are plotted side-by-side.  This behavior can be changed by the @var{style}
-## argument, which can take the values @code{"grouped"} (the default),
-## or @code{"stacked"}.
+## argument, which can take the values @qcode{"grouped"} (the default),
+## or @qcode{"stacked"}.
 ##
 ## Optional property/value pairs are passed directly to the underlying patch
 ## objects.
@@ -80,7 +80,7 @@
 ##
 ## @noindent
 ## will change the colors used for the bars.  The color of bars can also be set
-## manually using the "facecolor" property as shown below.
+## manually using the @qcode{"facecolor"} property as shown below.
 ##
 ## @example
 ## @group
--- a/scripts/plot/barh.m
+++ b/scripts/plot/barh.m
@@ -36,8 +36,8 @@
 ## If @var{y} is a matrix, then each column of @var{y} is taken to be a
 ## separate bar graph plotted on the same graph.  By default the columns
 ## are plotted side-by-side.  This behavior can be changed by the @var{style}
-## argument, which can take the values @code{"grouped"} (the default),
-## or @code{"stacked"}.
+## argument, which can take the values @qcode{"grouped"} (the default),
+## or @qcode{"stacked"}.
 ##
 ## Optional property/value pairs are passed directly to the underlying patch
 ## objects.
--- a/scripts/plot/box.m
+++ b/scripts/plot/box.m
@@ -23,8 +23,8 @@
 ## @deftypefnx {Function File} {} box (@var{hax}, @dots{})
 ## Control display of the axis border.
 ##
-## The argument may be either "on" or "off".  If it is omitted, the current
-## box state is toggled.
+## The argument may be either @qcode{"on"} or @qcode{"off"}.  If it is
+## omitted, the current box state is toggled.
 ##
 ## If the first argument @var{hax} is an axes handle, then operate on
 ## this axis rather than the current axes returned by @code{gca}.
@@ -68,3 +68,4 @@
   set (hax, "box", box_state);
 
 endfunction
+
--- a/scripts/plot/caxis.m
+++ b/scripts/plot/caxis.m
@@ -29,8 +29,9 @@
 ## colormap.  Values outside this range are clamped to the first and last
 ## colormap entries.
 ##
-## If @var{limits} is "auto", then automatic colormap scaling is applied,
-## whereas if @var{limits} is "manual" the colormap scaling is set to manual.
+## If @var{limits} is @qcode{"auto"}, then automatic colormap scaling is
+## applied, whereas if @var{limits} is @qcode{"manual"} the colormap scaling
+## is set to manual.
 ##
 ## If the first argument @var{hax} is an axes handle, then operate on
 ## this axis rather than the current axes returned by @code{gca}.
@@ -44,7 +45,7 @@
   [hax, varargin, nargin] = __plt_get_axis_arg__ ("caxis", varargin{:});
 
   oldfig = [];
-  if (isempty (hax))
+  if (! isempty (hax))
     oldfig = get (0, "currentfigure");
   endif
   unwind_protect
--- a/scripts/plot/cla.m
+++ b/scripts/plot/cla.m
@@ -24,11 +24,11 @@
 ## Clear the current axes.
 ##
 ## @code{cla} operates by deleting child graphic objects with visible
-## handles (HandleVisibility = "on").
+## handles (HandleVisibility = @qcode{"on"}).
 ##
-## If the optional argument "reset" is specified, delete all child objects
-## including those with hidden handles and reset all axis properties to
-## their defaults.  However, the following properties are not reset:
+## If the optional argument @qcode{"reset"} is specified, delete all child
+## objects including those with hidden handles and reset all axis properties
+## to their defaults.  However, the following properties are not reset:
 ## Position, Units.
 ##
 ## If the first argument @var{hax} is an axes handle, then operate on
--- a/scripts/plot/clabel.m
+++ b/scripts/plot/clabel.m
@@ -35,19 +35,19 @@
 ## this plot rather than the one in the current axes returned by @code{gca}.
 ##
 ## By default, all contours are labeled.  However, the contours to label can be
-## specified by the vector @var{v}.  If the "manual" argument is given then
-## the contours to label can be selected with the mouse.
+## specified by the vector @var{v}.  If the @qcode{"manual"} argument is
+## given then the contours to label can be selected with the mouse.
 ##
 ## Additional property/value pairs that are valid properties of text objects
 ## can be given and are passed to the underlying text objects.  Moreover,
-## the contour group property "LabelSpacing" is available which determines
-## the spacing between labels on a contour to be specified.  The default is
-## 144 points, or 2 inches.
+## the contour group property @qcode{"LabelSpacing"} is available which
+## determines the spacing between labels on a contour to be specified.  The
+## default is 144 points, or 2 inches.
 ##
 ## The optional return value @var{h} is a vector of graphics handles to
-## the text objects representing each label.  
-## The "userdata" property of the text objects contains the numerical value of
-## the contour label.
+## the text objects representing each label.
+## The @qcode{"userdata"} property of the text objects contains the numerical
+## value of the contour label.
 ##
 ## An example of the use of @code{clabel} is
 ##
--- a/scripts/plot/clf.m
+++ b/scripts/plot/clf.m
@@ -25,12 +25,12 @@
 ## Clear the current figure window.
 ## 
 ## @code{clf} operates by deleting child graphics objects with visible
-## handles (HandleVisibility = "on").
+## handles (HandleVisibility = @qcode{"on"}).
 ##
-## If the optional argument "reset" is specified, delete all child objects
-## including those with hidden handles and reset all figure properties to
-## their defaults.  However, the following properties are not reset:
-## Position, Units, PaperPosition, PaperUnits.
+## If the optional argument @qcode{"reset"} is specified, delete all child
+## objects including those with hidden handles and reset all figure
+## properties to their defaults.  However, the following properties are not
+## reset: Position, Units, PaperPosition, PaperUnits.
 ##
 ## If the first argument @var{hfig} is a figure handle, then operate on
 ## this figure rather than the current figure returned by @code{gcf}.
--- a/scripts/plot/close.m
+++ b/scripts/plot/close.m
@@ -24,18 +24,18 @@
 ## Close figure window(s).
 ##
 ## @code{close} operates by calling the function specified by the
-## "closerequestfcn" property for each figure.  By default, the function
+## @qcode{"closerequestfcn"} property for each figure.  By default, the function
 ## @code{closereq} is used.
 ##
 ## When called with no arguments, close the current figure.  This is equivalent
 ## to @code{close (gcf)}.  If the input @var{h} is a graphic handle, or vector
 ## of graphics handles, then close each figure in @var{h}.
 ##
-## If the argument "all" is given then all figures with visible handles
-## (HandleVisibility = "on") are closed.
+## If the argument @qcode{"all"} is given then all figures with visible handles
+## (HandleVisibility = @qcode{"on"}) are closed.
 ##
-## If the argument "all hidden" is given then all figures, including hidden
-## ones, are closed.
+## If the argument @qcode{"all hidden"} is given then all figures, including
+## hidden ones, are closed.
 ##
 ## Implementation Note: @code{close} calls a function to dispose of the figure.
 ## It is possible that the function will delay or abort removing the figure.
--- a/scripts/plot/closereq.m
+++ b/scripts/plot/closereq.m
@@ -40,3 +40,4 @@
   endif
 
 endfunction
+
--- a/scripts/plot/colorbar.m
+++ b/scripts/plot/colorbar.m
@@ -35,36 +35,36 @@
 ## Valid values for @var{loc} are
 ##
 ## @table @asis
-## @item "EastOutside"
+## @item @qcode{"EastOutside"}
 ## Place the colorbar outside the plot to the right.  This is the default.
 ##
-## @item "East"
+## @item @qcode{"East"}
 ## Place the colorbar inside the plot to the right.
 ##
-## @item "WestOutside"
+## @item @qcode{"WestOutside"}
 ## Place the colorbar outside the plot to the left.
 ##
-## @item "West"
+## @item @qcode{"West"}
 ## Place the colorbar inside the plot to the left.
 ##
-## @item "NorthOutside"
+## @item @qcode{"NorthOutside"}
 ## Place the colorbar above the plot.
 ##
-## @item "North"
+## @item @qcode{"North"}
 ## Place the colorbar at the top of the plot.
 ##
-## @item "SouthOutside"
+## @item @qcode{"SouthOutside"}
 ## Place the colorbar under the plot.
 ##
-## @item "South"
+## @item @qcode{"South"}
 ## Place the colorbar at the bottom of the plot.
 ## @end table
 ##
 ## To remove a colorbar from a plot use any one of the following keywords for
-## the @var{delete_option}: "delete", "hide", "off".
+## the @var{delete_option}: @qcode{"delete"}, @qcode{"hide"}, @qcode{"off"}.
 ## 
-## If the argument "peer" is given, then the following argument is treated
-## as the axes handle in which to add the colorbar.  Alternatively, 
+## If the argument @qcode{"peer"} is given, then the following argument is
+## treated as the axes handle in which to add the colorbar.  Alternatively,
 ## If the first argument @var{hax} is an axes handle, then the colorbar is
 ## added to this axis, rather than the current axes returned by @code{gca}.
 ##
@@ -78,9 +78,9 @@
 ## colorbar object.
 ##
 ## Implementation Note: A colorbar is created as an additional axes to the
-## current figure with the "tag" property set to "colorbar".  The created
-## axes object has the extra property "location" which controls the positioning
-## of the colorbar.
+## current figure with the @qcode{"tag"} property set to @qcode{"colorbar"}. 
+## The created axes object has the extra property @qcode{"location"} which
+## controls the positioning of the colorbar.
 ## @seealso{colormap}
 ## @end deftypefn
 
--- a/scripts/plot/comet.m
+++ b/scripts/plot/comet.m
@@ -58,7 +58,7 @@
   endif
 
   oldfig = [];
-  if (isempty (hax))
+  if (! isempty (hax))
     oldfig = get (0, "currentfigure");
   endif
   unwind_protect
--- a/scripts/plot/comet3.m
+++ b/scripts/plot/comet3.m
@@ -60,7 +60,7 @@
   endif
 
   oldfig = [];
-  if (isempty (hax))
+  if (! isempty (hax))
     oldfig = get (0, "currentfigure");
   endif
   unwind_protect
--- a/scripts/plot/compass.m
+++ b/scripts/plot/compass.m
@@ -100,7 +100,7 @@
   [r, p] = cart2pol (x, y);
 
   oldfig = [];
-  if (isempty (hax))
+  if (! isempty (hax))
     oldfig = get (0, "currentfigure");
   endif
   unwind_protect
--- a/scripts/plot/contour.m
+++ b/scripts/plot/contour.m
@@ -64,7 +64,7 @@
   [hax, varargin] = __plt_get_axis_arg__ ("contour", varargin{:});
 
   oldfig = [];
-  if (isempty (hax))
+  if (! isempty (hax))
     oldfig = get (0, "currentfigure");
   endif
   unwind_protect
--- a/scripts/plot/contour3.m
+++ b/scripts/plot/contour3.m
@@ -66,7 +66,7 @@
   [hax, varargin, nargin] = __plt_get_axis_arg__ ("contour3", varargin{:});
 
   oldfig = [];
-  if (isempty (hax))
+  if (! isempty (hax))
     oldfig = get (0, "currentfigure");
   endif
   unwind_protect
--- a/scripts/plot/contourf.m
+++ b/scripts/plot/contourf.m
@@ -65,7 +65,7 @@
   [hax, varargin] = __plt_get_axis_arg__ ("contour", varargin{:});
 
   oldfig = [];
-  if (isempty (hax))
+  if (! isempty (hax))
     oldfig = get (0, "currentfigure");
   endif
   unwind_protect
--- a/scripts/plot/cylinder.m
+++ b/scripts/plot/cylinder.m
@@ -84,7 +84,7 @@
     zz = z;
   else
   oldfig = [];
-  if (isempty (hax))
+  if (! isempty (hax))
     oldfig = get (0, "currentfigure");
   endif
     unwind_protect
--- a/scripts/plot/daspect.m
+++ b/scripts/plot/daspect.m
@@ -30,9 +30,9 @@
 ## @code{(daspect (@var{mode}))}
 ##
 ## Set the data aspect ratio mode of the current axes.  @var{mode} is
-## either "auto" or "manual".
+## either @qcode{"auto"} or @qcode{"manual"}.
 ## 
-## @code{daspect ("mode")}
+## @code{daspect (@qcode{"mode"})}
 ##
 ## Return the data aspect ratio mode of the current axes.
 ## 
--- a/scripts/plot/diffuse.m
+++ b/scripts/plot/diffuse.m
@@ -56,3 +56,4 @@
   retval(retval < 0) = 0;
 
 endfunction
+
--- a/scripts/plot/ellipsoid.m
+++ b/scripts/plot/ellipsoid.m
@@ -75,7 +75,7 @@
     zz = z;
   else
   oldfig = [];
-  if (isempty (hax))
+  if (! isempty (hax))
     oldfig = get (0, "currentfigure");
   endif
     unwind_protect
--- a/scripts/plot/errorbar.m
+++ b/scripts/plot/errorbar.m
@@ -131,7 +131,7 @@
   [hax, varargin] = __plt_get_axis_arg__ ("errorbar", varargin{:});
 
   oldfig = [];
-  if (isempty (hax))
+  if (! isempty (hax))
     oldfig = get (0, "currentfigure");
   endif
   unwind_protect
--- a/scripts/plot/ezmesh.m
+++ b/scripts/plot/ezmesh.m
@@ -41,8 +41,8 @@
 ##
 ## @var{n} is a scalar defining the number of points to use in each dimension.
 ##
-## If the argument "circ" is given, then the function is plotted over a disk
-## centered on the middle of the domain @var{dom}.
+## If the argument @qcode{"circ"} is given, then the function is plotted over
+## a disk centered on the middle of the domain @var{dom}.
 ##
 ## If the first argument @var{hax} is an axes handle, then plot into this axis,
 ## rather than the current axes returned by @code{gca}.
--- a/scripts/plot/ezmeshc.m
+++ b/scripts/plot/ezmeshc.m
@@ -41,8 +41,8 @@
 ##
 ## @var{n} is a scalar defining the number of points to use in each dimension.
 ##
-## If the argument "circ" is given, then the function is plotted over a disk
-## centered on the middle of the domain @var{dom}.
+## If the argument @qcode{"circ"} is given, then the function is plotted over
+## a disk centered on the middle of the domain @var{dom}.
 ##
 ## If the first argument @var{hax} is an axes handle, then plot into this axis,
 ## rather than the current axes returned by @code{gca}.
--- a/scripts/plot/ezpolar.m
+++ b/scripts/plot/ezpolar.m
@@ -69,3 +69,4 @@
 %!demo
 %! clf;
 %! ezpolar (@(t) sin (5/4 * t), [0, 8*pi]);
+
--- a/scripts/plot/ezsurf.m
+++ b/scripts/plot/ezsurf.m
@@ -41,8 +41,8 @@
 ##
 ## @var{n} is a scalar defining the number of points to use in each dimension.
 ##
-## If the argument "circ" is given, then the function is plotted over a disk
-## centered on the middle of the domain @var{dom}.
+## If the argument @qcode{"circ"} is given, then the function is plotted over
+## a disk centered on the middle of the domain @var{dom}.
 ##
 ## If the first argument @var{hax} is an axes handle, then plot into this axis,
 ## rather than the current axes returned by @code{gca}.
--- a/scripts/plot/ezsurfc.m
+++ b/scripts/plot/ezsurfc.m
@@ -41,8 +41,8 @@
 ##
 ## @var{n} is a scalar defining the number of points to use in each dimension.
 ##
-## If the argument "circ" is given, then the function is plotted over a disk
-## centered on the middle of the domain @var{dom}.
+## If the argument @qcode{"circ"} is given, then the function is plotted over
+## a disk centered on the middle of the domain @var{dom}.
 ##
 ## If the first argument @var{hax} is an axes handle, then plot into this axis,
 ## rather than the current axes returned by @code{gca}.
--- a/scripts/plot/feather.m
+++ b/scripts/plot/feather.m
@@ -99,7 +99,7 @@
        ytmp - u * arrowsize / 3];
 
   oldfig = [];
-  if (isempty (hax))
+  if (! isempty (hax))
     oldfig = get (0, "currentfigure");
   endif
   unwind_protect
--- a/scripts/plot/fill.m
+++ b/scripts/plot/fill.m
@@ -73,7 +73,7 @@
   iargs = __find_patches__ (varargin{:});
 
   oldfig = [];
-  if (isempty (hax))
+  if (! isempty (hax))
     oldfig = get (0, "currentfigure");
   endif
   unwind_protect
--- a/scripts/plot/findall.m
+++ b/scripts/plot/findall.m
@@ -30,7 +30,7 @@
 ## The return value @var{h} is a list of handles to the found graphic objects.
 ##
 ## @code{findall} performs the same search as @code{findobj}, but it
-## includes hidden objects ("HandleVisibility" = "off").  For full
+## includes hidden objects (HandleVisibility = @qcode{"off"}).  For full
 ## documentation, @pxref{XREFfindobj,,findobj}.
 ## @seealso{findobj, allchild, get, set}
 ## @end deftypefn
--- a/scripts/plot/findfigs.m
+++ b/scripts/plot/findfigs.m
@@ -79,3 +79,4 @@
     endif
   endfor
 endfunction
+
--- a/scripts/plot/findobj.m
+++ b/scripts/plot/findobj.m
@@ -43,30 +43,32 @@
 ## descendants, by passing a handle or set of handles @var{hlist} as the first
 ## argument.
 ##
-## The depth of the object hierarchy to search can be limited with the "-depth"
-## argument.  An example of searching only three generations of children is:
+## The depth of the object hierarchy to search can be limited with the
+## @qcode{"-depth"} argument.  An example of searching only three generations
+## of children is:
 ##
 ## @example
 ## findobj (@var{hlist}, "-depth", @var{d}, @var{prop_name}, @var{prop_value})
 ## @end example
 ##
 ## Specifying a depth @var{d} of 0, limits the search to the set of objects
-## passed in @var{hlist}.  A depth @var{d} of 0 is equivalent to the "flat"
-## argument.
+## passed in @var{hlist}.  A depth @var{d} of 0 is equivalent to the
+## @qcode{"flat"} argument.
 ##
 ## A specified logical operator may be applied to the pairs of @var{prop_name}
-## and @var{prop_value}.  The supported logical operators are: "-and", "-or",
-## "-xor", "-not".
+## and @var{prop_value}.  The supported logical operators are:
+## @qcode{"-and"}, @qcode{"-or"},
+## @qcode{"-xor"}, @qcode{"-not"}.
 ##
 ## Objects may also be matched by comparing a regular expression to the
 ## property values, where property values that match
 ## @code{regexp (@var{prop_value}, @var{pattern})} are returned.
 ##
 ## Finally, objects may be matched by property name only by using the
-## "-property" option.
+## @qcode{"-property"} option.
 ##
 ## Implementation Note: The search only includes objects with visible
-## handles ("HandleVisibility" = "on").  @xref{XREFfindall,,findall}, to
+## handles (HandleVisibility = @qcode{"on"}).  @xref{XREFfindall,,findall}, to
 ## search for all objects including hidden ones.
 ## @seealso{findall, allchild, get, set}
 ## @end deftypefn
@@ -178,7 +180,7 @@
         ## This is sloppy ... but works like Matlab.
         if (strcmpi (args{na}, "-not"))
           h = [];
-          return
+          return;
         endif
         na = na + 1;
       endif
@@ -188,7 +190,7 @@
   endwhile
 
   numpairs = np - 1;
-  if (~ isempty (logicaloperator))
+  if (! isempty (logicaloperator))
     logicaloperator = shift (logicaloperator, 1);
   endif
 
--- a/scripts/plot/gcbo.m
+++ b/scripts/plot/gcbo.m
@@ -22,7 +22,7 @@
 ## Return a handle to the object whose callback is currently executing.
 ## 
 ## If no callback is executing, this function returns the empty matrix.  This
-## handle is obtained from the root object property "CallbackObject".
+## handle is obtained from the root object property @qcode{"CallbackObject"}.
 ##
 ## When called with a second output argument, return the handle of the figure
 ## containing the object whose callback is currently executing.  If no callback
--- a/scripts/plot/gcf.m
+++ b/scripts/plot/gcf.m
@@ -34,7 +34,7 @@
 ## @noindent
 ## plots a sine wave, finds the handle of the current figure, and then
 ## makes that figure invisible.  Setting the visible property of the
-## figure to "on" will cause it to be displayed again.
+## figure to @qcode{"on"} will cause it to be displayed again.
 ## @seealso{gca, gco, gcbf, gcbo, get, set}
 ## @end deftypefn
 
--- a/scripts/plot/gco.m
+++ b/scripts/plot/gco.m
@@ -23,7 +23,7 @@
 ## to the current object of the figure with handle @var{fig}.
 ##
 ## The current object of a figure is the object that was last clicked on.  It
-## is stored in the "CurrentObject" property of the target figure.
+## is stored in the @qcode{"CurrentObject"} property of the target figure.
 ##
 ## If the last mouse click did not occur on any child object of the figure,
 ## then the current object is the figure itself.
@@ -44,3 +44,4 @@
   h = get (get (0, "currentfigure"), "currentobject");
 
 endfunction
+
--- a/scripts/plot/gnuplot_binary.in
+++ b/scripts/plot/gnuplot_binary.in
@@ -22,7 +22,7 @@
 ## Query or set the name of the program invoked by the plot command
 ## when the graphics toolkit is set to "gnuplot".  Additional arguments to
 ## pass to the external plotting program may also be given.
-## The default value is @code{"gnuplot"} with no additional arguments.
+## The default value is @qcode{"gnuplot"} with no additional arguments.
 ## @xref{Installation}.
 ## @seealso{graphics_toolkit}
 ## @end deftypefn
--- a/scripts/plot/graphics_toolkit.m
+++ b/scripts/plot/graphics_toolkit.m
@@ -53,7 +53,7 @@
     if (all (isfigure (name)))
       hlist = name;
       retval = get (hlist, "__graphics_toolkit__");
-      return
+      return;
     elseif (! ischar (name))
       error ("graphics_toolkit: invalid graphics toolkit NAME");
     endif
--- a/scripts/plot/grid.m
+++ b/scripts/plot/grid.m
@@ -26,10 +26,10 @@
 ## @deftypefnx {Function File} {} grid (@var{hax}, @dots{})
 ## Control the display of plot grid lines.
 ##
-## The function state input may be either "on" or "off".
+## The function state input may be either @qcode{"on"} or @qcode{"off"}.
 ## If it is omitted, the current grid state is toggled.
 ##
-## When the first argument is "minor" all subsequent commands
+## When the first argument is @qcode{"minor"} all subsequent commands
 ## modify the minor grid rather than the major grid.
 ##
 ## If the first argument @var{hax} is an axes handle, then operate on
--- a/scripts/plot/guidata.m
+++ b/scripts/plot/guidata.m
@@ -59,3 +59,4 @@
   endif
 
 endfunction
+
--- a/scripts/plot/guihandles.m
+++ b/scripts/plot/guihandles.m
@@ -19,7 +19,7 @@
 ## -*- texinfo -*-
 ## @deftypefn  {Function File} {@var{hdata} =} guihandles (@var{handle})
 ## @deftypefnx {Function File} {@var{hdata} =} guihandles
-##   
+##
 ## @seealso{guidata, getappdata, setappdata}
 ## @end deftypefn
 
@@ -70,3 +70,4 @@
   endfor
 
 endfunction
+
--- a/scripts/plot/hdl2struct.m
+++ b/scripts/plot/hdl2struct.m
@@ -19,8 +19,8 @@
 ## Return a structure, @var{s}, whose fields describe the properties
 ## of the object, and its children, associated with the handle, @var{h}.
 ##
-## The fields of the structure @var{s} are "type", "handle", "properties",
-## "children", and "special".
+## The fields of the structure @var{s} are @qcode{"type"}, @qcode{"handle"},
+## @qcode{"properties"}, @qcode{"children"}, and @qcode{"special"}.
 ## @seealso{struct2hdl, findobj}
 ## @end deftypefn
 
@@ -169,3 +169,4 @@
 
 
 ## FIXME: need validation tests
+
--- a/scripts/plot/hidden.m
+++ b/scripts/plot/hidden.m
@@ -24,7 +24,8 @@
 ## Control mesh hidden line removal.
 ##
 ## When called with no argument the hidden line removal state is toggled.
-## When called with one of the modes "on" or "off" the state is set accordingly.
+## When called with one of the modes @qcode{"on"} or @qcode{"off"} the state
+## is set accordingly.
 ##
 ## The optional output argument @var{mode} is the current state.
 ##
--- a/scripts/plot/hold.m
+++ b/scripts/plot/hold.m
@@ -22,9 +22,9 @@
 ## @deftypefnx {Command} {} hold off
 ## @deftypefnx {Command} {} hold all
 ## @deftypefnx {Function File} {} hold (@var{hax}, @dots{})
-## Toggle or set the "hold" state of the plotting engine which determines
-## whether new graphic objects are added to the plot or replace the existing
-## objects.
+## Toggle or set the @qcode{"hold"} state of the plotting engine which
+## determines whether new graphic objects are added to the plot or replace
+## the existing objects.
 ##
 ## @table @code
 ## @item hold on
--- a/scripts/plot/isonormals.m
+++ b/scripts/plot/isonormals.m
@@ -38,7 +38,7 @@
 ## vertices data @var{v} a patch handle @var{p} can be passed to this
 ## function.
 ##
-## If given the string input argument "negate" as last input argument
+## If given the string input argument @qcode{"negate"} as last input argument
 ## then compute the reverse vector normals of an isosurface geometry.
 ##
 ## If no output argument is given then directly redraw the patch that is
--- a/scripts/plot/isosurface.m
+++ b/scripts/plot/isosurface.m
@@ -38,9 +38,9 @@
 ## which are three--dimensional arrays with the same size than @var{val}
 ## then the volume data is taken at those given points.
 ##
-## The string input argument "noshare" is only for compatibility and
+## The string input argument @qcode{"noshare"} is only for compatibility and
 ## has no effect.  If given the string input argument
-## "verbose" then print messages to the command line interface about the
+## @qcode{"verbose"} then print messages to the command line interface about the
 ## current progress.
 ##
 ## If called with the input argument @var{col} which is a
--- a/scripts/plot/legend.m
+++ b/scripts/plot/legend.m
@@ -58,33 +58,33 @@
 ##
 ## The optional parameter @var{orient} determines if the key elements
 ## are placed vertically or horizontally.  The allowed values are
-## "vertical" (default) or "horizontal".
+## @qcode{"vertical"} (default) or @qcode{"horizontal"}.
 ##
 ## The following customizations are available using @var{option}:
 ##
 ## @table @asis
-## @item "show"
+## @item @qcode{"show"}
 ##   Show legend on the plot
 ##
-## @item "hide"
+## @item @qcode{"hide"}
 ##   Hide legend on the plot
 ##
-## @item "toggle"
-##   Toggles between "hide" and "show"
+## @item @qcode{"toggle"}
+##   Toggles between @qcode{"hide"} and @qcode{"show"}
 ##
-## @item "boxon"
+## @item @qcode{"boxon"}
 ##   Show a box around legend
 ##
-## @item "boxoff"
+## @item @qcode{"boxoff"}
 ##   Hide the box around legend
 ##
-## @item "left"
+## @item @qcode{"left"}
 ##   Place label text to the left of the keys
 ##
-## @item "right"
+## @item @qcode{"right"}
 ##   Place label text to the right of the keys
 ##
-## @item "off"
+## @item @qcode{"off"}
 ##   Delete the legend object
 ## @end table
 ##
@@ -107,11 +107,12 @@
 ## The legend label text is either provided in the call to @code{legend} or
 ## is taken from the DisplayName property of graphics objects.  If no
 ## labels or DisplayNames are available, then the label text is simply
-## "data1", "data2", @dots{}, @nospell{"dataN"}.
+## @qcode{"data1"}, @qcode{"data2"}, @dots{}, @nospell{@qcode{"dataN"}}.
 ##
 ## Implementation Note: A legend is implemented as an additional axes object
-## of the current figure with the "tag" set to "legend".  Properties of the
-## legend object may be manipulated directly by using @code{set}.
+## of the current figure with the @qcode{"tag"} set to @qcode{"legend"}. 
+## Properties of the legend object may be manipulated directly by using
+## @code{set}.
 ## @end deftypefn
 
 function [hlegend2, hobjects2, hplot2, text_strings2] = legend (varargin)
--- a/scripts/plot/linkprop.m
+++ b/scripts/plot/linkprop.m
@@ -99,3 +99,4 @@
     warning ("linkprop: can not remove linked properties");
   endif
 endfunction
+
--- a/scripts/plot/loglog.m
+++ b/scripts/plot/loglog.m
@@ -46,7 +46,7 @@
   endif
 
   oldfig = [];
-  if (isempty (hax))
+  if (! isempty (hax))
     oldfig = get (0, "currentfigure");
   endif
   unwind_protect
--- a/scripts/plot/loglogerr.m
+++ b/scripts/plot/loglogerr.m
@@ -49,7 +49,7 @@
   [hax, varargin] = __plt_get_axis_arg__ ("loglogerr", varargin{:});
 
   oldfig = [];
-  if (isempty (hax))
+  if (! isempty (hax))
     oldfig = get (0, "currentfigure");
   endif
   unwind_protect
--- a/scripts/plot/mesh.m
+++ b/scripts/plot/mesh.m
@@ -32,7 +32,7 @@
 ## given, then it is plotted over the meshgrid
 ## @code{@var{x} = 1:columns (@var{z}), @var{y} = 1:rows (@var{z})}.
 ## Thus, columns of @var{z} correspond to different @var{x} values and rows
-## of @var{z} correspond to different @var{y} values.  
+## of @var{z} correspond to different @var{y} values.
 ##
 ## The color of the mesh is computed by linearly scaling the @var{Z} values
 ## to fit the range of the current colormap.  Use @code{caxis} and/or
@@ -64,7 +64,7 @@
   [hax, varargin, nargin] = __plt_get_axis_arg__ ("mesh", varargin{:});
 
   oldfig = [];
-  if (isempty (hax))
+  if (! isempty (hax))
     oldfig = get (0, "currentfigure");
   endif
   unwind_protect
--- a/scripts/plot/meshc.m
+++ b/scripts/plot/meshc.m
@@ -32,7 +32,7 @@
 ## given, then it is plotted over the meshgrid
 ## @code{@var{x} = 1:columns (@var{z}), @var{y} = 1:rows (@var{z})}.
 ## Thus, columns of @var{z} correspond to different @var{x} values and rows
-## of @var{z} correspond to different @var{y} values.  
+## of @var{z} correspond to different @var{y} values.
 ## 
 ## The color of the mesh is computed by linearly scaling the @var{Z} values
 ## to fit the range of the current colormap.  Use @code{caxis} and/or
@@ -62,7 +62,7 @@
   [hax, varargin, nargin] = __plt_get_axis_arg__ ("meshc", varargin{:});
 
   oldfig = [];
-  if (isempty (hax))
+  if (! isempty (hax))
     oldfig = get (0, "currentfigure");
   endif
   unwind_protect
--- a/scripts/plot/meshz.m
+++ b/scripts/plot/meshz.m
@@ -32,7 +32,7 @@
 ## given, then it is plotted over the meshgrid
 ## @code{@var{x} = 1:columns (@var{z}), @var{y} = 1:rows (@var{z})}.
 ## Thus, columns of @var{z} correspond to different @var{x} values and rows
-## of @var{z} correspond to different @var{y} values.  
+## of @var{z} correspond to different @var{y} values.
 ##
 ## The color of the mesh is computed by linearly scaling the @var{Z} values
 ## to fit the range of the current colormap.  Use @code{caxis} and/or
@@ -112,7 +112,7 @@
   endif
     
   oldfig = [];
-  if (isempty (hax))
+  if (! isempty (hax))
     oldfig = get (0, "currentfigure");
   endif
   unwind_protect
--- a/scripts/plot/newplot.m
+++ b/scripts/plot/newplot.m
@@ -25,41 +25,41 @@
 ##
 ## This function is called at the beginning of all high-level plotting
 ## functions.  It is not normally required in user programs.  @code{newplot}
-## queries the "NextPlot" field of the current figure and axis to determine
-## what to do.
+## queries the @qcode{"NextPlot"} field of the current figure and axis to
+## determine what to do.
 ##
 ## @multitable @columnfractions .25 .75
 ## @headitem Figure NextPlot @tab Action
-## @item "new" @tab Create a new figure and make it the current figure.
+## @item @qcode{"new"} @tab Create a new figure and make it the current figure.
 ##
-## @item "add" (default) @tab Add new graphic objects to the current figure.
+## @item @qcode{"add"} (default) @tab Add new graphic objects to the current figure.
 ##
-## @item "replacechildren" @tab Delete child objects whose HandleVisibility is
-## set to "on".  Set NextPlot property to "add".  This typically clears a
-## figure, but leaves in place hidden objects such as menubars.  This is
-## equivalent to @code{clf}.
+## @item @qcode{"replacechildren"} @tab Delete child objects whose HandleVisibility is
+## set to @qcode{"on"}.  Set NextPlot property to @qcode{"add"}.  This
+## typically clears a figure, but leaves in place hidden objects such as
+## menubars.  This is equivalent to @code{clf}.
 ##
-## @item "replace" @tab Delete all child objects of the figure and reset all
-## figure properties to their defaults.  However, the following four properties
-## are not reset: Position, Units, PaperPosition, PaperUnits.  This is
-## equivalent to @code{clf reset}.
-## @end multitable    
+## @item @qcode{"replace"} @tab Delete all child objects of the figure and
+## reset all figure properties to their defaults.  However, the following
+## four properties are not reset: Position, Units, PaperPosition, PaperUnits.
+##  This is equivalent to @code{clf reset}.
+## @end multitable
 ##
 ## @multitable @columnfractions .25 .75
 ## @headitem Axis NextPlot @tab Action
-## @item "add" @tab Add new graphic objects to the current axes.  This is
+## @item @qcode{"add"} @tab Add new graphic objects to the current axes.  This is
 ## equivalent to @code{hold on}.
 ##
-## @item "replacechildren" @tab Delete child objects whose HandleVisibility is
-## set to "on", but leave axis properties unmodified.  This typically clears a
-## plot, but preserves special settings such as log scaling for axes.
-## This is equivalent to @code{cla}.
+## @item @qcode{"replacechildren"} @tab Delete child objects whose HandleVisibility is
+## set to @qcode{"on"}, but leave axis properties unmodified.  This typically
+## clears a plot, but preserves special settings such as log scaling for
+## axes.  This is equivalent to @code{cla}.
 ##
-## @item "replace" (default) @tab Delete all child objects of the axis and
-## reset all axis properties to their defaults.  However, the following
-## properties are not reset: Position, Units.  This is equivalent to
-## @code{cla reset}.
-## @end multitable    
+## @item @qcode{"replace"} (default) @tab Delete all child objects of the
+## axis and reset all axis properties to their defaults.  However, the
+## following properties are not reset: Position, Units.  This is equivalent
+## to @code{cla reset}.
+## @end multitable
 ##
 ## If the optional input @var{hfig} or @var{hax} is given then prepare the
 ## specified figure or axes rather than the current figure and axes.
--- a/scripts/plot/orient.m
+++ b/scripts/plot/orient.m
@@ -23,9 +23,10 @@
 ## @deftypefnx {Function File} {@var{orientation} =} orient (@var{hfig})
 ## Query or set the default print orientation.
 ##
-## Valid values for @var{orientation} are "landscape", "portrait", and "tall".
+## Valid values for @var{orientation} are @qcode{"landscape"},
+## @qcode{"portrait"}, and @qcode{"tall"}.
 ##
-## The "tall" option sets the orientation to portrait and fills
+## The @qcode{"tall"} option sets the orientation to portrait and fills
 ## the page with the plot, while leaving a 0.25 inch border.
 ##
 ## When called with no arguments, return the default print orientation.
--- a/scripts/plot/pareto.m
+++ b/scripts/plot/pareto.m
@@ -25,7 +25,7 @@
 ## Draw a Pareto chart.
 ##
 ## A Pareto chart is a bar graph that arranges information in such a way
-## that priorities for process improvement can be established;  It organizes
+## that priorities for process improvement can be established; It organizes
 ## and displays information to show the relative importance of data.  The chart
 ## is similar to the histogram or bar chart, except that the bars are arranged
 ## in decreasing magnitude from left to right along the x-axis.
--- a/scripts/plot/patch.m
+++ b/scripts/plot/patch.m
@@ -34,7 +34,7 @@
 ## input is present then 3-D patches will be created.
 ##
 ## The color argument @var{c} can take many forms.  To create polygons
-## which all share a single color use a string value (e.g., "r" for
+## which all share a single color use a string value (e.g., @qcode{"r"} for
 ## red), a scalar value which is scaled by @code{caxis} and indexed into the
 ## current colormap, or a 3-element RGB vector with the precise TrueColor.
 ##
@@ -45,16 +45,19 @@
 ##
 ## Instead of specifying polygons by matrices @var{x} and @var{y}, it is
 ## possible to present a unique list of vertices and then a list of polygon
-## faces created from those vertices.  In this case the "Vertices" matrix will
-## be an @nospell{Nx2} (2-D patch) or @nospell{Nx3} (3-D path).  The
-## @nospell{MxN} "Faces" matrix describes M polygons having N vertices---each
-## row describes a single polygon and each column entry is an index into the
-## "Vertices" matrix to identify a vertex.  The patch object can be created by
-## directly passing the property/value pairs "Vertices"/@var{verts},
-## "Faces"/@var{faces} as inputs.
+## faces created from those vertices.  In this case the
+## @qcode{"Vertices"} matrix will be an @nospell{Nx2} (2-D patch) or
+## @nospell{Nx3} (3-D path).  The @nospell{MxN} @qcode{"Faces"} matrix
+## describes M polygons having N vertices---each row describes a
+## single polygon and each column entry is an index into the
+## @qcode{"Vertices"} matrix to identify a vertex.  The patch object
+## can be created by directly passing the property/value pairs
+## @qcode{"Vertices"}/@var{verts}, @qcode{"Faces"}/@var{faces} as
+## inputs.
 ##
 ## A third input form is to create a structure @var{fv} with the fields
-## "vertices", "faces", and optionally "facevertexcdata".
+## @qcode{"vertices"}, @qcode{"faces"}, and optionally
+## @qcode{"facevertexcdata"}.
 ##
 ## If the first argument @var{hax} is an axes handle, then plot into this axis,
 ## rather than the current axes returned by @code{gca}.
@@ -64,9 +67,8 @@
 ##
 ## Implementation Note: Patches are highly configurable objects.  To truly
 ## customize them requires setting patch properties directly.  Useful patch
-## properties are: "cdata", "edgecolor", "facecolor", "faces",
-## "facevertexcdata",
-##
+## properties are: @qcode{"cdata"}, @qcode{"edgecolor"},
+## @qcode{"facecolor"}, @qcode{"faces"}, @qcode{"facevertexcdata"}.
 ## @seealso{fill, get, set}
 ## @end deftypefn
 
--- a/scripts/plot/pbaspect.m
+++ b/scripts/plot/pbaspect.m
@@ -31,7 +31,7 @@
 ## @code{pbaspect(@var{mode})}
 ##
 ## Set the plot box aspect ratio mode of the current axes.  @var{mode} is
-## either "auto" or "manual".
+## either @qcode{"auto"} or @qcode{"manual"}.
 ##
 ## @code{pbaspect ("mode")}
 ##
--- a/scripts/plot/pcolor.m
+++ b/scripts/plot/pcolor.m
@@ -42,8 +42,8 @@
 ## @code{shading} modifies an attribute determining the manner by which the
 ## face color of each cell is interpolated from the values of @var{c},
 ## and the visibility of the cells' edges.  By default the attribute is
-## "faceted", which renders a single color for each cell's face with the edge
-## visible.
+## @qcode{"faceted"}, which renders a single color for each cell's face with
+## the edge visible.
 ##
 ## If the first argument @var{hax} is an axes handle, then plot into this axis,
 ## rather than the current axes returned by @code{gca}.
@@ -75,7 +75,7 @@
   endif
 
   oldfig = [];
-  if (isempty (hax))
+  if (! isempty (hax))
     oldfig = get (0, "currentfigure");
   endif
   unwind_protect
--- a/scripts/plot/peaks.m
+++ b/scripts/plot/peaks.m
@@ -92,3 +92,4 @@
   endif
 
 endfunction
+
--- a/scripts/plot/pie.m
+++ b/scripts/plot/pie.m
@@ -61,7 +61,7 @@
   endif
 
   oldfig = [];
-  if (isempty (hax))
+  if (! isempty (hax))
     oldfig = get (0, "currentfigure");
   endif
   unwind_protect
--- a/scripts/plot/pie3.m
+++ b/scripts/plot/pie3.m
@@ -62,7 +62,7 @@
   endif
 
   oldfig = [];
-  if (isempty (hax))
+  if (! isempty (hax))
     oldfig = get (0, "currentfigure");
   endif
   unwind_protect
--- a/scripts/plot/plot.m
+++ b/scripts/plot/plot.m
@@ -93,8 +93,9 @@
 ##
 ## Multiple property-value pairs may be specified, but they must appear
 ## in pairs.  These arguments are applied to the line objects drawn by
-## @code{plot}.  Useful properties to modify are "linestyle", "linewidth",
-## "color", "marker", "markersize", "markeredgecolor", "markerfacecolor".
+## @code{plot}.  Useful properties to modify are @qcode{"linestyle"},
+## @qcode{"linewidth"}, @qcode{"color"}, @qcode{"marker"},
+## @qcode{"markersize"}, @qcode{"markeredgecolor"}, @qcode{"markerfacecolor"}.
 ##
 ## The @var{fmt} format argument can also be used to control the plot style.
 ## The format is composed of three parts: linestyle, markerstyle, color. 
@@ -103,7 +104,7 @@
 ## only lines are drawn.  If both are specified then lines and markers will
 ## be plotted.  If no @var{fmt} and no @var{property}/@var{value} pairs are
 ## given, then the default plot style is solid lines with no markers and the
-## color determined by the "colororder" property of the current axes.
+## color determined by the @qcode{"colororder"} property of the current axes.
 ##
 ## Format arguments:
 ##
@@ -147,13 +148,13 @@
 ## @item @samp{w} @tab White
 ## @end multitable
 ##
-## @item ";key;"
-## Here "key" is the label to use for the plot legend.
+## @item @qcode{";key;"}
+## Here @qcode{"key"} is the label to use for the plot legend.
 ## @end table
 ##
 ## The @var{fmt} argument may also be used to assign legend keys.
 ## To do so, include the desired label between semicolons after the
-## formatting sequence described above, e.g., "+b;Key Title;".
+## formatting sequence described above, e.g., @qcode{"+b;Key Title;"}.
 ## Note that the last semicolon is required and Octave will generate
 ## an error if it is left out.
 ##
@@ -207,7 +208,7 @@
   endif
 
   oldfig = [];
-  if (isempty (hax))
+  if (! isempty (hax))
     oldfig = get (0, "currentfigure");
   endif
   unwind_protect
--- a/scripts/plot/plot3.m
+++ b/scripts/plot/plot3.m
@@ -110,7 +110,7 @@
   endif
 
   oldfig = [];
-  if (isempty (hax))
+  if (! isempty (hax))
     oldfig = get (0, "currentfigure");
   endif
   unwind_protect
--- a/scripts/plot/plotmatrix.m
+++ b/scripts/plot/plotmatrix.m
@@ -72,19 +72,15 @@
     print_usage ();
   endif
 
-  oldfig = ifelse (isempty (bigax2), [], get (0, "currentfigure"));
+  oldfig = [];
+  if (! isempty (bigax2))
+    oldfig = get (0, "currentfigure");
+  endif
   unwind_protect
     bigax2 = newplot (bigax2);
 
     [h2, ax2, p2, pax2] = __plotmatrix__ (bigax2, varargin{:});
 
-    if (nargout > 0)
-      h = h2;
-      ax = ax2;
-      bigax = bigax2;
-      p = p2;
-      pax = pax2;
-    endif
     axes (bigax2);
     ctext = text (0, 0, "", "visible", "off",
                   "handlevisibility", "off", "xliminclude", "off",
@@ -98,6 +94,14 @@
     endif
   end_unwind_protect
 
+  if (nargout > 0)
+    h = h2;
+    ax = ax2;
+    bigax = bigax2;
+    p = p2;
+    pax = pax2;
+  endif
+
 endfunction
 
 
--- a/scripts/plot/polar.m
+++ b/scripts/plot/polar.m
@@ -50,7 +50,7 @@
   endif
 
   oldfig = [];
-  if (isempty (hax))
+  if (! isempty (hax))
     oldfig = get (0, "currentfigure");
   endif
   unwind_protect
--- a/scripts/plot/print.m
+++ b/scripts/plot/print.m
@@ -57,7 +57,7 @@
 ##
 ## @item -G@var{ghostscript_command}
 ##   Specify the command for calling Ghostscript.  For Unix and Windows
-## the defaults are 'gs' and 'gswin32c', respectively.
+## the defaults are @qcode{"gs"} and @qcode{"gswin32c"}, respectively.
 ##
 ## @item  -color
 ## @itemx -mono
@@ -71,9 +71,9 @@
 ## @itemx -landscape
 ##   Specify the orientation of the plot for printed output.  For
 ## non-printed output the aspect ratio of the output corresponds to
-## the plot area defined by the "paperposition" property in the
+## the plot area defined by the @qcode{"paperposition"} property in the
 ## orientation specified.  This option is equivalent to changing
-## the figure's "paperorientation" property.
+## the figure's @qcode{"paperorientation"} property.
 ##
 ## @item  -TextAlphaBits=@var{n}
 ## @itemx -GraphicsAlphaBits=@var{n}
@@ -204,9 +204,9 @@
 ## and devices are available.
 ##
 ##   When Ghostscript output is sent to a printer the size is determined
-## by the figure's "papersize" property.  When the output
+## by the figure's @qcode{"papersize"} property.  When the output
 ## is sent to a file the size is determined by the plot box defined by
-## the figure's "paperposition" property.
+## the figure's @qcode{"paperposition"} property.
 ##
 ## @item -append
 ##   Append PostScript or PDF output to a pre-existing file of the same type.
@@ -214,7 +214,7 @@
 ## @item -r@var{NUM}
 ##   Resolution of bitmaps in pixels per inch.  For both metafiles and
 ## SVG the default is the screen resolution; for other formats it is 150 dpi.
-## To specify screen resolution, use "-r0".
+## To specify screen resolution, use @qcode{"-r0"}.
 ##
 ## @item  -loose
 ## @itemx -tight
@@ -241,9 +241,9 @@
 ##   Plot size in pixels for EMF, GIF, JPEG, PBM, PNG, and SVG@.  For
 ## PS, EPS, PDF, and other vector formats the plot size is in points.
 ## This option is equivalent to changing the size of the plot box
-## associated with the "paperposition" property.  When using the command form
-## of the print function you must quote the @var{xsize},@var{ysize}
-## option.  For example, by writing @w{"-S640,480"}.
+## associated with the @qcode{"paperposition"} property.  When using the
+## command form of the print function you must quote the
+## @var{xsize},@var{ysize} option.  For example, by writing @w{"-S640,480"}.
 ##
 ## @item  -F@var{fontname}
 ## @itemx -F@var{fontname}:@var{size}
@@ -708,4 +708,3 @@
   endif
 endfunction
 
-
--- a/scripts/plot/private/__add_datasource__.m
+++ b/scripts/plot/private/__add_datasource__.m
@@ -49,3 +49,4 @@
     endif
   endwhile
 endfunction
+
--- a/scripts/plot/private/__add_default_menu__.m
+++ b/scripts/plot/private/__add_default_menu__.m
@@ -19,7 +19,7 @@
 ## -*- texinfo -*-
 ## @deftypefn {Function File} {} __add_default_menu__ (@var{fig})
 ## Add default menu to figure.  All uimenu handles have
-## their "HandleVisibility" property set to "off".
+## their @qcode{"HandleVisibility"} property set to @qcode{"off"}.
 ## @end deftypefn
 
 ## Author: Kai Habel
--- a/scripts/plot/private/__axis_label__.m
+++ b/scripts/plot/private/__axis_label__.m
@@ -40,3 +40,4 @@
   endif
 
 endfunction
+
--- a/scripts/plot/private/__bar__.m
+++ b/scripts/plot/private/__bar__.m
@@ -150,7 +150,7 @@
 
   if (nargout < 2)
   oldfig = [];
-  if (isempty (hax))
+  if (! isempty (hax))
     oldfig = get (0, "currentfigure");
   endif
     unwind_protect
--- a/scripts/plot/private/__clabel__.m
+++ b/scripts/plot/private/__clabel__.m
@@ -114,3 +114,4 @@
     i1 += clen+1;
   endwhile
 endfunction
+
--- a/scripts/plot/private/__color_str_rgb__.m
+++ b/scripts/plot/private/__color_str_rgb__.m
@@ -48,3 +48,4 @@
     error ("__color_str_rgb__: expecting a string argument");
   endif
 endfunction
+
--- a/scripts/plot/private/__contour__.m
+++ b/scripts/plot/private/__contour__.m
@@ -573,3 +573,4 @@
     endif
   endif
 endfunction
+
--- a/scripts/plot/private/__default_plot_options__.m
+++ b/scripts/plot/private/__default_plot_options__.m
@@ -32,3 +32,4 @@
   options.errorstyle = [];
 
 endfunction
+
--- a/scripts/plot/private/__errcomm__.m
+++ b/scripts/plot/private/__errcomm__.m
@@ -76,3 +76,4 @@
   drawnow ();
 
 endfunction
+
--- a/scripts/plot/private/__errplot__.m
+++ b/scripts/plot/private/__errplot__.m
@@ -228,7 +228,11 @@
     xhi = xdata + dx;
   else
     n = xdata > 0;
-    rx = exp (0.01 * (max (log (xdata(n))) - min (log (xdata(n)))));
+    if (! any (n))
+      n = xdata < 0;
+    endif
+    logdata = log (abs (xdata(n)));
+    rx = exp (0.01 * (max (logdata) - min (logdata)));
     xlo = xdata/rx;
     xhi = xdata*rx;
   endif
@@ -238,7 +242,11 @@
     yhi = ydata + dy;
   else
     n = ydata > 0;
-    ry = exp (0.01 * (max (log (ydata(n))) - min (log (ydata(n)))));
+    if (! any (n))
+      n = ydata < 0;
+    endif
+    logdata = log (abs (ydata(n)));
+    ry = exp (0.01 * (max (logdata) - min (logdata)));
     ylo = ydata/ry;
     yhi = ydata*ry;
   endif
@@ -279,7 +287,7 @@
                               xldata, xudata, "yerr", xscale, yscale);
     xdata = [x1; x2];
     ydata = [y1; y2];
-    return
+    return;
   else
     error ("errorbar: valid error bar types are xerr, yerr, boxxy, and xyerr");
   endif
--- a/scripts/plot/private/__ezplot__.m
+++ b/scripts/plot/private/__ezplot__.m
@@ -420,7 +420,7 @@
             if (! auto_domain_done)
               domain = find_valid_domain (X, Y, Z);
             endif
-          end
+          endif
         endif
       endif
     endif
@@ -428,7 +428,7 @@
 
   ## Now, actually call the correct plot function with valid data and domain.
   oldfig = [];
-  if (isempty (hax))
+  if (! isempty (hax))
     oldfig = get (0, "currentfigure");
   endif
   unwind_protect
--- a/scripts/plot/private/__file_filter__.m
+++ b/scripts/plot/private/__file_filter__.m
@@ -91,3 +91,4 @@
   endif
 
 endfunction
+
--- a/scripts/plot/private/__fltk_file_filter__.m
+++ b/scripts/plot/private/__fltk_file_filter__.m
@@ -62,3 +62,4 @@
   retval = fltk_str;
 
 endfunction
+
--- a/scripts/plot/private/__getlegenddata__.m
+++ b/scripts/plot/private/__getlegenddata__.m
@@ -56,3 +56,4 @@
   endfor
 
 endfunction
+
--- a/scripts/plot/private/__gnuplot_open_stream__.m
+++ b/scripts/plot/private/__gnuplot_open_stream__.m
@@ -43,3 +43,4 @@
     set (h, "__plot_stream__", plot_stream);
   endif
 endfunction
+
--- a/scripts/plot/private/__gnuplot_print__.m
+++ b/scripts/plot/private/__gnuplot_print__.m
@@ -313,3 +313,4 @@
       fontsize = {fontsize};
   endswitch
 endfunction
+
--- a/scripts/plot/private/__go_draw_axes__.m
+++ b/scripts/plot/private/__go_draw_axes__.m
@@ -442,13 +442,13 @@
 
     if (isfield (obj, "xdata"))
       obj.xdata = double (obj.xdata);
-    end
+    endif
     if (isfield (obj, "ydata"))
       obj.ydata = double (obj.ydata);
-    end
+    endif
     if (isfield (obj, "zdata"))
       obj.zdata = double (obj.zdata);
-    end
+    endif
 
     if (isfield (obj, "units"))
       units = obj.units;
@@ -2659,3 +2659,4 @@
     endif
   endif
 endfunction
+
--- a/scripts/plot/private/__interp_cube__.m
+++ b/scripts/plot/private/__interp_cube__.m
@@ -47,7 +47,7 @@
   ##endif
   if (isempty (v))
     Vxyz = idx = frac = [];
-    return
+    return;
   endif
 
   switch (req)
@@ -182,3 +182,4 @@
   frac(:, 3) = (v(:, 3) - z(idx(:, 3))) ...
       ./ (z(idx(:, 3)+1) - z(idx(:, 3)));
 endfunction
+
--- a/scripts/plot/private/__is_function__.m
+++ b/scripts/plot/private/__is_function__.m
@@ -29,3 +29,4 @@
   result = (existval == 2 || existval == 3 || existval == 5 || existval == 6);
 
 endfunction
+
--- a/scripts/plot/private/__line__.m
+++ b/scripts/plot/private/__line__.m
@@ -126,3 +126,4 @@
   endif
 
 endfunction
+
--- a/scripts/plot/private/__marching_cube__.m
+++ b/scripts/plot/private/__marching_cube__.m
@@ -149,7 +149,7 @@
   id =  find (cedge); # select only voxels which are intersected
   if (isempty (id))
     T = p = col = [];
-    return
+    return;
   endif
 
   ## phase II: calculate the list of intersection points
@@ -528,3 +528,4 @@
   0, 3, 8, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1;
   -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 ] + 1;
 endfunction
+
--- a/scripts/plot/private/__next_line_style__.m
+++ b/scripts/plot/private/__next_line_style__.m
@@ -45,7 +45,7 @@
     else
       ## Executed when "hold all" is active
       nChildren = length (get (ca, "Children"));
-      nColors = length (get (ca, "ColorOrder"));
+      nColors = rows (get (ca, "ColorOrder"));
       style_index = mod (floor (nChildren/nColors), nStyles) + 1;
     endif
     options = __pltopt__ ("__next_line_style__",
@@ -55,3 +55,4 @@
   endif
 
 endfunction
+
--- a/scripts/plot/private/__patch__.m
+++ b/scripts/plot/private/__patch__.m
@@ -366,3 +366,4 @@
     recursive = false;
   endif
 endfunction
+
--- a/scripts/plot/private/__pie__.m
+++ b/scripts/plot/private/__pie__.m
@@ -198,3 +198,4 @@
     endfor
   endif
 endfunction
+
--- a/scripts/plot/private/__plt__.m
+++ b/scripts/plot/private/__plt__.m
@@ -147,7 +147,7 @@
   endif
 
   for i = 1 : n
-    key = options.key;
+    key = options(i).key;
     if (! isempty (key))
       hlgnd = [hlgnd(:); h(i)];
       tlgnd = {tlgnd{:}, key};
--- a/scripts/plot/private/__pltopt__.m
+++ b/scripts/plot/private/__pltopt__.m
@@ -231,3 +231,4 @@
   endif
 
 endfunction
+
--- a/scripts/plot/private/__quiver__.m
+++ b/scripts/plot/private/__quiver__.m
@@ -442,3 +442,4 @@
        "markerfacecolor", get (h, "markerfacecolor"),
        "markersize", get (h, "markersize"));
 endfunction
+
--- a/scripts/plot/private/__scatter__.m
+++ b/scripts/plot/private/__scatter__.m
@@ -376,3 +376,4 @@
     endif
   endif
 endfunction
+
--- a/scripts/plot/private/__stem__.m
+++ b/scripts/plot/private/__stem__.m
@@ -38,7 +38,7 @@
       check_stem_arg (have_z, varargin{:});
 
   oldfig = [];
-  if (isempty (hax))
+  if (! isempty (hax))
     oldfig = get (0, "currentfigure");
   endif
   unwind_protect
@@ -565,3 +565,4 @@
   set (kids(2), "xdata", xt, "ydata", yt, "zdata", zt);
   set (kids(1), "xdata", x, "ydata", y, "zdata", z);
 endfunction
+
--- a/scripts/plot/private/__uigetdir_fltk__.m
+++ b/scripts/plot/private/__uigetdir_fltk__.m
@@ -32,3 +32,4 @@
   dirname = __fltk_uigetfile__ ("", dialog_title, start_path, [240, 120], "dir");
 
 endfunction
+
--- a/scripts/plot/private/__uigetfile_fltk__.m
+++ b/scripts/plot/private/__uigetfile_fltk__.m
@@ -36,3 +36,4 @@
   [retval, retpath, retindex] = __fltk_uigetfile__ (filters, title, defval, position, multiselect);
 
 endfunction
+
--- a/scripts/plot/private/__uiobject_split_args__.m
+++ b/scripts/plot/private/__uiobject_split_args__.m
@@ -64,3 +64,4 @@
   endif
 
 endfunction
+
--- a/scripts/plot/private/__uiputfile_fltk__.m
+++ b/scripts/plot/private/__uiputfile_fltk__.m
@@ -36,3 +36,4 @@
   [retval, retpath, retindex] = __fltk_uigetfile__ (filters, title, defval, position, tag);
 
 endfunction
+
--- a/scripts/plot/quiver.m
+++ b/scripts/plot/quiver.m
@@ -40,7 +40,7 @@
 ## The style to use for the plot can be defined with a line style @var{style}
 ## of the same format as the @code{plot} command.
 ## If a marker is specified then markers at the grid points of the vectors are
-## drawn rather than arrows.  If the argument "filled" is given then the
+## drawn rather than arrows.  If the argument @qcode{"filled"} is given then the
 ## markers are filled.
 ##
 ## If the first argument @var{hax} is an axes handle, then plot into this axis,
@@ -69,7 +69,7 @@
     print_usage ();
   else
   oldfig = [];
-  if (isempty (hax))
+  if (! isempty (hax))
     oldfig = get (0, "currentfigure");
   endif
     unwind_protect
--- a/scripts/plot/quiver3.m
+++ b/scripts/plot/quiver3.m
@@ -40,7 +40,7 @@
 ## The style to use for the plot can be defined with a line style @var{style}
 ## of the same format as the @code{plot} command.
 ## If a marker is specified then markers at the grid points of the vectors are
-## drawn rather than arrows.  If the argument "filled" is given then the
+## drawn rather than arrows.  If the argument @qcode{"filled"} is given then the
 ## markers are filled.
 ##
 ## If the first argument @var{hax} is an axes handle, then plot into this axis,
@@ -72,7 +72,7 @@
     print_usage ();
   else
   oldfig = [];
-  if (isempty (hax))
+  if (! isempty (hax))
     oldfig = get (0, "currentfigure");
   endif
     unwind_protect
--- a/scripts/plot/rectangle.m
+++ b/scripts/plot/rectangle.m
@@ -61,7 +61,7 @@
   [hax, varargin] = __plt_get_axis_arg__ ("rectangle", varargin{:});
 
   oldfig = [];
-  if (isempty (hax))
+  if (! isempty (hax))
     oldfig = get (0, "currentfigure");
   endif
   unwind_protect
--- a/scripts/plot/refresh.m
+++ b/scripts/plot/refresh.m
@@ -42,3 +42,4 @@
   drawnow ();
 
 endfunction
+
--- a/scripts/plot/refreshdata.m
+++ b/scripts/plot/refreshdata.m
@@ -29,10 +29,10 @@
 ## The optional second argument @var{workspace} can take the following values:
 ##
 ## @table @asis
-## @item "base"
+## @item @qcode{"base"}
 ## Evaluate the datasource properties in the base workspace.  (default).
 ##
-## @item "caller"
+## @item @qcode{"caller"}
 ## Evaluate the datasource properties in the workspace of the function
 ## that called @code{refreshdata}.
 ## @end table
--- a/scripts/plot/ribbon.m
+++ b/scripts/plot/ribbon.m
@@ -77,7 +77,7 @@
   endif
 
   oldfig = [];
-  if (isempty (hax))
+  if (! isempty (hax))
     oldfig = get (0, "currentfigure");
   endif
   unwind_protect
--- a/scripts/plot/rose.m
+++ b/scripts/plot/rose.m
@@ -91,7 +91,7 @@
 
   if (nargout < 2)
   oldfig = [];
-  if (isempty (hax))
+  if (! isempty (hax))
     oldfig = get (0, "currentfigure");
   endif
     unwind_protect
--- a/scripts/plot/saveas.m
+++ b/scripts/plot/saveas.m
@@ -46,7 +46,7 @@
 ##
 ## All device formats specified in @code{print} may also be used.  If
 ## @var{fmt} is omitted it is extracted from the extension of @var{filename}.
-## The default format is "pdf".
+## The default format is @qcode{"pdf"}.
 ##
 ## @example
 ## @group
@@ -105,3 +105,4 @@
   print (fig, filename, prt_opt);
 
 endfunction
+
--- a/scripts/plot/scatter.m
+++ b/scripts/plot/scatter.m
@@ -43,8 +43,8 @@
 ##
 ## The marker to use can be changed with the @var{style} argument, that is a
 ## string defining a marker in the same manner as the @code{plot} command.
-## If no marker is specified it defaults to 'o' or circles.
-## If the argument "filled" is given then the markers are filled.
+## If no marker is specified it defaults to @qcode{"o"} or circles.
+## If the argument @qcode{"filled"} is given then the markers are filled.
 ##
 ## Additional property/value pairs are passed directly to the underlying
 ## patch object.
@@ -76,7 +76,7 @@
     print_usage ();
   else
   oldfig = [];
-  if (isempty (hax))
+  if (! isempty (hax))
     oldfig = get (0, "currentfigure");
   endif
     unwind_protect
--- a/scripts/plot/scatter3.m
+++ b/scripts/plot/scatter3.m
@@ -43,8 +43,8 @@
 ##
 ## The marker to use can be changed with the @var{style} argument, that is a
 ## string defining a marker in the same manner as the @code{plot} command.
-## If no marker is specified it defaults to 'o' or circles.
-## If the argument "filled" is given then the markers are filled.
+## If no marker is specified it defaults to @qcode{"o"} or circles.
+## If the argument @qcode{"filled"} is given then the markers are filled.
 ##
 ## Additional property/value pairs are passed directly to the underlying
 ## patch object.
@@ -73,7 +73,7 @@
     print_usage ();
   else
   oldfig = [];
-  if (isempty (hax))
+  if (! isempty (hax))
     oldfig = get (0, "currentfigure");
   endif
     unwind_protect
--- a/scripts/plot/semilogx.m
+++ b/scripts/plot/semilogx.m
@@ -46,7 +46,7 @@
   endif
 
   oldfig = [];
-  if (isempty (hax))
+  if (! isempty (hax))
     oldfig = get (0, "currentfigure");
   endif
   unwind_protect
--- a/scripts/plot/semilogxerr.m
+++ b/scripts/plot/semilogxerr.m
@@ -51,7 +51,7 @@
   [hax, varargin] = __plt_get_axis_arg__ ("semilogxerr", varargin{:});
 
   oldfig = [];
-  if (isempty (hax))
+  if (! isempty (hax))
     oldfig = get (0, "currentfigure");
   endif
   unwind_protect
--- a/scripts/plot/semilogy.m
+++ b/scripts/plot/semilogy.m
@@ -46,7 +46,7 @@
   endif
 
   oldfig = [];
-  if (isempty (hax))
+  if (! isempty (hax))
     oldfig = get (0, "currentfigure");
   endif
   unwind_protect
--- a/scripts/plot/semilogyerr.m
+++ b/scripts/plot/semilogyerr.m
@@ -51,7 +51,7 @@
   [hax, varargin] = __plt_get_axis_arg__ ("semilogyerr", varargin{:});
 
   oldfig = [];
-  if (isempty (hax))
+  if (! isempty (hax))
     oldfig = get (0, "currentfigure");
   endif
   unwind_protect
--- a/scripts/plot/shading.m
+++ b/scripts/plot/shading.m
@@ -24,13 +24,13 @@
 ## Valid arguments for @var{type} are
 ##
 ## @table @asis
-## @item "flat"
+## @item @qcode{"flat"}
 ## Single colored patches with invisible edges.
 ##
-## @item "faceted"
+## @item @qcode{"faceted"}
 ## Single colored patches with visible edges.
 ##
-## @item "interp"
+## @item @qcode{"interp"}
 ## Color between patch vertices are interpolated and the patch edges are
 ## invisible.
 ## @end table
--- a/scripts/plot/shg.m
+++ b/scripts/plot/shg.m
@@ -35,3 +35,4 @@
   drawnow ();
 
 endfunction
+
--- a/scripts/plot/shrinkfaces.m
+++ b/scripts/plot/shrinkfaces.m
@@ -25,17 +25,17 @@
 ##
 ## Reduce the faces area for a given patch, structure or explicit faces
 ## and points matrices by a scale factor @var{sf}.  The structure
-## @var{fv} must contain the fields 'faces' and 'vertices'.  If the
-## factor @var{sf} is omitted then a default of 0.3 is used.
+## @var{fv} must contain the fields @qcode{"faces"} and @qcode{"vertices"}. 
+## If the factor @var{sf} is omitted then a default of 0.3 is used.
 ##
 ## Given a patch handle as the first input argument and no output
 ## parameters, perform the shrinking of the patch faces in place and
 ## redraw the patch.
 ##
 ## If called with one output argument, return a structure with fields
-## 'faces', 'vertices', and 'facevertexcdata' containing the data after
-## shrinking which can then directly be used as an input argument for the
-## @command{patch} function.
+## @qcode{"faces"}, @qcode{"vertices"}, and @qcode{"facevertexcdata"}
+## containing the data after shrinking which can then directly be used as an
+## input argument for the @code{patch} function.
 ##
 ## Performing the shrinking on faces which are not convex can lead to
 ## undesired results.
--- a/scripts/plot/slice.m
+++ b/scripts/plot/slice.m
@@ -29,11 +29,11 @@
 ## Each element of the 3-dimensional array @var{v} represents a scalar value at
 ## a location given by the parameters @var{x}, @var{y}, and @var{z}.  The
 ## parameters @var{x}, @var{x}, and @var{z} are either 3-dimensional arrays of
-## the same size as the array @var{v} in the "meshgrid" format or vectors.  The
-## parameters @var{xi}, etc. respect a similar format to @var{x}, etc., and
-## they represent the points at which the array @var{vi} is interpolated using
-## interp3.  The vectors @var{sx}, @var{sy}, and @var{sz} contain points of
-## orthogonal slices of the respective axes.
+## the same size as the array @var{v} in the @qcode{"meshgrid"} format or
+## vectors.  The parameters @var{xi}, etc. respect a similar format to
+## @var{x}, etc., and they represent the points at which the array @var{vi}
+## is interpolated using interp3.  The vectors @var{sx}, @var{sy}, and
+## @var{sz} contain points of orthogonal slices of the respective axes.
 ##
 ## If @var{x}, @var{y}, @var{z} are omitted, they are assumed to be
 ## @code{x = 1:size (@var{v}, 2)}, @code{y = 1:size (@var{v}, 1)} and
@@ -42,21 +42,21 @@
 ## @var{method} is one of:
 ##
 ## @table @asis
-## @item "nearest"
+## @item @qcode{"nearest"}
 ## Return the nearest neighbor.
 ##
-## @item "linear"
+## @item @qcode{"linear"}
 ## Linear interpolation from nearest neighbors.
 ##
-## @item "cubic"
+## @item @qcode{"cubic"}
 ## Cubic interpolation from four nearest neighbors (not implemented yet).
 ##
-## @item "spline"
+## @item @qcode{"spline"}
 ## Cubic spline interpolation---smooth first and second derivatives
 ## throughout the curve.
 ## @end table
 ##
-## The default method is "linear".
+## The default method is @qcode{"linear"}.
 ##
 ## If the first argument @var{hax} is an axes handle, then plot into this axis,
 ## rather than the current axes returned by @code{gca}.
@@ -134,7 +134,7 @@
   endif
 
   oldfig = [];
-  if (isempty (hax))
+  if (! isempty (hax))
     oldfig = get (0, "currentfigure");
   endif
   unwind_protect
--- a/scripts/plot/specular.m
+++ b/scripts/plot/specular.m
@@ -91,3 +91,4 @@
   retval = retval .^ se;
 
 endfunction
+
--- a/scripts/plot/sphere.m
+++ b/scripts/plot/sphere.m
@@ -72,7 +72,7 @@
     zz = z;
   else
   oldfig = [];
-  if (isempty (hax))
+  if (! isempty (hax))
     oldfig = get (0, "currentfigure");
   endif
     unwind_protect
@@ -87,3 +87,4 @@
   endif
 
 endfunction
+
--- a/scripts/plot/stairs.m
+++ b/scripts/plot/stairs.m
@@ -75,7 +75,7 @@
       [h, xs, ys] = __stairs__ (false, varargin{:});
     else
   oldfig = [];
-  if (isempty (hax))
+  if (! isempty (hax))
     oldfig = get (0, "currentfigure");
   endif
       unwind_protect
--- a/scripts/plot/stem.m
+++ b/scripts/plot/stem.m
@@ -34,11 +34,11 @@
 ## the same length as the number of rows in @var{y}, or it can be a
 ## matrix of the same size as @var{y}.
 ##
-## The default color is @code{"b"} (blue), the default line style is
-## @code{"-"}, and the default marker is @code{"o"}.  The line style can
+## The default color is @qcode{"b"} (blue), the default line style is
+## @qcode{"-"}, and the default marker is @qcode{"o"}.  The line style can
 ## be altered by the @code{linespec} argument in the same manner as the
-## @code{plot} command.  If the "filled" argument is present the markers at
-## the top of the stems will be filled in.  For example,
+## @code{plot} command.  If the @qcode{"filled"} argument is present the
+## markers at the top of the stems will be filled in.  For example,
 ##
 ## @example
 ## @group
--- a/scripts/plot/stem3.m
+++ b/scripts/plot/stem3.m
@@ -26,12 +26,12 @@
 ## Plot a 3-D stem graph.
 ##
 ## Stems are drawn from the height @var{z} to the location in the x-y plane
-## determined by @var{x} and @var{y}.  The default color is @code{"b"} (blue),
-## the default line style is @code{"-"}, and the default marker is @code{"o"}.
+## determined by @var{x} and @var{y}.  The default color is @qcode{"b"} (blue),
+## the default line style is @qcode{"-"}, and the default marker is @qcode{"o"}.
 ##
 ## The line style can be altered by the @code{linespec} argument in the same
-## manner as the @code{plot} command.  If the "filled" argument is present
-## the markers at the top of the stems will be filled in.
+## manner as the @code{plot} command.  If the @qcode{"filled"} argument is
+## present the markers at the top of the stems will be filled in.
 ##
 ## Optional property/value pairs may be specified to control the appearance
 ## of the plot.
--- a/scripts/plot/stemleaf.m
+++ b/scripts/plot/stemleaf.m
@@ -195,7 +195,7 @@
   n_far_l   = sum (x<o_fence_l);
   n_far_h   = sum (x>o_fence_h);
 
-  # display table similar to that on pg. 33
+  ## display table similar to that on pg. 33
   plot_out = sprintf ("       Data: %s", caption);
   plot_out = [plot_out; sprintf(" ")];
   plot_out = [plot_out; sprintf("         Fenced Letter Display")];
--- a/scripts/plot/struct2hdl.m
+++ b/scripts/plot/struct2hdl.m
@@ -20,11 +20,12 @@
 ## @deftypefnx {Function File} {@var{h} =} struct2hdl (@var{s}, @var{p}, @var{hilev})
 ## Construct a graphics handle object @var{h} from the structure @var{s}.
 ##
-## The structure must contain the fields "handle", "type", "children",
-## "properties", and "special".  If the handle of an existing figure or axes
-## is specified, @var{p}, the new object will be created as a child of that
-## object.  If no parent handle is provided then a new figure and the necessary
-## children will be constructed using the default values from the root figure.
+## The structure must contain the fields @qcode{"handle"}, @qcode{"type"},
+## @qcode{"children"}, @qcode{"properties"}, and @qcode{"special"}.  If the
+## handle of an existing figure or axes is specified, @var{p}, the new object
+## will be created as a child of that object.  If no parent handle is provided
+## then a new figure and the necessary children will be constructed using the
+## default values from the root figure.
 ##
 ## A third boolean argument @var{hilev} can be passed to specify whether
 ## the function should preserve listeners/callbacks, e.g., for legends or
@@ -636,3 +637,4 @@
 
 
 ## FIXME: Need validation tests
+
--- a/scripts/plot/subplot.m
+++ b/scripts/plot/subplot.m
@@ -64,7 +64,7 @@
 ## demo ("subplot", 1)
 ## @end example
 ##
-## If the option "align" is given then the plot boxes of the subwindows
+## If the option @qcode{"align"} is given then the plot boxes of the subwindows
 ## will align, but this may leave no room for axis tick marks or labels.
 ##
 ## If the output @var{hax} is requested, subplot returns the axis handle for
@@ -114,8 +114,8 @@
     
   if (! initial_args_decoded && nargin > 0)
     arg = varargin{1};
-    if (nargin == 1 && ishandle (arg))
-      ## Axes handle?
+    if (nargin == 1 && isaxes (arg))
+      ## Axes handle
       axes (arg);
       cf = get (0, "currentfigure");
       set (cf, "nextplot", "add");
@@ -277,7 +277,7 @@
     else
       pos = get (0, "defaultaxesouterposition");
     endif
-    return
+    return;
   endif
 
   if (strcmp (position_property, "outerposition")
@@ -369,6 +369,7 @@
   endif
 endfunction
 
+
 %!demo
 %! clf;
 %! r = 3;
--- a/scripts/plot/surf.m
+++ b/scripts/plot/surf.m
@@ -32,7 +32,7 @@
 ## given, then it is plotted over the meshgrid
 ## @code{@var{x} = 1:columns (@var{z}), @var{y} = 1:rows (@var{z})}.
 ## Thus, columns of @var{z} correspond to different @var{x} values and rows
-## of @var{z} correspond to different @var{y} values.  
+## of @var{z} correspond to different @var{y} values.
 ##
 ## The color of the surface is computed by linearly scaling the @var{Z} values
 ## to fit the range of the current colormap.  Use @code{caxis} and/or
@@ -63,7 +63,7 @@
   [hax, varargin] = __plt_get_axis_arg__ ("surf", varargin{:});
 
   oldfig = [];
-  if (isempty (hax))
+  if (! isempty (hax))
     oldfig = get (0, "currentfigure");
   endif
   unwind_protect
--- a/scripts/plot/surfc.m
+++ b/scripts/plot/surfc.m
@@ -32,7 +32,7 @@
 ## given, then it is plotted over the meshgrid
 ## @code{@var{x} = 1:columns (@var{z}), @var{y} = 1:rows (@var{z})}.
 ## Thus, columns of @var{z} correspond to different @var{x} values and rows
-## of @var{z} correspond to different @var{y} values.  
+## of @var{z} correspond to different @var{y} values.
 ##
 ## The color of the surface is computed by linearly scaling the @var{Z} values
 ## to fit the range of the current colormap.  Use @code{caxis} and/or
@@ -65,7 +65,7 @@
   endif
 
   oldfig = [];
-  if (isempty (hax))
+  if (! isempty (hax))
     oldfig = get (0, "currentfigure");
   endif
   unwind_protect
@@ -82,7 +82,7 @@
 
     drawnow ();
 
-    # don't pass string arguments to __contour__()
+    ## don't pass string arguments to __contour__()
     stop_idx = find (cellfun ("isclass", varargin, "char"), 1);
     if (isempty (stop_idx))
       stop_idx = nargin;
--- a/scripts/plot/surfl.m
+++ b/scripts/plot/surfl.m
@@ -34,11 +34,11 @@
 ## given, then it is plotted over the meshgrid
 ## @code{@var{x} = 1:columns (@var{z}), @var{y} = 1:rows (@var{z})}.
 ## Thus, columns of @var{z} correspond to different @var{x} values and rows
-## of @var{z} correspond to different @var{y} values.  
+## of @var{z} correspond to different @var{y} values.
 ##
-## The default lighting mode "cdata", changes the cdata property of the
+## The default lighting mode @qcode{"cdata"}, changes the cdata property of the
 ## surface object to give the impression of a lighted surface.
-## @strong{Warning:} The alternative mode "light" mode which creates a light
+## @strong{Warning:} The alternative mode @qcode{"light"} mode which creates a light
 ## object to illuminate the surface is not implemented (yet).
 ##
 ## The light source location can be specified using @var{L}.  It can be given
@@ -51,13 +51,13 @@
 ## @var{p} = [0.55 0.6 0.4 10].
 ##
 ## @table @asis
-## @item "AM" strength of ambient light
+## @item @qcode{"AM"} strength of ambient light
 ##
-## @item "D" strength of diffuse reflection
+## @item @qcode{"D"} strength of diffuse reflection
 ##
-## @item "SP" strength of specular reflection
+## @item @qcode{"SP"} strength of specular reflection
 ##
-## @item "EXP" specular exponent
+## @item @qcode{"EXP"} specular exponent
 ## @end table
 ##
 ## If the first argument @var{hax} is an axes handle, then plot into this axis,
@@ -137,7 +137,7 @@
   endif
 
   oldfig = [];
-  if (isempty (hax))
+  if (! isempty (hax))
     oldfig = get (0, "currentfigure");
   endif
   unwind_protect
--- a/scripts/plot/surfnorm.m
+++ b/scripts/plot/surfnorm.m
@@ -115,7 +115,7 @@
 
   if (nargout == 0)
   oldfig = [];
-  if (isempty (hax))
+  if (! isempty (hax))
     oldfig = get (0, "currentfigure");
   endif
    unwind_protect
--- a/scripts/plot/tetramesh.m
+++ b/scripts/plot/tetramesh.m
@@ -39,8 +39,8 @@
 ##
 ## The optional return value @var{h} is a vector of patch handles where each
 ## handle represents one tetrahedron in the order given by @var{T}. 
-## A typical use case for @var{h} is to turn the respective patch "visible"
-## property "on" or "off".
+## A typical use case for @var{h} is to turn the respective patch
+## @qcode{"visible"} property @qcode{"on"} or @qcode{"off"}.
 ##
 ## Type @code{demo tetramesh} to see examples on using @code{tetramesh}.
 ## @seealso{trimesh, delaunay3, delaunayn, patch}
--- a/scripts/plot/uicontextmenu.m
+++ b/scripts/plot/uicontextmenu.m
@@ -28,3 +28,4 @@
   handle = __go_uicontextmenu__ (h, args{:});
 
 endfunction
+
--- a/scripts/plot/uicontrol.m
+++ b/scripts/plot/uicontrol.m
@@ -34,3 +34,4 @@
   endif
 
 endfunction
+
--- a/scripts/plot/uigetfile.m
+++ b/scripts/plot/uigetfile.m
@@ -30,12 +30,12 @@
 ## formats:
 ##
 ## @table @asis
-## @item "/path/to/filename.ext"
+## @item @qcode{"/path/to/filename.ext"}
 ## If a filename is given then the file extension is extracted and used as
 ## filter.  In addition, the path is selected as current path and the filename
 ## is selected as default file.  Example: @code{uigetfile ("myfun.m")}
 ##
-## @item A single file extension "*.ext"
+## @item A single file extension @qcode{"*.ext"}
 ## Example: @code{uigetfile ("*.ext")}
 ##
 ## @item A 2-column cell array
@@ -54,10 +54,11 @@
 ## If @var{default_file} is given then it will be selected in the GUI dialog.
 ## If, in addition, a path is given it is also used as current path.
 ##
-## The screen position of the GUI dialog can be set using the "Position" key
-## and a 2-element vector containing the pixel coordinates.
-## Two or more files can be selected when setting the "MultiSelect" key to "on".
-## In that case @var{fname} is a cell array containing the files.
+## The screen position of the GUI dialog can be set using the
+## @qcode{"Position"} key and a 2-element vector containing the pixel
+## coordinates.  Two or more files can be selected when setting the
+## @qcode{"MultiSelect"} key to @qcode{"on"}.  In that case @var{fname} is a
+## cell array containing the files.
 ## @seealso{uiputfile, uigetdir}
 ## @end deftypefn
 
--- a/scripts/plot/uimenu.m
+++ b/scripts/plot/uimenu.m
@@ -19,44 +19,45 @@
 ## -*- texinfo -*-
 ## @deftypefn  {Function File} {} uimenu (@var{property}, @var{value}, @dots{})
 ## @deftypefnx {Function File} {} uimenu (@var{h}, @var{property}, @var{value}, @dots{})
-## Create a uimenu object and return a handle to it.  If @var{h} is ommited
+## Create a uimenu object and return a handle to it.  If @var{h} is omitted
 ## then a top-level menu for the current figure is created.  If @var{h}
 ## is given then a submenu relative to @var{h} is created.
 ##
 ## uimenu objects have the following specific properties:
 ##
 ## @table @asis
-## @item "accelerator"
+## @item @qcode{"accelerator"}
 ## A string containing the key combination together with CTRL to execute this
-## menu entry (e.g., "x" for CTRL+x).
+## menu entry (e.g., @qcode{"x"} for CTRL+x).
 ##
-## @item "callback"
+## @item @qcode{"callback"}
 ## Is the function called when this menu entry is executed.  It can be either a
-## function string (e.g., "myfun"), a function handle (e.g., @@myfun) or a cell
-## array containing the function handle and arguments for the callback
-## function (e.g., @{@@myfun, arg1, arg2@}).
+## function string (e.g., @qcode{"myfun"}), a function handle (e.g., @@myfun)
+## or a cell array containing the function handle and arguments for the
+## callback function (e.g., @{@@myfun, arg1, arg2@}).
 ##
-## @item "checked"
-## Can be set "on" or "off".  Sets a mark at this menu entry.
+## @item @qcode{"checked"}
+## Can be set @qcode{"on"} or @qcode{"off"}.  Sets a mark at this menu entry.
 ##
-## @item "enable"
-## Can be set "on" or "off".  If disabled the menu entry cannot be selected
-## and it is grayed out.
+## @item @qcode{"enable"}
+## Can be set @qcode{"on"} or @qcode{"off"}.  If disabled the menu entry
+## cannot be selected and it is grayed out.
 ##
-## @item "foregroundcolor"
+## @item @qcode{"foregroundcolor"}
 ## A color value setting the text color for this menu entry.
 ##
-## @item "label"
-## A string containing the label for this menu entry.  A "&"-symbol can be
-## used to mark the "accelerator" character (e.g., @nospell{"E&xit"})
+## @item @qcode{"label"}
+## A string containing the label for this menu entry.  A @qcode{"&"}-symbol
+## can be used to mark the @qcode{"accelerator"} character (e.g.,
+## @nospell{@qcode{"E&xit"}})
 ##
-## @item "position"
+## @item @qcode{"position"}
 ## An scalar value containing the relative menu position.  The entry with the
 ## lowest value is at the first position starting from left or top.
 ##
-## @item "separator"
-## Can be set "on" or "off".  If enabled it draws a separator line above the
-## current position.  It is ignored for top level entries.
+## @item @qcode{"separator"}
+## Can be set @qcode{"on"} or @qcode{"off"}.  If enabled it draws a separator
+## line above the current position.  It is ignored for top level entries.
 ##
 ## @end table
 ##
--- a/scripts/plot/uipanel.m
+++ b/scripts/plot/uipanel.m
@@ -29,3 +29,4 @@
   handle = __go_uipanel__ (h, args{:});
 
 endfunction
+
--- a/scripts/plot/uipushtool.m
+++ b/scripts/plot/uipushtool.m
@@ -37,3 +37,4 @@
   handle = __go_uipushtool__ (h, args{:});
 
 endfunction
+
--- a/scripts/plot/uiputfile.m
+++ b/scripts/plot/uiputfile.m
@@ -24,27 +24,27 @@
 ## Open a GUI dialog for selecting a file.  @var{flt} contains a (list of) file
 ## filter string(s) in one of the following formats:
 ##
-## @table @code
-## @item "/path/to/filename.ext"
-## If a filename is given the file extension is
-## extracted and used as filter.
-## In addition the path is selected as current path and the filename is selected
-## as default file.
-## Example: uiputfile ("myfun.m");
+## @table @asis
+## @item @qcode{"/path/to/filename.ext"}
+## If a filename is given the file extension is extracted and used as filter.
+## In addition the path is selected as current path and the filename is
+## selected as default file.  Example: @code{uiputfile ("myfun.m")}
 ##
-## @item "*.ext"
+## @item @qcode{"*.ext"}
 ## A single file extension.
-## Example: uiputfile ("*.ext");
+## Example: @code{uiputfile ("*.ext")}
 ##
-## @item @{"*.ext","My Description"@}
+## @item @code{@{"*.ext", "My Description"@}}
 ## A 2-column cell array containing the file extension in the 1st column and
 ## a brief description in the 2nd column.
-## Example: uiputfile (@{"*.ext","My Description";"*.xyz","XYZ-Format"@});
+## Example: @code{uiputfile (@{"*.ext","My Description";"*.xyz",
+## "XYZ-Format"@})}
 ## @end table
 ##
 ## The filter string can also contain a semicolon separated list of filter
 ## extensions.
-## Example: uiputfile (@{"*.gif;*.png;*.jpg", "Supported Picture Formats"@});
+## Example: @code{uiputfile (@{"*.gif;*.png;*.jpg",
+## "Supported Picture Formats"@})}
 ##
 ## @var{dialog_name} can be used to customize the dialog title.
 ## If @var{default_file} is given it is preselected in the GUI dialog.
--- a/scripts/plot/uiresume.m
+++ b/scripts/plot/uiresume.m
@@ -39,7 +39,8 @@
       set (h, "__uiwait_state__", "triggered");
     endif
   catch
-    # Ignore exception
+    ## Ignore exception
   end_try_catch
 
 endfunction
+
--- a/scripts/plot/uitoggletool.m
+++ b/scripts/plot/uitoggletool.m
@@ -37,3 +37,4 @@
   handle = __go_uitoggletool__ (h, args{:});
 
 endfunction
+
--- a/scripts/plot/uitoolbar.m
+++ b/scripts/plot/uitoolbar.m
@@ -29,3 +29,4 @@
   handle = __go_uitoolbar__ (h, args{:});
 
 endfunction
+
--- a/scripts/plot/uiwait.m
+++ b/scripts/plot/uiwait.m
@@ -78,3 +78,4 @@
   endif
 
 endfunction
+
--- a/scripts/plot/waitforbuttonpress.m
+++ b/scripts/plot/waitforbuttonpress.m
@@ -47,3 +47,4 @@
   endif
 
 endfunction
+
--- a/scripts/plot/waterfall.m
+++ b/scripts/plot/waterfall.m
@@ -35,7 +35,7 @@
 ## given, then it is plotted over the meshgrid
 ## @code{@var{x} = 1:columns (@var{z}), @var{y} = 1:rows (@var{z})}.
 ## Thus, columns of @var{z} correspond to different @var{x} values and rows
-## of @var{z} correspond to different @var{y} values.  
+## of @var{z} correspond to different @var{y} values.
 ##
 ## The color of the mesh is computed by linearly scaling the @var{Z} values
 ## to fit the range of the current colormap.  Use @code{caxis} and/or
--- a/scripts/plot/whitebg.m
+++ b/scripts/plot/whitebg.m
@@ -29,7 +29,7 @@
 ## If the optional argument @var{color} is present then the background color
 ## is set to @var{color} rather than inverted.  @var{color} may be a string
 ## representing one of the eight known colors or an RGB triplet.  The special
-## string argument "none" restores the plot to the default colors.
+## string argument @qcode{"none"} restores the plot to the default colors.
 ##
 ## If the first argument @var{hfig} is a figure handle, then operate on
 ## this figure rather than the current figure returned by @code{gcf}.  The
--- a/scripts/plot/xlim.m
+++ b/scripts/plot/xlim.m
@@ -26,14 +26,15 @@
 ## Query or set the limits of the x-axis of the current plot.
 ##
 ## Called without arguments @code{xlim} returns the x-axis limits of the
-## current plot.  With the input query "mode", return the current x-limit
-## calculation mode which is either "auto" or "manual".
+## current plot.  With the input query @qcode{"mode"}, return the current
+## x-limit calculation mode which is either @qcode{"auto"} or
+## @qcode{"manual"}.
 ##
 ## If passed a 2-element vector [@var{x_lo} @var{x_hi}], the limits of the
 ## x-axis are set to these values.
 ##
-## The current plotting mode can be set by passing either "auto" or "manual" as
-## the argument.
+## The current plotting mode can be set by passing either @qcode{"auto"} or
+## @qcode{"manual"} as the argument.
 ##
 ## If the first argument @var{hax} is an axes handle, then operate on
 ## this axis rather than the current axes returned by @code{gca}.
--- a/scripts/plot/ylim.m
+++ b/scripts/plot/ylim.m
@@ -26,14 +26,15 @@
 ## Query or set the limits of the y-axis of the current plot.
 ##
 ## Called without arguments @code{ylim} returns the y-axis limits of the
-## current plot.  With the input query "mode", return the current y-limit
-## calculation mode which is either "auto" or "manual".
+## current plot.  With the input query @qcode{"mode"}, return the current
+## y-limit calculation mode which is either @qcode{"auto"} or
+## @qcode{"manual"}.
 ##
 ## If passed a 2-element vector [@var{y_lo} @var{y_hi}], the limits of the
 ## y-axis are set to these values.
 ##
-## The current plotting mode can be set by passing either "auto" or "manual" as
-## the argument.
+## The current plotting mode can be set by passing either @qcode{"auto"} or
+## @qcode{"manual"} as the argument.
 ##
 ## If the first argument @var{hax} is an axes handle, then operate on
 ## this axis rather than the current axes returned by @code{gca}.
--- a/scripts/plot/zlabel.m
+++ b/scripts/plot/zlabel.m
@@ -77,8 +77,6 @@
 %!   z = zlabel ("zlabel_string");
 %!   assert (get (gca, "zlabel"), z);
 %!   assert (get (z, "type"), "text");
-%!   ## FIXME: visible test is failing.  Not sure why.
-%!   #assert (get (z, "visible"), "off");
 %!   assert (get (z, "string"), "zlabel_string");
 %! unwind_protect_cleanup
 %!   close (hf);
--- a/scripts/plot/zlim.m
+++ b/scripts/plot/zlim.m
@@ -26,14 +26,15 @@
 ## Query or set the limits of the z-axis of the current plot.
 ##
 ## Called without arguments @code{zlim} returns the z-axis limits of the
-## current plot.  With the input query "mode", return the current z-limit
-## calculation mode which is either "auto" or "manual".
+## current plot.  With the input query @qcode{"mode"}, return the current
+## z-limit calculation mode which is either @qcode{"auto"} or
+## @qcode{"manual"}.
 ##
 ## If passed a 2-element vector [@var{z_lo} @var{z_hi}], the limits of the
 ## z-axis are set to these values.
 ##
-## The current plotting mode can be set by passing either "auto" or "manual" as
-## the argument.
+## The current plotting mode can be set by passing either @qcode{"auto"} or
+## @qcode{"manual"} as the argument.
 ##
 ## If the first argument @var{hax} is an axes handle, then operate on
 ## this axis rather than the current axes returned by @code{gca}.
--- a/scripts/polynomial/conv.m
+++ b/scripts/polynomial/conv.m
@@ -29,10 +29,10 @@
 ## The optional @var{shape} argument may be
 ##
 ## @table @asis
-## @item @var{shape} = "full"
+## @item @var{shape} = @qcode{"full"}
 ## Return the full convolution.  (default)
 ##
-## @item @var{shape} = "same"
+## @item @var{shape} = @qcode{"same"}
 ## Return the central part of the convolution with the same size as @var{a}.
 ## @end table
 ##
--- a/scripts/polynomial/mkpp.m
+++ b/scripts/polynomial/mkpp.m
@@ -45,12 +45,12 @@
 
 function pp = mkpp (x, P, d)
 
-  # check number of arguments
+  ## check number of arguments
   if (nargin < 2 || nargin > 3)
     print_usage ();
   endif
 
-  # check x
+  ## check x
   if (length (x) < 2)
     error ("mkpp: at least one interval is needed");
   endif
--- a/scripts/polynomial/pchip.m
+++ b/scripts/polynomial/pchip.m
@@ -125,6 +125,7 @@
 
 endfunction
 
+
 %!demo
 %! x = 0:8;
 %! y = [1, 1, 1, 1, 0.5, 0, 0, 0, 0];
@@ -170,3 +171,4 @@
 
 %!error (pchip (1,2));
 %!error (pchip (1,2,3));
+
--- a/scripts/polynomial/polyeig.m
+++ b/scripts/polynomial/polyeig.m
@@ -83,9 +83,11 @@
 
 endfunction
 
+
 %!test
 %! C0 = [8, 0; 0, 4]; C1 = [1, 0; 0, 1];
 %! [v,z] = polyeig (C0, C1);
 %! assert (isequal (z(1), -8), true);
 %! d = C0*v + C1*v*z;
 %! assert (isequal (norm(d), 0.0), true);
+
--- a/scripts/polynomial/polyfit.m
+++ b/scripts/polynomial/polyfit.m
@@ -115,7 +115,7 @@
   p = r \ (q' * y);
   p(k) = p;
   
-  if (n ~= m)
+  if (n != m)
     q = p; p = zeros (n+1, 1); 
     p(polymask) = q;
   endif
@@ -137,12 +137,12 @@
     try
       C = cholinv (r.'*r)(k, k);
     catch
-      C = NaN * ones (m+1, m+1);
+      C = NaN (m+1, m+1);
     end_try_catch
 
-    if (n ~= m)
+    if (n != m)
       ## fill matrices if required
-      s.X(:, ~polymask) = 0;
+      s.X(:, !polymask) = 0;
       s.R = zeros (n+1, n+1); s.R(polymask, polymask) = r;
       s.C = zeros (n+1, n+1); s.C(polymask, polymask) = C;
     else
--- a/scripts/polynomial/polyout.m
+++ b/scripts/polynomial/polyout.m
@@ -32,7 +32,7 @@
 ##
 ## @end ifnottex
 ## and return it as a string or write it to the screen (if @var{nargout} is
-## zero).  @var{x} defaults to the string @code{"s"}.
+## zero).  @var{x} defaults to the string @qcode{"s"}.
 ## @seealso{polyreduce}
 ## @end deftypefn
 
--- a/scripts/polynomial/ppval.m
+++ b/scripts/polynomial/ppval.m
@@ -95,7 +95,7 @@
     yi = shiftdim (yi, nd);
   endif
 
-  ##
+  ## FIXME: Why is this commented out, rather than just removed?
   #if (d == 1)
   #  yi = reshape (yi, sxi);
   #endif
@@ -127,3 +127,4 @@
 %! ret(:,:,1) = ppval (pp, breaks');
 %! ret(:,:,2) = ppval (pp, breaks');
 %! assert (ppval (pp, [breaks',breaks']), ret)
+
--- a/scripts/polynomial/residue.m
+++ b/scripts/polynomial/residue.m
@@ -160,7 +160,7 @@
     ## The inputs are the residue, pole, and direct part. Solve for the
     ## corresponding numerator and denominator polynomials
     [r, p] = rresidue (b, a, varargin{1}, toler, e);
-    return
+    return;
   endif
 
   ## Make sure both polynomials are in reduced form.
--- a/scripts/polynomial/splinefit.m
+++ b/scripts/polynomial/splinefit.m
@@ -59,18 +59,18 @@
 ## the degrees of freedom are reduced to P.
 ##
 ## The optional property, @var{constaints}, is a structure specifying
-## linear constraints on the fit.  The structure has three fields, "xc",
-## "yc", and "cc".
+## linear constraints on the fit.  The structure has three fields, @qcode{"xc"},
+## @qcode{"yc"}, and @qcode{"cc"}.
 ##
 ## @table @asis
-## @item "xc"
+## @item @qcode{"xc"}
 ## Vector of the x-locations of the constraints.
 ##
-## @item "yc"
+## @item @qcode{"yc"}
 ## Constraining values at the locations @var{xc}.
 ## The default is an array of zeros.
 ##
-## @item "cc"
+## @item @qcode{"cc"}
 ## Coefficients (matrix).  The default is an array of ones.  The number of
 ## rows is limited to the order of the piecewise polynomials, @var{order}.
 ## @end table
--- a/scripts/prefs/addpref.m
+++ b/scripts/prefs/addpref.m
@@ -69,6 +69,8 @@
 
 endfunction
 
+
 %% Testing these functions will require some care to avoid wiping out
 %% existing (or creating unwanted) preferences for the user running the
 %% tests.
+
--- a/scripts/prefs/getpref.m
+++ b/scripts/prefs/getpref.m
@@ -90,6 +90,8 @@
 
 endfunction
 
+
 %% Testing these functions will require some care to avoid wiping out
 %% existing (or creating unwanted) preferences for the user running the
 %% tests.
+
--- a/scripts/prefs/ispref.m
+++ b/scripts/prefs/ispref.m
@@ -55,6 +55,8 @@
 
 endfunction
 
+
 %% Testing these functions will require some care to avoid wiping out
 %% existing (or creating unwanted) preferences for the user running the
 %% tests.
+
--- a/scripts/prefs/private/loadprefs.m
+++ b/scripts/prefs/private/loadprefs.m
@@ -38,6 +38,8 @@
 
 endfunction
 
+
 %% Testing these functions will require some care to avoid wiping out
 %% existing (or creating unwanted) preferences for the user running the
 %% tests.
+
--- a/scripts/prefs/private/prefsfile.m
+++ b/scripts/prefs/private/prefsfile.m
@@ -29,6 +29,8 @@
   
 endfunction
 
+
 %% Testing these functions will require some care to avoid wiping out
 %% existing (or creating unwanted) preferences for the user running the
 %% tests.
+
--- a/scripts/prefs/private/saveprefs.m
+++ b/scripts/prefs/private/saveprefs.m
@@ -31,6 +31,8 @@
 
 endfunction
 
+
 %% Testing these functions will require some care to avoid wiping out
 %% existing (or creating unwanted) preferences for the user running the
 %% tests.
+
--- a/scripts/prefs/setpref.m
+++ b/scripts/prefs/setpref.m
@@ -62,6 +62,8 @@
 
 endfunction
 
+
 %% Testing these functions will require some care to avoid wiping out
 %% existing (or creating unwanted) preferences for the user running the
 %% tests.
+
--- a/scripts/set/intersect.m
+++ b/scripts/set/intersect.m
@@ -60,7 +60,7 @@
       len_a = rows (a);
     else
       c = [a(:); b(:)];
-      [c, ic] = sort (c);               ## [a(:);b(:)](ic) == c
+      [c, ic] = sort (c);               # [a(:);b(:)](ic) == c
       if (iscellstr (c))
         ii = find (strcmp (c(1:end-1), c(2:end)));
       else
@@ -71,8 +71,8 @@
     endif
 
     if (nargout > 1)
-      ia = ja(ic(ii));                  ## a(ia) == c
-      ib = jb(ic(ii+1) - len_a);        ## b(ib) == c
+      ia = ja(ic(ii));                  # a(ia) == c
+      ib = jb(ic(ii+1) - len_a);        # b(ib) == c
     endif
 
     if (nargin == 2 && (rows (b) == 1 || rows (a) == 1))
--- a/scripts/set/ismember.m
+++ b/scripts/set/ismember.m
@@ -48,7 +48,7 @@
 ## @end group
 ## @end example
 ##
-## With the optional third argument @code{"rows"}, and matrices
+## With the optional third argument @qcode{"rows"}, and matrices
 ## @var{A} and @var{s} with the same number of columns, compare rows in
 ## @var{A} with the rows in @var{s}.
 ##
--- a/scripts/set/powerset.m
+++ b/scripts/set/powerset.m
@@ -24,7 +24,7 @@
 ## The set @var{a} must be a numerical matrix or a cell array of strings.  The
 ## output will always be a cell array of either vectors or strings.
 ##
-## With the optional second argument @code{"rows"}, each row of the set @var{a}
+## With the optional second argument @qcode{"rows"}, each row of the set @var{a}
 ## is considered one element of the set.  As a result, @var{a} must then be a
 ## numerical 2-D matrix.
 ##
--- a/scripts/set/private/validargs.m
+++ b/scripts/set/private/validargs.m
@@ -55,3 +55,4 @@
   endif
 
 endfunction
+
--- a/scripts/set/setdiff.m
+++ b/scripts/set/setdiff.m
@@ -26,7 +26,7 @@
 ## return a column vector, otherwise return a row vector.
 ## @var{a}, @var{b} may be cell arrays of string(s).
 ##
-## Given the optional third argument @samp{"rows"}, return the rows in
+## Given the optional third argument @qcode{"rows"}, return the rows in
 ## @var{a} that are not in @var{b}, sorted in ascending order by rows.
 ##
 ## If requested, return @var{i} such that @code{c = a(i)}.
--- a/scripts/set/union.m
+++ b/scripts/set/union.m
@@ -33,9 +33,9 @@
 ## @end group
 ## @end example
 ##
-## If the optional third input argument is the string "rows" then each row of
-## the matrices @var{a} and @var{b} will be considered as a single set element.
-## For example:
+## If the optional third input argument is the string @qcode{"rows"} then
+## each row of the matrices @var{a} and @var{b} will be considered as a
+## single set element.  For example:
 ##
 ## @example
 ## @group
--- a/scripts/set/unique.m
+++ b/scripts/set/unique.m
@@ -29,16 +29,16 @@
 ## output is always a column vector.  @var{x} may also be a cell array of
 ## strings.
 ##
-## If the optional argument @code{"rows"} is supplied, return the unique
+## If the optional argument @qcode{"rows"} is supplied, return the unique
 ## rows of @var{x}, sorted in ascending order.
 ##
 ## If requested, return index vectors @var{i} and @var{j} such that
 ## @code{x(i)==y} and @code{y(j)==x}.
 ##
-## Additionally, if @var{i} is a requested output then one of @code{"first"} or
-## @code{"last"} may be given as an input.  If @code{"last"} is specified,
-## return the highest possible indices in @var{i}, otherwise, if @code{"first"}
-## is specified, return the lowest.  The default is @code{"last"}.
+## Additionally, if @var{i} is a requested output then one of @qcode{"first"} or
+## @qcode{"last"} may be given as an input.  If @qcode{"last"} is specified,
+## return the highest possible indices in @var{i}, otherwise, if @qcode{"first"}
+## is specified, return the lowest.  The default is @qcode{"last"}.
 ## @seealso{union, intersect, setdiff, setxor, ismember}
 ## @end deftypefn
 
@@ -221,3 +221,4 @@
 %!error unique({"a", "b", "c"}, "UnknownOption1", "UnknownOption2")
 %!error unique({"a", "b", "c"}, "rows", "UnknownOption2")
 %!error unique({"a", "b", "c"}, "UnknownOption1", "last")
+
--- a/scripts/signal/arch_fit.m
+++ b/scripts/signal/arch_fit.m
@@ -116,3 +116,4 @@
   endfor
 
 endfunction
+
--- a/scripts/signal/arch_rnd.m
+++ b/scripts/signal/arch_rnd.m
@@ -100,3 +100,4 @@
   y = y(1:t);
 
 endfunction
+
--- a/scripts/signal/arch_test.m
+++ b/scripts/signal/arch_test.m
@@ -94,3 +94,4 @@
   pval = 1 - chi2cdf (lm, p);
 
 endfunction
+
--- a/scripts/signal/arma_rnd.m
+++ b/scripts/signal/arma_rnd.m
@@ -79,3 +79,4 @@
   x = x(n + 1 : t + n);
 
 endfunction
+
--- a/scripts/signal/detrend.m
+++ b/scripts/signal/detrend.m
@@ -28,8 +28,9 @@
 ## is assumed.  This corresponds to removing a linear trend.
 ##
 ## The order of the polynomial can also be given as a string, in which case
-## @var{p} must be either @t{"constant"} (corresponds to @code{@var{p}=0}) or
-## @t{"linear"} (corresponds to @code{@var{p}=1}).
+## @var{p} must be either @qcode{"constant"} (corresponds to
+## @code{@var{p}=0}) or
+## @qcode{"linear"} (corresponds to @code{@var{p}=1}).
 ## @seealso{polyfit}
 ## @end deftypefn
 
--- a/scripts/signal/durbinlevinson.m
+++ b/scripts/signal/durbinlevinson.m
@@ -91,3 +91,4 @@
   endif
 
 endfunction
+
--- a/scripts/signal/fftconv.m
+++ b/scripts/signal/fftconv.m
@@ -67,36 +67,36 @@
 
 %% FIXME: Borrow tests from conv.m.  May need a tolerance on the assert comparison
 %!test
-%!  x = ones (3,1);
-%!  y = ones (1,3);
-%!  b = 2;
-%!  c = 3;
-%!  assert (fftconv (x, x), [1; 2; 3; 2; 1], 5*eps);
-%!  assert (fftconv (y, y), [1, 2, 3, 2, 1], 5*eps);
-%!  assert (fftconv (x, y), [1, 2, 3, 2, 1], 5*eps);
-%!  assert (fftconv (y, x), [1; 2; 3; 2; 1], 5*eps);
-%!  assert (fftconv (c, x), [3; 3; 3], 5*eps);
-%!  assert (fftconv (c, y), [3, 3, 3], 5*eps);
-%!  assert (fftconv (x, c), [3; 3; 3], 5*eps);
-%!  assert (fftconv (y, c), [3, 3, 3], 5*eps);
-%!  assert (fftconv (b, c), 6, 5*eps);
+%! x = ones (3,1);
+%! y = ones (1,3);
+%! b = 2;
+%! c = 3;
+%! assert (fftconv (x, x), [1; 2; 3; 2; 1], 5*eps);
+%! assert (fftconv (y, y), [1, 2, 3, 2, 1], 5*eps);
+%! assert (fftconv (x, y), [1, 2, 3, 2, 1], 5*eps);
+%! assert (fftconv (y, x), [1; 2; 3; 2; 1], 5*eps);
+%! assert (fftconv (c, x), [3; 3; 3], 5*eps);
+%! assert (fftconv (c, y), [3, 3, 3], 5*eps);
+%! assert (fftconv (x, c), [3; 3; 3], 5*eps);
+%! assert (fftconv (y, c), [3, 3, 3], 5*eps);
+%! assert (fftconv (b, c), 6, 5*eps);
 
 %!test
-%!  a = 1:10;
-%!  b = 1:3;
-%!  assert (size (conv (a,b)), [1, numel(a)+numel(b)-1])
-%!  assert (size (conv (b,a)), [1, numel(a)+numel(b)-1])
+%! a = 1:10;
+%! b = 1:3;
+%! assert (size (conv (a,b)), [1, numel(a)+numel(b)-1]);
+%! assert (size (conv (b,a)), [1, numel(a)+numel(b)-1]);
 
-%!  a = (1:10).';
-%!  b = 1:3;
-%!  assert (size (conv (a,b)), [numel(a)+numel(b)-1, 1])
-%!  assert (size (conv (b,a)), [numel(a)+numel(b)-1, 1])
+%! a = (1:10).';
+%! b = 1:3;
+%! assert (size (conv (a,b)), [numel(a)+numel(b)-1, 1]);
+%! assert (size (conv (b,a)), [numel(a)+numel(b)-1, 1]);
 
 %!test
-%!  a = 1:10;
-%!  b = (1:3).';
-%!  assert (size (conv (a,b)), [1, numel(a)+numel(b)-1])
-%!  assert (size (conv (b,a)), [1, numel(a)+numel(b)-1])
+%! a = 1:10;
+%! b = (1:3).';
+%! assert (size (conv (a,b)), [1, numel(a)+numel(b)-1]);
+%! assert (size (conv (b,a)), [1, numel(a)+numel(b)-1]);
 
 %% Test input validation
 %!error fftconv (1)
--- a/scripts/signal/fftshift.m
+++ b/scripts/signal/fftshift.m
@@ -85,47 +85,47 @@
 
 
 %!test
-%!  x = [0:7];
-%!  y = fftshift (x);
-%!  assert (y, [4 5 6 7 0 1 2 3]);
-%!  assert (fftshift (y), x);
+%! x = [0:7];
+%! y = fftshift (x);
+%! assert (y, [4 5 6 7 0 1 2 3]);
+%! assert (fftshift (y), x);
 
 %!test
-%!  x = [0:6];
-%!  y = fftshift (x);
-%!  assert (y, [4 5 6 0 1 2 3]);
-%!  assert (fftshift (y), [1 2 3 4 5 6 0]);
+%! x = [0:6];
+%! y = fftshift (x);
+%! assert (y, [4 5 6 0 1 2 3]);
+%! assert (fftshift (y), [1 2 3 4 5 6 0]);
 
 %!test
-%!  x = [0:7]';
-%!  y = fftshift (x);
-%!  assert (y, [4;5;6;7;0;1;2;3]);
-%!  assert (fftshift (y), x);
+%! x = [0:7]';
+%! y = fftshift (x);
+%! assert (y, [4;5;6;7;0;1;2;3]);
+%! assert (fftshift (y), x);
 
 %!test
-%!  x = [0:6]';
-%!  y = fftshift (x);
-%!  assert (y, [4;5;6;0;1;2;3]);
-%!  assert (fftshift (y), [1;2;3;4;5;6;0]);
+%! x = [0:6]';
+%! y = fftshift (x);
+%! assert (y, [4;5;6;0;1;2;3]);
+%! assert (fftshift (y), [1;2;3;4;5;6;0]);
 
 %!test
-%!  x = [0:3];
-%!  x = [x;2*x;3*x+1;4*x+1];
-%!  y = fftshift (x);
-%!  assert (y, [[7 10 1 4];[9 13 1 5];[2 3 0 1];[4 6 0 2]]);
-%!  assert (fftshift (y), x);
+%! x = [0:3];
+%! x = [x;2*x;3*x+1;4*x+1];
+%! y = fftshift (x);
+%! assert (y, [[7 10 1 4];[9 13 1 5];[2 3 0 1];[4 6 0 2]]);
+%! assert (fftshift (y), x);
 
 %!test
-%!  x = [0:3];
-%!  x = [x;2*x;3*x+1;4*x+1];
-%!  y = fftshift (x,1);
-%!  assert (y, [[1 4 7 10];[1 5 9 13];[0 1 2 3];[0 2 4 6]]);
-%!  assert (fftshift (y,1), x);
+%! x = [0:3];
+%! x = [x;2*x;3*x+1;4*x+1];
+%! y = fftshift (x,1);
+%! assert (y, [[1 4 7 10];[1 5 9 13];[0 1 2 3];[0 2 4 6]]);
+%! assert (fftshift (y,1), x);
 
 %!test
-%!  x = [0:3];
-%!  x = [x;2*x;3*x+1;4*x+1];
-%!  y = fftshift (x,2);
-%!  assert (y, [[2 3 0 1];[4 6 0 2];[7 10 1 4];[9 13 1 5]]);
-%!  assert (fftshift (y,2), x);
+%! x = [0:3];
+%! x = [x;2*x;3*x+1;4*x+1];
+%! y = fftshift (x,2);
+%! assert (y, [[2 3 0 1];[4 6 0 2];[7 10 1 4];[9 13 1 5]]);
+%! assert (fftshift (y,2), x);
 
--- a/scripts/signal/filter2.m
+++ b/scripts/signal/filter2.m
@@ -24,13 +24,13 @@
 ## Possible values are:
 ##
 ## @table @asis
-## @item "full"
+## @item @qcode{"full"}
 ## pad @var{x} with zeros on all sides before filtering.
 ##
-## @item "same"
+## @item @qcode{"same"}
 ## unpadded @var{x} (default)
 ##
-## @item "valid"
+## @item @qcode{"valid"}
 ## trim @var{x} after filtering so edge effects are no included.
 ## @end table
 ##
--- a/scripts/signal/fractdiff.m
+++ b/scripts/signal/fractdiff.m
@@ -67,3 +67,4 @@
   endif
 
 endfunction
+
--- a/scripts/signal/freqz.m
+++ b/scripts/signal/freqz.m
@@ -44,8 +44,8 @@
 ## For fastest computation, @var{n} should factor into a small number of
 ## small primes.
 ##
-## If the fourth argument, "whole", is omitted the response is evaluated at
-## frequencies between 0 and
+## If the fourth argument, @qcode{"whole"}, is omitted the response is
+## evaluated at frequencies between 0 and
 ## @ifnottex
 ##  pi.
 ## @end ifnottex
@@ -178,7 +178,7 @@
 
 
 %!test # correct values and fft-polyval consistency
-%! # butterworth filter, order 2, cutoff pi/2 radians
+%! ## butterworth filter, order 2, cutoff pi/2 radians
 %! b = [0.292893218813452  0.585786437626905  0.292893218813452];
 %! a = [1  0  0.171572875253810];
 %! [h,w] = freqz (b,a,32);
@@ -203,3 +203,4 @@
 %! assert (h,h2.',20*eps);
 %! [h3,f3] = freqz (b,a,32,"whole",320);
 %! assert (f3,[0:31]'*10,10*eps);
+
--- a/scripts/signal/freqz_plot.m
+++ b/scripts/signal/freqz_plot.m
@@ -64,3 +64,4 @@
   axis ([w(1), w(n)], "autoy", "label");
 
 endfunction
+
--- a/scripts/signal/hurst.m
+++ b/scripts/signal/hurst.m
@@ -46,3 +46,4 @@
   H = log (RS) / log (xr);
 
 endfunction
+
--- a/scripts/signal/periodogram.m
+++ b/scripts/signal/periodogram.m
@@ -34,7 +34,7 @@
 ##
 ## @itemize
 ## @item x: data; if real-valued a one-sided spectrum is estimated,
-## if complex-valued or range indicates "@nospell{twosided}", the full
+## if complex-valued or range indicates @qcode{"@nospell{twosided}"}, the full
 ## spectrum is estimated.
 ##
 ## @item win: weight data with window, x.*win is used for further computation,
@@ -44,9 +44,10 @@
 ##
 ## @item Fs: sampling rate, default 1.
 ##
-## @item range: "@nospell{onesided}" computes spectrum from [0..nfft/2+1].
-## "@nospell{twosided}" computes spectrum from [0..nfft-1].  These strings
-## can appear at any position in the list input arguments after window.
+## @item range: @qcode{"@nospell{onesided}"} computes spectrum from [0..nfft/2+1].
+## @qcode{"@nospell{twosided}"} computes spectrum from [0..nfft-1].  These
+## strings can appear at any position in the list input arguments after
+## window.
 ##
 ## @item @nospell{Pxx}: one-, or two-sided power spectrum.
 ##
@@ -188,3 +189,4 @@
   endif
 
 endfunction
+
--- a/scripts/signal/private/rectangle_lw.m
+++ b/scripts/signal/private/rectangle_lw.m
@@ -33,3 +33,4 @@
   retval(1:t, 1) = ones (t, 1);
 
 endfunction
+
--- a/scripts/signal/private/rectangle_sw.m
+++ b/scripts/signal/private/rectangle_sw.m
@@ -37,32 +37,3 @@
 
 endfunction
 
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
--- a/scripts/signal/private/triangle_sw.m
+++ b/scripts/signal/private/triangle_sw.m
@@ -37,32 +37,3 @@
 
 endfunction
 
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
--- a/scripts/signal/spectral_adf.m
+++ b/scripts/signal/spectral_adf.m
@@ -24,7 +24,7 @@
 ## autocovariances @var{c}, window name @var{win}, and bandwidth,
 ## @var{b}.
 ##
-## The window name, e.g., @code{"triangle"} or @code{"rectangle"} is
+## The window name, e.g., @qcode{"triangle"} or @qcode{"rectangle"} is
 ## used to search for a function called @code{@var{win}_lw}.
 ##
 ## If @var{win} is omitted, the triangle window is used.  If @var{b} is
@@ -68,8 +68,10 @@
 
 endfunction
 
+
 %% Test input validation
 %!error spectral_adf ();
 %!error spectral_adf (1, 2, 3, 4);
 %!error spectral_adf (1, 2);
 %!error spectral_adf (1, "invalid");
+
--- a/scripts/signal/spectral_xdf.m
+++ b/scripts/signal/spectral_xdf.m
@@ -23,7 +23,7 @@
 ## Return the spectral density estimator given a data vector @var{x},
 ## window name @var{win}, and bandwidth, @var{b}.
 ##
-## The window name, e.g., @code{"triangle"} or @code{"rectangle"} is
+## The window name, e.g., @qcode{"triangle"} or @qcode{"rectangle"} is
 ## used to search for a function called @code{@var{win}_sw}.
 ##
 ## If @var{win} is omitted, the triangle window is used.  If @var{b} is
@@ -69,8 +69,10 @@
 
 endfunction
 
+
 %% Test input validation
 %!error spectral_xdf ();
 %!error spectral_xdf (1, 2, 3, 4);
 %!error spectral_xdf (1, 2);
 %!error spectral_xdf (1, "invalid");
+
--- a/scripts/signal/stft.m
+++ b/scripts/signal/stft.m
@@ -132,3 +132,4 @@
   endif
 
 endfunction
+
--- a/scripts/signal/synthesis.m
+++ b/scripts/signal/synthesis.m
@@ -70,3 +70,4 @@
   x = reshape (z, inc * nc, 1);
 
 endfunction
+
--- a/scripts/signal/yulewalker.m
+++ b/scripts/signal/yulewalker.m
@@ -55,6 +55,3 @@
 endfunction
 
 
-
-
-
--- a/scripts/sparse/colperm.m
+++ b/scripts/sparse/colperm.m
@@ -35,3 +35,4 @@
   idx = find (diff ([j; Inf]) != 0);
   [dummy, p] = sort (idx - [0; idx(1:(end-1))]);
 endfunction
+
--- a/scripts/sparse/eigs.m
+++ b/scripts/sparse/eigs.m
@@ -70,32 +70,32 @@
 ## @var{sigma} is a string, it must have one of the following values.
 ## 
 ## @table @asis
-## @item "lm"
+## @item @qcode{"lm"}
 ## Largest Magnitude (default).
 ## 
-## @item "sm"
+## @item @qcode{"sm"}
 ## Smallest Magnitude.
 ## 
-## @item "la"
+## @item @qcode{"la"}
 ## Largest Algebraic (valid only for real symmetric problems).
 ## 
-## @item "sa"
+## @item @qcode{"sa"}
 ## Smallest Algebraic (valid only for real symmetric problems).
 ## 
-## @item "be"
+## @item @qcode{"be"}
 ## Both Ends, with one more from the high-end if @var{k} is odd (valid only for
 ## real symmetric problems).
 ## 
-## @item "lr"
+## @item @qcode{"lr"}
 ## Largest Real part (valid only for complex or unsymmetric problems).
 ## 
-## @item "sr"
+## @item @qcode{"sr"}
 ## Smallest Real part (valid only for complex or unsymmetric problems).
 ## 
-## @item "li"
+## @item @qcode{"li"}
 ## Largest Imaginary part (valid only for complex or unsymmetric problems).
 ## 
-## @item "si"
+## @item @qcode{"si"}
 ## Smallest Imaginary part (valid only for complex or unsymmetric problems).
 ## @end table
 ## 
@@ -361,6 +361,7 @@
 
 endfunction
 
+
 #### SPARSE MATRIX VERSIONS ####
 
 ## Real positive definite tests, n must be even
@@ -1106,3 +1107,4 @@
 %!assert (eigs (diag (1:5), 5, "sa"), [1;2;3;4;5]);
 %!assert (eigs (diag (1:5), 5, "la"), [5;4;3;2;1]);
 %!assert (eigs (diag (1:5), 3, "be"), [1;4;5]);
+
--- a/scripts/sparse/etreeplot.m
+++ b/scripts/sparse/etreeplot.m
@@ -20,7 +20,7 @@
 ## @deftypefn  {Function File} {} etreeplot (@var{A})
 ## @deftypefnx {Function File} {} etreeplot (@var{A}, @var{node_style}, @var{edge_style})
 ## Plot the elimination tree of the matrix @var{A} or
-## @xcode{@var{A}+@var{A}'} if @var{A} in not symmetric.  The optional
+## @tcode{@var{A}+@var{A}'} if @var{A} in not symmetric.  The optional
 ## parameters @var{node_style} and @var{edge_style} define the output
 ## style.
 ## @seealso{treeplot, gplot}
@@ -34,3 +34,4 @@
 
   treeplot (etree (A+A'), varargin{:});
 endfunction
+
--- a/scripts/sparse/gmres.m
+++ b/scripts/sparse/gmres.m
@@ -234,3 +234,4 @@
 %!error <A must be a function or matrix> gmres ({1},2)
 %!error <M1 must be a function or matrix> gmres (1,2,3,4,5,{6})
 %!error <M2 must be a function or matrix> gmres (1,2,3,4,5,6,{7})
+
--- a/scripts/sparse/pcg.m
+++ b/scripts/sparse/pcg.m
@@ -391,101 +391,101 @@
 
 
 %!demo
-%!  # Simplest usage of pcg (see also 'help pcg')
-%! 
-%!  N = 10;
-%!  A = diag ([1:N]); b = rand (N, 1);
-%!  y = A \ b;  # y is the true solution
-%!  x = pcg (A, b);
-%!  printf ("The solution relative error is %g\n", norm (x - y) / norm (y));
-%! 
-%!  # You shouldn't be afraid if pcg issues some warning messages in this
-%!  # example: watch out in the second example, why it takes N iterations
-%!  # of pcg to converge to (a very accurate, by the way) solution
+%! ## Simplest usage of pcg (see also 'help pcg')
+%!
+%! N = 10;
+%! A = diag ([1:N]); b = rand (N, 1);
+%! y = A \ b;  # y is the true solution
+%! x = pcg (A, b);
+%! printf ("The solution relative error is %g\n", norm (x - y) / norm (y));
+%!
+%! ## You shouldn't be afraid if pcg issues some warning messages in this
+%! ## example: watch out in the second example, why it takes N iterations
+%! ## of pcg to converge to (a very accurate, by the way) solution
 
 %!demo
-%!  # Full output from pcg, except for the eigenvalue estimates
-%!  # We use this output to plot the convergence history
-%! 
-%!  N = 10;
-%!  A = diag ([1:N]); b = rand (N, 1);
-%!  X = A \ b;  # X is the true solution
-%!  [x, flag, relres, iter, resvec] = pcg (A, b);
-%!  printf ("The solution relative error is %g\n", norm (x - X) / norm (X));
-%!  title ("Convergence history");
-%!  semilogy ([0:iter], resvec / resvec(1), "o-g");
-%!  xlabel ("Iteration"); ylabel ("log(||b-Ax||/||b||)");
-%!  legend ("relative residual");
+%! ## Full output from pcg, except for the eigenvalue estimates
+%! ## We use this output to plot the convergence history
+%!
+%! N = 10;
+%! A = diag ([1:N]); b = rand (N, 1);
+%! X = A \ b;  # X is the true solution
+%! [x, flag, relres, iter, resvec] = pcg (A, b);
+%! printf ("The solution relative error is %g\n", norm (x - X) / norm (X));
+%! title ("Convergence history");
+%! semilogy ([0:iter], resvec / resvec(1), "o-g");
+%! xlabel ("Iteration"); ylabel ("log(||b-Ax||/||b||)");
+%! legend ("relative residual");
 
 %!demo
-%!  # Full output from pcg, including the eigenvalue estimates
-%!  # Hilbert matrix is extremely ill-conditioned, so pcg WILL have problems
-%! 
-%!  N = 10;
-%!  A = hilb (N); b = rand (N, 1);
-%!  X = A \ b;  # X is the true solution
-%!  [x, flag, relres, iter, resvec, eigest] = pcg (A, b, [], 200);
-%!  printf ("The solution relative error is %g\n", norm (x - X) / norm (X));
-%!  printf ("Condition number estimate is %g\n", eigest(2) / eigest(1));
-%!  printf ("Actual condition number is   %g\n", cond (A));
-%!  title ("Convergence history");
-%!  semilogy ([0:iter], resvec, ["o-g";"+-r"]);
-%!  xlabel ("Iteration"); ylabel ("log(||b-Ax||)");
-%!  legend ("absolute residual", "absolute preconditioned residual");
+%! ## Full output from pcg, including the eigenvalue estimates
+%! ## Hilbert matrix is extremely ill-conditioned, so pcg WILL have problems
+%!
+%! N = 10;
+%! A = hilb (N); b = rand (N, 1);
+%! X = A \ b;  # X is the true solution
+%! [x, flag, relres, iter, resvec, eigest] = pcg (A, b, [], 200);
+%! printf ("The solution relative error is %g\n", norm (x - X) / norm (X));
+%! printf ("Condition number estimate is %g\n", eigest(2) / eigest(1));
+%! printf ("Actual condition number is   %g\n", cond (A));
+%! title ("Convergence history");
+%! semilogy ([0:iter], resvec, ["o-g";"+-r"]);
+%! xlabel ("Iteration"); ylabel ("log(||b-Ax||)");
+%! legend ("absolute residual", "absolute preconditioned residual");
 
 %!demo
-%!  # Full output from pcg, including the eigenvalue estimates
-%!  # We use the 1-D Laplacian matrix for A, and cond(A) = O(N^2)
-%!  # and that's the reason we need some preconditioner; here we take
-%!  # a very simple and not powerful Jacobi preconditioner,
-%!  # which is the diagonal of A
+%! ## Full output from pcg, including the eigenvalue estimates
+%! ## We use the 1-D Laplacian matrix for A, and cond(A) = O(N^2)
+%! ## and that's the reason we need some preconditioner; here we take
+%! ## a very simple and not powerful Jacobi preconditioner,
+%! ## which is the diagonal of A.
 %!
-%!  N = 100;
-%!  A = zeros (N, N);
-%!  for i = 1 : N - 1 # form 1-D Laplacian matrix
-%!    A(i:i+1, i:i+1) = [2 -1; -1 2];
-%!  endfor
-%!  b = rand (N, 1);
-%!  X = A \ b;  # X is the true solution
-%!  maxit = 80;
-%!  printf ("System condition number is %g\n", cond (A));
-%!  # No preconditioner: the convergence is very slow!
+%! N = 100;
+%! A = zeros (N, N);
+%! for i = 1 : N - 1 # form 1-D Laplacian matrix
+%!   A(i:i+1, i:i+1) = [2 -1; -1 2];
+%! endfor
+%! b = rand (N, 1);
+%! X = A \ b;  # X is the true solution
+%! maxit = 80;
+%! printf ("System condition number is %g\n", cond (A));
+%! ## No preconditioner: the convergence is very slow!
 %!
-%!  [x, flag, relres, iter, resvec, eigest] = pcg (A, b, [], maxit);
-%!  printf ("System condition number estimate is %g\n", eigest(2) / eigest(1));
-%!  title ("Convergence history");
-%!  semilogy ([0:iter], resvec(:,1), "o-g");
-%!  xlabel ("Iteration"); ylabel ("log(||b-Ax||)");
-%!  legend ("NO preconditioning: absolute residual");
+%! [x, flag, relres, iter, resvec, eigest] = pcg (A, b, [], maxit);
+%! printf ("System condition number estimate is %g\n", eigest(2) / eigest(1));
+%! title ("Convergence history");
+%! semilogy ([0:iter], resvec(:,1), "o-g");
+%! xlabel ("Iteration"); ylabel ("log(||b-Ax||)");
+%! legend ("NO preconditioning: absolute residual");
 %!
-%!  pause (1);
-%!  # Test Jacobi preconditioner: it will not help much!!!
+%! pause (1);
+%! ## Test Jacobi preconditioner: it will not help much!!!
 %!
-%!  M = diag (diag (A)); # Jacobi preconditioner
-%!  [x, flag, relres, iter, resvec, eigest] = pcg (A, b, [], maxit, M);
-%!  printf ("JACOBI preconditioned system condition number estimate is %g\n", eigest(2) / eigest(1));
-%!  hold on;
-%!  semilogy ([0:iter], resvec(:,1), "o-r");
-%!  legend ("NO preconditioning: absolute residual", ...
-%!          "JACOBI preconditioner: absolute residual");
+%! M = diag (diag (A)); # Jacobi preconditioner
+%! [x, flag, relres, iter, resvec, eigest] = pcg (A, b, [], maxit, M);
+%! printf ("JACOBI preconditioned system condition number estimate is %g\n", eigest(2) / eigest(1));
+%! hold on;
+%! semilogy ([0:iter], resvec(:,1), "o-r");
+%! legend ("NO preconditioning: absolute residual", ...
+%!         "JACOBI preconditioner: absolute residual");
 %!
-%!  pause (1);
-%!  # Test nonoverlapping block Jacobi preconditioner: it will help much!
+%! pause (1);
+%! ## Test nonoverlapping block Jacobi preconditioner: it will help much!
 %!
-%!  M = zeros (N, N); k = 4;
-%!  for i = 1 : k : N # form 1-D Laplacian matrix
-%!    M(i:i+k-1, i:i+k-1) = A(i:i+k-1, i:i+k-1);
-%!  endfor
-%!  [x, flag, relres, iter, resvec, eigest] = pcg (A, b, [], maxit, M);
-%!  printf ("BLOCK JACOBI preconditioned system condition number estimate is %g\n", eigest(2) / eigest(1));
-%!  semilogy ([0:iter], resvec(:,1), "o-b");
-%!  legend ("NO preconditioning: absolute residual", ...
-%!          "JACOBI preconditioner: absolute residual", ...
-%!          "BLOCK JACOBI preconditioner: absolute residual");
-%!  hold off;
+%! M = zeros (N, N); k = 4;
+%! for i = 1 : k : N # form 1-D Laplacian matrix
+%!   M(i:i+k-1, i:i+k-1) = A(i:i+k-1, i:i+k-1);
+%! endfor
+%! [x, flag, relres, iter, resvec, eigest] = pcg (A, b, [], maxit, M);
+%! printf ("BLOCK JACOBI preconditioned system condition number estimate is %g\n", eigest(2) / eigest(1));
+%! semilogy ([0:iter], resvec(:,1), "o-b");
+%! legend ("NO preconditioning: absolute residual", ...
+%!         "JACOBI preconditioner: absolute residual", ...
+%!         "BLOCK JACOBI preconditioner: absolute residual");
+%! hold off;
 
 %!test
-%! # solve small diagonal system
+%! ## solve small diagonal system
 %!
 %! N = 10;
 %! A = diag ([1:N]); b = rand (N, 1);
@@ -495,9 +495,9 @@
 %! assert (flag, 0);
 
 %!test
-%! # solve small indefinite diagonal system
-%! # despite A is indefinite, the iteration continues and converges
-%! # indefiniteness of A is detected
+%! ## solve small indefinite diagonal system
+%! ## despite A is indefinite, the iteration continues and converges
+%! ## indefiniteness of A is detected
 %!
 %! N = 10;
 %! A = diag([1:N] .* (-ones(1, N) .^ 2)); b = rand (N, 1);
@@ -507,7 +507,7 @@
 %! assert (flag, 3);
 
 %!test
-%! # solve tridiagonal system, do not converge in default 20 iterations
+%! ## solve tridiagonal system, do not converge in default 20 iterations
 %!
 %! N = 100;
 %! A = zeros (N, N);
@@ -522,9 +522,9 @@
 %! assert (iter, 20); # should perform max allowable default number of iterations
 
 %!test
-%! # solve tridiagonal system with 'perfect' preconditioner
-%! # which converges in one iteration, so the eigest does not
-%! # work and issues a warning
+%! ## solve tridiagonal system with 'perfect' preconditioner
+%! ## which converges in one iteration, so the eigest does not
+%! ## work and issues a warning
 %!
 %! N = 100;
 %! A = zeros (N, N);
--- a/scripts/sparse/pcr.m
+++ b/scripts/sparse/pcr.m
@@ -303,7 +303,7 @@
 
 
 %!demo
-%! # Simplest usage of PCR (see also 'help pcr')
+%! ## Simplest usage of PCR (see also 'help pcr')
 %!
 %! N = 20;
 %! A = diag (linspace (-3.1,3,N)); b = rand (N,1);
@@ -311,13 +311,13 @@
 %! x = pcr (A,b);
 %! printf ("The solution relative error is %g\n", norm (x-y) / norm (y));
 %!
-%! # You shouldn't be afraid if PCR issues some warning messages in this
-%! # example: watch out in the second example, why it takes N iterations
-%! # of PCR to converge to (a very accurate, by the way) solution
+%! ## You shouldn't be afraid if PCR issues some warning messages in this
+%! ## example: watch out in the second example, why it takes N iterations
+%! ## of PCR to converge to (a very accurate, by the way) solution.
 
 %!demo
-%! # Full output from PCR
-%! # We use this output to plot the convergence history
+%! ## Full output from PCR
+%! ## We use this output to plot the convergence history
 %!
 %! N = 20;
 %! A = diag (linspace (-3.1,30,N)); b = rand (N,1);
@@ -330,11 +330,11 @@
 %! semilogy ([0:iter], resvec/resvec(1), "o-g;relative residual;");
 
 %!demo
-%! # Full output from PCR
-%! # We use indefinite matrix based on the Hilbert matrix, with one
-%! # strongly negative eigenvalue
-%! # Hilbert matrix is extremely ill conditioned, so is ours,
-%! # and that's why PCR WILL have problems
+%! ## Full output from PCR
+%! ## We use indefinite matrix based on the Hilbert matrix, with one
+%! ## strongly negative eigenvalue
+%! ## Hilbert matrix is extremely ill conditioned, so is ours,
+%! ## and that's why PCR WILL have problems
 %!
 %! N = 10;
 %! A = hilb (N); A(1,1) = -A(1,1); b = rand (N,1);
@@ -350,14 +350,14 @@
 %! semilogy ([0:iter], resvec, "o-g;absolute residual;");
 
 %!demo
-%! # Full output from PCR
-%! # We use an indefinite matrix based on the 1-D Laplacian matrix for A,
-%! # and here we have cond(A) = O(N^2)
-%! # That's the reason we need some preconditioner; here we take
-%! # a very simple and not powerful Jacobi preconditioner,
-%! # which is the diagonal of A
+%! ## Full output from PCR
+%! ## We use an indefinite matrix based on the 1-D Laplacian matrix for A,
+%! ## and here we have cond(A) = O(N^2)
+%! ## That's the reason we need some preconditioner; here we take
+%! ## a very simple and not powerful Jacobi preconditioner,
+%! ## which is the diagonal of A.
 %!
-%! # Note that we use here indefinite preconditioners!
+%! ## Note that we use here indefinite preconditioners!
 %!
 %! N = 100;
 %! A = zeros (N,N);
@@ -369,7 +369,7 @@
 %! X = A \ b;  # X is the true solution
 %! maxit = 80;
 %! printf ("System condition number is %g\n", cond (A));
-%! # No preconditioner: the convergence is very slow!
+%! ## No preconditioner: the convergence is very slow!
 %!
 %! [x, flag, relres, iter, resvec] = pcr (A,b,[],maxit);
 %! clf;
@@ -378,7 +378,7 @@
 %! semilogy ([0:iter], resvec, "o-g;NO preconditioning: absolute residual;");
 %!
 %! pause (1);
-%! # Test Jacobi preconditioner: it will not help much!!!
+%! ## Test Jacobi preconditioner: it will not help much!!!
 %!
 %! M = diag (diag (A)); # Jacobi preconditioner
 %! [x, flag, relres, iter, resvec] = pcr (A,b,[],maxit,M);
@@ -386,8 +386,8 @@
 %! semilogy ([0:iter],resvec,"o-r;JACOBI preconditioner: absolute residual;");
 %!
 %! pause (1);
-%! # Test nonoverlapping block Jacobi preconditioner: this one should give
-%! # some convergence speedup!
+%! ## Test nonoverlapping block Jacobi preconditioner: this one should give
+%! ## some convergence speedup!
 %!
 %! M = zeros (N,N); k = 4;
 %! for i=1:k:N # get k x k diagonal blocks of A
@@ -399,7 +399,7 @@
 %! hold off;
 
 %!test
-%! # solve small indefinite diagonal system
+%! ## solve small indefinite diagonal system
 %!
 %! N = 10;
 %! A = diag (linspace (-10.1,10,N)); b = ones (N,1);
@@ -409,8 +409,8 @@
 %! assert (flag, 0);
 
 %!test
-%! # solve tridiagonal system, do not converge in default 20 iterations
-%! # should perform max allowable default number of iterations
+%! ## solve tridiagonal system, do not converge in default 20 iterations
+%! ## should perform max allowable default number of iterations
 %!
 %! N = 100;
 %! A = zeros (N,N);
@@ -425,8 +425,8 @@
 %! assert (iter, 20);
 
 %!test
-%! # solve tridiagonal system with "perfect" preconditioner
-%! # converges in one iteration
+%! ## solve tridiagonal system with "perfect" preconditioner
+%! ## converges in one iteration
 %!
 %! N = 100;
 %! A = zeros (N,N);
--- a/scripts/sparse/private/__sprand_impl__.m
+++ b/scripts/sparse/private/__sprand_impl__.m
@@ -78,3 +78,4 @@
   S = sparse (i, j, randfun (k, 1), m, n);
 
 endfunction
+
--- a/scripts/sparse/spdiags.m
+++ b/scripts/sparse/spdiags.m
@@ -91,3 +91,4 @@
 %!assert (spdiags (zeros (1,0),1,1,1), sparse (0))
 %!assert (spdiags (zeros (0,1),1,1,1), sparse (0))
 %!assert (spdiags ([0.5 -1 0.5], 0:2, 1, 1), sparse(0.5))
+
--- a/scripts/sparse/sprandn.m
+++ b/scripts/sparse/sprandn.m
@@ -75,3 +75,4 @@
 %% Test very large, very low density matrix doesn't fail 
 %!test
 %! s = sprandn(1e6,1e6,1e-7);
+
--- a/scripts/sparse/sprandsym.m
+++ b/scripts/sparse/sprandsym.m
@@ -121,7 +121,7 @@
   ## Degenerate case
   if (k == 1)
     r = 1;
-    return
+    return;
   endif
 
   ## Compute the stuff described above
--- a/scripts/sparse/svds.m
+++ b/scripts/sparse/svds.m
@@ -40,13 +40,13 @@
 ## and defaults to 6.
 ##
 ## The argument @var{sigma} specifies which singular values to find.  When
-## @var{sigma} is the string 'L', the default, the largest singular values of
-## @var{A} are found.  Otherwise, @var{sigma} must be a real scalar and the
-## singular values closest to @var{sigma} are found.  As a corollary,
+## @var{sigma} is the string @qcode{'L'}, the default, the largest singular
+## values of @var{A} are found.  Otherwise, @var{sigma} must be a real scalar
+## and the singular values closest to @var{sigma} are found.  As a corollary,
 ## @code{@var{sigma} = 0} finds the smallest singular values.  Note that for
-## relatively small values of @var{sigma}, there is a chance that the requested
-## number of singular values will not be found.  In that case @var{sigma}
-## should be increased.
+## relatively small values of @var{sigma}, there is a chance that the
+## requested number of singular values will not be found.  In that case
+## @var{sigma} should be increased.
 ##
 ## @var{opts} is a structure defining options that @code{svds} will pass
 ## to @code{eigs}.  The possible fields of this structure are documented in
@@ -103,7 +103,7 @@
   endif
 
   if (nargin < 4)
-    opts.tol = 0;   ## use ARPACK default
+    opts.tol = 0;    # use ARPACK default
     opts.disp = 0;
     opts.maxit = 300;
   else
@@ -111,7 +111,7 @@
       error ("svds: OPTS must be a structure");
     endif
     if (!isfield (opts, "tol"))
-      opts.tol = 0;   ## use ARPACK default
+      opts.tol = 0;  # use ARPACK default
     else
       opts.tol = opts.tol / root2;
     endif
--- a/scripts/sparse/treelayout.m
+++ b/scripts/sparse/treelayout.m
@@ -144,7 +144,7 @@
       if (columns (idx) == 1 && top_level == 1)
         s++;
       else
-        # We aren't in top level separator now.
+        ## We aren't in top level separator now.
         top_level = 0;
       endif
       ## If there is not any descendant of "parent node":
--- a/scripts/specfun/bessel.m
+++ b/scripts/specfun/bessel.m
@@ -93,3 +93,4 @@
 
 
 %!error bessel ()
+
--- a/scripts/specfun/betaln.m
+++ b/scripts/specfun/betaln.m
@@ -55,3 +55,4 @@
 %% Test input validation
 %!error (betaln (1))
 %!error (betaln (1,2,3))
+
--- a/scripts/specfun/ellipke.m
+++ b/scripts/specfun/ellipke.m
@@ -98,13 +98,14 @@
 
 endfunction
 
-%% Test complete elliptic functions of first and second kind
-%% against "exact" solution from Mathematica 3.0
+
+## Test complete elliptic functions of first and second kind
+## against "exact" solution from Mathematica 3.0
 %!test
 %! m = [0.0; 0.01; 0.1; 0.5; 0.9; 0.99; 1.0 ];
 %! [k,e] = ellipke (m);
 %!
-%! # K(1.0) is really infinity - see below
+%! ## K(1.0) is really infinity - see below
 %! k_exp = [1.5707963267948966192;
 %!          1.5747455615173559527;
 %!          1.6124413487202193982;
@@ -123,7 +124,7 @@
 %! assert (k, k_exp, 8*eps);
 %! assert (e, e_exp, 8*eps);
 
-%% Test against A&S Table 17.1
+## Test against A&S Table 17.1
 %!test
 %! m = [0:5:50]'/100;
 %! k_exp = [1.570796326794897;
@@ -152,6 +153,7 @@
 %! assert (k, k_exp, 1e-15);
 %! assert (e, e_exp, 1e-8);
 
-%% Test input validation
+## Test input validation
 %!error ellipke ()
 %!error ellipke (1,2,3)
+
--- a/scripts/specfun/expint.m
+++ b/scripts/specfun/expint.m
@@ -201,3 +201,4 @@
 %% Test input validation
 %!error expint ()
 %!error expint (1,2)
+
--- a/scripts/specfun/legendre.m
+++ b/scripts/specfun/legendre.m
@@ -22,12 +22,12 @@
 ## @deftypefnx {Function File} {@var{l} =} legendre (@var{n}, @var{x}, @var{normalization})
 ## Compute the Legendre function of degree @var{n} and order
 ## @var{m} = 0 @dots{} N@.  The optional argument, @var{normalization},
-## may be one of @code{"unnorm"}, @code{"sch"}, or @code{"norm"}.
-## The default is @code{"unnorm"}.  The value of @var{n} must be a
+## may be one of @qcode{"unnorm"}, @qcode{"sch"}, or @qcode{"norm"}.
+## The default is @qcode{"unnorm"}.  The value of @var{n} must be a
 ## non-negative scalar integer.
 ##
 ## If the optional argument @var{normalization} is missing or is
-## @code{"unnorm"}, compute the Legendre function of degree @var{n} and
+## @qcode{"unnorm"}, compute the Legendre function of degree @var{n} and
 ## order @var{m} and return all values for @var{m} = 0 @dots{} @var{n}.
 ## The return value has one dimension more than @var{x}.
 ##
@@ -84,7 +84,7 @@
 ## @end group
 ## @end example
 ##
-## If the optional argument @code{normalization} is @code{"sch"},
+## If the optional argument @code{normalization} is @qcode{"sch"},
 ## compute the Schmidt semi-normalized associated Legendre function.
 ## The Schmidt semi-normalized associated Legendre function is related
 ## to the unnormalized Legendre functions by the following:
@@ -127,7 +127,7 @@
 ##
 ## @end ifnottex
 ##
-## If the optional argument @var{normalization} is @code{"norm"},
+## If the optional argument @var{normalization} is @qcode{"norm"},
 ## compute the fully normalized associated Legendre function.
 ## The fully normalized associated Legendre function is related
 ## to the unnormalized Legendre functions by the following:
--- a/scripts/special-matrix/gallery.m
+++ b/scripts/special-matrix/gallery.m
@@ -162,9 +162,9 @@
 ## (reproducibility) for a given size input and @var{j} index.
 ##
 ## The final optional argument determines the class of the resulting matrix.
-## Possible values for @var{class}: "uint8", "uint16", "uint32", "int8",
-## "int16", int32", "single", "double".
-## The default is "double".
+## Possible values for @var{class}: @qcode{"uint8"}, @qcode{"uint16"},
+## @qcode{"uint32"}, @qcode{"int8"}, @qcode{"int16"}, int32", @qcode{"single"},
+## @qcode{"double"}.  The default is @qcode{"double"}.
 ##
 ## @end deftypefn
 ##
@@ -262,8 +262,8 @@
 ## (reproducibility) for a given size input and @var{j} index.
 ##
 ## The final optional argument determines the class of the resulting matrix.
-## Possible values for @var{class}: "single", "double".
-## The default is "double".
+## Possible values for @var{class}: @qcode{"single"}, @qcode{"double"}.
+## The default is @qcode{"double"}.
 ##
 ## @end deftypefn
 ##
@@ -383,8 +383,8 @@
 ## (reproducibility) for a given size input and @var{j} index.
 ##
 ## The final optional argument determines the class of the resulting matrix.
-## Possible values for @var{class}: "single", "double".
-## The default is "double".
+## Possible values for @var{class}: @qcode{"single"}, @qcode{"double"}.
+## The default is @qcode{"double"}.
 ##
 ## @end deftypefn
 ##
@@ -1949,7 +1949,7 @@
       Q(1,2:n) = ones (1, n-1);
       for i = 2:n
         Q(i,i) = -(i-1);
-      end
+      endfor
       Q = diag (sqrt ([n 1:n-1] .* [1:n])) \ Q;
 
     case (5)
@@ -2217,8 +2217,8 @@
   if (p == 1)
     A = randn (m, n);
     A = A / norm (A);
-    return
-  end
+    return;
+  endif
 
   ##  Set up vector sigma of singular values.
   switch (abs (mode))
@@ -2244,7 +2244,7 @@
   ##  Convert to diagonal matrix of singular values.
   if (mode < 0)
     sigma = sigma (p:-1:1);
-  end
+  endif
   sigma = diag (sigma);
 
   if (posdef)
@@ -2252,13 +2252,13 @@
     Q = qmult (p);
     A = Q' * sigma * Q;
     A = (A + A') / 2;  # Ensure matrix is symmetric.
-    return
+    return;
   endif
 
   if (m != n)
     ## Expand to m-by-n diagonal matrix
     sigma(m, n) = 0;
-  end
+  endif
 
   if (kl == 0 && ku == 0)
     ## Diagonal matrix requested - nothing more to do.
@@ -2852,3 +2852,4 @@
     A = A';
   endif
 endfunction
+
--- a/scripts/special-matrix/toeplitz.m
+++ b/scripts/special-matrix/toeplitz.m
@@ -96,8 +96,8 @@
   endif
 
   if (issparse (c) && issparse (r))
-    c = c(:).';  ## enforce row vector
-    r = r(:).';  ## enforce row vector
+    c = c(:).';  # enforce row vector
+    r = r(:).';  # enforce row vector
     cidx = find (c);
     ridx = find (r);
 
--- a/scripts/startup/__finish__.m
+++ b/scripts/startup/__finish__.m
@@ -40,3 +40,4 @@
 
 ## No test needed for internal helper function.
 %!assert (1)
+
--- a/scripts/statistics/base/mean.m
+++ b/scripts/statistics/base/mean.m
@@ -39,13 +39,13 @@
 ## The following options are recognized:
 ##
 ## @table @asis
-## @item "a"
+## @item @qcode{"a"}
 ## Compute the (ordinary) arithmetic mean.  [default]
 ##
-## @item "g"
+## @item @qcode{"g"}
 ## Compute the geometric mean.
 ##
-## @item "h"
+## @item @qcode{"h"}
 ## Compute the harmonic mean.
 ## @end table
 ##
--- a/scripts/statistics/base/moment.m
+++ b/scripts/statistics/base/moment.m
@@ -45,7 +45,7 @@
 ## Valid options are:
 ##
 ## @table @asis
-## @item "c"
+## @item @qcode{"c"}
 ##   Central Moment.  The moment about the mean defined as
 ## @tex
 ## $$
@@ -62,7 +62,7 @@
 ##
 ## @end ifnottex
 ##
-## @item "a"
+## @item @qcode{"a"}
 ##   Absolute Moment.  The moment about zero ignoring sign defined as
 ## @tex
 ## $$
@@ -79,7 +79,7 @@
 ##
 ## @end ifnottex
 ##
-## @item "ac"
+## @item @qcode{"ac"}
 ##   Absolute Central Moment.  Defined as
 ## @tex
 ## $$
--- a/scripts/statistics/base/qqplot.m
+++ b/scripts/statistics/base/qqplot.m
@@ -97,3 +97,4 @@
   endif
 
 endfunction
+
--- a/scripts/statistics/distributions/tcdf.m
+++ b/scripts/statistics/distributions/tcdf.m
@@ -157,3 +157,4 @@
 ##     x = power(mpf(10), -mpf(i))
 ##     print "%%!assert (tcdf (10^(-%d), 2.5), %s, -eps)" \
 ##         % (i, nstr(F(x, nu), 17))
+
--- a/scripts/statistics/distributions/wienrnd.m
+++ b/scripts/statistics/distributions/wienrnd.m
@@ -52,3 +52,4 @@
   retval = [((1: n*t)' / n), retval];
 
 endfunction
+
--- a/scripts/statistics/models/logistic_regression.m
+++ b/scripts/statistics/models/logistic_regression.m
@@ -190,3 +190,4 @@
   endif
 
 endfunction
+
--- a/scripts/statistics/models/private/logistic_regression_derivatives.m
+++ b/scripts/statistics/models/private/logistic_regression_derivatives.m
@@ -41,3 +41,4 @@
       - dlogp' * dlogp;
 
 endfunction
+
--- a/scripts/statistics/models/private/logistic_regression_likelihood.m
+++ b/scripts/statistics/models/private/logistic_regression_likelihood.m
@@ -37,3 +37,4 @@
   dev = -2 * sum (log (p));
 
 endfunction
+
--- a/scripts/statistics/tests/anova.m
+++ b/scripts/statistics/tests/anova.m
@@ -108,3 +108,4 @@
   endif
 
 endfunction
+
--- a/scripts/statistics/tests/bartlett_test.m
+++ b/scripts/statistics/tests/bartlett_test.m
@@ -65,3 +65,4 @@
   endif
 
 endfunction
+
--- a/scripts/statistics/tests/chisquare_test_homogeneity.m
+++ b/scripts/statistics/tests/chisquare_test_homogeneity.m
@@ -66,3 +66,4 @@
   endif
 
 endfunction
+
--- a/scripts/statistics/tests/chisquare_test_independence.m
+++ b/scripts/statistics/tests/chisquare_test_independence.m
@@ -51,3 +51,4 @@
   endif
 
 endfunction
+
--- a/scripts/statistics/tests/cor_test.m
+++ b/scripts/statistics/tests/cor_test.m
@@ -22,18 +22,18 @@
 ## populations.
 ##
 ## The optional argument string @var{alt} describes the alternative
-## hypothesis, and can be @code{"!="} or @code{"<>"} (non-zero),
-## @code{">"} (greater than 0), or @code{"<"} (less than 0).  The
+## hypothesis, and can be @qcode{"!="} or @qcode{"<>"} (non-zero),
+## @qcode{">"} (greater than 0), or @qcode{"<"} (less than 0).  The
 ## default is the two-sided case.
 ##
 ## The optional argument string @var{method} specifies which
 ## correlation coefficient to use for testing.  If @var{method} is
-## @code{"pearson"} (default), the (usual) Pearson's product moment
+## @qcode{"pearson"} (default), the (usual) Pearson's product moment
 ## correlation coefficient is used.  In this case, the data should come
 ## from a bivariate normal distribution.  Otherwise, the other two
 ## methods offer nonparametric alternatives.  If @var{method} is
-## @code{"kendall"}, then Kendall's rank correlation tau is used.  If
-## @var{method} is @code{"spearman"}, then Spearman's rank correlation
+## @qcode{"kendall"}, then Kendall's rank correlation tau is used.  If
+## @var{method} is @qcode{"spearman"}, then Spearman's rank correlation
 ## rho is used.  Only the first character is necessary.
 ##
 ## The output is a structure with the following elements:
@@ -133,3 +133,4 @@
   endif
 
 endfunction
+
--- a/scripts/statistics/tests/f_test_regression.m
+++ b/scripts/statistics/tests/f_test_regression.m
@@ -75,3 +75,4 @@
   endif
 
 endfunction
+
--- a/scripts/statistics/tests/hotelling_test.m
+++ b/scripts/statistics/tests/hotelling_test.m
@@ -70,3 +70,4 @@
   endif
 
 endfunction
+
--- a/scripts/statistics/tests/hotelling_test_2.m
+++ b/scripts/statistics/tests/hotelling_test_2.m
@@ -84,3 +84,4 @@
   endif
 
 endfunction
+
--- a/scripts/statistics/tests/kolmogorov_smirnov_test.m
+++ b/scripts/statistics/tests/kolmogorov_smirnov_test.m
@@ -36,11 +36,11 @@
 ## that calculates the CDF of distribution @var{dist} exists.
 ##
 ## With the optional argument string @var{alt}, the alternative of
-## interest can be selected.  If @var{alt} is @code{"!="} or
-## @code{"<>"}, the null is tested against the two-sided alternative F
+## interest can be selected.  If @var{alt} is @qcode{"!="} or
+## @qcode{"<>"}, the null is tested against the two-sided alternative F
 ## != G@.  In this case, the test statistic @var{ks} follows a two-sided
-## Kolmogorov-Smirnov distribution.  If @var{alt} is @code{">"}, the
-## one-sided alternative F > G is considered.  Similarly for @code{"<"},
+## Kolmogorov-Smirnov distribution.  If @var{alt} is @qcode{">"}, the
+## one-sided alternative F > G is considered.  Similarly for @qcode{"<"},
 ## the one-sided alternative F > G is considered.  In this case, the
 ## test statistic @var{ks} has a one-sided Kolmogorov-Smirnov
 ## distribution.  The default is the two-sided case.
@@ -121,7 +121,7 @@
 %!error kolmogorov_smirnov_test (1)
 %!error <X must be a vector> kolmogorov_smirnov_test ({}, "unif", 2, 4)
 %!error <no not_a_distcdf or not_a_dist_cdf function found>
-%!  kolmogorov_smirnov_test (1, "not_a_dist");
+%! kolmogorov_smirnov_test (1, "not_a_dist");
 %!error <alternative foo not recognized>
-%!  kolmogorov_smirnov_test (1, "unif", 2, 4, "foo");
+%! kolmogorov_smirnov_test (1, "unif", 2, 4, "foo");
 
--- a/scripts/statistics/tests/kolmogorov_smirnov_test_2.m
+++ b/scripts/statistics/tests/kolmogorov_smirnov_test_2.m
@@ -25,11 +25,11 @@
 ## G.
 ##
 ## With the optional argument string @var{alt}, the alternative of
-## interest can be selected.  If @var{alt} is @code{"!="} or
-## @code{"<>"}, the null is tested against the two-sided alternative F
+## interest can be selected.  If @var{alt} is @qcode{"!="} or
+## @qcode{"<>"}, the null is tested against the two-sided alternative F
 ## != G@.  In this case, the test statistic @var{ks} follows a two-sided
-## Kolmogorov-Smirnov distribution.  If @var{alt} is @code{">"}, the
-## one-sided alternative F > G is considered.  Similarly for @code{"<"},
+## Kolmogorov-Smirnov distribution.  If @var{alt} is @qcode{">"}, the
+## one-sided alternative F > G is considered.  Similarly for @qcode{"<"},
 ## the one-sided alternative F < G is considered.  In this case, the
 ## test statistic @var{ks} has a one-sided Kolmogorov-Smirnov
 ## distribution.  The default is the two-sided case.
@@ -102,3 +102,4 @@
   endif
 
 endfunction
+
--- a/scripts/statistics/tests/kruskal_wallis_test.m
+++ b/scripts/statistics/tests/kruskal_wallis_test.m
@@ -18,7 +18,7 @@
 
 ## -*- texinfo -*-
 ## @deftypefn {Function File} {[@var{pval}, @var{k}, @var{df}] =} kruskal_wallis_test (@var{x1}, @dots{})
-## Perform a Kruskal-Wallis one-factor "analysis of variance".
+## Perform a Kruskal-Wallis one-factor analysis of variance.
 ##
 ## Suppose a variable is observed for @var{k} > 1 different groups, and
 ## let @var{x1}, @dots{}, @var{xk} be the corresponding data vectors.
@@ -36,9 +36,10 @@
 ## where @var{sum_ties} is the sum of @var{t}^2 - @var{t} over each group
 ## of ties where @var{t} is the number of ties in the group and @var{n}
 ## is the total number of values in the input data.  For more info on
-## this adjustment see "Use of Ranks in One-Criterion Variance Analysis"
-## in Journal of the American Statistical Association, Vol. 47,
-## No. 260 (Dec 1952) by William H. Kruskal and W. Allen Wallis.
+## this adjustment see William H. Kruskal and W. Allen Wallis,
+## @cite{Use of Ranks in One-Criterion Variance Analysis}, 
+## Journal of the American Statistical Association, Vol. 47,
+## No. 260 (Dec 1952).
 ##
 ## The p-value (1 minus the CDF of this distribution at @var{k}) is
 ## returned in @var{pval}.
@@ -97,3 +98,4 @@
 
 ## Test with ties
 %!assert (abs (kruskal_wallis_test ([86 86], [74]) - 0.157299207050285) < 0.0000000000001)
+
--- a/scripts/statistics/tests/manova.m
+++ b/scripts/statistics/tests/manova.m
@@ -159,3 +159,4 @@
   printf ("\n");
 
 endfunction
+
--- a/scripts/statistics/tests/mcnemar_test.m
+++ b/scripts/statistics/tests/mcnemar_test.m
@@ -63,5 +63,3 @@
 
 endfunction
 
-
-
--- a/scripts/statistics/tests/prop_test_2.m
+++ b/scripts/statistics/tests/prop_test_2.m
@@ -25,10 +25,10 @@
 ## approximately follows a standard normal distribution.
 ##
 ## With the optional argument string @var{alt}, the alternative of
-## interest can be selected.  If @var{alt} is @code{"!="} or
-## @code{"<>"}, the null is tested against the two-sided alternative
-## @var{p1} != @var{p2}.  If @var{alt} is @code{">"}, the one-sided
-## alternative @var{p1} > @var{p2} is used.  Similarly for @code{"<"},
+## interest can be selected.  If @var{alt} is @qcode{"!="} or
+## @qcode{"<>"}, the null is tested against the two-sided alternative
+## @var{p1} != @var{p2}.  If @var{alt} is @qcode{">"}, the one-sided
+## alternative @var{p1} > @var{p2} is used.  Similarly for @qcode{"<"},
 ## the one-sided alternative @var{p1} < @var{p2} is used.
 ## The default is the two-sided case.
 ##
@@ -78,3 +78,4 @@
   endif
 
 endfunction
+
--- a/scripts/statistics/tests/run_test.m
+++ b/scripts/statistics/tests/run_test.m
@@ -56,3 +56,4 @@
   endif
 
 endfunction
+
--- a/scripts/statistics/tests/sign_test.m
+++ b/scripts/statistics/tests/sign_test.m
@@ -25,12 +25,12 @@
 ## (@var{x} != @var{y})} and @var{p} = 1/2.
 ##
 ## With the optional argument @code{alt}, the alternative of interest
-## can be selected.  If @var{alt} is @code{"!="} or @code{"<>"}, the
+## can be selected.  If @var{alt} is @qcode{"!="} or @qcode{"<>"}, the
 ## null hypothesis is tested against the two-sided alternative PROB
-## (@var{x} < @var{y}) != 1/2.  If @var{alt} is @code{">"}, the
+## (@var{x} < @var{y}) != 1/2.  If @var{alt} is @qcode{">"}, the
 ## one-sided alternative PROB (@var{x} > @var{y}) > 1/2 ("x is
 ## stochastically greater than y") is considered.  Similarly for
-## @code{"<"}, the one-sided alternative PROB (@var{x} > @var{y}) < 1/2
+## @qcode{"<"}, the one-sided alternative PROB (@var{x} > @var{y}) < 1/2
 ## ("x is stochastically less than y") is considered.  The default is
 ## the two-sided case.
 ##
@@ -81,3 +81,4 @@
   endif
 
 endfunction
+
--- a/scripts/statistics/tests/t_test.m
+++ b/scripts/statistics/tests/t_test.m
@@ -25,9 +25,9 @@
 ## - 1} degrees of freedom.
 ##
 ## With the optional argument string @var{alt}, the alternative of
-## interest can be selected.  If @var{alt} is @code{"!="} or
-## @code{"<>"}, the null is tested against the two-sided alternative
-## @code{mean (@var{x}) != @var{m}}.  If @var{alt} is @code{">"}, the
+## interest can be selected.  If @var{alt} is @qcode{"!="} or
+## @qcode{"<>"}, the null is tested against the two-sided alternative
+## @code{mean (@var{x}) != @var{m}}.  If @var{alt} is @qcode{">"}, the
 ## one-sided alternative @code{mean (@var{x}) > @var{m}} is considered.
 ## Similarly for @var{"<"}, the one-sided alternative @code{mean
 ## (@var{x}) < @var{m}} is considered.  The default is the two-sided
@@ -81,3 +81,4 @@
   endif
 
 endfunction
+
--- a/scripts/statistics/tests/t_test_2.m
+++ b/scripts/statistics/tests/t_test_2.m
@@ -25,11 +25,11 @@
 ## freedom.
 ##
 ## With the optional argument string @var{alt}, the alternative of
-## interest can be selected.  If @var{alt} is @code{"!="} or
-## @code{"<>"}, the null is tested against the two-sided alternative
-## @code{mean (@var{x}) != mean (@var{y})}.  If @var{alt} is @code{">"},
+## interest can be selected.  If @var{alt} is @qcode{"!="} or
+## @qcode{"<>"}, the null is tested against the two-sided alternative
+## @code{mean (@var{x}) != mean (@var{y})}.  If @var{alt} is @qcode{">"},
 ## the one-sided alternative @code{mean (@var{x}) > mean (@var{y})} is
-## used.  Similarly for @code{"<"}, the one-sided alternative @code{mean
+## used.  Similarly for @qcode{"<"}, the one-sided alternative @code{mean
 ## (@var{x}) < mean (@var{y})} is used.  The default is the two-sided
 ## case.
 ##
@@ -82,3 +82,4 @@
   endif
 
 endfunction
+
--- a/scripts/statistics/tests/t_test_regression.m
+++ b/scripts/statistics/tests/t_test_regression.m
@@ -27,9 +27,9 @@
 ## If @var{r} is omitted, a value of 0 is assumed.
 ##
 ## With the optional argument string @var{alt}, the alternative of
-## interest can be selected.  If @var{alt} is @code{"!="} or
-## @code{"<>"}, the null is tested against the two-sided alternative
-## @nospell{@code{@var{rr} * @var{b} != @var{r}}}.  If @var{alt} is @code{">"},
+## interest can be selected.  If @var{alt} is @qcode{"!="} or
+## @qcode{"<>"}, the null is tested against the two-sided alternative
+## @nospell{@code{@var{rr} * @var{b} != @var{r}}}.  If @var{alt} is @qcode{">"},
 ## the one-sided alternative
 ## @nospell{@code{@var{rr} * @var{b} > @var{r}}} is used.  Similarly for
 ## @var{"<"}, the one-sided alternative
@@ -97,3 +97,4 @@
   endif
 
 endfunction
+
--- a/scripts/statistics/tests/u_test.m
+++ b/scripts/statistics/tests/u_test.m
@@ -25,11 +25,11 @@
 ## equivalent to the Wilcoxon rank-sum test.
 ##
 ## With the optional argument string @var{alt}, the alternative of
-## interest can be selected.  If @var{alt} is @code{"!="} or
-## @code{"<>"}, the null is tested against the two-sided alternative
-## PROB (@var{x} > @var{y}) != 1/2.  If @var{alt} is @code{">"}, the
+## interest can be selected.  If @var{alt} is @qcode{"!="} or
+## @qcode{"<>"}, the null is tested against the two-sided alternative
+## PROB (@var{x} > @var{y}) != 1/2.  If @var{alt} is @qcode{">"}, the
 ## one-sided alternative PROB (@var{x} > @var{y}) > 1/2 is considered.
-## Similarly for @code{"<"}, the one-sided alternative PROB (@var{x} >
+## Similarly for @qcode{"<"}, the one-sided alternative PROB (@var{x} >
 ## @var{y}) < 1/2 is considered.  The default is the two-sided case.
 ##
 ## The p-value of the test is returned in @var{pval}.
@@ -83,3 +83,4 @@
   endif
 
 endfunction
+
--- a/scripts/statistics/tests/var_test.m
+++ b/scripts/statistics/tests/var_test.m
@@ -25,9 +25,9 @@
 ## degrees of freedom.
 ##
 ## With the optional argument string @var{alt}, the alternative of
-## interest can be selected.  If @var{alt} is @code{"!="} or
-## @code{"<>"}, the null is tested against the two-sided alternative
-## @code{var (@var{x}) != var (@var{y})}.  If @var{alt} is @code{">"},
+## interest can be selected.  If @var{alt} is @qcode{"!="} or
+## @qcode{"<>"}, the null is tested against the two-sided alternative
+## @code{var (@var{x}) != var (@var{y})}.  If @var{alt} is @qcode{">"},
 ## the one-sided alternative @code{var (@var{x}) > var (@var{y})} is
 ## used.  Similarly for "<", the one-sided alternative @code{var
 ## (@var{x}) > var (@var{y})} is used.  The default is the two-sided
@@ -78,3 +78,4 @@
   endif
 
 endfunction
+
--- a/scripts/statistics/tests/welch_test.m
+++ b/scripts/statistics/tests/welch_test.m
@@ -25,11 +25,11 @@
 ## Student distribution with @var{df} degrees of freedom.
 ##
 ## With the optional argument string @var{alt}, the alternative of
-## interest can be selected.  If @var{alt} is @code{"!="} or
-## @code{"<>"}, the null is tested against the two-sided alternative
-## @code{mean (@var{x}) != @var{m}}.  If @var{alt} is @code{">"}, the
+## interest can be selected.  If @var{alt} is @qcode{"!="} or
+## @qcode{"<>"}, the null is tested against the two-sided alternative
+## @code{mean (@var{x}) != @var{m}}.  If @var{alt} is @qcode{">"}, the
 ## one-sided alternative mean(x) > @var{m} is considered.  Similarly for
-## @code{"<"}, the one-sided alternative mean(x) < @var{m} is
+## @qcode{"<"}, the one-sided alternative mean(x) < @var{m} is
 ## considered.  The default is the two-sided case.
 ##
 ## The p-value of the test is returned in @var{pval}.
@@ -83,3 +83,4 @@
   endif
 
 endfunction
+
--- a/scripts/statistics/tests/wilcoxon_test.m
+++ b/scripts/statistics/tests/wilcoxon_test.m
@@ -27,11 +27,11 @@
 ## and thus is invalid for @var{n} @leq{} 25.
 ##
 ## With the optional argument string @var{alt}, the alternative of
-## interest can be selected.  If @var{alt} is @code{"!="} or
-## @code{"<>"}, the null is tested against the two-sided alternative
-## PROB (@var{x} > @var{y}) != 1/2.  If alt is @code{">"}, the one-sided
+## interest can be selected.  If @var{alt} is @qcode{"!="} or
+## @qcode{"<>"}, the null is tested against the two-sided alternative
+## PROB (@var{x} > @var{y}) != 1/2.  If alt is @qcode{">"}, the one-sided
 ## alternative PROB (@var{x} > @var{y}) > 1/2 is considered.  Similarly
-## for @code{"<"}, the one-sided alternative PROB (@var{x} > @var{y}) <
+## for @qcode{"<"}, the one-sided alternative PROB (@var{x} > @var{y}) <
 ## 1/2 is considered.  The default is the two-sided case.
 ##
 ## The p-value of the test is returned in @var{pval}.
@@ -89,3 +89,4 @@
   endif
 
 endfunction
+
--- a/scripts/statistics/tests/z_test.m
+++ b/scripts/statistics/tests/z_test.m
@@ -24,11 +24,11 @@
 ## @var{z} follows a standard normal distribution.
 ##
 ## With the optional argument string @var{alt}, the alternative of
-## interest can be selected.  If @var{alt} is @code{"!="} or
-## @code{"<>"}, the null is tested against the two-sided alternative
-## @code{mean (@var{x}) != @var{m}}.  If @var{alt} is @code{">"}, the
+## interest can be selected.  If @var{alt} is @qcode{"!="} or
+## @qcode{"<>"}, the null is tested against the two-sided alternative
+## @code{mean (@var{x}) != @var{m}}.  If @var{alt} is @qcode{">"}, the
 ## one-sided alternative @code{mean (@var{x}) > @var{m}} is considered.
-## Similarly for @code{"<"}, the one-sided alternative @code{mean
+## Similarly for @qcode{"<"}, the one-sided alternative @code{mean
 ## (@var{x}) < @var{m}} is considered.  The default is the two-sided
 ## case.
 ##
@@ -80,8 +80,9 @@
   if (nargout == 0)
     s = ["Z-test of mean(x) == %g against mean(x) %s %g,\n", ...
          "with known var(x) == %g:\n",                       ...
-         "  pval = %g\n");
+         "  pval = %g\n"];
     printf (s, m, alt, m, v, pval);
   endif
 
 endfunction
+
--- a/scripts/statistics/tests/z_test_2.m
+++ b/scripts/statistics/tests/z_test_2.m
@@ -24,11 +24,11 @@
 ## statistic @var{z} follows a standard normal distribution.
 ##
 ## With the optional argument string @var{alt}, the alternative of
-## interest can be selected.  If @var{alt} is @code{"!="} or
-## @code{"<>"}, the null is tested against the two-sided alternative
-## @code{mean (@var{x}) != mean (@var{y})}.  If alt is @code{">"}, the
+## interest can be selected.  If @var{alt} is @qcode{"!="} or
+## @qcode{"<>"}, the null is tested against the two-sided alternative
+## @code{mean (@var{x}) != mean (@var{y})}.  If alt is @qcode{">"}, the
 ## one-sided alternative @code{mean (@var{x}) > mean (@var{y})} is used.
-## Similarly for @code{"<"}, the one-sided alternative @code{mean
+## Similarly for @qcode{"<"}, the one-sided alternative @code{mean
 ## (@var{x}) < mean (@var{y})} is used.  The default is the two-sided
 ## case.
 ##
@@ -86,3 +86,4 @@
   endif
 
 endfunction
+
--- a/scripts/strings/base2dec.m
+++ b/scripts/strings/base2dec.m
@@ -30,7 +30,7 @@
 ##
 ## If @var{s} is a string matrix, return a column vector with one value per
 ## row of @var{s}.  If a row contains invalid symbols then the
-## corresponding value will be NaN@.  
+## corresponding value will be NaN@.
 ##
 ## If @var{s} is a cell array of strings, return a column vector with one
 ## value per cell element in @var{s}.
--- a/scripts/strings/dec2base.m
+++ b/scripts/strings/dec2base.m
@@ -62,7 +62,7 @@
     d = cell2mat (d);
   endif
 
-  # Create column vector for algorithm
+  ## Create column vector for algorithm
   if (! iscolumn (d))
     d = d(:);
   endif
--- a/scripts/strings/index.m
+++ b/scripts/strings/index.m
@@ -32,8 +32,8 @@
 ## @end group
 ## @end example
 ##
-## If @var{direction} is @samp{"first"}, return the first element found.
-## If @var{direction} is @samp{"last"}, return the last element found.
+## If @var{direction} is @qcode{"first"}, return the first element found.
+## If @var{direction} is @qcode{"last"}, return the last element found.
 ##
 ## @seealso{find, rindex}
 ## @end deftypefn
--- a/scripts/strings/isstrprop.m
+++ b/scripts/strings/isstrprop.m
@@ -35,45 +35,45 @@
 ## The second argument @var{prop} must be one of
 ##
 ## @table @asis
-## @item "alpha"
+## @item @qcode{"alpha"}
 ## True for characters that are alphabetic (letters).
 ##
-## @item  "alnum"
-## @itemx "alphanum"
+## @item  @qcode{"alnum"}
+## @itemx @qcode{"alphanum"}
 ## True for characters that are alphabetic or digits.
 ##
-## @item "lower"
+## @item @qcode{"lower"}
 ## True for lowercase letters.
 ##
-## @item "upper"
+## @item @qcode{"upper"}
 ## True for uppercase letters.
 ##
-## @item "digit"
+## @item @qcode{"digit"}
 ## True for decimal digits (0-9).
 ##
-## @item "xdigit"
+## @item @qcode{"xdigit"}
 ## True for hexadecimal digits (@nospell{a-fA-F0-9}).
 ##
-## @item  "space"
-## @itemx "wspace"
+## @item  @qcode{"space"}
+## @itemx @qcode{"wspace"}
 ## True for whitespace characters (space, formfeed, newline, carriage
 ## return, tab, vertical tab).
 ##
-## @item "punct"
+## @item @qcode{"punct"}
 ## True for punctuation characters (printing characters except space
 ## or letter or digit).
 ##
-## @item "cntrl"
+## @item @qcode{"cntrl"}
 ## True for control characters.
 ##
-## @item  "graph"
-## @itemx "graphic"
+## @item  @qcode{"graph"}
+## @itemx @qcode{"graphic"}
 ## True for printing characters except space.
 ##
-## @item "print"
+## @item @qcode{"print"}
 ## True for printing characters including space.
 ##
-## @item "ascii"
+## @item @qcode{"ascii"}
 ## True for characters that are in the range of ASCII encoding.
 ##
 ## @end table
--- a/scripts/strings/mat2str.m
+++ b/scripts/strings/mat2str.m
@@ -29,7 +29,7 @@
 ## precision of the real part and @code{@var{n}(2)} defines the
 ## precision of the imaginary part.  The default for @var{n} is 15.
 ##
-## If the argument "class" is given then the class of @var{x} is
+## If the argument @qcode{"class"} is given then the class of @var{x} is
 ## included in the string in such a way that @code{eval} will result in the
 ## construction of a matrix of the same class.
 ##
--- a/scripts/strings/regexptranslate.m
+++ b/scripts/strings/regexptranslate.m
@@ -24,7 +24,7 @@
 ## values
 ##
 ## @table @asis
-## @item "wildcard"
+## @item @qcode{"wildcard"}
 ## The wildcard characters @code{.}, @code{*}, and @code{?} are replaced
 ## with wildcards that are appropriate for a regular expression.
 ## For example:
@@ -36,7 +36,7 @@
 ## @end group
 ## @end example
 ##
-## @item "escape"
+## @item @qcode{"escape"}
 ## The characters @code{$.?[]}, that have special meaning for regular
 ## expressions are escaped so that they are treated literally.  For example:
 ##
--- a/scripts/strings/rindex.m
+++ b/scripts/strings/rindex.m
@@ -32,7 +32,7 @@
 ## @end example
 ##
 ## The @code{rindex} function is equivalent to @code{index} with
-## @var{direction} set to @samp{"last"}.
+## @var{direction} set to @qcode{"last"}.
 ##
 ## @seealso{find, index}
 ## @end deftypefn
--- a/scripts/strings/str2num.m
+++ b/scripts/strings/str2num.m
@@ -42,7 +42,7 @@
 ## in the string @var{s}.  Use @code{str2double} for a safer and faster
 ## conversion.
 ##
-## For cell array of strings use @code{str2double}.  
+## For cell array of strings use @code{str2double}.
 ## @seealso{str2double, eval}
 ## @end deftypefn
 
--- a/scripts/strings/strcat.m
+++ b/scripts/strings/strcat.m
@@ -24,7 +24,7 @@
 ## returns a cell string with the individual cells concatenated.
 ## For numerical input, each element is converted to the
 ## corresponding ASCII character.  Trailing white space for each of
-## the inputs (@var{s1}, @var{S2}, @dots{}) is eliminated before they
+## the inputs (@var{s1}, @var{s2}, @dots{}) is eliminated before they
 ## are concatenated.
 ##
 ## For example:
@@ -118,6 +118,7 @@
 
 endfunction
 
+
 ## test the dimensionality
 ## 1d
 %!assert (strcat ("ab ", "ab "), "abab")
--- a/scripts/strings/strjoin.m
+++ b/scripts/strings/strjoin.m
@@ -58,13 +58,13 @@
 
   if (numel (cstr) == 1)
     rval = cstr{1};
-    return
+    return;
   endif
 
   if (ischar (delimiter))
     delimiter = do_string_escapes (delimiter);
     delimiter = {delimiter};
-  end
+  endif
  
   num = numel (cstr); 
   if (numel (delimiter) == 1 && num > 1)
@@ -85,6 +85,7 @@
 
 endfunction
 
+
 %!assert (strjoin ({"hello"}, "-"), "hello")
 %!assert (strjoin ({"hello", "world"}), "hello world")
 %!assert (strjoin ({"Octave", "Scilab", "Lush", "Yorick"}, "*"),
@@ -94,3 +95,4 @@
 %!assert (strjoin ({'Octave','Scilab'},'\n'), "Octave\nScilab")
 %!assert (strjoin ({'Octave','Scilab'},{'\n'}), "Octave\\nScilab")
 %!assert (strjoin ({},'foo'), "")
+
--- a/scripts/strings/strjust.m
+++ b/scripts/strings/strjust.m
@@ -21,8 +21,8 @@
 ## @deftypefn  {Function File} {} strjust (@var{s})
 ## @deftypefnx {Function File} {} strjust (@var{s}, @var{pos})
 ## Return the text, @var{s}, justified according to @var{pos}, which may
-## be @samp{"left"}, @samp{"center"}, or @samp{"right"}.  If @var{pos}
-## is omitted it defaults to @samp{"right"}.
+## be @qcode{"left"}, @qcode{"center"}, or @qcode{"right"}.  If @var{pos}
+## is omitted it defaults to @qcode{"right"}.
 ##
 ## Null characters are replaced by spaces.  All other character
 ## data are treated as non-white space.
--- a/scripts/strings/strmatch.m
+++ b/scripts/strings/strmatch.m
@@ -23,7 +23,7 @@
 ## @deftypefnx {Function File} {} strmatch (@var{s}, @var{A}, "exact")
 ## Return indices of entries of @var{A} which begin with the string @var{s}.
 ## The second argument @var{A} must be a string, character matrix, or a cell
-## array of strings.  If the third argument @code{"exact"} is not given, then
+## array of strings.  If the third argument @qcode{"exact"} is not given, then
 ## @var{s} only needs to match @var{A} up to the length of @var{s}.
 ## Trailing spaces and nulls in @var{s} and @var{A} are ignored when matching.
 ##
@@ -43,7 +43,7 @@
 ## @end example
 ##
 ## @strong{Caution:} @code{strmatch} is scheduled for deprecation.  Use
-## @code{strncmp} (normal case), or @code{strcmp} ("exact" case), or
+## @code{strncmp} (normal case), or @code{strcmp} (@qcode{"exact"} case), or
 ## @code{regexp} in all new code.
 ## @seealso{strfind, findstr, strcmp, strncmp, strcmpi, strncmpi, find}
 ## @end deftypefn
--- a/scripts/strings/strsplit.m
+++ b/scripts/strings/strsplit.m
@@ -159,7 +159,7 @@
     args.delimitertype = "simple";
   endif
 
-  # Save the length of the "delimitertype" parameter
+  ## Save the length of the "delimitertype" parameter
   length_deltype = numel (args.delimitertype);
 
   if (nargin == 1 || (nargin > 1 && (islogical (del) || isnumeric (del))))
@@ -209,6 +209,7 @@
   endif
 endfunction
 
+
 %!shared str
 %! str = "The rain in Spain stays mainly in the plain.";
 % Split on all whitespace.
--- a/scripts/strings/validatestring.m
+++ b/scripts/strings/validatestring.m
@@ -28,11 +28,12 @@
 ## cellstr of valid values, then @var{validstr} will be the validated form
 ## of @var{str} where validation is defined as @var{str} being a member
 ## or substring of @var{validstr}.  This is useful for both verifying
-## and expanding short options, such as "r", to their longer forms, such as
-## "red".  If @var{str} is a substring of @var{validstr}, and there are
-## multiple matches, the shortest match will be returned if all matches are
-## substrings of each other.  Otherwise, an error will be raised because the
-## expansion of @var{str} is ambiguous.  All comparisons are case insensitive.
+## and expanding short options, such as @qcode{"r"}, to their longer forms,
+## such as @qcode{"red"}.  If @var{str} is a substring of @var{validstr}, and
+## there are multiple matches, the shortest match will be returned if all
+## matches are substrings of each other.  Otherwise, an error will be raised
+## because the expansion of @var{str} is ambiguous.  All comparisons are case
+## insensitive.
 ##
 ## The additional inputs @var{funcname}, @var{varname}, and @var{position}
 ## are optional and will make any generated validation error message more
--- a/scripts/testfun/__have_feature__.m
+++ b/scripts/testfun/__have_feature__.m
@@ -32,3 +32,4 @@
     retval = false;
   endif
 endfunction
+
--- a/scripts/testfun/__printf_assert__.m
+++ b/scripts/testfun/__printf_assert__.m
@@ -25,3 +25,4 @@
   global _assert_printf;
   _assert_printf = cat (2, _assert_printf, sprintf (varargin{:}));
 endfunction
+
--- a/scripts/testfun/__prog_output_assert__.m
+++ b/scripts/testfun/__prog_output_assert__.m
@@ -32,3 +32,4 @@
   endif
   _assert_printf = "";
 endfunction
+
--- a/scripts/testfun/__run_test_suite__.m
+++ b/scripts/testfun/__run_test_suite__.m
@@ -267,3 +267,4 @@
   n_tot = n_with + n_without;
   printf ("\n%d (of %d) %s files have no tests.\n", n_without, n_tot, typ);
 endfunction
+
--- a/scripts/testfun/assert.m
+++ b/scripts/testfun/assert.m
@@ -67,7 +67,7 @@
 
   if (call_depth == 0)
     errmsg = "";
-  end
+  endif
 
   in = deblank (argn(1,:));
   for i = 2:rows (argn)
@@ -367,7 +367,7 @@
         errmsg = [errmsg "\n"];
       endif
       errmsg = [errmsg, pprint(in, err)];
-    end
+    endif
 
   endif
 
@@ -549,21 +549,22 @@
 ## structures
 %!error <Expected struct, but observed double> assert (1, struct ("a", 1))
 %!error <Structure sizes don't match>
-%!  x(1,2,3).a = 1;
-%!  y(1,2).a = 1;
-%!  assert (x,y);
+%! x(1,2,3).a = 1;
+%! y(1,2).a = 1;
+%! assert (x,y);
 %!error <Structure sizes don't match>
-%!  x(1,2,3).a = 1;
-%!  y(3,2,2).a = 1;
-%!  assert (x,y);
+%! x(1,2,3).a = 1;
+%! y(3,2,2).a = 1;
+%! assert (x,y);
 %!error <Structure sizes don't match>
-%!  x.a = 1;  x.b = 1;
-%!  y.a = 1;
-%!  assert (x,y);
+%! x.a = 1;
+%! x.b = 1;
+%! y.a = 1;
+%! assert (x,y);
 %!error <'b' is not an expected field>
-%!  x.b = 1;
-%!  y.a = 1;
-%!  assert (x,y);
+%! x.b = 1;
+%! y.a = 1;
+%! assert (x,y);
 
 %!test
 %! x.a = 1; x.b=[2, 2];
--- a/scripts/testfun/demo.m
+++ b/scripts/testfun/demo.m
@@ -28,9 +28,9 @@
 ## Examples are stored in the script file, or in a file with the same
 ## name but no extension located on Octave's load path.  To keep examples
 ## separate from regular script code, all lines are prefixed by @code{%!}.  Each
-## example must also be introduced by the keyword 'demo' flush left to the
-## prefix with no intervening spaces.  The remainder of the example can
-## contain arbitrary Octave code.  For example:
+## example must also be introduced by the keyword @qcode{"demo"} flush left
+## to the prefix with no intervening spaces.  The remainder of the example
+## can contain arbitrary Octave code.  For example:
 ##
 ## @example
 ## @group
@@ -67,8 +67,8 @@
 ## rather than just anonymous functions or inline functions, you will have to
 ## use @code{eval (example ("function",n))} to see them.  Because eval only
 ## evaluates one line, or one statement if the statement crosses
-## multiple lines, you must wrap your demo in "if 1 <demo stuff> endif"
-## with the 'if' on the same line as 'demo'.  For example:
+## multiple lines, you must wrap your demo in @qcode{"if 1 <demo stuff> endif"}
+## with the @qcode{"if"} on the same line as @qcode{"demo"}.  For example:
 ##
 ## @example
 ## @group
--- a/scripts/testfun/example.m
+++ b/scripts/testfun/example.m
@@ -24,7 +24,7 @@
 ## @deftypefnx {Function File} {[@var{s}, @var{idx}] =} example (@dots{})
 ##
 ## Display the code for example @var{n} associated with the function
-## "@var{name}", but do not run it.  If @var{n} is not specified, all examples
+## @var{name}, but do not run it.  If @var{n} is not specified, all examples
 ## are displayed.
 ##
 ## When called with output arguments, the examples are returned in the form of
--- a/scripts/testfun/test.m
+++ b/scripts/testfun/test.m
@@ -34,14 +34,14 @@
 ## output is selected.
 ##
 ## @table @asis
-## @item "quiet"
+## @item @qcode{"quiet"}
 ##  Don't report all the tests as they happen, just the errors.
 ##
-## @item "normal"
+## @item @qcode{"normal"}
 ## Report all tests as they happen, but don't do tests which require
 ## user interaction.
 ##
-## @item "verbose"
+## @item @qcode{"verbose"}
 ## Do tests which require user interaction.
 ## @end table
 ##
@@ -58,13 +58,14 @@
 ## @var{n} and @var{max}, the number of successful tests and the total number
 ## of tests in the file @var{name} are returned.
 ##
-## If the second argument is the string "grabdemo", the contents of the demo
-## blocks are extracted but not executed.  Code for all code blocks is
-## concatenated and returned as @var{code} with @var{idx} being a vector of
-## positions of the ends of the demo blocks.
+## If the second argument is the string @qcode{"grabdemo"}, the contents of
+## the demo blocks are extracted but not executed.  Code for all code blocks
+## is concatenated and returned as @var{code} with @var{idx} being a vector
+## of positions of the ends of the demo blocks.
 ##
-## If the second argument is "explain", then @var{name} is ignored and an
-## explanation of the line markers used is written to the file @var{fid}.
+## If the second argument is @qcode{"explain"}, then @var{name} is ignored
+## and an explanation of the line markers used is written to the file
+## @var{fid}.
 ## @seealso{assert, fail, error, demo, example}
 ## @end deftypefn
 
@@ -357,7 +358,7 @@
         __name = __block(__name_position(1):__name_position(2));
         __code = __block;
         try
-          eval (__code); ## Define the function
+          eval (__code);  # Define the function
           __clear = sprintf ("%sclear %s;\n", __clear, __name);
         catch
           __success = 0;
@@ -749,9 +750,9 @@
 %! % you should now see a spectrogram in the image window
 
 
-### now test test itself
+## now test 'test' itself
 
-%!## usage and error testing
+## usage and error testing
 % !fail ('test','usage.*test')           # no args, generates usage()
 % !fail ('test (1,2,3,4)','usage.*test') # too many args, generates usage()
 %!fail ('test ("test", "bogus")','unknown flag')  # incorrect args
@@ -769,7 +770,7 @@
 
 %!warning <warning message> warning ('warning message');
 
-%!## test of shared variables
+## test of shared variables
 %!shared a                # create a shared variable
 %!test   a=3;             # assign to a shared variable
 %!test   assert (a,3)     # variable should equal 3
@@ -807,17 +808,17 @@
 %! assert (x,6);
 %! assert (z,9);
 
-%!## test of assert block
+## test of assert block
 %!assert (isempty ([]))      # support for test assert shorthand
 
-%!## demo blocks
+## demo blocks
 %!demo                   # multiline demo block
 %! t = [0:0.01:2*pi]; x = sin (t);
 %! plot (t,x);
 %! % you should now see a sine wave in your figure window
 %!demo a=3               # single line demo blocks work too
 
-%!## this is a comment block. it can contain anything.
+## this is a comment block. it can contain anything.
 %!##
 %! it is the "#" as the block type that makes it a comment
 %! and it stays as a comment even through continuation lines
--- a/scripts/time/addtodate.m
+++ b/scripts/time/addtodate.m
@@ -21,8 +21,9 @@
 ## Add @var{q} amount of time (with units @var{f}) to the serial datenum,
 ## @var{d}.
 ##
-## @var{f} must be one of "year", "month", "day", "hour", "minute", "second",
-## or "millisecond".
+## @var{f} must be one of @qcode{"year"}, @qcode{"month"}, @qcode{"day"},
+## @qcode{"hour"}, @qcode{"minute"}, @qcode{"second"}, or
+## @qcode{"millisecond"}.
 ## @seealso{datenum, datevec, etime}
 ## @end deftypefn
 
--- a/scripts/time/asctime.m
+++ b/scripts/time/asctime.m
@@ -19,7 +19,7 @@
 ## -*- texinfo -*-
 ## @deftypefn {Function File} {} asctime (@var{tm_struct})
 ## Convert a time structure to a string using the following 
-## format: "ddd mmm mm HH:MM:SS yyyy".  For example:
+## format: @qcode{"ddd mmm mm HH:MM:SS yyyy"}.  For example:
 ##
 ## @example
 ## @group
--- a/scripts/time/clock.m
+++ b/scripts/time/clock.m
@@ -54,6 +54,7 @@
 
 endfunction
 
+
 %!test
 %! t1 = clock;
 %! t2 = str2num (strftime ("[%Y, %m, %d, %H, %M, %S]", localtime (time ())));
--- a/scripts/time/datenum.m
+++ b/scripts/time/datenum.m
@@ -203,3 +203,4 @@
 %!error <expected date vector containing> datenum ([1, 2])
 %!error <expected date vector containing> datenum ([1,2,3,4,5,6,7])
 %!error <all inputs must be of class double> datenum (int32 (2000), int32 (1), int32 (1))
+
--- a/scripts/time/datestr.m
+++ b/scripts/time/datestr.m
@@ -37,16 +37,16 @@
 ##
 ## @multitable @columnfractions 0.1 0.45 0.35
 ## @headitem Code @tab Format @tab Example
-## @item  0 @tab dd-mmm-yyyy HH:MM:SS   @tab 07-Sep-2000 15:38:09
-## @item  1 @tab dd-mmm-yyyy            @tab 07-Sep-2000
-## @item  2 @tab mm/dd/yy               @tab 09/07/00
-## @item  3 @tab mmm                    @tab Sep
-## @item  4 @tab m                      @tab S
-## @item  5 @tab mm                     @tab 09
-## @item  6 @tab mm/dd                  @tab 09/07
-## @item  7 @tab dd                     @tab 07
-## @item  8 @tab ddd                    @tab Thu
-## @item  9 @tab d                      @tab T
+## @item 0 @tab dd-mmm-yyyy HH:MM:SS   @tab 07-Sep-2000 15:38:09
+## @item 1 @tab dd-mmm-yyyy            @tab 07-Sep-2000
+## @item 2 @tab mm/dd/yy               @tab 09/07/00
+## @item 3 @tab mmm                    @tab Sep
+## @item 4 @tab m                      @tab S
+## @item 5 @tab mm                     @tab 09
+## @item 6 @tab mm/dd                  @tab 09/07
+## @item 7 @tab dd                     @tab 07
+## @item 8 @tab ddd                    @tab Thu
+## @item 9 @tab d                      @tab T
 ## @item 10 @tab yyyy                   @tab 2000
 ## @item 11 @tab yy                     @tab 00
 ## @item 12 @tab mmmyy                  @tab Sep00
--- a/scripts/time/datetick.m
+++ b/scripts/time/datetick.m
@@ -24,10 +24,10 @@
 ## @deftypefnx {Function File} {} datetick (@dots{}, "keepticks")
 ## @deftypefnx {Function File} {} datetick (@var{hax}, @dots{})
 ## Add date formatted tick labels to an axis.  The axis to apply the
-## ticks to is determined by @var{axis} which can take the values "x",
-## "y", or "z".  The default value is "x".  The formatting of the labels is
-## determined by the variable @var{form}, which can either be a string or
-## positive integer that @code{datestr} accepts.
+## ticks to is determined by @var{axis} which can take the values @qcode{"x"},
+## @qcode{"y"}, or @qcode{"z"}.  The default value is @qcode{"x"}.  The
+## formatting of the labels is determined by the variable @var{form}, which
+## can either be a string or positive integer that @code{datestr} accepts.
 ## @seealso{datenum, datestr}
 ## @end deftypefn
 
@@ -36,7 +36,7 @@
   [hax, varargin, nargin] = __plt_get_axis_arg__ ("datetick", varargin{:});
 
   oldfig = [];
-  if (isempty (hax))
+  if (! isempty (hax))
     oldfig = get (0, "currentfigure");
   endif
   if (isempty (hax))
--- a/scripts/time/weekday.m
+++ b/scripts/time/weekday.m
@@ -24,14 +24,14 @@
 ##
 ## @var{d} is a serial date number or a date string.
 ##
-## If the string @var{format} is not present or is equal to "short" then
+## If the string @var{format} is not present or is equal to @qcode{"short"} then
 ## @var{s} will contain the abbreviated name of the weekday.  If @var{format}
-## is "long" then @var{s} will contain the full name.
+## is @qcode{"long"} then @var{s} will contain the full name.
 ##
 ## Table of return values based on @var{format}:
 ##
 ## @multitable @columnfractions .06 .13 .16
-## @headitem @var{n} @tab "short" @tab "long"
+## @headitem @var{n} @tab @qcode{"short"} @tab @qcode{"long"}
 ## @item 1 @tab Sun @tab Sunday
 ## @item 2 @tab Mon @tab Monday
 ## @item 3 @tab Tue @tab Tuesday
--- a/scripts/ui/errordlg.m
+++ b/scripts/ui/errordlg.m
@@ -24,7 +24,7 @@
 ## The message may have multiple lines separated by newline characters
 ## ("\n"), or it may be a cellstr array with one element for each
 ## line.  The optional input @var{title} (character string) can be used to
-## set the dialog caption.  The default title is "Error Dialog".
+## set the dialog caption.  The default title is @qcode{"Error Dialog"}.
 ##
 ## The return value is always 1.
 ## @seealso{helpdlg, inputdlg, listdlg, msgbox, questdlg, warndlg}
@@ -48,3 +48,4 @@
 %!demo
 %! disp ('- test errordlg with prompt and caption.');
 %! errordlg ('Oops another error','This is a very long and informative caption');
+
--- a/scripts/ui/helpdlg.m
+++ b/scripts/ui/helpdlg.m
@@ -24,7 +24,7 @@
 ## The message may have multiple lines separated by newline characters
 ## ("\n"), or it may be a cellstr array with one element for each
 ## line.  The optional input @var{title} (character string) can be used to
-## set the dialog caption.  The default title is "Help Dialog".
+## set the dialog caption.  The default title is @qcode{"Help Dialog"}.
 ##
 ## The return value is always 1.
 ## @seealso{errordlg, inputdlg, listdlg, msgbox, questdlg, warndlg}
--- a/scripts/ui/inputdlg.m
+++ b/scripts/ui/inputdlg.m
@@ -32,7 +32,8 @@
 ## A cell array with strings labeling each text field.  This input is required. 
 ##
 ## @item title
-## String to use for the caption of the dialog.  The default is "Input Dialog".
+## String to use for the caption of the dialog.  The default is @qcode{"Input
+## Dialog"}.
 ##
 ## @item rowscols
 ## Specifies the size of the text fields and can take three forms:
--- a/scripts/ui/listdlg.m
+++ b/scripts/ui/listdlg.m
@@ -27,37 +27,37 @@
 ## The indices in @var{sel} are 1-based.
 ##
 ## The arguments are specified in form of @var{key}, @var{value} pairs. 
-## The "ListString" argument pair must be specified.
+## The @qcode{"ListString"} argument pair must be specified.
 ##
 ## Valid @var{key} and @var{value} pairs are:
 ##
 ## @table @asis
-## @item "ListString"
+## @item @qcode{"ListString"}
 ## a cell array of strings comprising the content of the list.
 ##
-## @item "SelectionMode"
-## can be either "Single" or "Multiple" (default).
+## @item @qcode{"SelectionMode"}
+## can be either @qcode{"Single"} or @qcode{"Multiple"} (default).
 ##
-## @item "ListSize"
+## @item @qcode{"ListSize"}
 ## a vector with two elements @var{width} and @var{height} defining
 ## the size of the list field in pixels.  Default is [160 300].
 ##
-## @item "InitialValue"
+## @item @qcode{"InitialValue"}
 ## a vector containing 1-based indices of preselected elements.  Default
 ## is 1 (first item).
 ##
-## @item "Name"
+## @item @qcode{"Name"}
 ## a string to be used as the dialog caption.  Default is "".
 ##
-## @item "PromptString"
+## @item @qcode{"PromptString"}
 ## a cell array of strings to be displayed above the list field.  Default
 ## is @{@}.
 ##
-## @item "OKString"
-## a string used to label the OK button.  Default is "OK".
+## @item @qcode{"OKString"}
+## a string used to label the OK button.  Default is @qcode{"OK"}.
 ##
-## @item "CancelString"
-## a string used to label the Cancel button.  Default is "Cancel".
+## @item @qcode{"CancelString"}
+## a string used to label the Cancel button.  Default is @qcode{"Cancel"}.
 ## @end table
 ##
 ## Example:
--- a/scripts/ui/msgbox.m
+++ b/scripts/ui/msgbox.m
@@ -23,13 +23,13 @@
 ## Display @var{msg} using a message dialog box. 
 ##
 ## The message may have multiple lines separated by newline characters
-## (@code{"\n"}), or it may be a cellstr array with one element for each
+## (@qcode{"\n"}), or it may be a cellstr array with one element for each
 ## line.  The optional input @var{title} (character string) can be used to
 ## decorate the dialog caption.
 ##
 ## The optional argument @var{icon} selects a dialog icon. 
-## It can be one of @code{"none"} (default), @code{"error"}, @code{"help"}, or
-## @code{"warn"}.
+## It can be one of @qcode{"none"} (default), @qcode{"error"},
+## @qcode{"help"}, or @qcode{"warn"}.
 ##
 ## The return value is always 1.
 ## @seealso{errordlg, helpdlg, inputdlg, listdlg, questdlg, warndlg}
@@ -45,10 +45,12 @@
 
 endfunction
 
-%!demo
-%!  disp('- test msgbox message only.');
-%!  msgbox("Below, you should see 3 lines:\nline #1\nline #2, and\nline #3.");
 
 %!demo
-%!  disp('- test msgbox message and caption.');
-%!  msgbox('You should see a single line.','A msgbox');
+%! disp('- test msgbox message only.');
+%! msgbox("Below, you should see 3 lines:\nline #1\nline #2, and\nline #3.");
+
+%!demo
+%! disp('- test msgbox message and caption.');
+%! msgbox('You should see a single line.','A msgbox');
+
--- a/scripts/ui/private/message_dialog.m
+++ b/scripts/ui/private/message_dialog.m
@@ -63,3 +63,4 @@
   endif
 
 endfunction
+
--- a/scripts/ui/questdlg.m
+++ b/scripts/ui/questdlg.m
@@ -38,7 +38,8 @@
 ## @var{btn3}.
 ##
 ## If only @var{msg} and @var{title} are specified, three buttons with
-## the default captions "Yes", "No", and "Cancel" are used.
+## the default captions @qcode{"Yes"}, @qcode{"No"}, and @qcode{"Cancel"} are
+## used.
 ##
 ## If only two button captions, @var{btn1} and @var{btn2}, are specified 
 ## the dialog will have only these two buttons.
@@ -81,7 +82,7 @@
       options{4} = varargin{1};  # default
       if (! any (strcmp (options{4}, options(1:3))))
         error (defbtn_error_msg);
-      end
+      endif
 
     case 3
       ## two buttons and default button string
@@ -91,7 +92,7 @@
       options{4} = varargin{3};  # default
       if (! any (strcmp (options{4}, options([1 3]))))
         error (defbtn_error_msg);
-      end
+      endif
 
     case 4
       ## three buttons and default button string
@@ -101,7 +102,7 @@
       options{4} = varargin{4};  # default
       if (! any (strcmp (options{4}, options(1:3))))
         error (defbtn_error_msg);
-      end
+      endif
 
     otherwise
       print_usage ();
--- a/scripts/ui/warndlg.m
+++ b/scripts/ui/warndlg.m
@@ -24,7 +24,7 @@
 ## The message may have multiple lines separated by newline characters
 ## ("\n"), or it may be a cellstr array with one element for each
 ## line.  The optional input @var{title} (character string) can be used to
-## set the dialog caption.  The default title is "Warning Dialog".
+## set the dialog caption.  The default title is @qcode{"Warning Dialog"}.
 ##
 ## @seealso{helpdlg, inputdlg, listdlg, questdlg}
 ## @end deftypefn
--- a/test/args.tst
+++ b/test/args.tst
@@ -123,98 +123,98 @@
 %!  assert (x, 0);
 %!endfunction
 %!test
-%!  f()
+%! f()
 
 ## numeric vector (spaces)
 %!function f (x = [0 1 2])
 %!  assert (x, [0 1 2]);
 %!endfunction
 %!test
-%!  f()
+%! f()
 
 ## numeric vector (range)
 %!function f (x = 1:3)
 %!  assert (x, 1:3);
 %!endfunction
 %!test
-%!  f()
+%! f()
 
 ## numeric vector (commas)
 %!function f (x = [0,1,2])
 %!  assert (x, [0 1 2]);
 %!endfunction
 %!test
-%!  f()
+%! f()
 
 ## numeric vector (commas and spaces)
 %!function f (x = [0, 1, 2])
 %!  assert (x, [0 1 2]);
 %!endfunction
 %!test
-%!  f()
+%! f()
 
 ## numeric matrix
 %!function f (x = [0, 1, 2;3, 4, 5])
 %!  assert (x, [0 1 2;3 4 5]);
 %!endfunction
 %!test
-%!  f()
+%! f()
 
 ## empty cell
 %!function f (x = {})
 %!  assert (x, {});
 %!endfunction
 %!test
-%!  f()
+%! f()
 
 ## full cell
 %!function f (x = {1})
 %!  assert (x, {1});
 %!endfunction
 %!test
-%!  f()
+%! f()
 
 ## many cells
 %!function f (x = {1 'a' "b" 2.0 struct("a", 3)})
 %!  assert (x, {1 'a' "b" 2.0 struct("a", 3)});
 %!endfunction
 %!test
-%!  f()
+%! f()
 
 ## struct
 %!function f (x = struct("a", 3))
 %!  assert (x, struct ("a", 3));
 %!endfunction
 %!test
-%!  f()
+%! f()
 
 ## char (double quotes)
 %!function f (x = "a")
 %!  assert (x, "a");
 %!endfunction
 %!test
-%!  f()
+%! f()
 
 ## char (single quotes)
 %!function f (x = 'a')
 %!  assert (x, "a");
 %!endfunction
 %!test
-%!  f()
+%! f()
 
 ## char (string, double quotes)
 %!function f (x = "abc123")
 %!  assert (x, "abc123");
 %!endfunction
 %!test
-%!  f()
+%! f()
 
 ## char (string, double quotes, punctuation)
 %!function f (x = "abc123`1234567890-=~!@#$%^&*()_+[]{}|;':\",./<>?\\")
 %!  assert (x, "abc123`1234567890-=~!@#$%^&*()_+[]{}|;':\",./<>?\\");
 %!endfunction
 %!test
-%!  f()
+%! f()
 
 ## Function handle (builtin)
 %!function f (x = @sin)
@@ -223,7 +223,7 @@
 %!  assert (isa (x, "function_handle") && strcmp (fname, "sin"));
 %!endfunction
 %!test
-%!  f()
+%! f()
 
 ## Function handle (anonymous)
 %!function f (x = @(x) x.^2)
@@ -232,5 +232,5 @@
 %!  assert (isa (x, "function_handle") && strcmp (ftype, "anonymous"));
 %!endfunction
 %!test
-%!  f()
+%! f()
 
--- a/test/build-sparse-tests.sh
+++ b/test/build-sparse-tests.sh
@@ -325,7 +325,7 @@
 %!test
 %! sv = as.^bf;
 %! fv = af.^bf;
-%! idx = find (af~=0);
+%! idx = find (af!=0);
 %! assert (sv(:)(idx), sparse (fv(:)(idx)), 100*eps)
 
 EOF
@@ -342,7 +342,7 @@
 %!test
 %! sv = as.^bs;
 %! fv = af.^bf;
-%! idx = find (af~=0);
+%! idx = find (af!=0);
 %! assert(sv(:)(idx), sparse (fv(:)(idx)), 100*eps)
 
 EOF
@@ -577,11 +577,11 @@
 %!assert (issparse (as.'))
 %!assert (issparse (as'))
 %!assert (issparse (-as))
-%!assert (~as, sparse (~af))
+%!assert (!as, sparse (!af))
 %!assert (as.', sparse (af.'));
 %!assert (as',  sparse (af'));
 %!assert (-as, sparse (-af));
-%!assert (~as, sparse (~af));
+%!assert (!as, sparse (!af));
 %!error [i,j] = size (af);as(i-1,j+1);
 %!error [i,j] = size (af);as(i+1,j-1);
 %!test
@@ -653,7 +653,7 @@
 %!testif HAVE_UMFPACK   # simple LU + row permutations
 %! [L,U,P] = lu (bs);
 %! assert (P'*L*U, bs, 1e-10);
-%! # triangularity
+%! ## triangularity
 %! [i,j,v] = find (L);
 %! assert (i-j>=0);
 %! [i,j,v] = find (U);
@@ -662,7 +662,7 @@
 %!testif HAVE_UMFPACK   # simple LU + row/col permutations
 %! [L,U,P,Q] = lu (bs);
 %! assert (P'*L*U*Q', bs, 1e-10);
-%! # triangularity
+%! ## triangularity
 %! [i,j,v] = find (L);
 %! assert (i-j>=0);
 %! [i,j,v] = find (U);
@@ -671,7 +671,7 @@
 %!testif HAVE_UMFPACK   # LU with vector permutations
 %! [L,U,P,Q] = lu (bs,'vector');
 %! assert (L(P,:)*U(:,Q), bs, 1e-10);
-%! # triangularity
+%! ## triangularity
 %! [i,j,v] = find (L);
 %! assert (i-j>=0);
 %! [i,j,v] = find (U);
@@ -680,7 +680,7 @@
 %!testif HAVE_UMFPACK   # LU with scaling
 %! [L,U,P,Q,R] = lu (bs);
 %! assert (R*P'*L*U*Q', bs, 1e-10);
-%! # triangularity
+%! ## triangularity
 %! [i,j,v] = find (L);
 %! assert (i-j>=0);
 %! [i,j,v] = find (U);
@@ -757,7 +757,7 @@
 %!testif HAVE_UMFPACK   # simple LU + row permutations
 %! [L,U,P] = lu (bs);
 %! assert (P'*L*U, bs, 1e-10);
-%! # triangularity
+%! ## triangularity
 %! [i,j,v] = find (L);
 %! assert (i-j>=0);
 %! [i,j,v] = find (U);
@@ -766,7 +766,7 @@
 %!testif HAVE_UMFPACK   # simple LU + row/col permutations
 %! [L,U,P,Q] = lu (bs);
 %! assert (P'*L*U*Q', bs, 1e-10);
-%! # triangularity
+%! ## triangularity
 %! [i,j,v] = find (L);
 %! assert (i-j>=0);
 %! [i,j,v] = find (U);
@@ -775,7 +775,7 @@
 %!testif HAVE_UMFPACK   # LU with vector permutations
 %! [L,U,P,Q] = lu (bs,'vector');
 %! assert (L (P,:)*U (:,Q), bs, 1e-10);
-%! # triangularity
+%! ## triangularity
 %! [i,j,v] = find (L);
 %! assert (i-j>=0);
 %! [i,j,v] = find (U);
@@ -784,7 +784,7 @@
 %!testif HAVE_UMFPACK   # LU with scaling
 %! [L,U,P,Q,R] = lu (bs);
 %! assert (R*P'*L*U*Q', bs, 1e-10);
-%! # triangularity
+%! ## triangularity
 %! [i,j,v] = find (L);
 %! assert (i-j>=0);
 %! [i,j,v] = find (U);
@@ -1204,7 +1204,7 @@
 gen_section
 gen_save_tests
 gen_section
-echo '%!test bf = bf+1i*(bf~=0);' >> $TESTS
+echo '%!test bf = bf+1i*(bf!=0);' >> $TESTS
 gen_rectangular_tests
 gen_section
 
@@ -1242,7 +1242,7 @@
 echo '%! as = sparse (af);' >> $TESTS
 gen_square_tests
 gen_section
-echo '%!test bf = bf+1i*(bf~=0);' >> $TESTS
+echo '%!test bf = bf+1i*(bf!=0);' >> $TESTS
 echo '%! bs = sparse (bf);' >> $TESTS
 gen_square_tests
 gen_section
--- a/test/classes/@Snork/end.m
+++ b/test/classes/@Snork/end.m
@@ -1,6 +1,6 @@
 function r = end (snk, index_pos, num_indices)
 
-  if (num_indices ~= 1)
+  if (num_indices != 1)
     error ('Snork object may only have one index')
   end
 
--- a/test/classes/@Snork/mpower.m
+++ b/test/classes/@Snork/mpower.m
@@ -1,6 +1,6 @@
 function s = mpower (s1, x)
 
-  if (~isa (s1, 'Snork') || isa (x, 'Snork'))
+  if (!isa (s1, 'Snork') || isa (x, 'Snork'))
     error ('mpower Snork!!!');
   end
 
--- a/test/classes/@Snork/ne.m
+++ b/test/classes/@Snork/ne.m
@@ -1,5 +1,5 @@
 function b = ne (s1, s2)
 
-  b = ~(s1 == s2);
+  b = !(s1 == s2);
 
 end
--- a/test/classes/@Snork/power.m
+++ b/test/classes/@Snork/power.m
@@ -1,6 +1,6 @@
 function s = power (s1, x)
 
-  if (~isa (s1, 'Snork') || isa (x, 'Snork'))
+  if (!isa (s1, 'Snork') || isa (x, 'Snork'))
     error ('power Snork!!!');
   end
 
--- a/test/classes/@Snork/subsasgn.m
+++ b/test/classes/@Snork/subsasgn.m
@@ -6,7 +6,7 @@
   switch (s(1).type)
     case '()'
       ind = s(1).subs;
-      if (numel (ind) ~= 1)
+      if (numel (ind) != 1)
         error ('Snork: need exactly one index');
       else
         if (length (s) == 1)
@@ -17,7 +17,7 @@
       end
     case '{}'
       ind = s(1).subs;
-      if (numel (ind) ~= 1)
+      if (numel (ind) != 1)
         error ('Snork: need exactly one index');
       else
         if (length (s) == 1)
--- a/test/classes/@Snork/subsref.m
+++ b/test/classes/@Snork/subsref.m
@@ -6,14 +6,14 @@
   switch (s(1).type)
     case '()'
       ind = s(1).subs;
-      if (numel (ind) ~= 1)
+      if (numel (ind) != 1)
         error ('Snork: need exactly one index');
       else
         b = snk.cack(ind{1});
       end
     case '{}'
       ind = s(1).subs;
-      if (numel (ind) ~= 1)
+      if (numel (ind) != 1)
         error ('Snork: need exactly one index');
       else
         b = snk.cack(ind{1});
--- a/test/classes/@Spork/loadobj.m
+++ b/test/classes/@Spork/loadobj.m
@@ -1,7 +1,7 @@
 function out = loadobj (in)
 
   out = in;
-  if (~isa (in, 'Spork'))
+  if (!isa (in, 'Spork'))
     out.cack = [];
   end
 
--- a/test/classes/classes.tst
+++ b/test/classes/classes.tst
@@ -59,9 +59,9 @@
 %! assert (isobject (snk));
 %! assert (isequal (class (snk), 'Snork'));
 %! assert (isa (snk, 'Snork'));
-%! assert (~isa (snk, 'Sneetch'));
+%! assert (!isa (snk, 'Sneetch'));
 %! assert (ismethod (snk, 'gick'));
-%! assert (~ismethod (snk, 'bletch'));
+%! assert (!ismethod (snk, 'bletch'));
 %! assert (exist ('snk') == 1);
 %! assert (exist ('blink') == 0);
 %!test snk1 = Snork (snk);
@@ -272,17 +272,17 @@
 %!assert (s1 == s1)
 %!assert (s1 == x1)
 %!assert (x1 == s1)
-%!assert (~(s1 == (s1 + 1)))
-%!assert (~(s1 == (x1 + 1)))
-%!assert (~(x1 == (s1 + 1)))
+%!assert (!(s1 == (s1 + 1)))
+%!assert (!(s1 == (x1 + 1)))
+%!assert (!(x1 == (s1 + 1)))
 
-%% Test overloaded ne (~=) for the Snork class
-%!assert (~(s1 ~= s1))
-%!assert (~(s1 ~= x1))
-%!assert (~(x1 ~= s1))
-%!assert (s1 ~= (s1 + 1))
-%!assert (x1 ~= (s1 + 1))
-%!assert (s1 ~= (x1 + 1))
+%% Test overloaded ne (!=) for the Snork class
+%!assert (!(s1 != s1))
+%!assert (!(s1 != x1))
+%!assert (!(x1 != s1))
+%!assert (s1 != (s1 + 1))
+%!assert (x1 != (s1 + 1))
+%!assert (s1 != (x1 + 1))
 
 %% Test overloaded lt (<) for the Snork class
 %!assert (s1 < (s1 + 1))
--- a/test/for.tst
+++ b/test/for.tst
@@ -19,7 +19,7 @@
 %!test
 %! for i = 1
 %!   __printf_assert__ ("%d", i);
-%! end
+%! end  # "end" is part of test, check not using "endfor"
 %! __printf_assert__ ("\n");
 %! assert (__prog_output_assert__ ("1"));
 
@@ -101,10 +101,25 @@
 %!   assert (i, {1 + 2*j; 2 + 2*j++})
 %! endfor
 
-%% test parsing of single-quoted character string appearing at the
-%% beginning of a for loop
+## test parsing of single-quoted character string appearing at the
+## beginning of a for loop
 %!test
 %! for i = 1:5
 %!   'foo';
 %! endfor
 %! assert (i, 5);
+
+%!test
+%! parfor i = 1
+%!   __printf_assert__ ("%d", i);
+%! end  # "end" is part of test, check not using "endparfor"
+%! __printf_assert__ ("\n");
+%! assert (__prog_output_assert__ ("1"));
+
+%!test
+%! parfor i = 1:4
+%!   __printf_assert__ ("%d", i);
+%! endparfor
+%! __printf_assert__ ("\n");
+%! assert (__prog_output_assert__ ("1234"));
+
--- a/test/global.tst
+++ b/test/global.tst
@@ -39,8 +39,8 @@
 %!  global H = 1;
 %!endfunction
 %!test
-%!  f;
-%!  fail ("H");
+%! f;
+%! fail ("H");
 
 %!function f ()
 %!  global H = 1;
--- a/test/if.tst
+++ b/test/if.tst
@@ -21,7 +21,7 @@
 %! if (i == 0)
 %!   i++;
 %!   __printf_assert__ ("%d\n", i);
-%! endif
+%! end  # "end" is part of test, check not using "endif"
 %! assert (__prog_output_assert__ ("1"));
 
 %!test
@@ -29,7 +29,7 @@
 %!   __printf_assert__ ("fail\n");
 %! else
 %!   __printf_assert__ ("pass\n");
-%! end
+%! endif
 %! assert (__prog_output_assert__ ("pass"));
 
 %!test
@@ -50,7 +50,7 @@
 %!   __printf_assert__ ("fail\n");
 %! elseif (y)
 %!   __printf_assert__ ("pass\n");
-%! end
+%! endif
 %! assert (__prog_output_assert__ ("pass"));
 
 %!test
@@ -76,11 +76,11 @@
 %!   __printf_assert__ ("fail\n");
 %! elseif (x)
 %!   __printf_assert__ ("fail\n");
-%! end
+%! endif
 %! assert (__prog_output_assert__ ("pass"));
 
-%% test parsing of single-quoted character string appearing at the
-%% beginning of an if condition
+## test parsing of single-quoted character string appearing at the
+## beginning of an if condition
 %!test
 %! if (1)
 %!   'foo';
@@ -88,8 +88,8 @@
 %! endif
 %! assert (x, 13);
 
-%% test parsing of single-quoted character string appearing at the
-%% beginning of an if condition
+## test parsing of single-quoted character string appearing at the
+## beginning of an if condition
 %!test
 %! if (0)
 %!   x = 42;
@@ -98,3 +98,4 @@
 %!   x = 13;
 %! endif
 %! assert (x, 13);
+
--- a/test/index.tst
+++ b/test/index.tst
@@ -134,7 +134,7 @@
 %!assert (b([],3), zeros (0,1))
 
 %!shared x
-%! # Dummy shared block to clear any previous definitions
+%! ## Dummy shared block to clear any previous definitions
 %! x = 1;
 
 %!test
--- a/test/io.tst
+++ b/test/io.tst
@@ -178,7 +178,7 @@
 %!  ret = 1;
 %!endfunction
 
-%!test
+%!testif HAVE_ZLIB
 %!
 %! [save_status, save_files] = testls (0);
 %! [load_status, load_files] = testls (1);
@@ -222,7 +222,7 @@
 %! matrix1 = rand (100, 2);
 %! save -ascii matrix.ascii matrix1
 %! matrix2 = load ("matrix.ascii");
-%! assert (matrix1, matrix2, 1e-9)
+%! assert (matrix1, matrix2, 1e-9);
 %!
 %! delete matrix.ascii;
 
@@ -237,7 +237,6 @@
 %!assert (puts (1),-1)
 
 %!error <Invalid call to puts> puts ()
-
 %!error <Invalid call to puts> puts (1, 2)
 
 %!assert (sscanf ('123456', '%10c'), '123456')
@@ -245,11 +244,11 @@
 
 %!assert (sscanf (['ab'; 'cd'], '%s'), 'acbd')
 
-%!assert (sscanf ('02:08:30', '%i:%i:%i'), [2; 0]);
-%!assert (sscanf ('02:08:30', '%d:%d:%d'), [2; 8; 30]);
+%!assert (sscanf ('02:08:30', '%i:%i:%i'), [2; 0])
+%!assert (sscanf ('02:08:30', '%d:%d:%d'), [2; 8; 30])
 
-%!assert (sscanf ('0177 08', '%i'), [127; 0; 8]);
-%!assert (sscanf ('0177 08', '%d'), [177; 8]);
+%!assert (sscanf ('0177 08', '%i'), [127; 0; 8])
+%!assert (sscanf ('0177 08', '%d'), [177; 8])
 
 %!test
 %! [val, count, msg, pos] = sscanf ("3I2", "%f");
@@ -282,9 +281,7 @@
 %! && v2 == [1; 2] && c2 == 2 && ischar (m2)));
 
 %!error <Invalid call to sscanf> sscanf ()
-
 %!error sscanf (1, 2)
-
 %!error <Invalid call to sscanf> sscanf ("foo", "bar", "C", 1)
 
 %!test
@@ -305,21 +302,25 @@
 %! assert (str, "test:1");
 
 %!error printf (1)
-
 %!error <Invalid call to printf> printf ()
 
 %!test
 %! [s, msg, status] = sprintf ("%s: %d\n", "test", 1);
-%!
 %! assert (s == "test: 1\n" && ischar (msg) && status == 8);
 
-%!error sprintf (1)
+%!assert (sprintf ("%-+6.2f", Inf), "+Inf  ")
+%!assert (sprintf ("%-6.2f", Inf), "Inf   ")
+%!assert (sprintf ("%-+6.2f", nan), "+NaN  ")  # lowercase nan is part of test
+%!assert (sprintf ("%-6.2f", nan), "NaN   ")
+%!assert (sprintf ("%-+6.2f", NA), "+NA   ")
+%!assert (sprintf ("%-6.2f", NA), "NA    ")
 
 %!error <Invalid call to sprintf> sprintf ()
+%!error <format TEMPLATE must be a string> sprintf (1)
 
 %!test
 %! arch_list = {"native"; "ieee-le"; "ieee-be"; "vaxd"; "vaxg"; "cray"};
-%! warning ("off", "Octave:fopen-mode")
+%! warning ("off", "Octave:fopen-mode");
 %! status = 1;
 %!
 %! for i = 1:6
@@ -386,17 +387,14 @@
 %! assert (__prog_output_assert__ ("error:"));
 
 %!error <Invalid call to fopen> fopen ()
-
 %!error <Invalid call to fopen> fopen ("foo", "wb", "native", 1)
 
 %!error fclose (0)
-
 %!error <Invalid call to fclose> fclose (1, 2)
 
 %!assert (ischar (tmpnam ()))
 
 %!warning tmpnam (1);
-
 %!warning tmpnam ("foo", 1);
 
 %!error <Invalid call to tmpnam> tmpnam (1, 2, 3)
@@ -472,81 +470,60 @@
 %! endif
 %! unlink (nm);
 
-%!error <Invalid call to fputs> fputs ()
-
-%!error <Invalid call to fputs> fputs (1, "foo", 1)
-
 %!assert (fputs (1, 1),-1)
 
-%!error <Invalid call to fgetl> fgetl ()
-
-%!error <Invalid call to fgetl> fgetl (1, 2, 3)
+%!error <Invalid call to fputs> fputs ()
+%!error <Invalid call to fputs> fputs (1, "foo", 1)
 
 %!error fgetl ("foo", 1)
 
-%!error <Invalid call to fgets> fgets ()
-
-%!error <Invalid call to fgets> fgets (1, 2, 3)
+%!error <Invalid call to fgetl> fgetl ()
+%!error <Invalid call to fgetl> fgetl (1, 2, 3)
 
 %!error fgets ("foo", 1)
 
-%!error <Invalid call to fprintf> fprintf ()
-
-%!error <Invalid call to fprintf> fprintf (1)
+%!error <Invalid call to fgets> fgets ()
+%!error <Invalid call to fgets> fgets (1, 2, 3)
 
 %!test
 %! s.a = 1;
 %! fail ("fprintf (s)", "Invalid call to fprintf");
 
+%!error <Invalid call to fprintf> fprintf ()
+%!error <Invalid call to fprintf> fprintf (1)
 %!error fprintf (1, 1)
-
 %!error fprintf (-1, "foo")
 
-%!error <Invalid call to fscanf> fscanf ()
-
-%!error <Invalid call to fscanf> fscanf (1)
-
 %!error fscanf ("foo", "bar")
 
-%!error <Invalid call to fread> fread ()
+%!error <Invalid call to fscanf> fscanf ()
+%!error <Invalid call to fscanf> fscanf (1)
 
+%!error <Invalid call to fread> fread ()
 %!error <Invalid call to fread> fread (1, 2, "char", 1, "native", 2)
-
 %!error fread ("foo")
 
 %!error <Invalid call to fwrite> fwrite ()
-
 %!error <Invalid call to fwrite> fwrite (1, rand (10), "char", 1, "native", 2)
-
 %!error fwrite ("foo", 1)
 
 %!error <Invalid call to feof> feof ()
-
 %!error <Invalid call to feof> feof (1, 2)
-
 %!error feof ("foo")
 
 %!error <Invalid call to ferror> ferror ()
-
 %!error <Invalid call to ferror> ferror (1, 'clear', 2)
-
 %!error ferror ("foo")
 
 %!error <Invalid call to ftell> ftell ()
-
 %!error <Invalid call to ftell> ftell (1, 2)
-
 %!error ftell ("foo")
 
 %!error <Invalid call to fseek> fseek ()
-
 %!error <Invalid call to fseek> fseek (1, 0, SEEK_SET, 1)
-
 %!error fseek ("foo", 0, SEEK_SET)
 
 %!error <Invalid call to frewind> frewind ()
-
 %!error <Invalid call to frewind> frewind (1, 2)
-
 %!error frewind ("foo")
 
--- a/test/jit.tst
+++ b/test/jit.tst
@@ -41,9 +41,9 @@
 %! while (1)
 %!   if (1)
 %!     break;
-%!  else
-%!    break;
-%!  endif
+%!   else
+%!     break;
+%!   endif
 %! endwhile
 
 %!testif HAVE_LLVM
@@ -54,6 +54,15 @@
 %! endfor
 %! assert (i, 100);
 
+## Also test parfor keyword
+%!testif HAVE_LLVM
+%! parfor i=1:1e6
+%!   if (i == 100)
+%!     break;
+%!   endif
+%! endparfor
+%! assert (i, 100);
+
 %!testif HAVE_LLVM
 %! inc = 1e-5;
 %! result = 0;
@@ -130,7 +139,7 @@
 %!     endif
 %!   endfor
 %! catch
-%! end
+%! end_try_catch
 %! assert (result == 500);
 
 %!function result = gen_test (n)
--- a/test/nest/varg_nest2.m
+++ b/test/nest/varg_nest2.m
@@ -6,7 +6,7 @@
     x = a;
   endif
 
-  function a, b = f
+  function [a, b] = f
     if nargout == 2
       a = b = 5;
     endif
--- a/test/parser.tst
+++ b/test/parser.tst
@@ -35,217 +35,229 @@
 ## Level 13 (parentheses and indexing)
 ## Overrides all other levels
 %!test
-%!  a.b = 1;
-%!  assert (a. b++, 1)
-%!  assert (a.b, 2)
-%!  clear a;
-%!  a.b = [0 1];
-%!  b = 2;
-%!  assert (a.b', [0;1])
-%!  assert (!a .b, logical ([1 0]))
-%!  assert (3*a .b, [0 3])
-%!  assert (a. b-1, [-1 0])
-%!  assert (a. b:3, 0:3)
-%!  assert (a. b>0.5, logical ([0 1]))
-%!  assert (a. b&0, logical ([0 0]))
-%!  assert (a. b|0, logical ([0 1]))
-%!  a.b = [1 2];
-%!  assert (a. b&&0, false)
-%!  assert (a. b||0, true)
-%!  a.b += a. b*2;
-%!  assert (a.b, [3 6])
+%! a.b = 1;
+%! assert (a. b++, 1);
+%! assert (a.b, 2);
+%! clear a;
+%! a.b = [0 1];
+%! b = 2;
+%! assert (a.b', [0;1]);
+%! assert (!a .b, logical ([1 0]));
+%! assert (3*a .b, [0 3]);
+%! assert (a. b-1, [-1 0]);
+%! assert (a. b:3, 0:3);
+%! assert (a. b>0.5, logical ([0 1]));
+%! assert (a. b&0, logical ([0 0]));
+%! assert (a. b|0, logical ([0 1]));
+%! a.b = [1 2];
+%! assert (a. b&&0, false);
+%! assert (a. b||0, true);
+%! a.b += a. b*2;
+%! assert (a.b, [3 6]);
 ## Level 12 (postfix increment and decrement)
 %!test
-%!  a = [3 5];
-%!  assert (2.^a ++, [8 32])
-%!  assert (a, [4 6])
-%!  assert (a--', [4; 6])
-%!  assert (a, [3 5])
-%!  a = 0;
-%!  assert (!a --, true)
-%!  assert (-a ++, 1)
-%!  assert (3*a ++, 0)
-%!  assert (a++-2, -1)
-%!  assert (1:a ++, 1:2)
-%!  assert (4>a++, true)
-%!  a = [0 -1];
-%!  assert ([1 1] & a++, logical ([0 1]))
-%!  assert ([0 0] | a++, logical ([1 0]))
-%!  a = 0;
-%!  assert (1 && a ++, false)
-%!  assert (0 || a --, true)
-%!  a = 5; b = 2;
-%!  b +=a ++;
-%!  assert (b, 7)
+%! a = [3 5];
+%! assert (2.^a ++, [8 32]);
+%! assert (a, [4 6]);
+%! assert (a--', [4; 6]);
+%! assert (a, [3 5]);
+%! a = 0;
+%! assert (!a --, true);
+%! assert (-a ++, 1);
+%! assert (3*a ++, 0);
+%! assert (a++-2, -1);
+%! assert (1:a ++, 1:2);
+%! assert (4>a++, true);
+%! a = [0 -1];
+%! assert ([1 1] & a++, logical ([0 1]));
+%! assert ([0 0] | a++, logical ([1 0]));
+%! a = 0;
+%! assert (1 && a ++, false);
+%! assert (0 || a --, true);
+%! a = 5; b = 2;
+%! b +=a ++;
+%! assert (b, 7);
 
 ## Level 11 (transpose and exponentiation)
 %!test
-%!  assert (-2 ^2, -4)
-%!  assert (!0 ^0, false)
-%!  assert (2*3 ^2, 18)
-%!  assert (2+3 ^2, 11)
-%!  assert ([1:10](1:2 ^2), [1 2 3 4])
-%!  assert (3>2 ^2, false)
-%!  assert (1&0 ^0, true)
-%!  assert (0|0 ^0, true)
-%!  assert (1&&0 ^0, true)
-%!  assert (0||0 ^0, true)
-%!  a = 3;
-%!  a *= 0 ^0;
-%!  assert (a, 3)
+%! assert (-2 ^2, -4);
+%! assert (!0 ^0, false);
+%! assert (2*3 ^2, 18);
+%! assert (2+3 ^2, 11);
+%! assert ([1:10](1:2 ^2), [1 2 3 4]);
+%! assert (3>2 ^2, false);
+%! assert (1&0 ^0, true);
+%! assert (0|0 ^0, true);
+%! assert (1&&0 ^0, true);
+%! assert (0||0 ^0, true);
+%! a = 3;
+%! a *= 0 ^0;
+%! assert (a, 3);
 ## Level 10 (unary plus/minus, prefix increment/decrement, not)
 %!test
-%!  a = 2;
-%!  assert (++ a*3, 9)
-%!  assert (-- a-2, 0)
-%!  assert (a, 2)
-%!  assert (! a-2, -2)
-%!  assert ([1:10](++ a:5), 3:5)
-%!  a = [1 0];
-%!  assert (! a>=[1 0], [false true])
-%!  a = 0;
-%!  assert (++ a&1, true)
-%!  assert (-- a|0, false)
-%!  assert (-- a&&1, true)
-%!  assert (++ a||0, false)
-%!  a = 3;
-%!  a *= ++a;
-%!  assert (a, 16)
+%! a = 2;
+%! assert (++ a*3, 9);
+%! assert (-- a-2, 0);
+%! assert (a, 2);
+%! assert (! a-2, -2);
+%! assert ([1:10](++ a:5), 3:5);
+%! a = [1 0];
+%! assert (! a>=[1 0], [false true]);
+%! a = 0;
+%! assert (++ a&1, true);
+%! assert (-- a|0, false);
+%! assert (-- a&&1, true);
+%! assert (++ a||0, false);
+%! a = 3;
+%! a *= ++a;
+%! assert (a, 16);
 ## Level 9 (multiply, divide)
 %!test
-%!  assert (3+4 * 5, 23)
-%!  assert (5 * 1:6, [5 6])
-%!  assert (3>1 * 5, false)
-%!  assert (1&1 * 0, false)
-%!  assert (1|1 * 0, true)
-%!  assert (1&&1 * 0, false)
-%!  assert (1||1 * 0, true)
-%!  a = 3;
-%!  a /= a * 2;
-%!  assert (a, 0.5)
+%! assert (3+4 * 5, 23);
+%! assert (5 * 1:6, [5 6]);
+%! assert (3>1 * 5, false);
+%! assert (1&1 * 0, false);
+%! assert (1|1 * 0, true);
+%! assert (1&&1 * 0, false);
+%! assert (1||1 * 0, true);
+%! a = 3;
+%! a /= a * 2;
+%! assert (a, 0.5);
 ## Level 8 (add, subtract)
 %!test
-%!  assert ([2 + 1:6], 3:6)
-%!  assert (3>1 + 5, false)
-%!  assert (1&1 - 1, false)
-%!  assert (0|1 - 2, true)
-%!  assert (1&&1 - 1, false)
-%!  assert (0||1 - 2, true)
-%!  a = 3;
-%!  a *= 1 + 1;
-%!  assert (a, 6)
+%! assert ([2 + 1:6], 3:6);
+%! assert (3>1 + 5, false);
+%! assert (1&1 - 1, false);
+%! assert (0|1 - 2, true);
+%! assert (1&&1 - 1, false);
+%! assert (0||1 - 2, true);
+%! a = 3;
+%! a *= 1 + 1;
+%! assert (a, 6);
 ## Level 7 (colon)
 %!test
-%!  assert (5:-1: 3>4, [true false false])
-%!  assert (1: 3&1, [true true true])
-%!  assert (1: 3|0, [true true true])
-%!  assert (-1: 3&&1, false)
-%!  assert (-1: 3||0, false)
-%!  a = [1:3];
-%!  a += 3 : 5;
-%!  assert (a, [4 6 8])
+%! assert (5:-1: 3>4, [true false false]);
+%! assert (1: 3&1, [true true true]);
+%! assert (1: 3|0, [true true true]);
+%! assert (-1: 3&&1, false);
+%! assert (-1: 3||0, false);
+%! a = [1:3];
+%! a += 3 : 5;
+%! assert (a, [4 6 8]);
 ## Level 6 (relational)
 %!test
-%!  assert (0 == -1&0, false)
-%!  assert (1 == -1|0, false)
-%!  assert (0 == -1&&0, false)
-%!  assert (1 == -1||0, false)
-%!  a = 2;
-%!  a *= 3 > 1;
-%!  assert (a, 2)
+%! assert (0 == -1&0, false);
+%! assert (1 == -1|0, false);
+%! assert (0 == -1&&0, false);
+%! assert (1 == -1||0, false);
+%! a = 2;
+%! a *= 3 > 1;
+%! assert (a, 2);
 ## Level 5 (element-wise and)
 %!test
-%!  assert (0 & 1|1, true)
-%!  assert ([0 1] & 1&&1, false)
-%!  assert (0 & 1||1, true)
-%!  a = 2;
-%!  a *= 3 & 1;
-%!  assert (a, 2)
+%! assert (0 & 1|1, true);
+%! assert ([0 1] & 1&&1, false);
+%! assert (0 & 1||1, true);
+%! a = 2;
+%! a *= 3 & 1;
+%! assert (a, 2);
 ## Level 4 (element-wise or)
 %!test
-%!  assert ([0 1] | 1&&0, false)
-%!  assert ([0 1] | 1||0, true)
-%!  a = 2;
-%!  a *= 0 | 1;
-%!  assert (a, 2)
+%! assert ([0 1] | 1&&0, false);
+%! assert ([0 1] | 1||0, true);
+%! a = 2;
+%! a *= 0 | 1;
+%! assert (a, 2);
 ## Level 3 (logical and)
 %!test
-%!  assert (0 && 1||1, true)
-%!  a = 2;
-%!  a *= 3 && 1;
-%!  assert (a, 2)
+%! assert (0 && 1||1, true);
+%! a = 2;
+%! a *= 3 && 1;
+%! assert (a, 2);
 ## Level 2 (logical or)
 %!test
-%!  a = 2;
-%!  a *= 0 || 1;
-%!  assert (a, 2)
+%! a = 2;
+%! a *= 0 || 1;
+%! assert (a, 2);
 
 ## Tests for operator precedence within each level where ordering should
 ## be left to right except for postfix and assignment operators.
 
 ## Level 13 (parentheses and indexing)
 %!test
-%!  a.b1 = 2;
-%!  assert (a.(strcat('b','1'))++, 2)
-%!  assert (a.b1, 3)
-%!  b = {1 2 3 4 5};
-%!  assert (b{(a. b1 + 1)}, 4)
-%!  b = 1:5;
-%!  assert (b(a. b1 + 1), 4)
-%!  assert ([2 3].^2', [4; 9])
+%! a.b1 = 2;
+%! assert (a.(strcat('b','1'))++, 2);
+%! assert (a.b1, 3);
+%! b = {1 2 3 4 5};
+%! assert (b{(a. b1 + 1)}, 4);
+%! b = 1:5;
+%! assert (b(a. b1 + 1), 4);
+%! assert ([2 3].^2', [4; 9]);
 ## Level 12 (postfix increment and decrement)
 ## No tests possible since a++-- is not valid
 ## Level 11 (transpose and exponentiation)
-## Note: Exponentiation works left to right for compatibility with Matlab.
-%!  assert (2^3**2, 64)
-%!  assert ([2 3].^2.', [4;9])
-%!  assert ([2 3].'.^2, [4;9])
-%!  assert (3*4i'.', 0 - 12i)
-%!  assert (3*4i.'.', 0 + 12i)
+## Note: Exponentiation should be left-to-right, but Octave does right-to-left.
+##       See bug #33304.
+%!test
+%! assert (2^3**2, 64);
+%! assert ([2 3].^2.', [4;9]);
+%! assert ([2 3].'.^2, [4;9]);
+%! assert (3*4i'.', 0 - 12i);
+%! assert (3*4i.'.', 0 + 12i);
+%! assert (2^-4^3, (1/16)^3);
+%! assert (2^+4^3, 16^3);
+%! assert (2^~0^2, 4);
+
+## Note: Exponentiation should be left-to-right, but Octave does right-to-left.
+##       See bug #33304.
+
 ## Level 10 (unary plus/minus, prefix increment/decrement, not)
 %!test
-%!  assert (+-+1, -1)
-%!  a = -1;
-%!  assert (!++a, true)
-%!  assert (a, 0)
-%!  assert (-~a, -1)
-%!  assert (!~--a, true)
-%!  assert (a, -1)
+%! assert (+-+1, -1);
+%! a = -1;
+%! assert (!++a, true);
+%! assert (a, 0);
+%! assert (-~a, -1);
+%! assert (!~--a, true);
+%! assert (a, -1);
 ## Level 9 (multiply, divide)
 %!test
-%!  assert (3 * 4 / 5, 2.4)
-%!  assert (3 ./ 4 .* 5, 3.75)
-%!  assert (2 * 4 \ 6, 0.75)
-%!  assert (2 .\ 4 .* 6, 12)
+%! assert (3 * 4 / 5, 2.4);
+%! assert (3 ./ 4 .* 5, 3.75);
+%! assert (2 * 4 \ 6, 0.75);
+%! assert (2 .\ 4 .* 6, 12);
 ## Level 8 (add, subtract)
 %!test
-%!  assert (-3 - 4 + 1 + 3 * 2, 0)
+%! assert (-3 - 4 + 1 + 3 * 2, 0);
 ## Level 7 (colon)
-## No tests possible because colon operator can't be combined with second colon operator
+## No tests possible because colon operator can't be combined
+## with second colon operator.
 ## Level 6 (relational)
 %!test
-%!  assert (0 < 1 <= 0.5 == 0 >= 0.5 > 0, true)
-%!  assert (1 < 1 == 0 != 0, true)
-%!  assert (1 < 1 == 0 ~= 0, true)
+%! assert (0 < 1 <= 0.5 == 0 >= 0.5 > 0, true);
+%! assert (1 < 1 == 0 != 0, true);
+%! assert (1 < 1 == 0 ~= 0, true);
 ## Level 5 (element-wise and)
-## No tests possible.  Only one operator (&) at this precedence level and operation is associative.
+## No tests possible.  Only one operator (&) at this precedence level
+## and operation is associative.
 ## Level 4 (element-wise or)
-## No tests possible.  Only one operator (|) at this precedence level and operation is associative.
+## No tests possible.  Only one operator (|) at this precedence level
+## and operation is associative.
 ## Level 3 (logical and)
 %!test
-%!  a = 1;
-%!  assert (1 && 0 && ++a, false)
-%!  assert (a, 1)
+%! a = 1;
+%! assert (1 && 0 && ++a, false);
+%! assert (a, 1);
 ## Level 2 (logical or)
 %!test
-%!  a = 1;
-%!  assert (0 || 1 || ++a, true)
-%!  assert (a, 1)
+%! a = 1;
+%! assert (0 || 1 || ++a, true);
+%! assert (a, 1);
 ## Level 1 (assignment)
 %!test
 %! a = 2; b = 5; c = 7;
-%! assert (a += b *= c += 1, 42)
-%! assert (b == 40 && c == 8)
+%! assert (a += b *= c += 1, 42);
+%! assert (b == 40 && c == 8);
 
 ## Test creation of anonymous functions
 
--- a/test/switch.tst
+++ b/test/switch.tst
@@ -21,7 +21,8 @@
 %! b = 2;
 %! c = 3;
 %!
-%! switch (0) case 1 x = a; case 2 x = b; otherwise x = c; endswitch
+%! ## "end" is part of test, check not using "endswitch"
+%! switch (0) case 1 x = a; case 2 x = b; otherwise x = c; end
 %! switch (1) case 1 y = a; case 2 y = b; otherwise y = c; endswitch
 %! switch (2) case 1 z = a; case 2 z = b; otherwise z = c; endswitch
 %! switch (3) case 1 p = a; case 2 p = b; otherwise p = c; endswitch
--- a/test/system.tst
+++ b/test/system.tst
@@ -140,7 +140,7 @@
 %!
 %! assert (deblank (s1.modestr), "-rw-rw-rw-");
 %! assert (deblank (s2.modestr), "----------");
-%! # Restore original umask value
+%! ## Restore original umask value
 %! umask (orig_umask);
 
 %!error <Invalid call to umask> umask ()
@@ -285,7 +285,7 @@
 %! d1 = pwd ();
 %! cd (xdir);
 %! if (ispc () && ! isunix ())
-%!   # should be a drive letter
+%!   ## should be a drive letter
 %!   assert (length (d1), 3);
 %!   assert (d1(2), ":");
 %!   assert (d1(3), "\\");
--- a/test/try.tst
+++ b/test/try.tst
@@ -20,7 +20,7 @@
 %! try
 %! catch
 %!   error ("Shoudn't get here");
-%! end_try_catch
+%! end  # "end" is part of test, check not using "end_try_catch"
 
 %!test
 %! try
@@ -158,3 +158,25 @@
 %!   assert (myerr1.message, myerr2.message);
 %!   assert (myerr1.identifier, myerr2.identifier);
 %! end_try_catch
+
+%!test
+%! x = 1;
+%! try error ("foo"); catch x; assert (x.message, "foo"); end_try_catch
+
+%!test
+%! x = 1;
+%! try error ("foo"); catch x end_try_catch
+%! assert (x.message, "foo");
+
+%!test
+%! x = 1;
+%! try error ("foo"); catch, x; assert (x, 1); end_try_catch
+
+%!test
+%! x = 1;
+%! try error ("foo"); catch; x; assert (x, 1); end_try_catch
+
+%!test
+%! x = 1;
+%! try error ("foo"); catch
+%!   x; assert (x, 1); end_try_catch
--- a/test/unwind.tst
+++ b/test/unwind.tst
@@ -28,7 +28,7 @@
 %!  unwind_protect_cleanup
 %!    g = save_g;
 %!    y = [y, g];
-%!  end_unwind_protect
+%!  end  # "end" is part of test, check not using "end_unwind_protect"
 %!endfunction
 %!
 %!test
--- a/test/while.tst
+++ b/test/while.tst
@@ -21,7 +21,7 @@
 %! while (eye (2))
 %!   i++;
 %!   __printf_assert__ ("%d\n", i);
-%! endwhile
+%! end  # "end" is part of test, check not using "endwhile"
 %! assert (__prog_output_assert__ (""));
 
 %!test