Commit Graph

85 Commits

Author SHA1 Message Date
Richard Heck
27e27db147 Add FIXME concerning bug #8599. 2013-03-18 19:31:04 -04:00
Richard Heck
5f0e82b72d Fix bug #8597: Output only (ref) for \eqref, not: equation (ref). 2013-03-18 18:09:22 -04:00
Richard Heck
86994bf753 Add a member to TocItem that tells us whether the item in question
is included in output.
2013-03-08 16:38:18 -05:00
Richard Heck
ecef54500d Introduce max_length parameter for plaintext() output routines,
so we can write a limited amount when using this for TOC and
tooltip output.

This should solve the problem with slowness that Kornel noticed,
which was caused by our trying to write an entire plaintext
bibliography every time we updated the TOC. We did that because
he had a bibliography inside a branch, and we use plaintext for
creating the tooltip that goes with the branch list.

Other related bugs were fixed along the way. E.g., it turns out
that, if someone had an InsetInclude inside a branch, then we would
have been writing a *plaintext file* for that inset every time we
updated the TOC. I wonder if some of the other reports of slowness
we have received might be due to this kind of issue?
2013-03-08 15:12:58 -05:00
Richard Heck
1b7d812e51 Fix really silly logic error. This should make prettyref-based
files work better when converted to refstyle.
2013-02-07 08:45:21 -05:00
Enrico Forestieri
91afc2430d Protect underlined \ref{} commands by enclosing them in \mbox{}.
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.
2012-08-30 14:09:23 +02:00
Richard Heck
e5fea4dabb Comments.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@40356 a592a061-630c-0410-9148-cb99ea01b6c8
2011-12-03 23:15:04 +00:00
Richard Heck
e47d0dfb0d Fix bug with output of prettyref chapter references.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@39288 a592a061-630c-0410-9148-cb99ea01b6c8
2011-07-13 15:18:29 +00:00
Richard Heck
5db4b7eb16 Move a bunch of code from Buffer to BufferParams. The point of this
is contained in the next commit.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@38742 a592a061-630c-0410-9148-cb99ea01b6c8
2011-05-13 19:39:56 +00:00
Richard Heck
4b5a58dca9 Forgot to change this in XHTML output, so formatted references weren't
getting output properly.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@38404 a592a061-630c-0410-9148-cb99ea01b6c8
2011-04-15 11:28:56 +00:00
Vincent van Ravesteijn
72ad0bdfbf Simplify logic in InsetRef::latex().
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@37960 a592a061-630c-0410-9148-cb99ea01b6c8
2011-03-19 10:37:24 +00:00
Vincent van Ravesteijn
eec88b7e5e Revert wrong previous commit.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@37959 a592a061-630c-0410-9148-cb99ea01b6c8
2011-03-19 10:34:59 +00:00
Vincent van Ravesteijn
e52af5f897 Simplify logic in InsetRef::latex().
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@37958 a592a061-630c-0410-9148-cb99ea01b6c8
2011-03-19 10:31:43 +00:00
Richard Heck
69ab57ab89 What is output as \eqref under prettyref needs to be handled differently
under refstyle, since (a) the default refstyle.cfg defines \eqref itself
and (b) does NOT define it the way AMS does. So we simply output:
	(\ref{label})
in this case, to match what we say in the UI.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@37918 a592a061-630c-0410-9148-cb99ea01b6c8
2011-03-13 20:29:52 +00:00
Enrico Forestieri
d866717ef7 Integrate texrow with otexstream in order to perform automatic line
counting when exporting to latex. This is done for the code comprised
between \begin{document} and \end{document}, while the preamble code
still needs manual calls to TexRow::newline() for registering new lines.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@37584 a592a061-630c-0410-9148-cb99ea01b6c8
2011-02-10 20:02:48 +00:00
Enrico Forestieri
1ef605f625 Introduce a wrapper class for odocstream to help ensuring that no
blank lines may be inadvertently output. This is achieved by using two
special iomanip-like variables (breakln and safebreakln) in the lyx::
namespace. When they are inserted in the stream, a newline is output
only if not already at the beginning of a line. The difference between
breakln and safebreakln is that, if needed, the former outputs '\n'
and the latter "%\n".
In future, the new class will also be used for counting the number of
newlines issued. Even if the infractrure for doing that is already in
place, the counting is essentially still done the old way.
There are still places in the code where the functionality of the
class could be used, most probably. ATM, it is used for InsetTabular,
InsetListings, InsetFloat, and InsetText.
The Comment and GreyedOut insets required a special treatment and a
new InsetLayout parameter (Display) has been introduced. The default
for Display is "true", meaning that the corresponding latex
environment is of "display" type, i.e., it stands on its own, whereas
"false" means that the contents appear inline with the text. The
latter is the case for both Comment and GreyedOut insets.
Mostly, the only visible effects on latex exports should be the
disappearing of some redundant % chars and the appearing/disappearing
of null {} latex groups after a comment or lyxgreyedout environments
(they are related to the presence or absence of a space immediately
after those environments), as well as the fact that math environments
are now started on their own lines.
As a last thing, only the latex code between \begin{document} and
\end{document} goes through the new class, the preamble being directly
output through odocstream, as usual.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@37360 a592a061-630c-0410-9148-cb99ea01b6c8
2011-01-29 02:41:13 +00:00
Richard Heck
4b1777d2fa Inset::addToToc() can and should be const. It wasn't, I take it, because
of things like:
  pit.push_back(CursorSlice(*this));
