Fix bug reported on user list: the path variable here was undefined,
causing a failure when running outside the user tree. This was my
fault: when I refactored this routine, I failed to note that this
variable was now undefined.
(cherry picked from commit 72c2a72afd)
Backported from b8648dea16.
With this new command line switch a list of modules can be loaded
unconditionally. This seems to be needed for the literate programming formats,
and it is useful to work around bug #5702 as well.
This reverts commit 824fe17511.
Following discussion on ticket #8342, I am not sure anymore that this is safe for branch. Reverting does not hurt much since the annoying debug messages that were cured by this commit are already (better) fixed by the patch for #8342.
Implement a more simple and elegant integration of the R package knitr. Now,
lyxknitr.R does not need to move or copy files at all.
This also fixes a bug: when /tmp was on a different file system (e.g.
encrypted home), lyxknitr.R failed to move files to /tmp because it relied on
R's 'file.rename' function, which in turn relied on the rename function in
<stdio.h>, which was failing with the EXDEV errno.
Patch from Yihui Xie.
This assures that refs to existing labels are not being touched if a new label with a duplicate name is created, and the name then changed by the duplicate checker.
Branch candidate.
(cherry picked from commit 86cccf1077)
Those commands can also be used in text mode but tex2lyx tries to
translate their argument causing havoc. So, import the whole commands
as ERT.
(cherry picked from commit ac92f2a79b)
The mhchem package treats the caret both as a shorthand for \uparrow or
as a superscript operator according to whether it is surrounded by
spaces or not. The \ce and \cf insets allow inserting spaces but there
is no provision for inserting a space after the caret, which is always
considered by LyX as a superscript operator. The solution here is to
insert a space after the caret if the superscript is empty or an empty
brace inset.
Mathed does not allow empty superscripts, so an empty brace has to be
inserted when working in LyX. On the other hand, when importing latex
code, an empty superscript is retained.
This has no effect whatsoever for normal latex code, as a space after
the caret is ignored. In any case, the output is only changed if an
empty brace inset is used as superscript. Specifically, the output is
changed from "^{{}}" to "^ {}".
(cherry picked from commit f251e01892)
Fix thinko in Undo::endUndoGroup.
Do not reset undo groups in Undo::clean
The underlying problem remains: the various VC functions should not
always reload the buffer or at least should use the parameter
clearUndo=false.
Filenames embraced in <...> can occur anywhere on the line and multiple times. This fixes for me the case that graphics included via ERT were not tracked. It also fixes#8336.
(cherry picked from commit e8a01d099a)
This is the same protection used for \cite{}. Although "ulem" commands
don't strictly need this protection with \ref{} and friends, this helps
when one wants to use another package souch as "soul".
Indeed, ulem's \uline{} doesn't hyphenate words, while soul's \ul{} does,
and thus the output is much nicer.
With this patch, replacing ulem with soul is as simple as adding
\usepackage{soul}
\renewcommand{\uline}[1]{\ul{#1}}
to the preamble, without worrying about manually enclosing in \mbox the
\ref commands. In any case, the output from ulem remains unchanged.
Another possibility offered by soul is that of typesetting as
"yellow highlighted" the underlined text. This is achieved by adding
\usepackage{color,soul}
\renewcommand{\uline}[1]{\hl{#1}}
to the preamble.
(cherry picked from commit 91afc2430d)
(cherry picked from commit 44b3278006)
Fix the wrong cursor move when forward flag is false:
The forward flag is used to place the cursor behind the replaced text if it's true.
But it's not correct to move the cursor if it's false. The cursor is in front of the
replacement already after the replaceSelectionWithString() was done.
(cherry picked from commit 430cf3ee5e)
The goal here is to get rid of the old code that modified variables
LANGUAGE and LC_ALL, therefore creating the problems mentionned
in the ticket.
In the new system, there is no explicit "GUI" message handler, that
needs to be reset at each language change. Instead, getGuiMessages
calls getMessages with the correct parameter. This allows to simplify
greatly the code and to remove a lot of old cruft.
The code does a reload on the buffer to avoid loose pointers if the
file changes directory. This commit adds a bool parameter to
Buffer::reload to allow for keeping the undo stack intact. This is of
couse only wanted in this case, not when reloading an earlier version
of the file.
In the existing code for setting layout of pragraph parameters,
Text::undoSpan is used to "guess" which paragraphs should be saved in Undo.
With this patch the approach is more precise: before every explicit change
to a paragraph, a Cursor::recordUndo call is inserted. This is much more robust than trying to guess.
In particular, we do not look at depth changes at all, since they are now
handled in updateBuffer since #8159 has been fixed.
It is not a good idea to slice an utf8 string at arbitrary offsets, we have to work on a docstring instead.
We need unfortunately to switch back and forth between utf8 and docstring.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@40149 a592a061-630c-0410-9148-cb99ea01b6c8
* Assure that really no language package is called when none is selected.
* Only call global custom package if global is desired.
This is a candidate for branch as well.
sectioning when we see an appendix. This fixes bug #8271, whose root
cause was the fact that we were resetting all the counters inside ERT.
Conflicts:
src/TextClass.h
then trying to compile.
There are really two problems here. One is that the renamed
buffer needs to be reloaded. All kinds of files, etc, may not
exist any more, if we've been saved to a new directory; our
children e.g. may not be in the right place. And, in this case,
we may no longer be a child of our old parent. Reloading will
fix all of that.
On reload, though, we need to clear our parent, since we may
not have one any more. It will get reset if need be.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@40609 a592a061-630c-0410-9148-cb99ea01b6c8
(cherry picked from commit 9283cbdbcb)
Use the short version of a path, which is guaranteed to be ascii and
works even if the path is not encodable in the current codepage.
(cherry picked from commit 08b3d492fa)
Fixes bug #7111: Assertion with undo and InsetBibitem
* add Paragraph::brokenBiblio(), with tells whether there is something to fix.
* rename Paragraph::checkBiblio to fixBiblio; simplify it greatly by using
InsetList methods
* In TextMetrics::redoParagraph, call recordUndo before fixBiblio (only when
there is something to fix obviously)
Special care is taken to update cursor only when it makes sense. Note
that there are cases where undo information is not recorded (current
cursor not in the slice where action happens)
Babel settings might contain @ characters. Check for this and wrap the settings into \makeatletter ... \makeatother switches if necessary (see discussion at #8265).
- UserGuide.lyx: fix description of the labeling lists, fixes also bug #8224
- German UserGuide.lyx: adapt some sections to be compliant with the other language variants
- apa.layout: the commands \volume, \copnum and \notes are only allowed in the preamble; fixes bug #8187
- APA.lyx: the template missed the \note command
(backported from master)
The idea is to record undo at the place where the document is modified:
1/ in Buffer::updateBuffer, add a recordUndo, with the caveat that a
const_cast has to be used (because updateBuffer is const but
modifies the document, go figure).
2/ in GuiApplication::dispatch, add an extra undo group that
encompasses the updateBuffer call. Some other undo groups may be
redundant now, but it is not a problem since they do not cost
anything.
For some unknown reason, the paste code likes to call Cursor::setSelection(), which is not appropriate here since we are not trying to set a selection at this point.
Text::outerFont looks recursively for paragraphs before the current one
which has a lower depth. If such a paragraph cannot be found, depthHook
and outerHook return the current paragraph. As such, we end up in an
infinite loop. So, if we find a par_depth that was the same as the
previous one, we apparently can't find a suitable paragraph and we should
quit the loop.
(cherry picked from commit b17250d7eb)
hard disk drive like D:\.
In this case, the working dir has already a slash at the end.
Appending another one would result in a path ending with a double slash,
which has a special meaning when used in TEXINPUTS (all subdirs would
be recursively scanned). So, avoid doing that.
(cherry picked from commit 93ebb7a863)
When using, e.g., a 'mathcal' inset in math, the inline completion and
other special characters like '\#', '{..}' are are painted in the
'mathcal' font as well. This is overcome by setting the mathnormal font
before painted these characters.
(cherry picked from commit 6377296492)
If no mask is supplied or the mask is attached to the end of the filename, we end up with unexpected names like
<system-temp-dir>\lyx_tmpdir.qHp780.vcr780_<mask>
instead of a temporary file in the lyx temporary directory like
<system-temp-dir>\lyx_tmpdir.qHp780\<mask>.vcr780.
(cherry picked from commit 5e4e4b674c)
On windows the temporary filename consists of uppercase characters. This
causes that the extension does not get replaced, and the logfile is left
behind.
Checking the extension case insensitively will correctly remove the
logfile.
(cherry picked from commit a02bfeebc5)
is intended for us, i.e., if the first argument is "box". Maybe we
should also check to make sure that the rest of the arguments are
good, but we used just to return true no matter what the argument
was, so this is an improvement.
LFUN_INSET_MODIFY is really kind of a mess.
The LATEX_LIST_ENVIRONMENT and LATEX_BIB_ENVIRONMENT type paragraphs are
not yet implemented in DocBook export. However, we need to actively skip
these paragraphs in order not to end up in an endless loop.
(cherry picked from commit fa9bd04ea4)
If the stream is good (i.e. there are still tokens) and we expect an
argument, we call getArg(). However, if there are only spaces, the stream
suddenly isn't good anymore after 'skipSpaces' and we would get an error
when calling 'getChar'. Therefore we have to check whether the stream is
still good.
MathParser: Do not rewind the stream if we can't read from it
If the stream is not good, we don't need to 'putback', because we didn't
read anything yet. If we now do rewind the stream, we are asking for
problems as in bug #8089.
This was introduced in [3cafb856\lyxgit] to fix bug #4318.
(cherry picked from commit 26dcfcd343)
(cherry picked from commit 1ef930c058)