2002-09-25 14:26:13 +00:00
|
|
|
|
/**
|
|
|
|
|
* \file insetfoot.C
|
|
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
|
* Licence details can be found in the file COPYING.
|
2002-03-21 17:09:55 +00:00
|
|
|
|
*
|
2002-09-25 14:26:13 +00:00
|
|
|
|
* \author J<EFBFBD>rgen Vigna
|
|
|
|
|
* \author Lars Gullik Bj<EFBFBD>nnes
|
2002-03-21 17:09:55 +00:00
|
|
|
|
*
|
2003-08-23 00:17:00 +00:00
|
|
|
|
* Full author contact details are available in file CREDITS.
|
2000-06-28 16:03:01 +00:00
|
|
|
|
*/
|
2000-03-08 13:52:57 +00:00
|
|
|
|
|
|
|
|
|
#include <config.h>
|
|
|
|
|
|
|
|
|
|
#include "insetfoot.h"
|
2003-09-05 09:01:27 +00:00
|
|
|
|
|
2000-03-08 13:52:57 +00:00
|
|
|
|
#include "gettext.h"
|
2002-05-14 14:22:11 +00:00
|
|
|
|
// the following are needed just to get the layout of the enclosing
|
|
|
|
|
// paragraph. This seems a bit too much to me (JMarc)
|
|
|
|
|
#include "lyxlayout.h"
|
2003-11-05 12:06:20 +00:00
|
|
|
|
#include "outputparams.h"
|
2003-09-06 17:23:08 +00:00
|
|
|
|
#include "paragraph.h"
|
2003-08-26 16:36:53 +00:00
|
|
|
|
#include "paragraph_funcs.h"
|
2000-03-08 13:52:57 +00:00
|
|
|
|
|
2003-09-05 17:23:11 +00:00
|
|
|
|
#include "support/std_ostream.h"
|
2000-07-04 19:16:35 +00:00
|
|
|
|
|
2006-10-21 00:16:43 +00:00
|
|
|
|
|
|
|
|
|
namespace lyx {
|
2003-10-06 15:43:21 +00:00
|
|
|
|
|
|
|
|
|
using std::string;
|
2003-07-25 17:11:25 +00:00
|
|
|
|
using std::auto_ptr;
|
2003-09-05 09:01:27 +00:00
|
|
|
|
using std::ostream;
|
2002-02-16 15:59:55 +00:00
|
|
|
|
|
|
|
|
|
|
2002-03-03 20:25:07 +00:00
|
|
|
|
InsetFoot::InsetFoot(BufferParams const & bp)
|
|
|
|
|
: InsetFootlike(bp)
|
2000-03-08 13:52:57 +00:00
|
|
|
|
{
|
2006-10-08 09:36:16 +00:00
|
|
|
|
setLabel(_("foot"));
|
2001-04-02 14:02:58 +00:00
|
|
|
|
setInsetName("Foot");
|
2000-03-08 13:52:57 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2003-05-26 09:13:55 +00:00
|
|
|
|
InsetFoot::InsetFoot(InsetFoot const & in)
|
|
|
|
|
: InsetFootlike(in)
|
2001-07-27 12:03:36 +00:00
|
|
|
|
{
|
2006-10-08 09:36:16 +00:00
|
|
|
|
setLabel(_("foot"));
|
2001-07-27 12:03:36 +00:00
|
|
|
|
setInsetName("Foot");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2004-11-23 23:04:52 +00:00
|
|
|
|
auto_ptr<InsetBase> InsetFoot::doClone() const
|
2001-07-27 12:03:36 +00:00
|
|
|
|
{
|
2003-07-25 17:11:25 +00:00
|
|
|
|
return auto_ptr<InsetBase>(new InsetFoot(*this));
|
2001-07-27 12:03:36 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2006-09-09 18:52:00 +00:00
|
|
|
|
docstring const InsetFoot::editMessage() const
|
2000-03-08 13:52:57 +00:00
|
|
|
|
{
|
2006-09-09 18:52:00 +00:00
|
|
|
|
return _("Opened Footnote Inset");
|
2000-03-08 13:52:57 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2006-10-19 16:51:30 +00:00
|
|
|
|
int InsetFoot::latex(Buffer const & buf, odocstream & os,
|
2003-11-05 12:06:20 +00:00
|
|
|
|
OutputParams const & runparams_in) const
|
2000-03-08 13:52:57 +00:00
|
|
|
|
{
|
2003-11-05 12:06:20 +00:00
|
|
|
|
OutputParams runparams = runparams_in;
|
2004-08-05 09:18:54 +00:00
|
|
|
|
// footnotes in titling commands like \title have moving arguments
|
|
|
|
|
runparams.moving_arg |= runparams_in.intitle;
|
2004-10-26 21:16:44 +00:00
|
|
|
|
|
2004-10-25 09:11:12 +00:00
|
|
|
|
// in titling commands, \thanks should be used instead of \footnote.
|
|
|
|
|
// some classes (e.g. memoir) do not understand \footnote.
|
|
|
|
|
if (runparams_in.intitle)
|
|
|
|
|
os << "%\n\\thanks{";
|
|
|
|
|
else
|
|
|
|
|
os << "%\n\\footnote{";
|
2002-03-21 17:09:55 +00:00
|
|
|
|
|
2004-03-25 09:16:36 +00:00
|
|
|
|
int const i = InsetText::latex(buf, os, runparams);
|
2001-06-29 14:01:29 +00:00
|
|
|
|
os << "%\n}";
|
2002-03-21 17:09:55 +00:00
|
|
|
|
|
2001-04-02 14:02:58 +00:00
|
|
|
|
return i + 2;
|
2000-03-08 13:52:57 +00:00
|
|
|
|
}
|
2002-04-03 17:44:05 +00:00
|
|
|
|
|
|
|
|
|
|
2006-10-19 21:00:33 +00:00
|
|
|
|
int InsetFoot::docbook(Buffer const & buf, odocstream & os,
|
2003-11-05 12:06:20 +00:00
|
|
|
|
OutputParams const & runparams) const
|
2002-04-03 17:44:05 +00:00
|
|
|
|
{
|
|
|
|
|
os << "<footnote>";
|
2004-03-25 09:16:36 +00:00
|
|
|
|
int const i = InsetText::docbook(buf, os, runparams);
|
2002-04-03 17:44:05 +00:00
|
|
|
|
os << "</footnote>";
|
|
|
|
|
|
|
|
|
|
return i;
|
|
|
|
|
}
|
2006-10-21 00:16:43 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} // namespace lyx
|