Overview - Maple Help

latex

produces output suitable for LaTeX printing and provides the translation functionality for File -> Export -> LaTeX

 Calling Sequence latex(expr, options) LaTeX(expr, options)  : LaTeX is a synonym of latex

Parameters

 expr - any Maple expression or construction, or a sequence of them

Options

 • append = ... : the right-hand side can be true or false (default); related to writeto.
 • asinpreviousreleases = ... : the right-hand side can be true or false (default); if true, the old latex program, of releases previous to Maple 2021, is used.
 • breaklines : related to linelength, the right-hand side can be true or false (default), to break lines using \\ according to the value of the linelength keyword, that can also be set and is shown via $\mathrm{latex}:-\mathrm{Settings}\left(\mathrm{linelength}\right)$.
 • filename = ... : deprecated (superseded by writeto), the right-hand side can be a symbol or a string representing a filename; if passed, output = file is also required.
 • forget = ... : the right-hand side can be true or false (default); to forget previously cached translations at the time of performing a latex translation.
 • linelength : related to breaklines, the right-hand side can be any positive number as an estimation of the desired number of characters in a math line. Its default value can be changed and is shown by $\mathrm{latex}:-\mathrm{Settings}\left(\mathrm{linelength}\right)$.
 • output = ... : the right-hand side can be the keyword string, to return a string with the latex translation, or file in which case filename = ... is also required (deprecated use, superseded by writeto).
 • thisisinput = ... : the right-hand side can be true or false (default); when given, some typesetting restrictions apply and a prompt > is included if the Maple MW file was created as a worksheet (see interface,format).
 • translation = ... : the right-hand side can be full (default), or restricted, in which case significant typesetting restrictions apply: the translation is done as you see in the input of help pages.
 • writeto = ... : the right-hand side can be screen (default) or any symbol or string representing a filename to which the output will be written; it can be used together with append, to append instead of overwrite a previously existing filename.
 • All the optional keywords that can have the value true on the right-hand side can be passed just as themselves, not as an equation, representing the value true. For example forget is the same as forget = true. Also, you don't need to use the exact spelling of any of these keywords - any unambiguous portion of them suffices, e.g. previous for asinpreviousreleases.

