lyx_mirror/src
Enrico Forestieri e8f480e7c2 Fix display and output of math macros with optional arguments
This is a long standing issue, present since the new math macros
inception in version 1.6. It manifests as a display issue when a
macro with optional arguments appears in the optional argument of
another macro. In this case the display is messed up and it is
difficult, if not impossible, changing the arguments as they do not
appear on screen as related to a specific macro instance. It also
manifests as latex errors when compiling, even if the latex output
is formally correct, due to limitations of the xargs package used
to output the macros. Most probably, both aspects have the same
root cause, as simply enclosing in braces the macro and its
parameters solves both issues. However, when reloading a document,
lyx strips the outer braces enclosing a macro argument, thus
frustrating this possible workaround.

This commit solves the display issue by correctly accounting for
macros with optional arguments nested in the argument of another
macro, and circumvents the xargs package limitations causing errors
by enclosing in braces the macros with optional arguments appearing
in the argument of an outer macro when they are output. This means
that when loading an old document with such macros and saving it
again, the macro representation is updated and will have these
additional braces. However, as such braces are stripped by lyx on
loading, there is no risk that they accumulate.

See also this thread:
http://www.mail-archive.com/lyx-devel@lists.lyx.org/msg197828.html
2016-12-01 18:02:47 +01:00
..
client Add verbose option 2016-08-17 22:32:14 +02:00
frontends Fix some warnings after 6c9207579 2016-11-23 17:44:22 +01:00
graphics Add 'needauth' option to converters that need explicit user authorization. 2016-11-22 23:54:58 +01:00
insets Add 'needauth' option to converters that need explicit user authorization. 2016-11-22 23:54:58 +01:00
mathed Fix display and output of math macros with optional arguments 2016-12-01 18:02:47 +01:00
support Simplify Changers interface 2016-11-21 00:08:11 +01:00
tests Use only one file for dummy implementations 2016-08-20 00:41:04 +02:00
tex2lyx tex2lyx test files: update them 2016-10-28 00:45:33 +02:00
.gitignore Setup .gitignore for generated files 2012-03-22 02:16:12 +01:00
AppleSpellChecker.cpp Remove unused include file. 2016-05-29 17:55:45 -04:00
AppleSpellChecker.h Remove ; from end of function definitions 2013-05-12 13:04:18 +02:00
AspellChecker.cpp Fix "dead store" warnings of Xcode analyze tool 2015-10-09 08:16:23 +02:00
AspellChecker.h Remove ; from end of function definitions 2013-05-12 13:04:18 +02:00
Author.cpp GuiChanges: provide feedback when there are no more changes 2016-05-29 17:55:42 -04:00
Author.h GuiChanges: provide feedback when there are no more changes 2016-05-29 17:55:42 -04:00
BiblioInfo.cpp Amend 2c4673af58 2016-09-20 11:34:17 +02:00
BiblioInfo.h Improve info display for biblatex databases, part II 2016-09-18 12:44:12 +02:00
boost.cpp
Box.cpp
Box.h
BranchList.cpp src/*.cpp: reformatting to increase consistency 2012-10-28 17:42:07 +01:00
BranchList.h
buffer_funcs.cpp Make newUnnamedFile() threadsafe 2014-07-05 12:58:22 +02:00
buffer_funcs.h #7789 unify and fix buffer statistics 2012-01-12 07:03:24 +00:00
Buffer.cpp Add 'needauth' option to converters that need explicit user authorization. 2016-11-22 23:54:58 +01:00
Buffer.h Add 'needauth' option to converters that need explicit user authorization. 2016-11-22 23:54:58 +01:00
BufferEncodings.cpp Docstringify getLongString in general and preamble snippets in particular 2016-10-17 00:16:59 +02:00
BufferEncodings.h Encodings: Split off the functions that need Buffer 2013-09-29 15:26:18 +02:00
BufferList.cpp Simple cache for information on exportable formats, since we seem 2016-10-20 23:07:13 -04:00
BufferList.h Simple cache for information on exportable formats, since we seem 2016-10-20 23:07:13 -04:00
BufferParams.cpp Fix usage of multiple varieties of the same polyglossia language. 2016-11-02 17:07:49 +01:00
BufferParams.h These two routines are now redundant. 2016-10-20 23:07:13 -04:00
BufferView.cpp Fix height of cursor inside insets 2016-11-04 12:01:43 +01:00
BufferView.h Move class definitions inside main class 2016-10-22 23:24:01 +02:00
Bullet.cpp Audit all the LASSERT calls, and try to do something sensible at 2013-04-25 17:27:10 -04:00
Bullet.h
Changes.cpp Correctly track ulem commands with change tracking 2016-10-23 18:23:41 +02:00
Changes.h Rationalise includes 2016-07-04 02:42:17 +02:00
Chktex.cpp Remove boost/format support 2016-05-29 17:55:45 -04:00
Chktex.h Remove boost/format support 2016-05-29 17:55:45 -04:00
Citation.h New \cite_engine_type default. 2013-05-16 20:39:23 +02:00
CMakeLists.txt Cmake build: Prepare for hardening use of external programs 2016-11-22 16:51:44 +01:00
CmdDef.cpp src/*.cpp: reformatting to increase consistency 2012-10-28 17:42:07 +01:00
CmdDef.h
Color.cpp In Color Preferences "frame of button" should be "button frame" 2016-11-03 08:57:35 +01:00
Color.h Import notefontcolor (one more step towards a working roundtrip for the LyX documentation) 2011-01-14 20:00:55 +00:00
ColorCode.h support for all default colors of the package xcolor 2015-05-14 22:23:44 +02:00
ColorSet.h
Compare.cpp Rationalise includes 2016-07-04 02:42:17 +02:00
Compare.h Slowly going through the suggestion made by our headers script. 2013-05-15 22:02:10 -07:00
CompletionList.h
Converter.cpp Better explanations to the user for [244de5d2/lyxgit] and 2016-11-24 01:06:20 +01:00
Converter.h Let LyX remember what documents 'needauth' converters have been authorized to run over by the user. 2016-11-23 22:17:13 +01:00
ConverterCache.cpp Perf comments: getFormatFromFile slows LyX startup considerably 2016-07-31 18:34:33 +01:00
ConverterCache.h
CoordCache.cpp Improve debug message 2015-11-20 22:43:45 +01:00
CoordCache.h Get rid of ParagraphMetrics::insetDimension 2015-10-19 13:17:16 +02:00
Counters.cpp New layout tags for better counter handling 2016-10-14 20:08:12 +02:00
Counters.h New layout tags for better counter handling 2016-10-14 20:08:12 +02:00
Cursor.cpp Fix height of cursor inside insets 2016-11-04 12:01:43 +01:00
Cursor.h Helpers to set selections to arbitrary DocIterators 2016-09-23 23:39:48 +02:00
CursorSlice.cpp Move one Text::setCursor instance to CursorSlice 2016-05-29 17:55:46 -04:00
CursorSlice.h Move one Text::setCursor instance to CursorSlice 2016-05-29 17:55:46 -04:00
CutAndPaste.cpp Clear temp cutstack before exiting LyX. 2016-11-21 17:03:50 +01:00
CutAndPaste.h Make insertInset use a temporary cut-and-paste area. 2016-11-09 15:28:11 +01:00
DepTable.cpp src/*.cpp: reformatting to increase consistency 2012-10-28 17:42:07 +01:00
DepTable.h
Dimension.cpp Fix LASSERT correction 2015-10-10 21:38:17 +02:00
Dimension.h Only display a blue rectangle for editable empty insets 2016-11-16 18:33:02 +01:00
DispatchResult.h Automatically show the review toolbar if the document has tracked changes 2016-05-29 17:55:42 -04:00
DocIterator.cpp Fix cppcheck initialization warnings 2016-06-06 21:55:39 +02:00
DocIterator.h explicit operator bool 2016-09-23 23:39:48 +02:00
DocumentClassPtr.h Replace support/shared_ptr.h and boost::shared_ptr with std::shared_ptr 2016-06-09 15:21:39 +01:00
EnchantChecker.cpp use enchant exception message accessor 2014-11-18 22:06:27 +01:00
EnchantChecker.h Remove ; from end of function definitions 2013-05-12 13:04:18 +02:00
Encoding.cpp Fix bug #9616 2016-09-10 13:36:45 +02:00
Encoding.h Fix bug #9616 2016-09-10 13:36:45 +02:00
ErrorList.cpp Use the new infrastructure to select rows during error reporting 2016-10-22 23:24:00 +02:00
ErrorList.h Move class definitions inside main class 2016-10-22 23:24:01 +02:00
Exporter.cpp Added -E option to specify export format and destination file-name (and export folder). 2011-09-15 01:07:49 +00:00
Exporter.h Added -E option to specify export format and destination file-name (and export folder). 2011-09-15 01:07:49 +00:00
factory.cpp Add 'needauth' option to converters that need explicit user authorization. 2016-11-22 23:54:58 +01:00
factory.h
Floating.cpp Docstringify getLongString in general and preamble snippets in particular 2016-10-17 00:16:59 +02:00
Floating.h Docstringify getLongString in general and preamble snippets in particular 2016-10-17 00:16:59 +02:00
FloatList.cpp Add more Float tags to allow to disable wide and sideways feature 2015-05-22 18:59:17 +02:00
FloatList.h Add more Float tags to allow to disable wide and sideways feature 2015-05-22 18:59:17 +02:00
Font.cpp Do not output bidi direction macros in passthru context 2016-10-21 10:40:19 +02:00
Font.h Slowly going through the suggestion made by our headers script. 2013-05-15 22:02:10 -07:00
FontEnums.h Correct computation of math font size 2016-11-21 00:02:35 +01:00
FontInfo.cpp Fix header 2016-11-23 19:16:18 +01:00
FontInfo.h Simplify Changers interface 2016-11-21 00:08:11 +01:00
FontList.cpp Rewrite setRowHeight using row information 2016-05-30 14:55:41 +02:00
FontList.h Rewrite setRowHeight using row information 2016-05-30 14:55:41 +02:00
Format.cpp Better title for ViewSource 2016-09-21 16:42:38 +02:00
Format.h Fix Unicode use in Format's prettyname 2016-08-28 01:30:53 +01:00
FuncCode.h Add the icon-size to the toolbar menu 2016-11-22 10:00:52 +01:00
FuncRequest.cpp Whitespace only. 2016-06-27 18:54:14 -04:00
FuncRequest.h This patch does two closely related things. 2016-06-27 18:16:35 -04:00
FuncStatus.cpp src/*.cpp: reformatting to increase consistency 2012-10-28 17:42:07 +01:00
FuncStatus.h
Graph.cpp Given how we are using this exclusion list, it makes more sense for it 2011-03-31 13:03:29 +00:00
Graph.h Given how we are using this exclusion list, it makes more sense for it 2011-03-31 13:03:29 +00:00
HSpace.cpp Audit all the LASSERT calls, and try to do something sensible at 2013-04-25 17:27:10 -04:00
HSpace.h
HunspellChecker.cpp Correct path names were to look for RPM based dictionaries for hunspell on Linux. 2016-05-29 17:55:44 -04:00
HunspellChecker.h Implement access to hunspell's stemming function and let the Thesaurus use that (part of bug #8060). 2012-03-02 10:20:09 +00:00
IndicesList.cpp src/*.cpp: reformatting to increase consistency 2012-10-28 17:42:07 +01:00
IndicesList.h Typos 2012-06-05 12:22:13 +02:00
InsetIterator.cpp
InsetIterator.h
InsetList.cpp Fix cppcheck initialization warnings 2016-06-06 21:55:39 +02:00
InsetList.h
Intl.cpp
Intl.h
KeyMap.cpp Add perf comment 2016-06-12 19:17:33 +01:00
KeyMap.h Replace support/shared_ptr.h and boost::shared_ptr with std::shared_ptr 2016-06-09 15:21:39 +01:00
KeySequence.cpp Use empty() to check empty and non-empty'ness not size() 2012-10-27 01:25:38 +02:00
KeySequence.h
Language.cpp Issue an error message if conflicting languages are used 2016-10-27 09:59:01 +02:00
Language.h Issue an error message if conflicting languages are used 2016-10-27 09:59:01 +02:00
LaTeX.cpp Fix #10394 Do not error on missing characters in "nullfont". 2016-09-23 09:04:03 +02:00
LaTeX.h Replace Boost.Signals with Boost.Signals2 2016-06-09 22:25:34 +02:00
LaTeXFeatures.cpp Fix usage of multiple varieties of the same polyglossia language. 2016-11-02 17:07:49 +01:00
LaTeXFeatures.h Fix usage of multiple varieties of the same polyglossia language. 2016-11-02 17:07:49 +01:00
LaTeXFonts.cpp Docstringify getLongString in general and preamble snippets in particular 2016-10-17 00:16:59 +02:00
LaTeXFonts.h Docstringify getLongString in general and preamble snippets in particular 2016-10-17 00:16:59 +02:00
LaTeXPackages.cpp Fix bug #4213: Change tracking support for tex2lyx. 2011-11-06 17:03:59 +00:00
LaTeXPackages.h Fix bug #4213: Change tracking support for tex2lyx. 2011-11-06 17:03:59 +00:00
Layout.cpp Implement PassThru option to arguments. 2016-10-21 10:39:55 +02:00
Layout.h Implement PassThru option to arguments. 2016-10-21 10:39:55 +02:00
LayoutEnums.h Implement PassThru option to arguments. 2016-10-21 10:39:55 +02:00
LayoutFile.cpp Simplifications, mainly removal of boost::function and useless std::bind 2016-07-03 01:39:32 +02:00
LayoutFile.h Fix bug #4812 (Layout in local directory lost on Save As, Copying) 2015-05-13 22:02:13 +02:00
LayoutModuleList.cpp Import theorems correctly (bugs #5702, #5776) 2012-10-26 22:23:16 +02:00
LayoutModuleList.h Import theorems correctly (bugs #5702, #5776) 2012-10-26 22:23:16 +02:00
Length.cpp Correct on-screen kerning in math for non-mu units 2016-11-22 11:30:26 +01:00
Length.h Fix Length::inBP() 2015-07-12 18:36:19 +02:00
lengthcommon.cpp Remove C-isms in isValidLength 2015-02-20 16:16:31 +01:00
Lexer.cpp Docstringify getLongString in general and preamble snippets in particular 2016-10-17 00:16:59 +02:00
Lexer.h Docstringify getLongString in general and preamble snippets in particular 2016-10-17 00:16:59 +02:00
lyx_commit_hash.h.in Autotools: read git commit hash at compile time 2014-11-24 22:00:21 +01:00
LyX.cpp Change default working directory from ~/ to "." 2016-10-11 22:25:42 -04:00
LyX.h Add verbose option 2016-08-17 22:32:14 +02:00
LyXAction.cpp Amend fix for #10428 2016-11-23 17:30:49 +01:00
LyXAction.h New LFUN tabular-feature: update prefs2prefs.py 2016-01-27 18:20:53 +01:00
lyxfind.cpp Remove assert on advanced find with knitr module (#10444). 2016-10-27 09:38:35 +02:00
lyxfind.h Initialize FindAndReplaceOptions in default constructor 2016-06-09 17:06:21 +02:00
LyXRC.cpp Bump up RC fileformat after [244de5d2/lyxgit] for the new 'needauth' options. 2016-11-25 23:33:08 +01:00
LyXRC.h Add 'needauth' option to converters that need explicit user authorization. 2016-11-22 23:54:58 +01:00
LyXVC.cpp Fix indentation 2016-10-19 14:10:47 +02:00
LyXVC.h Do some caching of window title and related UI 2016-10-19 11:59:47 +02:00
lyxwinres.rc Update years 2011-01-21 13:24:23 +00:00
main.cpp Remove unneeded include. 2010-11-17 16:14:26 +00:00
Makefile.am Add support for \mathbin and friends 2016-11-16 15:21:53 +01:00
MetricsInfo.cpp InsetMath: match the screen display with the EnsureMath behaviour in output 2016-11-22 11:30:26 +01:00
MetricsInfo.h InsetMath: match the screen display with the EnsureMath behaviour in output 2016-11-22 11:30:26 +01:00
ModuleList.cpp Fix indentation 2016-06-26 14:26:35 +02:00
ModuleList.h Remove some header leftovers based on Scott's script hints. 2013-05-02 00:30:16 -07:00
Mover.cpp Centralize replacement of "$$s" 2014-05-14 15:45:20 -04:00
Mover.h
output_docbook.cpp Fix missing includes after change 670efa8f64 2016-07-04 12:11:24 +02:00
output_docbook.h
output_latex.cpp Also track local language switches 2016-09-27 23:00:29 +02:00
output_latex.h Also track local language switches 2016-09-27 23:00:29 +02:00
output_plaintext.cpp Fix a bunch of small performance issues spotted by cppcheck 2014-07-05 19:13:10 +02:00
output_plaintext.h Introduce max_length parameter for plaintext() output routines, 2013-03-08 15:12:58 -05:00
output_xhtml.cpp Fix XHTML export of German Additional Features manual. 2016-08-04 22:43:17 -04:00
output_xhtml.h Rename some variables and routines. 2016-07-10 00:00:03 -04:00
output.cpp
output.h
OutputEnums.h
OutputParams.cpp Correctly track ulem commands with change tracking 2016-10-23 18:23:41 +02:00
OutputParams.h Correctly track ulem commands with change tracking 2016-10-23 18:23:41 +02:00
paper.h Convert remaining C++ files to UTF-8 2015-12-05 19:33:24 +00:00
Paragraph.cpp Handle properly unicode paragraph/line break 2016-11-10 09:37:36 +01:00
Paragraph.h Fix problem with branch handling. The problem was that we were not 2016-07-09 23:58:34 -04:00
ParagraphList.h
ParagraphMetrics.cpp Simplifications, mainly removal of boost::function and useless std::bind 2016-07-03 01:39:32 +02:00
ParagraphMetrics.h Take inset dimension into account in row signature 2016-06-03 11:21:09 +02:00
ParagraphParameters.cpp
ParagraphParameters.h
ParIterator.cpp
ParIterator.h Remove some header leftovers based on Scott's script hints. 2013-05-02 00:30:16 -07:00
PDFOptions.cpp Rationalise includes 2016-07-04 02:42:17 +02:00
PDFOptions.h Add some missing member variable initializations 2015-09-13 19:47:21 +02:00
PersonalWordList.cpp src/*.cpp: reformatting to increase consistency 2012-10-28 17:42:07 +01:00
PersonalWordList.h Fix a bunch of minor issues discovered by the cppcheck script. 2014-04-21 11:52:00 -04:00
PrinterParams.cpp Fix cppcheck initialization warnings 2016-06-06 21:55:39 +02:00
PrinterParams.h
Row.cpp Amend b30f8d3c 2016-11-21 12:09:48 +01:00
Row.h On-screen justification: stretch in proportion with the em, up to a limit 2016-11-06 12:20:00 +01:00
RowPainter.cpp Round values properly when drawing right margin selection 2016-11-04 15:58:54 +01:00
RowPainter.h Change tracking cue: paint over labels in text and prepare for further work 2016-06-13 08:46:15 +01:00
Server.cpp Whitespace only. 2016-06-27 18:54:14 -04:00
Server.h Use iostream instead of sstream and move it from header to cpp-source of LyX-Server 2016-06-12 13:03:06 +02:00
ServerSocket.cpp Fix missing include for file i/o prototypes after header cleanup in change 489dca71cd 2016-07-04 10:30:19 +02:00
ServerSocket.h Replace support/shared_ptr.h and boost::shared_ptr with std::shared_ptr 2016-06-09 15:21:39 +01:00
Session.cpp Let LyX remember what documents 'needauth' converters have been authorized to run over by the user. 2016-11-23 22:17:13 +01:00
Session.h Let LyX remember what documents 'needauth' converters have been authorized to run over by the user. 2016-11-23 22:17:13 +01:00
sgml.cpp Make static counters atomic 2016-07-31 18:34:33 +01:00
sgml.h Fix a bunch of small performance issues spotted by cppcheck 2014-07-05 19:13:10 +02:00
Spacing.cpp
Spacing.h
SpellChecker.h Fix cppcheck initialization warnings 2016-06-06 21:55:39 +02:00
TexRow.cpp Improvement to the reverse-search algorithm 2016-10-22 23:24:01 +02:00
TexRow.h Fix compilation on cygwin & others 2016-10-23 00:25:05 +02:00
texstream.cpp TexRow for InPreamble 2016-10-17 00:16:59 +02:00
texstream.h Some compilers are worried that a struct is not the same as a class 2016-10-18 00:54:37 +02:00
Text2.cpp Move one Text::setCursor instance to CursorSlice 2016-05-29 17:55:46 -04:00
Text3.cpp Make insertInset use a temporary cut-and-paste area. 2016-11-09 15:28:11 +01:00
Text.cpp Use the new infrastructure to select rows during error reporting 2016-10-22 23:24:00 +02:00
Text.h Move one Text::setCursor instance to CursorSlice 2016-05-29 17:55:46 -04:00
TextClass.cpp Implement PassThru option to arguments. 2016-10-21 10:39:55 +02:00
TextClass.h Enable to specify the target format for converting the local layout 2016-07-31 18:34:33 +01:00
TextMetrics.cpp Handle properly unicode paragraph/line break 2016-11-10 09:37:36 +01:00
TextMetrics.h Split TextMetrics::setRowHeight in three parts 2016-05-30 14:55:41 +02:00
Thesaurus.cpp Make Thesaurus check for more general dictionaries (en-v2.idx) 2015-06-02 17:28:44 +02:00
Thesaurus.h Forbid wrong compiler generated copy constructors 2015-09-20 19:43:06 +02:00
Toc.h Replace support/shared_ptr.h and boost::shared_ptr with std::shared_ptr 2016-06-09 15:21:39 +01:00
TocBackend.cpp Remove tooltips from the data of Toc Items 2016-07-03 17:28:46 +02:00
TocBackend.h Remove tooltips from the data of Toc Items 2016-07-03 17:28:46 +02:00
Trans.cpp Add comment about coverity #23335. 2016-06-11 23:09:30 -04:00
Trans.h Add missing intializations 2015-10-10 21:04:28 +02:00
Undo.cpp Update all paragraphs layouts when undoing bufferparams 2016-01-20 15:20:51 +01:00
Undo.h Repeat after me: into account, into account, into account 2015-09-27 21:38:20 +02:00
update_flags.h
VCBackend.cpp Typo 2016-10-19 11:21:02 +02:00
VCBackend.h Set window title according to platform UI 2016-09-08 15:59:44 +02:00
version.cpp Make builds reproducible 2015-03-26 18:14:45 +01:00
version.h add support for Urdu and Syriac 2016-10-28 00:21:58 +02:00
VSpace.cpp Audit all the LASSERT calls, and try to do something sensible at 2013-04-25 17:27:10 -04:00
VSpace.h
WordLangTuple.h #9496 factor out getting language from LFUN args or cursor position in speller LFUNs 2015-07-16 21:59:15 +02:00
WordList.cpp Remove non-copyable idioms 2016-06-09 19:16:44 +01:00
WordList.h Remove non-copyable idioms 2016-06-09 19:16:44 +01:00