which I've had to change to:
  pit.push_back(CursorSlice(const_cast<InsetCaption &>(*this)));
and similarly in a few other places.

If anyone thinks we should instead have:
  explicit CursorSlice(Inset const &);
then we can also do that.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@37192 a592a061-630c-0410-9148-cb99ea01b6c8
2011-01-12 22:23:27 +00:00
Richard Heck
a2111a1c50 Simplify InsetRef::forToc().
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@36978 a592a061-630c-0410-9148-cb99ea01b6c8
2010-12-20 22:47:09 +00:00
Richard Heck
9e9c96035c Finish disentangling tocString(). We introduce a new method, forToc(),
that also makes sure it doesn't do more work than it needs to do, by
limiting the size to 40 characters. Previously, InsetBranch::addToToc()
would have added a string representing the entire contents of the
branch! It's hard to imagine that having to recalculate that sort of
thing doesn't cause some problems with speed, especially in documents
with lots of notes and branches and such.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@36974 a592a061-630c-0410-9148-cb99ea01b6c8
2010-12-20 21:55:09 +00:00
Richard Heck
832d6cd7e1 Begin undoing the tocString() mess by renaming that routine.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@36889 a592a061-630c-0410-9148-cb99ea01b6c8
2010-12-15 01:34:04 +00:00
Richard Heck
0940cd77d4 Better way of doing these checks, suggested by Enrico.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@36356 a592a061-630c-0410-9148-cb99ea01b6c8
2010-11-17 22:17:53 +00:00
Richard Heck
4bf281106b Be more careful here about isalpha and isalnum. Per Enrico's suggestion,
we first do a range test, then check the status. I think this is right
in both cases.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@36351 a592a061-630c-0410-9148-cb99ea01b6c8
2010-11-17 21:19:01 +00:00
Richard Heck
6f76593069 Fix a bug in getFormattedReference().
Also, change from using the "cha" prefix for chapters, a la prettyref,
to the "chap" prefix, a la refstyle. We alias \pr@chap to \pr@cha for
prettyref users.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@36238 a592a061-630c-0410-9148-cb99ea01b6c8
2010-11-10 16:45:55 +00:00
Richard Heck
19aa16756c Fix bug in fallback reference output with refstyle. Based on idea by
Jean-Pierre Chretien.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@36211 a592a061-630c-0410-9148-cb99ea01b6c8
2010-11-08 17:50:02 +00:00
Richard Heck
96dfec471f Partially fix #5108.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@35984 a592a061-630c-0410-9148-cb99ea01b6c8
2010-11-01 21:54:20 +00:00
Richard Heck
91b4afa3c1 This has to be delayed, since otherwise it provides the command before
the user gets to do so.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@35907 a592a061-630c-0410-9148-cb99ea01b6c8
2010-10-29 14:31:52 +00:00
Richard Heck
16a1c042ef Fix prettyref output.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@35906 a592a061-630c-0410-9148-cb99ea01b6c8
2010-10-29 13:07:05 +00:00
Vincent van Ravesteijn
2bbf8e5f2d Remove InsetCommand::mailer_name_.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@35893 a592a061-630c-0410-9148-cb99ea01b6c8
2010-10-29 00:46:21 +00:00
Richard Heck
1fbddcb149 Change the way we output formatted references under refstyle to avoid
some problems with the previous \\lyxref macro.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@35882 a592a061-630c-0410-9148-cb99ea01b6c8
2010-10-28 15:15:14 +00:00
Vincent van Ravesteijn
6d82aacf48 Remove InsetRef::isLatex. This no longer needed as we always can access the Buffer nowadays from the Inset.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@35874 a592a061-630c-0410-9148-cb99ea01b6c8
2010-10-27 22:34:18 +00:00
Richard Heck
bfa9991f93 Fix bug #6962. I hadn't see how these were being escaped.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@35757 a592a061-630c-0410-9148-cb99ea01b6c8
2010-10-21 17:56:00 +00:00
Richard Heck
4ff48f1d54 Need ifthen for this, too.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@35647 a592a061-630c-0410-9148-cb99ea01b6c8
2010-10-14 14:02:49 +00:00
Richard Heck
01013c0785 Refstyle support. The user can now choose between prettyref and restyle
for formatted references. Fixes #2295, in so far as it makes it possible
to translate formatted references.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@35623 a592a061-630c-0410-9148-cb99ea01b6c8
2010-10-13 12:36:53 +00:00
Uwe Stöhr
7d68833dc9 remove unused include of FuncRequest
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@35189 a592a061-630c-0410-9148-cb99ea01b6c8
2010-08-24 03:07:09 +00:00
Richard Heck
7d4c560f87 Remove Nameref support. Too many issues involving translation, quotes,
etc.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@34920 a592a061-630c-0410-9148-cb99ea01b6c8
2010-07-16 15:19:04 +00:00
Richard Heck
47db764ccc Nameref support.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@34884 a592a061-630c-0410-9148-cb99ea01b6c8
2010-07-13 03:23:29 +00:00
Richard Heck
d65020b293 s/updateLabels/updateBuffer/g, per a suggestion of Abdel's.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@33613 a592a061-630c-0410-9148-cb99ea01b6c8
2010-03-03 22:13:45 +00:00
Richard Heck
fce0bea8a2 Truncate long cross-references and show the whole thing in a tooltip.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@33586 a592a061-630c-0410-9148-cb99ea01b6c8
2010-02-26 20:16:12 +00:00
Jürgen Spitzmüller
1178b30c54 generalize special handling of command inset parameters on LaTeX output (escaping, etc.).
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@33461 a592a061-630c-0410-9148-cb99ea01b6c8
2010-02-13 13:08:32 +00:00
Abdelrazak Younes
377cdd5f6c Transfer LyXfunc code to GuiApplication::dispatch() and getStatus(). Now
a lot of simplification is possible. Except some instability period...


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@33389 a592a061-630c-0410-9148-cb99ea01b6c8
2010-02-09 16:11:13 +00:00
Richard Heck
c2ac70552c Introduce a "formatted counter" for use with formatted reference during
XHTML output.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@33113 a592a061-630c-0410-9148-cb99ea01b6c8
2010-01-20 20:33:36 +00:00
Richard Heck
caa4e94bf0 Get rid of some magic booleans in updateLabels() and related routines.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@33110 a592a061-630c-0410-9148-cb99ea01b6c8
2010-01-20 19:42:12 +00:00
Richard Heck
22dc345e8c Better XHTML output for InsetRef.
The idea here is to implement something like \refstepcounter for LyX. We
do this by tracking the "active" counter in Counters.cpp. We also have
to track when we go in and out of environments to which counters are
local, and so on and so forth.