Description

 • The latex function produces output on the screen which is a translation to LaTeX of its arguments, and the LaTeX command is a synonym of latex. This command has been rewritten for Maple 2021, and it can now translate to LaTeX everything that can be displayed on a Maple worksheet or document (exception made of embedded components and DocumentTools objects).
 • The Export As > LaTeX related functionality has also been rewritten, now resulting in a LaTeX file where everything you see on the worksheet is translated, that contains equation labels, hyperlinked in the input and text when they appear as such in the worksheet being exported, and where the input and output in the LaTeX file are formatted using automatic line breaking.
 • There are three main ways of using latex.
 – Entering latex(expression) followed by pressing Enter produces the display on the screen of the LaTeX form of expression, that you can copy and paste into a .tex file, to be used with any LaTeX application (not provided with the Maple system).
 – Any Maple expression being displayed, input or output, or a subexpression of it, can be highlighted with the mouse, then translated to LaTeX and copied in one go through right-click and using the menu Edit > Copy As > Copy as LaTeX.
 – Any Maple worksheet, say filename.mw, can be translated to LaTeX as a whole using the menu File > Export As > LaTeX. The resulting file, filename.tex, can be processed with any LaTeX application to produce a PDF file that looks as the worksheet.
 • Using File > Export As > LaTeX you can produce LaTeX versions of course lessons or entire scientific papers directly in the Maple worksheet, that combines what-you-see-is-what-you-get editing capabilities with the Maple computational engine to produce mathematical results. Relevant for this purpose, you can:
 – In the worksheet, before exporting, remove all or selectively some of Maple's input, while keeping all of Maple's output and corresponding equation labels, by respectively using the menus Show/Hide Contents > Input or Edit > Delete Element. This is particularly useful to produce LaTeX mathematical documents that entirely or partially hide their computer algebra origin.
 – In the worksheet, select any mathematical expression written using Maple syntax that appears within the text (e.g. Int(f(x), x)), or as Maple input and, use Format > Convert To > 2-D Math Nonexecutable (or, alternatively right-click (Command-click, on Mac) and select Convert To > 2-D Math Nonexecutable) to produce a textbook mathematical display of that expression, that will then appear as such in the LaTeX exported document.
 – In the resulting filename.tex file, adjust the automatic line-breaking in the formulas by placing $\mathrm{\\}$ wherever you want an additional linebreak, or enclosing a formula's subexpression between $\left\{\right\}$ to avoid its automatic line-breaking. This provides valuable flexibility to tweak the way the filename.tex LaTeX file is displayed.
 – Set several preferences regarding how to perform the LaTeX translation using the latex:-Settings command. To see the different settings and their current value enter $\mathrm{latex}:-\mathrm{Settings}\left(\right)$.
 • The translation of mathematical expressions performed by latex precisely respects the form and color you see on the screen with very few exceptions (e.g. the blue in Maple's output is not translated). For example, inert functions are translated using gray color the way it is used to display them in the worksheet. To change this or other default behaviors you can use latex:-Settings; e.g., to avoid using color and have everything translated in black enter $\mathrm{latex}:-\mathrm{Settings}\left(\mathrm{usecolor}=\mathrm{false}\right)$.
 • Mathematical functions are translated to LaTeX using the notation shown in the NIST Digital Library of Mathematical Functions. To change that see latex:-Settings and latex,functions.
 • All alias, and print/F routines you may define to compactly display expressions or a function $F$ in any particular way, as well as the value of $\mathrm{interface}\left(\mathrm{imaginaryunit}\right)$, are taken into account at the time of translating to LaTeX.
 • It is possible to change or extend the capabilities of latex to translate any function, say $F$ by defining a procedure with the name latex/F. The latex command uses this procedure when it encounters a function with name $F$ within the expression(s) being translated. For more information, see latex,functions.
 • You can use the GraphTheory:-Latex command to generate LaTeX code for graphs constructed with the GraphTheory package.
 • The latex command displays output on the screen that can be copied and pasted elsewhere; it however returns NULL as the function value. Therefore the ditto commands, % and %%, will not recall the previous latex output. To get output (return value) different from NULL, you can use the optional argument output = string.

The latex:-Settings

 • Several settings of the translation to LaTeX can be adjusted according to preference, using the latex:-Settings command or its synonym LaTeX:-Settings. These settings and the corresponding default values can be seen by entering the command with no arguments or using the keyword query
 > latex:-Settings();
 $\left[{\mathrm{cacheresults}}{=}{\mathrm{true}}{,}{\mathrm{commabetweentensorindices}}{=}{\mathrm{false}}{,}{\mathrm{invisibletimes}}{=}{""}{,}{\mathrm{leavespaceafterfunctionname}}{=}{\mathrm{false}}{,}{\mathrm{linelength}}{=}{66}{,}{\mathrm{powersoftrigonometricfunctions}}{=}{\mathrm{mixed}}{,}{\mathrm{spaceaftersqrt}}{=}{\mathrm{true}}{,}{\mathrm{usecolor}}{=}{\mathrm{true}}{,}{\mathrm{usedisplaystyleinput}}{=}{\mathrm{true}}{,}{\mathrm{useimaginaryunit}}{=}{I}{,}{\mathrm{useinputlineprompt}}{=}{\mathrm{true}}{,}{\mathrm{userestrictedtypesetting}}{=}{\mathrm{false}}{,}{\mathrm{usespecialfunctionrules}}{=}{\mathrm{true}}{,}{\mathrm{usetypesettingcurrentsettings}}{=}{\mathrm{false}}\right]$ (1)
 • The possible values of the right-hand sides and their meaning is as follows
 – cacheresults : all results by the internal latex subroutines are cached, for performance, so the translations are computed only once. However, if you are changing things in your worksheet that affect the way things are displayed, previously cached results may prevent you to get different LaTeX translations for the same input. To avoid caching results pass $\mathrm{cacheresults}=\mathrm{false}$. Alternatively, use the latex option forget, or the command $\mathrm{latex}:-\mathrm{Forget}\left(\right)$.
 – commabetweentensorindices : default value is false; if set to true, a comma between tensor indices is placed also in the LaTeX translation, so that they are displayed the same way they are on a Maple sheet.
 – invisibletimes : sets the string used to represent the product operator, by default " ". That matches the default of the LaTeX typesetting system where no spacing is placed between the operands of a product, so a*b is displayed $\mathrm{ab}$. To have a small space between the operands of a product you can use $\mathrm{invisibletimes}="\\,"$
 – leavespaceafterfunctionname : default value is false, if set to true no \! LaTeX negative spacing command will be placed between a function name, say $F$ and the parenthesis \left( \right) surrounding the function's arguments.
 – linelength : default value is 66; it indicates the approximate length at which a line-break $"\\"$ should be introduced when using the option breaklines.
 – powersoftrigonometricfunctions : default value is mixed; other possible values are textbooknotation and computernotation. With the value mixed, ${\mathrm{sin}\left(x+y\right)}^{2}$ is translated to LaTeX as \sin^2 (x + y), and upon compilation will look like ${\mathrm{sin}}^{2}\left(x+y\right)$. With the value textbook, in addition, inverse trigonometric functions are translated to LaTeX with the notation that uses the name of the corresponding trigonometric function power -1, so $\mathrm{arcsin}\left(x+y\right)$ is translated as \sin^{-1} (x + y). With the value computer the translation is an exact replica of what you see displayed on the Maple sheet.
 – spaceaftersqrt : default value is true; to insert or not a LaTeX small spacing command after a square root when it is an operand of a product.
 – usecolor : default value is true, so that colors in the worksheet are translated as such to LaTeX.
 – usedisplaystyleinput : default value is true, so that when using File > Export As > LaTeX all the input lines appears preceded by \displaystyle, i.e.: when compiling the .tex file, these lines are displayed with LaTeX math display style (the size of the fonts won't depend on the context).
 – useimaginaryunit : default value is the one shown by $\mathrm{interface}\left(\mathrm{imaginaryunit}\right)$, that in Maple is the capital letter I. This setting can be used to indicate the use of a different symbol when translating to LaTeX.
 – useinputlineprompt : can be true or false, to put or not a prompt at the beginning of Maple input lines when using File > Export As > LaTeX. When the Maple sheet was created as a worksheet, $\mathrm{interface}\left(\mathrm{format}\right)="worksheet"$ and so the default value of useinputlineprompt is true. Otherwise, when it started as a document, $\mathrm{interface}\left(\mathrm{format}\right)="document"$ and the value of useinputlineprompt is by default false. You can use useinputlineprompt to override these default values.
 – userestrictedtypesetting : default value is false; if set to true, only a restricted form of typesetting, like the one used in the input lines of the Maple help pages, is used when translating to LaTeX.
 – usespecialfunctionrules : default value is true; if set to false, no typesetting for the notation of mathematical functions is used.
 – usetypesettingcurrentsettings : default is false; if set to true the Typesetting rules set in the Maple worksheet are not overridden by latex.
 NOTE: unlike the case where you input latex(expression), when translating whole Maple worksheets using File > Export As > LaTeX the design is to export the worksheet to LaTeX reproducing what you see on the screen. So in that case the following settings are ignored: powersoftrigonometricfunctions, useimaginaryunit, userestrictedtypesetting, usespecialfunctionrules and usetypesettingcurrentsettings.

Tips for File > Export As > LaTeX

 • In order to translate everything that can be displayed on a Maple sheet, some CTAN official LaTeX packages are used, listed at the beginning of the exported .tex file. Current LaTeX applications include those packages. Also, a copy of the maple.sty file, found in the etc directory of your Maple installation (kernelopts(mapledir)), should be in the same directory where you placed the .tex file that resulted from File > Export > LaTeX.
 • Input lines can be entirely or partially omitted in the exported LaTeX document while keeping all the equation labels unchanged by respectively clearing the check box for  Show/Hide Contents > Input in the View menu or using the menu Edit > Delete Element.
 • The Maple sheet input lines appear in the exported TEX file not indented and using the automatic line-breaking of the LaTeX math {$...$} environment. The output lines appear using the automatic line-breaking of the $\left\{\mathrm{dmath}\right\}$ environment of the breqn LaTeX package, plus some additional automatic line-breaking performed by Maple routines where necessary beyond the $\left\{\mathrm{dmath}\right\}$ environment. The additional automatic line-breaking performed by Maple routines appears in the exported TEX file as lines whose only contents is $\mathbf{\}\mathbf{\}$, and the linelength keyword of the latex:-Settings can control their occurrence. Both input and output lines can be split furthermore by inserting, in the exported file, $\mathbf{\}\mathbf{\}$ wherever you want an additional line break.
 • To avoid an automatically occurring line-break, in the exported TEX file, enclose within {} the parts of an expression you want to be in the same line. Together with the one of the previous paragraph, this mechanism complements the automatic line-breaking, giving you full control of how lines are split in the exported document.
 • When working with large expressions, neither the automatic line-breaking, nor the breaklines option of latex, will break lines in fractions or across matrix lines (i.e., the number of matrix columns is not altered).
 • Matrices have an excellent chance of being appropriately exported, provided that they fit within the margins of a page. Note that is not always the case, despite the matrix fitting within the computer screen's margins.
 • Before exporting, check the menu options View > Markers, View > Sections > Show Section Boundaries and View > Show/Hide Contents > Execution Group Boundaries. That provides visual indicators of where bookmarks, Sections, paragraphs (text), input and output regions start and end. Using the menu Format > Bookmarks you can change bookmarks, relevant in Table Of Contents, and using Edit and its submenus, you can Split or Join execution groups or sections, Delete Elements, and adjust these regions to get the exported TEX file looking as desired.
 • When inserting non-ASCII characters in the middle of text, for example, by clicking the palettes, place them within inlined math regions. To start such a region, you can press Shift + F5, type or insert the characters, then end with Ctrl + T (Command + T, on Mac) to return to text mode.
 • When inlining math within the text, make sure you have both opening and matching closing parenthesis (), {} or [], within the math region. That assures their display in the printed exported LaTeX document is optimal and avoids having unmatched opening or closing delimiters.
 • When closing inlined math, make sure there is a blank text character before any text that follows instead of an inlined math blank character. While in the Maple sheet, these two different blank characters look the same way, that is not the case in the LaTeX exported document where an ending math blank character is not displayed.
 • Images can conveniently be inserted in the Maple sheet using the menu Insert > Image > From File. These images appear exported in the TEX file using the $\\mathrm{includegraphics}$ environment, with the options keepaspectratio and width = ... where the right-hand side has a maximum value of $3.9\mathrm{in}$regardless of the width of the image. You can adjust the size of the image in the TEX file by changing those two options or using the height = ... option.
 • Embedded components are not translated - there exist no natural LaTeX commands for them to translate onto. The alternative is to handle the visualized embedded component as an image. For that, you can Either use the menu Edit > Copy > Copy as Image or depending on your OS/software you can take a screen shoot. Then insert this file image in the right position using the menu Insert > Image > From File. The image will appear in the right place in the .tex exported file and you can tweak its appearance as explained in the previous item.
 • DocumentTools objects like Tabulate, or Tables (not mathematical table objects) inlined within Text are translated only rudimentarily: all their columns centered. Here too, either you can adjust the look of the table directly in the .tex exported file, or transform the table into an image to be handled the same way as an embedded component explained in the previous item.
 • You can have the integration constants $\mathrm{_Cn}$, appearing in solutions to differential equations, exported to LaTeX as ${c}_{n}$ by entering (e.g., for $n\le 10$) $\mathrm{alias}\left(\mathrm{seq}\left({c}_{k}=\mathrm{_C}‖k,k=0..10\right)\right)$.

Examples

Fractions are translated using the \frac LaTeX command, not elevating the denominator to the power -1

 > $\mathrm{ee}≔\frac{a}{x+\frac{y}{3}}$
 ${\mathrm{ee}}{≔}\frac{{a}}{{x}{+}\frac{{y}}{{3}}}$ (2)
 > $\mathrm{latex}\left(\mathrm{ee}\right)$
 \frac{a}{x +\frac{y}{3}}

You can use latex or LaTeX indistinctly; these two commands are synonyms of each other.

 > $\mathrm{LaTeX}\left(\mathrm{ee}\right)$
 \frac{a}{x +\frac{y}{3}}

The LaTeX translation is displayed on the screen; that is useful for copy & paste, but the actual return value of latex(ee) is NULL. If you need a non-NULL return value use output = string

 > $\mathrm{latex}\left(\mathrm{ee},\mathrm{output}=\mathrm{string}\right)$
 ${"\frac\left\{a\right\}\left\{x +\frac\left\{y\right\}\left\{3\right\}\right\}"}$ (3)

Color is translated the same way you see it on the screen (blue and black are ignored)

 > $\mathrm{ee}≔\left(\mathrm{Int}=\mathrm{int}\right)\left(\frac{1}{{x}^{2}+1},x\right)$
 ${\mathrm{ee}}{≔}{\int }\frac{{1}}{{{x}}^{{2}}{+}{1}}\phantom{\rule[-0.0ex]{0.3em}{0.0ex}}{ⅆ}{x}{=}{\mathrm{arctan}}{}\left({x}\right)$ (4)
 > $\mathrm{latex}\left(\mathrm{ee}\right)$
 \textcolor{gray}{\int}\frac{1}{x^{2}+1}\textcolor{gray}{d}x = \arctan \! \left(x \right)

Translating color is a setting. You can change any of the latex:-settings using latex:-Settings(keyword = value) or using its synonym LaTeX:-Settings. To query about these settings use the keyword $\mathrm{query}$ or enter the command without arguments

 > $\mathrm{latex}:-\mathrm{Settings}\left(\right)$
 $\left[{\mathrm{cacheresults}}{=}{\mathrm{true}}{,}{\mathrm{commabetweentensorindices}}{=}{\mathrm{false}}{,}{\mathrm{invisibletimes}}{=}{""}{,}{\mathrm{leavespaceafterfunctionname}}{=}{\mathrm{false}}{,}{\mathrm{linelength}}{=}{66}{,}{\mathrm{powersoftrigonometricfunctions}}{=}{\mathrm{mixed}}{,}{\mathrm{spaceaftersqrt}}{=}{\mathrm{true}}{,}{\mathrm{usecolor}}{=}{\mathrm{true}}{,}{\mathrm{usedisplaystyleinput}}{=}{\mathrm{true}}{,}{\mathrm{useimaginaryunit}}{=}{I}{,}{\mathrm{useinputlineprompt}}{=}{\mathrm{true}}{,}{\mathrm{userestrictedtypesetting}}{=}{\mathrm{false}}{,}{\mathrm{usespecialfunctionrules}}{=}{\mathrm{true}}{,}{\mathrm{usetypesettingcurrentsettings}}{=}{\mathrm{false}}\right]$ (5)

So, for example, to avoid color being translated, you can enter

 > $\mathrm{latex}:-\mathrm{Settings}\left(\mathrm{usecolor}=\mathrm{false}\right)$
 $\left[{\mathrm{usecolor}}{=}{\mathrm{false}}\right]$ (6)
 > $\mathrm{latex}\left(\mathrm{ee}\right)$
 \int \frac{1}{x^{2}+1}d x = \arctan \! \left(x \right)

To avoid artificial spacing between a function's name and its arguments surrounded by \left( and \right), the latex command places \! in between, as you see above in \arctan \! \left(x \right). To not have this LaTeX spacing command \! automatically inserted, use, for instance

 > $\mathrm{latex}:-\mathrm{Settings}\left(\mathrm{leavespace}=\mathrm{true}\right)$
 $\mathrm{* Partial match of \text{'}}{}\mathrm{leavespace}{}\mathrm{\text{'} against keyword \text{'}}{}\mathrm{leavespaceafterfunctionname}{}\text{'}$
 $\left[{\mathrm{leavespaceafterfunctionname}}{=}{\mathrm{true}}\right]$ (7)
 > $\mathrm{latex}\left(\mathrm{ee}\right)$
 \int \frac{1}{x^{2}+1}d x = \arctan \left(x \right)

Powers of trigonometric (not inverse-trigonometric) functions, say ${\mathrm{sin}\left(x+y\right)}^{2}$, are frequently display in textbooks as ${\mathrm{sin}}^{2}\left(x+y\right)$ and while the computer uses the former notation, latex uses the latter one for trigonometric functions by default

 > $\mathrm{ee}≔{\mathrm{sin}\left(x+y\right)}^{2}+{\mathrm{arcsin}\left(x\right)}^{2}$
 ${\mathrm{ee}}{≔}{{\mathrm{sin}}{}\left({x}{+}{y}\right)}^{{2}}{+}{{\mathrm{arcsin}}{}\left({x}\right)}^{{2}}$ (8)
 > $\mathrm{latex}\left(\mathrm{ee}\right)$
 \sin^{2}\left(x +y \right)+\arcsin \left(x \right)^{2}

You can change that too. The options for the right-hand side of $\mathrm{powersoftrigonometricfunctions}=\mathrm{...}$ are: $\mathrm{textbooknotation}$, $\mathrm{computernotation}$ or $\mathrm{mixed}$ (default), and you can use any unambiguous portion of the long-keyword $\mathrm{powersoftrigonometricfunctions}$ to indicate it. Using $\mathrm{powersoftrig}=\mathrm{textbook}$, in addition, inverse-trigonometric functions are LaTeX translated as the corresponding trigonometric functions to the power -1, so $\mathrm{arcsin}\left(x\right)$ will look in the LaTeX translation as ${\mathrm{sin}}^{\left(-1\right)}x$

 > $\mathrm{latex}:-\mathrm{Settings}\left(\mathrm{powersoftrig}=\mathrm{textbook}\right)$
 $\mathrm{* Partial match of \text{'}}{}\mathrm{powersoftrig}{}\mathrm{\text{'} against keyword \text{'}}{}\mathrm{powersoftrigonometricfunctions}{}\text{'}$
 $\left[{\mathrm{powersoftrigonometricfunctions}}{=}{\mathrm{textbooknotation}}\right]$ (9)
 > $\mathrm{latex}\left(\mathrm{ee}\right)$
 \sin^{2}\left(x +y \right)+\left(\sin^{-1}\left(x \right)\right)^{2}

Using $\mathrm{powersoftrigonometricfunctions}=\mathrm{computer}$, the LaTeX translation is exactly as displayed in (8)

 > $\mathrm{latex}:-\mathrm{Settings}\left(\mathrm{powersoftrig}=\mathrm{computer}\right)$
 $\mathrm{* Partial match of \text{'}}{}\mathrm{powersoftrig}{}\mathrm{\text{'} against keyword \text{'}}{}\mathrm{powersoftrigonometricfunctions}{}\text{'}$
 $\left[{\mathrm{powersoftrigonometricfunctions}}{=}{\mathrm{computernotation}}\right]$ (10)
 > $\mathrm{latex}\left(\mathrm{ee}\right)$
 \sin \left(x +y \right)^{2}+\arcsin \left(x \right)^{2}

When a square root is part of a product, the Maple typesetting leaves a small space between the square root and the next product operand, for example:

 > $\mathrm{ee}≔\mathrm{sqrt}\left(f\left(x\right)\right)g\left(x\right)$
 ${\mathrm{ee}}{≔}\sqrt{{f}{}\left({x}\right)}{}{g}{}\left({x}\right)$ (11)

To reproduce that spacing, latex places the LaTeX spacing command \, after the square root when within a product

 > $\mathrm{latex}\left(\mathrm{ee}\right)$
 \sqrt{f \left(x \right)}\, g \left(x \right)

To avoid that extra LaTeX spacing use

 > $\mathrm{latex}:-\mathrm{Settings}\left(\mathrm{spaceaftersqrt}=\mathrm{false}\right)$
 $\left[{\mathrm{spaceaftersqrt}}{=}{\mathrm{false}}\right]$ (12)
 > $\mathrm{latex}\left(\mathrm{ee}\right)$
 \sqrt{f \left(x \right)} g \left(x \right)

The Maple default for representing the imaginary unit is the capital letter $I$. This is respected by the LaTeX translation

 > $\mathrm{ee}≔x+Iy$
 ${\mathrm{ee}}{≔}{x}{+}{I}{}{y}$ (13)
 > $\mathrm{latex}\left(\mathrm{ee}\right)$
 x +\mathrm{I} y

You can however change this default in two different ways. For example, if you prefer $i$ instead of I, you can use $\mathrm{interface}\left(\mathrm{imaginaryunit}=i\right)$

 > $\mathrm{interface}\left(\mathrm{imaginaryunit}=i\right):$
 > $\mathrm{latex}\left(\mathrm{ee}\right)$
 i y +x

The symbol used in the LaTeX translation to represent the imaginary unit, is always displayed when you input

 > $\mathrm{latex}:-\mathrm{Settings}\left(\mathrm{imaginary}\right)$
 $\mathrm{* Partial match of \text{'}}{}\mathrm{imaginary}{}\mathrm{\text{'} against keyword \text{'}}{}\mathrm{useimaginaryunit}{}\text{'}$
 $\left[{\mathrm{useimaginaryunit}}{=}{i}\right]$ (14)

This setting actually allows you to use any different symbol than the one set via $\mathrm{interface}\left(\mathrm{imaginaryunit}=\mathrm{...}\right)$. For example, keep $i$ for use in the Maple input/output and use $j$ in the translation to LaTeX

 > $\mathrm{latex}:-\mathrm{Settings}\left(\mathrm{imaginary}=j\right)$
 $\mathrm{* Partial match of \text{'}}{}\mathrm{imaginary}{}\mathrm{\text{'} against keyword \text{'}}{}\mathrm{useimaginaryunit}{}\text{'}$
 $\left[{\mathrm{useimaginaryunit}}{=}{j}\right]$ (15)
 > $\mathrm{latex}\left(\mathrm{ee}\right)$
 j y +x

By default, latex leaves the invisible times product operator to be defined by the standard LaTeX typesetting system. That is, for example, no LaTeX spacing command between the letters $x$ and $y$ in the product $xy$. Hence,

 > $\mathrm{latex}\left(xy\right)$
 x y

That corresponds to the invisibletimes setting:

 > $\mathrm{latex}:-\mathrm{Settings}\left(\mathrm{invisibletimes}\right)$
 $\left[{\mathrm{invisibletimes}}{=}{""}\right]$ (16)

If however you prefer, for instance, a tiny space LaTeX command between the operands of a product, you can use $\mathrm{latex}:-\mathrm{Settings}\left(\mathrm{invisible}="\\,"\right)$

 > $\mathrm{latex}:-\mathrm{Settings}\left(\mathrm{invisibletimes}="\\,"\right)$
 $\left[{\mathrm{invisibletimes}}{=}{"\,"}\right]$ (17)
 > $\mathrm{latex}\left(xy\right)$
 x\,y

Regardless of the value of $\mathrm{interface}\left(\mathrm{typesetting}\right)$, or of $\mathrm{Typesetting}:-\mathrm{EnableTypesetRule}\left(\mathrm{SpecialFunctionRules}\right)$, the mathematical functions of the language are translated to LaTeX using the notation shown in the NIST Digital Library of Mathematical Functions. So for example BesselJ(n, z) is translated to LaTeX as J_{n}! left(z right)

 > $\mathrm{latex}\left(\mathrm{BesselJ}\left(n,z\right)\right)$
 J_{n}\left(z \right)

Upon LaTeX compilation, that will look like ${J}_{n}\left(z\right)$. You can change this default in two different ways. First, through the usespecialfunctionrules setting, changing its default value true to false

 > $\mathrm{latex}:-\mathrm{Settings}\left(\mathrm{specialfunctionrules}=\mathrm{false}\right)$
 $\mathrm{* Partial match of \text{'}}{}\mathrm{specialfunctionrules}{}\mathrm{\text{'} against keyword \text{'}}{}\mathrm{usespecialfunctionrules}{}\text{'}$
 $\left[{\mathrm{usespecialfunctionrules}}{=}{\mathrm{false}}\right]$ (18)
 > $\mathrm{latex}\left(\mathrm{BesselJ}\left(n,z\right)\right)$
 \mathit{BesselJ}\left(n , z\right)

Reset that setting to its default value

 > $\mathrm{latex}:-\mathrm{Settings}\left(\mathrm{usespecialfunctionrules}=\mathrm{true}\right):$

Second, with the usetypesettingcurrentsettings keyword, changing its default value false to true

 > $\mathrm{latex}:-\mathrm{Settings}\left(\mathrm{usetypesettingcurrentsettings}=\mathrm{true}\right)$
 $\left[{\mathrm{usetypesettingcurrentsettings}}{=}{\mathrm{true}}\right]$ (19)

and so, the value of the Typesetting settings is followed by latex:

 > $\mathrm{Typesetting}:-\mathrm{DisableTypesetRule}\left(\mathrm{Typesetting}:-\mathrm{SpecialFunctionRules}\right)$
 ${\varnothing }$ (20)
 > $\mathrm{latex}\left(\mathrm{BesselJ}\left(n,z\right),\mathrm{forget}\right)$
 \mathit{BesselJ}\left(n , z\right)

When changing Typesetting settings in the middle of a Maple session, to discard previously cached results by latex use the option forget (this is not necessary when changing settings using latex:-Settings)

 > $\mathrm{Typesetting}:-\mathrm{EnableTypesetRule}\left(\mathrm{Typesetting}:-\mathrm{SpecialFunctionRules}\right)$
 ${\varnothing }$ (21)
 > $\mathrm{latex}\left(\mathrm{BesselJ}\left(n,z\right),\mathrm{forget}\right)$
 J_{n}\left(z \right)
 > 

Compatibility

 • The latex command was updated in Maple 2021.