This all gets done in updateLabels(), but only if we are producing
output, which is why I added the output boolean a while ago.

I expect there are bugs in here, though it seems to work pretty well
with the documents I've tested.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@33108 a592a061-630c-0410-9148-cb99ea01b6c8
2010-01-20 19:03:17 +00:00
Richard Heck
3e654186d2 Move the StartTag, EndTag, and CompTag classes into the html namespace.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@33099 a592a061-630c-0410-9148-cb99ea01b6c8
2010-01-19 22:08:04 +00:00
Richard Heck
bb80bd78f9 Whitespace.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@32690 a592a061-630c-0410-9148-cb99ea01b6c8
2009-12-31 15:52:16 +00:00
Richard Heck
996505c2ae This patch introduces an optional argument to Buffer::updateLabels(), so
as to allow us to call the routine when we are preparing for output and
so to do certain things we might not want to do every time. 

This is an abuse of updateLabels(), in a way, but updateLabels() long
ago became the general recurse-through-the-Buffer routine, and to
implement the sort of thing I want to do here in validate(), say, much
of the code in updateLabels()---in particular, the counter-update
code---would have to be duplicated. So I believe this is the best, and
easiest, way to go.

Actual use of the new argument will follow.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@32318 a592a061-630c-0410-9148-cb99ea01b6c8
2009-12-04 03:03:38 +00:00
Richard Heck
6acadc3530 Fix silly omission.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@32258 a592a061-630c-0410-9148-cb99ea01b6c8
2009-11-30 22:45:32 +00:00
Richard Heck
c5738e5af6 Restore XHTML output for InsetLabel and InsetRef. There are a couple
other fixes in here, too.

There is an issue here which I guess I'll deal with later, namely, that
the name attribute for <a> is unavailable in XHTML 1.1, which is what we
need for MathML support, at least in Firefox. Firefox will deal with it
if it's there, but the document won't validate. I'll figure out what to
do about this later.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@32226 a592a061-630c-0410-9148-cb99ea01b6c8
2009-11-28 21:37:47 +00:00
Richard Heck
5499281403 Use that again.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@32199 a592a061-630c-0410-9148-cb99ea01b6c8
2009-11-25 16:53:02 +00:00
Richard Heck
85503ec1b9 Get XHTML output for InsetRef working, again in a fairly primitive way. We just
use the label name as associated text, and put it into square brackets. It'd be
nice to be able to do more, but for that we'd need to associate counters with
the labels, which would be nice for display, too. But we don't have that yet.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@31976 a592a061-630c-0410-9148-cb99ea01b6c8
2009-11-14 14:12:37 +00:00