1999-09-27 18:44:28 +00:00
|
|
|
// -*- C++ -*-
|
2003-08-23 00:17:00 +00:00
|
|
|
/**
|
2007-04-26 04:41:58 +00:00
|
|
|
* \file BufferParams.h
|
2003-08-23 00:17:00 +00:00
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
* Licence details can be found in the file COPYING.
|
2002-03-21 17:27:08 +00:00
|
|
|
*
|
2008-11-14 15:58:50 +00:00
|
|
|
* \author Lars Gullik Bjønnes
|
2003-08-23 00:17:00 +00:00
|
|
|
* \author Jean-Marc Lasgouttes
|
|
|
|
* \author John Levon
|
2008-11-14 15:58:50 +00:00
|
|
|
* \author André Pönitz
|
2002-03-21 17:27:08 +00:00
|
|
|
*
|
2003-08-23 00:17:00 +00:00
|
|
|
* Full author contact details are available in file CREDITS.
|
|
|
|
*/
|
1999-09-27 18:44:28 +00:00
|
|
|
|
1999-11-04 01:40:20 +00:00
|
|
|
#ifndef BUFFERPARAMS_H
|
|
|
|
#define BUFFERPARAMS_H
|
1999-09-27 18:44:28 +00:00
|
|
|
|
2008-04-20 15:00:11 +00:00
|
|
|
#include "Citation.h"
|
2020-11-30 20:34:16 +00:00
|
|
|
#include "ColorCode.h"
|
2021-01-22 09:34:41 +00:00
|
|
|
#include "ColorSet.h"
|
2012-03-13 16:13:31 +00:00
|
|
|
#include "DocumentClassPtr.h"
|
2009-02-11 23:22:10 +00:00
|
|
|
#include "LayoutModuleList.h"
|
2003-07-26 23:04:39 +00:00
|
|
|
#include "paper.h"
|
2021-03-06 15:53:33 +00:00
|
|
|
#include "WordLangTuple.h"
|
2001-12-28 13:26:54 +00:00
|
|
|
|
2003-09-15 20:23:57 +00:00
|
|
|
#include "support/copied_ptr.h"
|
2020-11-30 20:34:16 +00:00
|
|
|
#include "support/types.h"
|
2003-09-07 01:45:40 +00:00
|
|
|
|
2009-07-23 20:34:16 +00:00
|
|
|
#include <map>
|
2011-05-13 19:39:56 +00:00
|
|
|
#include <vector>
|
1999-09-27 18:44:28 +00:00
|
|
|
|
2006-10-21 00:16:43 +00:00
|
|
|
namespace lyx {
|
|
|
|
|
2008-03-15 00:22:54 +00:00
|
|
|
namespace support { class FileName; }
|
2007-11-28 15:25:07 +00:00
|
|
|
|
2020-10-15 19:27:52 +00:00
|
|
|
class Author;
|
|
|
|
class AuthorList;
|
2003-09-09 17:00:19 +00:00
|
|
|
class BranchList;
|
|
|
|
class Bullet;
|
2020-11-30 20:34:16 +00:00
|
|
|
class Buffer;
|
2008-02-28 01:42:02 +00:00
|
|
|
class DocumentClass;
|
2006-12-10 16:08:52 +00:00
|
|
|
class Encoding;
|
2010-03-31 19:38:05 +00:00
|
|
|
class Font;
|
2020-10-15 19:27:52 +00:00
|
|
|
class Format;
|
2009-04-16 07:29:01 +00:00
|
|
|
class IndicesList;
|
2007-11-07 23:25:08 +00:00
|
|
|
class Language;
|
2020-11-30 20:34:16 +00:00
|
|
|
class LaTeXFeatures;
|
This is the last of the commits that hopes to enforce the distinction between "layout files" and "document classes" that was introduced by the modules code. For the most part, these changes just refactor code from TextClass between: (a) a TextClass base class; (b) a LayoutFile subclass, which represents the information in a .layout file; and (c) a DocumentClass subclass, which represents the layout information associated with a Buffer---a LayoutFile plus Modules. Methods from TextClass have been apportioned between the three classes depending upon what is needed where, and signatures have been changed where necessary so that the right kind of class is required.
At this point, there are no simple TextClass objects in the main LyX code, and it is impossible to create them, since the TextClass constructor is protected. Only LayoutFile and DocumentClass objects can be constructed, and for the most part these are constructed only by their respective containers: BaseClassList and DocumentClassBundle. There is an exception: LayoutFile does have a public default constructor, but if anyone knows how to make it go away, please do.
There will be one or two more commits along these lines, but these will be simple renamings. For example, BaseClassList should be LayoutFileList.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23343 a592a061-630c-0410-9148-cb99ea01b6c8
2008-02-29 02:45:33 +00:00
|
|
|
class LayoutFile;
|
2008-02-29 02:50:12 +00:00
|
|
|
class LayoutFileIndex;
|
2017-04-13 20:51:48 +00:00
|
|
|
class Length;
|
2008-02-29 02:50:12 +00:00
|
|
|
class Lexer;
|
2020-11-30 20:34:16 +00:00
|
|
|
class otexstream;
|
2007-11-07 23:25:08 +00:00
|
|
|
class PDFOptions;
|
2003-09-09 17:00:19 +00:00
|
|
|
class Spacing;
|
|
|
|
class VSpace;
|
2000-03-17 10:14:46 +00:00
|
|
|
|
2020-11-30 22:00:40 +00:00
|
|
|
enum class Flavor : int;
|
2020-11-30 20:34:16 +00:00
|
|
|
enum class QuoteStyle : int;
|
2020-11-29 23:03:35 +00:00
|
|
|
|
2000-08-07 20:58:24 +00:00
|
|
|
/** Buffer parameters.
|
This is one of a series of patches that will merge the layout modules development in personal/branches/rgheck back into the tree.
Design goal: Allow the use of layout "modules", which are to LaTeX packages as layout files are to LaTeX document classes. Thus, one could have a module that defined certain character styles, environments, commands, or what have you, and include it in various documents, each of which uses a different document class, without having to modify the layout files themselves. For example, a theorems.module could be used with article.layout to provide support for theorem-type environments, without having to modify article.layout itself, and the same module could be used with book.layout, etc.
This first patch does some reworking of the infrastructrue. We need to distinguish between the TextClass that a particular document is using and the layout of that document, since modules, in particular, can modify the layout. The solution adopted here is to add a TextClass pointer to BufferParams, which will hold the layout. The layout itself is then constructed from the TextClass the document is using. At present, this is completely trivial, but that will change when modules are added.
The pointer in question is a boost::shared_ptr. This is needed because CutAndPaste saves a copy of the layout with each cut or copied selection. We cannot assume the selection vanishes when the document is closed, so there are two options: (i) keep a list of all the layouts that have ever been used by any document; (ii) used some kind of smart pointer. The latter seems preferable, as the former would waste memory. More importantly, the use of a smart pointer allows modules to be modified on disk and then reloaded while LyX is running, and it will eventually allow the same for layout files.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19756 a592a061-630c-0410-9148-cb99ea01b6c8
2007-08-23 16:41:13 +00:00
|
|
|
* This class contains all the parameters for this buffer's use. Some
|
2003-09-15 20:23:57 +00:00
|
|
|
* work needs to be done on this class to make it nice. Now everything
|
|
|
|
* is in public.
|
|
|
|
*/
|
1999-09-27 18:44:28 +00:00
|
|
|
class BufferParams {
|
|
|
|
public:
|
1999-11-15 12:01:38 +00:00
|
|
|
///
|
2008-03-15 00:22:54 +00:00
|
|
|
enum ParagraphSeparation {
|
1999-11-15 12:01:38 +00:00
|
|
|
///
|
2008-03-15 00:22:54 +00:00
|
|
|
ParagraphIndentSeparation,
|
1999-11-15 12:01:38 +00:00
|
|
|
///
|
2008-03-15 00:22:54 +00:00
|
|
|
ParagraphSkipSeparation
|
1999-11-15 12:01:38 +00:00
|
|
|
};
|
|
|
|
///
|
1999-09-27 18:44:28 +00:00
|
|
|
BufferParams();
|
|
|
|
|
2007-05-01 08:26:40 +00:00
|
|
|
/// get l10n translated to the buffers language
|
2008-03-15 00:22:54 +00:00
|
|
|
docstring B_(std::string const & l10n) const;
|
2007-05-01 08:26:40 +00:00
|
|
|
|
2003-03-12 02:39:12 +00:00
|
|
|
/// read a header token, if unrecognised, return it or an unknown class name
|
2008-03-15 00:22:54 +00:00
|
|
|
std::string readToken(Lexer & lex,
|
2007-11-28 15:25:07 +00:00
|
|
|
std::string const & token, ///< token to read.
|
2021-01-22 09:34:41 +00:00
|
|
|
support::FileName const & filename);
|
2003-03-12 02:39:12 +00:00
|
|
|
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
Fix bug #4812 (Layout in local directory lost on Save As, Copying)
The "save-as" part of the bug is fixed by extending the \textclass tag
such that, if a local layout file is used, its path relative to the
document directory is now stored together with the name. If a relative
path cannot be used, an absolute one is used but, in this case, the
document is not usable on a different platform.
The "copy" part is fixed by introducing a new \origin tag, which is
written when the file is saved. This tag stores the absolute path of
the document directory. If the document is manually copied to a
different location, the local layout file is retrivied by using
\origin (which is only updated on save).
This new tag may prove useful also for locating other files when the
document is manually moved to a different directory.
As in the original implementation the files needed for the layout
(for example, a latex class) had to be in the same directory as the
layout file, this directory has also to be added to TEXINPUTS.
2015-05-13 19:40:51 +00:00
|
|
|
void writeFile(std::ostream &, Buffer const *) const;
|
1999-09-27 18:44:28 +00:00
|
|
|
|
2007-12-14 14:51:47 +00:00
|
|
|
/// check what features are implied by the buffer parameters.
|
|
|
|
void validate(LaTeXFeatures &) const;
|
|
|
|
|
2015-10-31 06:12:31 +00:00
|
|
|
/** \returns true if the babel package is used (interrogates
|
2010-07-17 14:49:30 +00:00
|
|
|
* the BufferParams, a LyXRC variable, and the document class).
|
2003-09-15 20:23:57 +00:00
|
|
|
* This returned value can then be passed to the insets...
|
2003-05-22 22:44:30 +00:00
|
|
|
*/
|
2011-02-13 21:41:44 +00:00
|
|
|
bool writeLaTeX(otexstream &, LaTeXFeatures &,
|
2010-01-07 10:01:26 +00:00
|
|
|
support::FileName const &) const;
|
2003-02-16 00:54:43 +00:00
|
|
|
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
|
|
|
void useClassDefaults();
|
2001-09-17 15:39:58 +00:00
|
|
|
///
|
|
|
|
bool hasClassDefaults() const;
|
|
|
|
|
2009-07-19 21:13:27 +00:00
|
|
|
///
|
2017-04-13 20:51:48 +00:00
|
|
|
Length const & getParIndent() const;
|
2009-07-19 21:13:27 +00:00
|
|
|
///
|
2017-04-13 20:51:48 +00:00
|
|
|
void setParIndent(Length const & indent);
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
2003-09-09 17:00:19 +00:00
|
|
|
VSpace const & getDefSkip() const;
|
2000-02-04 09:38:32 +00:00
|
|
|
///
|
2003-09-09 17:00:19 +00:00
|
|
|
void setDefSkip(VSpace const & vs);
|
1999-09-27 18:44:28 +00:00
|
|
|
|
2017-04-19 14:19:18 +00:00
|
|
|
///
|
2017-04-19 15:49:11 +00:00
|
|
|
Length const & getMathIndent() const;
|
2017-04-19 14:19:18 +00:00
|
|
|
///
|
2017-04-19 15:49:11 +00:00
|
|
|
void setMathIndent(Length const & indent);
|
2017-04-19 14:19:18 +00:00
|
|
|
|
2017-04-05 20:22:47 +00:00
|
|
|
/// Whether formulas are indented
|
2017-04-13 00:31:26 +00:00
|
|
|
bool is_math_indent;
|
2017-04-05 20:22:47 +00:00
|
|
|
|
2017-04-25 00:28:10 +00:00
|
|
|
|
2017-05-12 09:57:17 +00:00
|
|
|
enum MathNumber { DEFAULT, LEFT, RIGHT };
|
|
|
|
/// number formulas on left/right/default
|
2017-05-13 18:39:45 +00:00
|
|
|
MathNumber math_numbering_side;
|
2017-04-25 00:28:10 +00:00
|
|
|
|
2017-05-12 13:07:02 +00:00
|
|
|
/// Convenience function for display: like math_number, but
|
|
|
|
/// DEFAULT is replaced by the best guess we have.
|
|
|
|
MathNumber getMathNumber() const;
|
|
|
|
|
This is one of a series of patches that will merge the layout modules development in personal/branches/rgheck back into the tree.
Design goal: Allow the use of layout "modules", which are to LaTeX packages as layout files are to LaTeX document classes. Thus, one could have a module that defined certain character styles, environments, commands, or what have you, and include it in various documents, each of which uses a different document class, without having to modify the layout files themselves. For example, a theorems.module could be used with article.layout to provide support for theorem-type environments, without having to modify article.layout itself, and the same module could be used with book.layout, etc.
This first patch does some reworking of the infrastructrue. We need to distinguish between the TextClass that a particular document is using and the layout of that document, since modules, in particular, can modify the layout. The solution adopted here is to add a TextClass pointer to BufferParams, which will hold the layout. The layout itself is then constructed from the TextClass the document is using. At present, this is completely trivial, but that will change when modules are added.
The pointer in question is a boost::shared_ptr. This is needed because CutAndPaste saves a copy of the layout with each cut or copied selection. We cannot assume the selection vanishes when the document is closed, so there are two options: (i) keep a list of all the layouts that have ever been used by any document; (ii) used some kind of smart pointer. The latter seems preferable, as the former would waste memory. More importantly, the use of a smart pointer allows modules to be modified on disk and then reloaded while LyX is running, and it will eventually allow the same for layout files.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19756 a592a061-630c-0410-9148-cb99ea01b6c8
2007-08-23 16:41:13 +00:00
|
|
|
/** Whether paragraphs are separated by using a indent like in
|
2003-09-15 20:23:57 +00:00
|
|
|
* articles or by using a little skip like in letters.
|
|
|
|
*/
|
2008-03-15 00:22:54 +00:00
|
|
|
ParagraphSeparation paragraph_separation;
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
2020-11-30 20:34:16 +00:00
|
|
|
QuoteStyle quotes_style;
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
2016-12-25 11:19:02 +00:00
|
|
|
bool dynamic_quotes;
|
|
|
|
///
|
2003-10-06 15:43:21 +00:00
|
|
|
std::string fontsize;
|
2010-10-18 14:20:03 +00:00
|
|
|
/// Get the LayoutFile this document is using.
|
This is the last of the commits that hopes to enforce the distinction between "layout files" and "document classes" that was introduced by the modules code. For the most part, these changes just refactor code from TextClass between: (a) a TextClass base class; (b) a LayoutFile subclass, which represents the information in a .layout file; and (c) a DocumentClass subclass, which represents the layout information associated with a Buffer---a LayoutFile plus Modules. Methods from TextClass have been apportioned between the three classes depending upon what is needed where, and signatures have been changed where necessary so that the right kind of class is required.
At this point, there are no simple TextClass objects in the main LyX code, and it is impossible to create them, since the TextClass constructor is protected. Only LayoutFile and DocumentClass objects can be constructed, and for the most part these are constructed only by their respective containers: BaseClassList and DocumentClassBundle. There is an exception: LayoutFile does have a public default constructor, but if anyone knows how to make it go away, please do.
There will be one or two more commits along these lines, but these will be simple renamings. For example, BaseClassList should be LayoutFileList.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23343 a592a061-630c-0410-9148-cb99ea01b6c8
2008-02-29 02:45:33 +00:00
|
|
|
LayoutFile const * baseClass() const;
|
2008-02-28 21:04:55 +00:00
|
|
|
///
|
This is the last of the commits that hopes to enforce the distinction between "layout files" and "document classes" that was introduced by the modules code. For the most part, these changes just refactor code from TextClass between: (a) a TextClass base class; (b) a LayoutFile subclass, which represents the information in a .layout file; and (c) a DocumentClass subclass, which represents the layout information associated with a Buffer---a LayoutFile plus Modules. Methods from TextClass have been apportioned between the three classes depending upon what is needed where, and signatures have been changed where necessary so that the right kind of class is required.
At this point, there are no simple TextClass objects in the main LyX code, and it is impossible to create them, since the TextClass constructor is protected. Only LayoutFile and DocumentClass objects can be constructed, and for the most part these are constructed only by their respective containers: BaseClassList and DocumentClassBundle. There is an exception: LayoutFile does have a public default constructor, but if anyone knows how to make it go away, please do.
There will be one or two more commits along these lines, but these will be simple renamings. For example, BaseClassList should be LayoutFileList.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23343 a592a061-630c-0410-9148-cb99ea01b6c8
2008-02-29 02:45:33 +00:00
|
|
|
LayoutFileIndex const & baseClassID() const;
|
|
|
|
/// Set the LyX layout file this document is using.
|
2011-12-03 22:15:11 +00:00
|
|
|
/// NOTE: This does not call makeDocumentClass() to update the local
|
2008-02-28 01:42:02 +00:00
|
|
|
/// DocumentClass. That needs to be done manually.
|
2014-03-29 22:52:36 +00:00
|
|
|
/// \param classname: the name of the layout file
|
2018-11-16 20:47:24 +00:00
|
|
|
/// \param path: non-empty only for local layout files
|
|
|
|
bool setBaseClass(std::string const & classname,
|
|
|
|
std::string const & path = std::string());
|
2008-01-05 17:04:56 +00:00
|
|
|
/// Adds the module information to the baseClass information to
|
2008-02-28 01:42:02 +00:00
|
|
|
/// create our local DocumentClass.
|
2012-06-04 17:39:24 +00:00
|
|
|
/// NOTE: This should NEVER be called externally unless one immediately goes
|
|
|
|
/// on to class BufferView::updateDocumentClass(). The exception, of course,
|
|
|
|
/// is in GuiDocument, where we use a BufferParams simply to hold a copy of
|
|
|
|
/// the parameters from the active Buffer.
|
2021-01-14 06:15:19 +00:00
|
|
|
void makeDocumentClass(bool clone = false, bool internal = false);
|
2008-02-28 01:42:02 +00:00
|
|
|
/// Returns the DocumentClass currently in use: the BaseClass as modified
|
2008-01-05 17:04:56 +00:00
|
|
|
/// by modules.
|
2008-02-28 01:42:02 +00:00
|
|
|
DocumentClass const & documentClass() const;
|
2011-12-03 22:15:11 +00:00
|
|
|
/// \return A pointer to the DocumentClass currently in use: the BaseClass
|
|
|
|
/// as modified by modules.
|
2012-10-21 18:17:26 +00:00
|
|
|
DocumentClassConstPtr documentClassPtr() const;
|
This is one of a series of patches that will merge the layout modules development in personal/branches/rgheck back into the tree.
Design goal: Allow the use of layout "modules", which are to LaTeX packages as layout files are to LaTeX document classes. Thus, one could have a module that defined certain character styles, environments, commands, or what have you, and include it in various documents, each of which uses a different document class, without having to modify the layout files themselves. For example, a theorems.module could be used with article.layout to provide support for theorem-type environments, without having to modify article.layout itself, and the same module could be used with book.layout, etc.
This first patch does some reworking of the infrastructrue. We need to distinguish between the TextClass that a particular document is using and the layout of that document, since modules, in particular, can modify the layout. The solution adopted here is to add a TextClass pointer to BufferParams, which will hold the layout. The layout itself is then constructed from the TextClass the document is using. At present, this is completely trivial, but that will change when modules are added.
The pointer in question is a boost::shared_ptr. This is needed because CutAndPaste saves a copy of the layout with each cut or copied selection. We cannot assume the selection vanishes when the document is closed, so there are two options: (i) keep a list of all the layouts that have ever been used by any document; (ii) used some kind of smart pointer. The latter seems preferable, as the former would waste memory. More importantly, the use of a smart pointer allows modules to be modified on disk and then reloaded while LyX is running, and it will eventually allow the same for layout files.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19756 a592a061-630c-0410-9148-cb99ea01b6c8
2007-08-23 16:41:13 +00:00
|
|
|
/// This bypasses the baseClass and sets the textClass directly.
|
|
|
|
/// Should be called with care and would be better not being here,
|
|
|
|
/// but it seems to be needed by CutAndPaste::putClipboard().
|
2012-03-13 16:13:31 +00:00
|
|
|
void setDocumentClass(DocumentClassConstPtr);
|
This is one of a series of patches that will merge the layout modules development in personal/branches/rgheck back into the tree.
Design goal: Allow the use of layout "modules", which are to LaTeX packages as layout files are to LaTeX document classes. Thus, one could have a module that defined certain character styles, environments, commands, or what have you, and include it in various documents, each of which uses a different document class, without having to modify the layout files themselves. For example, a theorems.module could be used with article.layout to provide support for theorem-type environments, without having to modify article.layout itself, and the same module could be used with book.layout, etc.
This patch adds the backend. The ModuleList class holds a list of the available modules, which are retrieved from lyxmodules.lst, itself generated by configure.py. There are two LFUNs available: modules-clear and module-add, which do the obvious thing; you can test by typing these into the minibuffer, along with the name of one of the available modules: URL (a CharStyle), Endnote (a Custom Inset), and---with the spaces---End To Foot (View>LaTeX and look at the user preamble), which are themselves in lib/layouts. There are some others, too, that allow theorems to be added to classes like article and book.
The GUI will come next.
Issues: (i) The configure.py script could be improved. It'd be nice, for example, if it tested for the presence of the LaTeX packages a particular module needs. But this would mean re-working the LaTeX script, and I don't know how to do that. Note that at present, the packages are ignored. This will change shortly. (ii) I've used std::string in LyXModule, following what seemed to be a precedent in TextClass. If some of these should be docstrings, please let me know, and I'll change them. (iii) There is at present no distinction between LaTeX and DocBook modules. Should there be? That is: Should there be modules that are available when the document class is a LaTeX class and others that are available only when it is DocBook? Or should there just be one set of modules? Each module can of course indicate for what it is suitable in its description.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19893 a592a061-630c-0410-9148-cb99ea01b6c8
2007-08-29 17:59:49 +00:00
|
|
|
/// List of modules in use
|
2010-11-26 18:42:53 +00:00
|
|
|
LayoutModuleList const & getModules() const { return layout_modules_; }
|
2008-07-27 17:46:27 +00:00
|
|
|
/// List of default modules the user has removed
|
2011-12-03 22:15:11 +00:00
|
|
|
std::list<std::string> const & getRemovedModules() const
|
2010-11-26 18:42:53 +00:00
|
|
|
{ return removed_modules_; }
|
2008-07-27 17:46:27 +00:00
|
|
|
///
|
2008-10-20 19:48:32 +00:00
|
|
|
/// Add a module to the list of modules in use. This checks only that the
|
2017-07-03 17:45:58 +00:00
|
|
|
/// module is not already in the list, so use layoutModuleCanBeAdeed first
|
2012-12-05 16:16:21 +00:00
|
|
|
/// if you want to check for compatibility.
|
2008-10-20 19:48:32 +00:00
|
|
|
/// \return true if module was successfully added.
|
2008-01-06 18:17:25 +00:00
|
|
|
bool addLayoutModule(std::string const & modName);
|
2008-10-20 19:48:32 +00:00
|
|
|
/// checks to make sure module's requriements are satisfied, that it does
|
|
|
|
/// not conflict with already-present modules, isn't already loaded, etc.
|
2012-12-05 16:16:21 +00:00
|
|
|
bool layoutModuleCanBeAdded(std::string const & modName) const;
|
2008-07-27 17:46:27 +00:00
|
|
|
///
|
2011-12-03 22:15:11 +00:00
|
|
|
void addRemovedModule(std::string const & modName)
|
2010-11-26 18:42:53 +00:00
|
|
|
{ removed_modules_.push_back(modName); }
|
This is one of a series of patches that will merge the layout modules development in personal/branches/rgheck back into the tree.
Design goal: Allow the use of layout "modules", which are to LaTeX packages as layout files are to LaTeX document classes. Thus, one could have a module that defined certain character styles, environments, commands, or what have you, and include it in various documents, each of which uses a different document class, without having to modify the layout files themselves. For example, a theorems.module could be used with article.layout to provide support for theorem-type environments, without having to modify article.layout itself, and the same module could be used with book.layout, etc.
This patch adds the backend. The ModuleList class holds a list of the available modules, which are retrieved from lyxmodules.lst, itself generated by configure.py. There are two LFUNs available: modules-clear and module-add, which do the obvious thing; you can test by typing these into the minibuffer, along with the name of one of the available modules: URL (a CharStyle), Endnote (a Custom Inset), and---with the spaces---End To Foot (View>LaTeX and look at the user preamble), which are themselves in lib/layouts. There are some others, too, that allow theorems to be added to classes like article and book.
The GUI will come next.
Issues: (i) The configure.py script could be improved. It'd be nice, for example, if it tested for the presence of the LaTeX packages a particular module needs. But this would mean re-working the LaTeX script, and I don't know how to do that. Note that at present, the packages are ignored. This will change shortly. (ii) I've used std::string in LyXModule, following what seemed to be a precedent in TextClass. If some of these should be docstrings, please let me know, and I'll change them. (iii) There is at present no distinction between LaTeX and DocBook modules. Should there be? That is: Should there be modules that are available when the document class is a LaTeX class and others that are available only when it is DocBook? Or should there just be one set of modules? Each module can of course indicate for what it is suitable in its description.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19893 a592a061-630c-0410-9148-cb99ea01b6c8
2007-08-29 17:59:49 +00:00
|
|
|
/// Clear the list
|
2010-11-26 18:42:53 +00:00
|
|
|
void clearLayoutModules() { layout_modules_.clear(); }
|
2008-07-27 17:46:27 +00:00
|
|
|
/// Clear the removed module list
|
2010-11-26 18:42:53 +00:00
|
|
|
void clearRemovedModules() { removed_modules_.clear(); }
|
2013-05-15 05:19:49 +00:00
|
|
|
/// Get the local layouts
|
2016-09-25 10:37:40 +00:00
|
|
|
docstring getLocalLayout(bool forced) const;
|
2013-05-15 05:19:49 +00:00
|
|
|
/// Set the local layouts
|
2016-09-25 10:37:40 +00:00
|
|
|
void setLocalLayout(docstring const & layout, bool forced);
|
1999-09-27 18:44:28 +00:00
|
|
|
|
2011-05-13 19:39:56 +00:00
|
|
|
/// returns \c true if the buffer contains a LaTeX document
|
|
|
|
bool isLatex() const;
|
|
|
|
/// returns \c true if the buffer contains a Wed document
|
|
|
|
bool isLiterate() const;
|
|
|
|
|
|
|
|
/// return the format of the buffer on a string
|
|
|
|
std::string bufferFormat() const;
|
|
|
|
/// return the default output format of the current backend
|
|
|
|
std::string getDefaultOutputFormat() const;
|
|
|
|
/// return the output flavor of \p format or the default
|
2020-11-30 22:00:40 +00:00
|
|
|
Flavor getOutputFlavor(std::string const & format = std::string()) const;
|
2011-05-13 19:39:56 +00:00
|
|
|
///
|
2016-10-21 02:56:40 +00:00
|
|
|
bool isExportable(std::string const & format, bool need_viewable) const;
|
2011-05-13 19:39:56 +00:00
|
|
|
///
|
2016-10-19 21:22:58 +00:00
|
|
|
std::vector<const Format *> const & exportableFormats(bool only_viewable) const;
|
2012-03-09 22:24:17 +00:00
|
|
|
/// the backends appropriate for use with this document.
|
|
|
|
/// so, e.g., latex is excluded , if we're using non-TeX fonts
|
2011-05-13 19:39:56 +00:00
|
|
|
std::vector<std::string> backends() const;
|
|
|
|
|
2010-01-07 10:01:26 +00:00
|
|
|
/// List of included children (for includeonly)
|
2011-12-03 22:15:11 +00:00
|
|
|
std::list<std::string> const & getIncludedChildren() const
|
2010-11-26 18:42:53 +00:00
|
|
|
{ return included_children_; }
|
2010-01-07 10:01:26 +00:00
|
|
|
///
|
2011-12-03 22:15:11 +00:00
|
|
|
void addIncludedChildren(std::string const & child)
|
2010-11-26 18:42:53 +00:00
|
|
|
{ included_children_.push_back(child); }
|
2010-01-07 10:01:26 +00:00
|
|
|
/// Clear the list of included children
|
2010-11-26 18:42:53 +00:00
|
|
|
void clearIncludedChildren() { included_children_.clear(); }
|
2010-01-07 10:01:26 +00:00
|
|
|
|
2010-01-10 13:25:41 +00:00
|
|
|
/// update aux files of unincluded children (with \includeonly)
|
2020-03-13 14:46:35 +00:00
|
|
|
enum ChildrenMaintenance {
|
|
|
|
CM_None,
|
|
|
|
CM_Mostly,
|
|
|
|
CM_Strict
|
|
|
|
};
|
|
|
|
ChildrenMaintenance maintain_unincluded_children;
|
2010-01-10 13:25:41 +00:00
|
|
|
|
2006-02-05 13:20:16 +00:00
|
|
|
/// returns the main font for the buffer (document)
|
2007-04-29 18:17:15 +00:00
|
|
|
Font const getFont() const;
|
2006-02-05 13:20:16 +00:00
|
|
|
|
2012-07-01 09:27:42 +00:00
|
|
|
/// translate quote style string to enum value
|
2020-11-30 20:34:16 +00:00
|
|
|
QuoteStyle getQuoteStyle(std::string const & qs) const;
|
2012-07-01 09:27:42 +00:00
|
|
|
|
2009-11-29 14:43:00 +00:00
|
|
|
/* these are for the PaperLayout */
|
2005-07-16 16:57:55 +00:00
|
|
|
/// the papersize
|
2003-06-10 14:39:45 +00:00
|
|
|
PAPER_SIZE papersize;
|
2001-11-29 17:12:21 +00:00
|
|
|
///
|
2003-06-10 14:39:45 +00:00
|
|
|
PAPER_ORIENTATION orientation;
|
2005-07-16 16:57:55 +00:00
|
|
|
/// use custom margins
|
2001-11-29 17:12:21 +00:00
|
|
|
bool use_geometry;
|
|
|
|
///
|
2003-10-06 15:43:21 +00:00
|
|
|
std::string paperwidth;
|
2001-11-29 17:12:21 +00:00
|
|
|
///
|
2003-10-06 15:43:21 +00:00
|
|
|
std::string paperheight;
|
2001-11-29 17:12:21 +00:00
|
|
|
///
|
2003-10-06 15:43:21 +00:00
|
|
|
std::string leftmargin;
|
2001-11-29 17:12:21 +00:00
|
|
|
///
|
2003-10-06 15:43:21 +00:00
|
|
|
std::string topmargin;
|
2001-11-29 17:12:21 +00:00
|
|
|
///
|
2003-10-06 15:43:21 +00:00
|
|
|
std::string rightmargin;
|
2001-11-29 17:12:21 +00:00
|
|
|
///
|
2003-10-06 15:43:21 +00:00
|
|
|
std::string bottommargin;
|
2001-11-29 17:12:21 +00:00
|
|
|
///
|
2003-10-06 15:43:21 +00:00
|
|
|
std::string headheight;
|
2001-11-29 17:12:21 +00:00
|
|
|
///
|
2003-10-06 15:43:21 +00:00
|
|
|
std::string headsep;
|
2001-11-29 17:12:21 +00:00
|
|
|
///
|
2003-10-06 15:43:21 +00:00
|
|
|
std::string footskip;
|
2008-02-19 05:24:48 +00:00
|
|
|
///
|
|
|
|
std::string columnsep;
|
2001-11-29 17:12:21 +00:00
|
|
|
|
|
|
|
/* some LaTeX options */
|
1999-09-27 18:44:28 +00:00
|
|
|
/// The graphics driver
|
2010-11-26 18:42:53 +00:00
|
|
|
std::string graphics_driver;
|
2009-04-10 11:06:53 +00:00
|
|
|
/// The default output format
|
2010-11-26 18:42:53 +00:00
|
|
|
std::string default_output_format;
|
2009-05-22 07:20:00 +00:00
|
|
|
/// customized bibliography processor
|
|
|
|
std::string bibtex_command;
|
|
|
|
/// customized index processor
|
|
|
|
std::string index_command;
|
2015-04-02 15:13:45 +00:00
|
|
|
/// font encoding(s) requested for this document
|
2009-11-29 14:43:00 +00:00
|
|
|
std::string fontenc;
|
2015-11-09 06:33:57 +00:00
|
|
|
/// the rm font: [0] for TeX fonts, [1] for non-TeX fonts
|
|
|
|
std::string fonts_roman[2];
|
The Grand Font Selection Redesign:
* lib/lyx2lyx/LyX.py (format_relation): add file format 247 (from Georg BAUM).
* lib/lyx2lyx/lyx_1_5.py: add convert_font_settings, revert_font_settings (from Georg BAUM).
* lib/chkconfig.ltx: Test for newly supported font packages
* lib/doc/LaTeXConfig.lyx.in: document newly supported font packages
* lib/doc/UserGuide.lyx: document new UI.
* lib/doc/Extended.lyx: update PostScript font documentation
* development/FORMAT: document file format change 246->247.
* src/tex-strings.[Ch]: new strings tex_fonts_roman, tex_fonts_sans,
tex_fonts_monospaced (with GUI equivalents).
* src/buffer.C: Format up to 247.
* src/bufferparams.C:
new params fontsRoman, fontsSans, fontsTypewriter, fontsDefaultFamily,
fontsSC, fontsOSF, fontsSansScale and fontsTypewriterScale
(LyXFont const BufferParams::getFont): consider switch of default family.
(string const BufferParams::loadFonts): new method to get all the LaTeX
font stuff done.
* src/paragraph.C
(LyXFont const Paragraph::getFont):
(LyXFont const Paragraph::getLabelFont):
(LyXFont const Paragraph::getLayoutFont): user buffer's not textclass's
default font
* src/text.C
(int LyXText::leftMargin):
(int LyXText::rightMargin): user buffer's not textclass's default font
* src/text2.C
(LyXFont LyXText::getFont):
(LyXFont LyXText::getLayoutFont):
(LyXFont LyXText::getLabelFont): check if the family of the default document
font has been customized.
* src/frontends/gtk/GDocument.[Ch]: implement new font ui (from Georg BAUM).
* src/frontends/gtk/glade/document.glade: implement new font ui (from Georg BAUM).
* src/frontends/qt3/Makefile.dialogs: add new FontModuleBase
* src/frontends/qt3/ui/FontModuleBase.ui: new File
* src/frontends/qt3/ui/TextLayoutModuleBase.ui: remove font widgets
* src/frontends/qt3/QDocument.C
* src/frontends/qt3/QDocumentDialog.[Ch]: implement new font ui
* src/frontends/qt4/Makefile.dialogs: add new FontUi
* src/frontends/qt4/QDocumentDialog.[Ch]: implement new font ui
* src/frontends/qt4/ui/FontUi.ui: new File
* src/frontends/qt4/ui/TextLayoutUi.ui: remove font widgets
* src/frontends/qt4/ui/compile_uic.sh: add new FontUi
* src/frontends/xforms/FormDocument.[Ch]: implement new font ui
* src/frontends/xforms/forms/form_document.fd: add new font tab.
* src/frontends/controllers/ControlDocument.[Ch]
(char ControlDocument::fontfamilies):
(char ControlDocument::fontfamilies_gui):
(bool ControlDocument::isFontAvailable):
(bool ControlDocument::providesSC):
(bool ControlDocument::providesOSF):
(bool ControlDocument::providesScale): new methods, providing font info.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@14143 a592a061-630c-0410-9148-cb99ea01b6c8
2006-06-19 08:10:17 +00:00
|
|
|
/// the rm font
|
2015-11-09 06:33:57 +00:00
|
|
|
std::string const & fontsRoman() const { return fonts_roman[useNonTeXFonts]; }
|
|
|
|
/// the sf font: [0] for TeX fonts, [1] for non-TeX fonts
|
|
|
|
std::string fonts_sans[2];
|
The Grand Font Selection Redesign:
* lib/lyx2lyx/LyX.py (format_relation): add file format 247 (from Georg BAUM).
* lib/lyx2lyx/lyx_1_5.py: add convert_font_settings, revert_font_settings (from Georg BAUM).
* lib/chkconfig.ltx: Test for newly supported font packages
* lib/doc/LaTeXConfig.lyx.in: document newly supported font packages
* lib/doc/UserGuide.lyx: document new UI.
* lib/doc/Extended.lyx: update PostScript font documentation
* development/FORMAT: document file format change 246->247.
* src/tex-strings.[Ch]: new strings tex_fonts_roman, tex_fonts_sans,
tex_fonts_monospaced (with GUI equivalents).
* src/buffer.C: Format up to 247.
* src/bufferparams.C:
new params fontsRoman, fontsSans, fontsTypewriter, fontsDefaultFamily,
fontsSC, fontsOSF, fontsSansScale and fontsTypewriterScale
(LyXFont const BufferParams::getFont): consider switch of default family.
(string const BufferParams::loadFonts): new method to get all the LaTeX
font stuff done.
* src/paragraph.C
(LyXFont const Paragraph::getFont):
(LyXFont const Paragraph::getLabelFont):
(LyXFont const Paragraph::getLayoutFont): user buffer's not textclass's
default font
* src/text.C
(int LyXText::leftMargin):
(int LyXText::rightMargin): user buffer's not textclass's default font
* src/text2.C
(LyXFont LyXText::getFont):
(LyXFont LyXText::getLayoutFont):
(LyXFont LyXText::getLabelFont): check if the family of the default document
font has been customized.
* src/frontends/gtk/GDocument.[Ch]: implement new font ui (from Georg BAUM).
* src/frontends/gtk/glade/document.glade: implement new font ui (from Georg BAUM).
* src/frontends/qt3/Makefile.dialogs: add new FontModuleBase
* src/frontends/qt3/ui/FontModuleBase.ui: new File
* src/frontends/qt3/ui/TextLayoutModuleBase.ui: remove font widgets
* src/frontends/qt3/QDocument.C
* src/frontends/qt3/QDocumentDialog.[Ch]: implement new font ui
* src/frontends/qt4/Makefile.dialogs: add new FontUi
* src/frontends/qt4/QDocumentDialog.[Ch]: implement new font ui
* src/frontends/qt4/ui/FontUi.ui: new File
* src/frontends/qt4/ui/TextLayoutUi.ui: remove font widgets
* src/frontends/qt4/ui/compile_uic.sh: add new FontUi
* src/frontends/xforms/FormDocument.[Ch]: implement new font ui
* src/frontends/xforms/forms/form_document.fd: add new font tab.
* src/frontends/controllers/ControlDocument.[Ch]
(char ControlDocument::fontfamilies):
(char ControlDocument::fontfamilies_gui):
(bool ControlDocument::isFontAvailable):
(bool ControlDocument::providesSC):
(bool ControlDocument::providesOSF):
(bool ControlDocument::providesScale): new methods, providing font info.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@14143 a592a061-630c-0410-9148-cb99ea01b6c8
2006-06-19 08:10:17 +00:00
|
|
|
/// the sf font
|
2015-11-09 06:33:57 +00:00
|
|
|
std::string const & fontsSans() const { return fonts_sans[useNonTeXFonts]; }
|
|
|
|
/// the tt font: [0] for TeX fonts, [1] for non-TeX fonts
|
|
|
|
std::string fonts_typewriter[2];
|
The Grand Font Selection Redesign:
* lib/lyx2lyx/LyX.py (format_relation): add file format 247 (from Georg BAUM).
* lib/lyx2lyx/lyx_1_5.py: add convert_font_settings, revert_font_settings (from Georg BAUM).
* lib/chkconfig.ltx: Test for newly supported font packages
* lib/doc/LaTeXConfig.lyx.in: document newly supported font packages
* lib/doc/UserGuide.lyx: document new UI.
* lib/doc/Extended.lyx: update PostScript font documentation
* development/FORMAT: document file format change 246->247.
* src/tex-strings.[Ch]: new strings tex_fonts_roman, tex_fonts_sans,
tex_fonts_monospaced (with GUI equivalents).
* src/buffer.C: Format up to 247.
* src/bufferparams.C:
new params fontsRoman, fontsSans, fontsTypewriter, fontsDefaultFamily,
fontsSC, fontsOSF, fontsSansScale and fontsTypewriterScale
(LyXFont const BufferParams::getFont): consider switch of default family.
(string const BufferParams::loadFonts): new method to get all the LaTeX
font stuff done.
* src/paragraph.C
(LyXFont const Paragraph::getFont):
(LyXFont const Paragraph::getLabelFont):
(LyXFont const Paragraph::getLayoutFont): user buffer's not textclass's
default font
* src/text.C
(int LyXText::leftMargin):
(int LyXText::rightMargin): user buffer's not textclass's default font
* src/text2.C
(LyXFont LyXText::getFont):
(LyXFont LyXText::getLayoutFont):
(LyXFont LyXText::getLabelFont): check if the family of the default document
font has been customized.
* src/frontends/gtk/GDocument.[Ch]: implement new font ui (from Georg BAUM).
* src/frontends/gtk/glade/document.glade: implement new font ui (from Georg BAUM).
* src/frontends/qt3/Makefile.dialogs: add new FontModuleBase
* src/frontends/qt3/ui/FontModuleBase.ui: new File
* src/frontends/qt3/ui/TextLayoutModuleBase.ui: remove font widgets
* src/frontends/qt3/QDocument.C
* src/frontends/qt3/QDocumentDialog.[Ch]: implement new font ui
* src/frontends/qt4/Makefile.dialogs: add new FontUi
* src/frontends/qt4/QDocumentDialog.[Ch]: implement new font ui
* src/frontends/qt4/ui/FontUi.ui: new File
* src/frontends/qt4/ui/TextLayoutUi.ui: remove font widgets
* src/frontends/qt4/ui/compile_uic.sh: add new FontUi
* src/frontends/xforms/FormDocument.[Ch]: implement new font ui
* src/frontends/xforms/forms/form_document.fd: add new font tab.
* src/frontends/controllers/ControlDocument.[Ch]
(char ControlDocument::fontfamilies):
(char ControlDocument::fontfamilies_gui):
(bool ControlDocument::isFontAvailable):
(bool ControlDocument::providesSC):
(bool ControlDocument::providesOSF):
(bool ControlDocument::providesScale): new methods, providing font info.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@14143 a592a061-630c-0410-9148-cb99ea01b6c8
2006-06-19 08:10:17 +00:00
|
|
|
/// the tt font
|
2015-11-09 06:33:57 +00:00
|
|
|
std::string const & fontsTypewriter() const { return fonts_typewriter[useNonTeXFonts]; }
|
|
|
|
/// the math font: [0] for TeX fonts, [1] for non-TeX fonts
|
|
|
|
std::string fonts_math[2];
|
2012-09-22 15:44:00 +00:00
|
|
|
/// the math font
|
2015-11-09 06:33:57 +00:00
|
|
|
std::string const & fontsMath() const { return fonts_math[useNonTeXFonts]; }
|
The Grand Font Selection Redesign:
* lib/lyx2lyx/LyX.py (format_relation): add file format 247 (from Georg BAUM).
* lib/lyx2lyx/lyx_1_5.py: add convert_font_settings, revert_font_settings (from Georg BAUM).
* lib/chkconfig.ltx: Test for newly supported font packages
* lib/doc/LaTeXConfig.lyx.in: document newly supported font packages
* lib/doc/UserGuide.lyx: document new UI.
* lib/doc/Extended.lyx: update PostScript font documentation
* development/FORMAT: document file format change 246->247.
* src/tex-strings.[Ch]: new strings tex_fonts_roman, tex_fonts_sans,
tex_fonts_monospaced (with GUI equivalents).
* src/buffer.C: Format up to 247.
* src/bufferparams.C:
new params fontsRoman, fontsSans, fontsTypewriter, fontsDefaultFamily,
fontsSC, fontsOSF, fontsSansScale and fontsTypewriterScale
(LyXFont const BufferParams::getFont): consider switch of default family.
(string const BufferParams::loadFonts): new method to get all the LaTeX
font stuff done.
* src/paragraph.C
(LyXFont const Paragraph::getFont):
(LyXFont const Paragraph::getLabelFont):
(LyXFont const Paragraph::getLayoutFont): user buffer's not textclass's
default font
* src/text.C
(int LyXText::leftMargin):
(int LyXText::rightMargin): user buffer's not textclass's default font
* src/text2.C
(LyXFont LyXText::getFont):
(LyXFont LyXText::getLayoutFont):
(LyXFont LyXText::getLabelFont): check if the family of the default document
font has been customized.
* src/frontends/gtk/GDocument.[Ch]: implement new font ui (from Georg BAUM).
* src/frontends/gtk/glade/document.glade: implement new font ui (from Georg BAUM).
* src/frontends/qt3/Makefile.dialogs: add new FontModuleBase
* src/frontends/qt3/ui/FontModuleBase.ui: new File
* src/frontends/qt3/ui/TextLayoutModuleBase.ui: remove font widgets
* src/frontends/qt3/QDocument.C
* src/frontends/qt3/QDocumentDialog.[Ch]: implement new font ui
* src/frontends/qt4/Makefile.dialogs: add new FontUi
* src/frontends/qt4/QDocumentDialog.[Ch]: implement new font ui
* src/frontends/qt4/ui/FontUi.ui: new File
* src/frontends/qt4/ui/TextLayoutUi.ui: remove font widgets
* src/frontends/qt4/ui/compile_uic.sh: add new FontUi
* src/frontends/xforms/FormDocument.[Ch]: implement new font ui
* src/frontends/xforms/forms/form_document.fd: add new font tab.
* src/frontends/controllers/ControlDocument.[Ch]
(char ControlDocument::fontfamilies):
(char ControlDocument::fontfamilies_gui):
(bool ControlDocument::isFontAvailable):
(bool ControlDocument::providesSC):
(bool ControlDocument::providesOSF):
(bool ControlDocument::providesScale): new methods, providing font info.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@14143 a592a061-630c-0410-9148-cb99ea01b6c8
2006-06-19 08:10:17 +00:00
|
|
|
/// the default family (rm, sf, tt)
|
2010-11-26 18:32:29 +00:00
|
|
|
std::string fonts_default_family;
|
2010-11-26 09:42:03 +00:00
|
|
|
/// use the fonts of the OS (OpenType, True Type) directly
|
|
|
|
bool useNonTeXFonts;
|
The Grand Font Selection Redesign:
* lib/lyx2lyx/LyX.py (format_relation): add file format 247 (from Georg BAUM).
* lib/lyx2lyx/lyx_1_5.py: add convert_font_settings, revert_font_settings (from Georg BAUM).
* lib/chkconfig.ltx: Test for newly supported font packages
* lib/doc/LaTeXConfig.lyx.in: document newly supported font packages
* lib/doc/UserGuide.lyx: document new UI.
* lib/doc/Extended.lyx: update PostScript font documentation
* development/FORMAT: document file format change 246->247.
* src/tex-strings.[Ch]: new strings tex_fonts_roman, tex_fonts_sans,
tex_fonts_monospaced (with GUI equivalents).
* src/buffer.C: Format up to 247.
* src/bufferparams.C:
new params fontsRoman, fontsSans, fontsTypewriter, fontsDefaultFamily,
fontsSC, fontsOSF, fontsSansScale and fontsTypewriterScale
(LyXFont const BufferParams::getFont): consider switch of default family.
(string const BufferParams::loadFonts): new method to get all the LaTeX
font stuff done.
* src/paragraph.C
(LyXFont const Paragraph::getFont):
(LyXFont const Paragraph::getLabelFont):
(LyXFont const Paragraph::getLayoutFont): user buffer's not textclass's
default font
* src/text.C
(int LyXText::leftMargin):
(int LyXText::rightMargin): user buffer's not textclass's default font
* src/text2.C
(LyXFont LyXText::getFont):
(LyXFont LyXText::getLayoutFont):
(LyXFont LyXText::getLabelFont): check if the family of the default document
font has been customized.
* src/frontends/gtk/GDocument.[Ch]: implement new font ui (from Georg BAUM).
* src/frontends/gtk/glade/document.glade: implement new font ui (from Georg BAUM).
* src/frontends/qt3/Makefile.dialogs: add new FontModuleBase
* src/frontends/qt3/ui/FontModuleBase.ui: new File
* src/frontends/qt3/ui/TextLayoutModuleBase.ui: remove font widgets
* src/frontends/qt3/QDocument.C
* src/frontends/qt3/QDocumentDialog.[Ch]: implement new font ui
* src/frontends/qt4/Makefile.dialogs: add new FontUi
* src/frontends/qt4/QDocumentDialog.[Ch]: implement new font ui
* src/frontends/qt4/ui/FontUi.ui: new File
* src/frontends/qt4/ui/TextLayoutUi.ui: remove font widgets
* src/frontends/qt4/ui/compile_uic.sh: add new FontUi
* src/frontends/xforms/FormDocument.[Ch]: implement new font ui
* src/frontends/xforms/forms/form_document.fd: add new font tab.
* src/frontends/controllers/ControlDocument.[Ch]
(char ControlDocument::fontfamilies):
(char ControlDocument::fontfamilies_gui):
(bool ControlDocument::isFontAvailable):
(bool ControlDocument::providesSC):
(bool ControlDocument::providesOSF):
(bool ControlDocument::providesScale): new methods, providing font info.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@14143 a592a061-630c-0410-9148-cb99ea01b6c8
2006-06-19 08:10:17 +00:00
|
|
|
/// use expert Small Caps
|
2010-11-26 18:32:29 +00:00
|
|
|
bool fonts_expert_sc;
|
2019-07-14 09:41:36 +00:00
|
|
|
/// use Old Style Figures (rm)
|
|
|
|
bool fonts_roman_osf;
|
|
|
|
/// use Old Style Figures (sf)
|
|
|
|
bool fonts_sans_osf;
|
|
|
|
/// use Old Style Figures (tt)
|
|
|
|
bool fonts_typewriter_osf;
|
2019-07-11 18:28:34 +00:00
|
|
|
/// the options for the roman font
|
|
|
|
std::string font_roman_opts;
|
2015-11-09 06:33:57 +00:00
|
|
|
/// the scale factor of the sf font: [0] for TeX fonts, [1] for non-TeX fonts
|
|
|
|
int fonts_sans_scale[2];
|
The Grand Font Selection Redesign:
* lib/lyx2lyx/LyX.py (format_relation): add file format 247 (from Georg BAUM).
* lib/lyx2lyx/lyx_1_5.py: add convert_font_settings, revert_font_settings (from Georg BAUM).
* lib/chkconfig.ltx: Test for newly supported font packages
* lib/doc/LaTeXConfig.lyx.in: document newly supported font packages
* lib/doc/UserGuide.lyx: document new UI.
* lib/doc/Extended.lyx: update PostScript font documentation
* development/FORMAT: document file format change 246->247.
* src/tex-strings.[Ch]: new strings tex_fonts_roman, tex_fonts_sans,
tex_fonts_monospaced (with GUI equivalents).
* src/buffer.C: Format up to 247.
* src/bufferparams.C:
new params fontsRoman, fontsSans, fontsTypewriter, fontsDefaultFamily,
fontsSC, fontsOSF, fontsSansScale and fontsTypewriterScale
(LyXFont const BufferParams::getFont): consider switch of default family.
(string const BufferParams::loadFonts): new method to get all the LaTeX
font stuff done.
* src/paragraph.C
(LyXFont const Paragraph::getFont):
(LyXFont const Paragraph::getLabelFont):
(LyXFont const Paragraph::getLayoutFont): user buffer's not textclass's
default font
* src/text.C
(int LyXText::leftMargin):
(int LyXText::rightMargin): user buffer's not textclass's default font
* src/text2.C
(LyXFont LyXText::getFont):
(LyXFont LyXText::getLayoutFont):
(LyXFont LyXText::getLabelFont): check if the family of the default document
font has been customized.
* src/frontends/gtk/GDocument.[Ch]: implement new font ui (from Georg BAUM).
* src/frontends/gtk/glade/document.glade: implement new font ui (from Georg BAUM).
* src/frontends/qt3/Makefile.dialogs: add new FontModuleBase
* src/frontends/qt3/ui/FontModuleBase.ui: new File
* src/frontends/qt3/ui/TextLayoutModuleBase.ui: remove font widgets
* src/frontends/qt3/QDocument.C
* src/frontends/qt3/QDocumentDialog.[Ch]: implement new font ui
* src/frontends/qt4/Makefile.dialogs: add new FontUi
* src/frontends/qt4/QDocumentDialog.[Ch]: implement new font ui
* src/frontends/qt4/ui/FontUi.ui: new File
* src/frontends/qt4/ui/TextLayoutUi.ui: remove font widgets
* src/frontends/qt4/ui/compile_uic.sh: add new FontUi
* src/frontends/xforms/FormDocument.[Ch]: implement new font ui
* src/frontends/xforms/forms/form_document.fd: add new font tab.
* src/frontends/controllers/ControlDocument.[Ch]
(char ControlDocument::fontfamilies):
(char ControlDocument::fontfamilies_gui):
(bool ControlDocument::isFontAvailable):
(bool ControlDocument::providesSC):
(bool ControlDocument::providesOSF):
(bool ControlDocument::providesScale): new methods, providing font info.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@14143 a592a061-630c-0410-9148-cb99ea01b6c8
2006-06-19 08:10:17 +00:00
|
|
|
/// the scale factor of the sf font
|
2015-11-09 06:33:57 +00:00
|
|
|
int fontsSansScale() const { return fonts_sans_scale[useNonTeXFonts]; }
|
2019-07-11 18:28:34 +00:00
|
|
|
// the options for the sans font
|
|
|
|
std::string font_sans_opts;
|
2015-11-09 06:33:57 +00:00
|
|
|
/// the scale factor of the tt font: [0] for TeX fonts, [1] for non-TeX fonts
|
|
|
|
int fonts_typewriter_scale[2];
|
The Grand Font Selection Redesign:
* lib/lyx2lyx/LyX.py (format_relation): add file format 247 (from Georg BAUM).
* lib/lyx2lyx/lyx_1_5.py: add convert_font_settings, revert_font_settings (from Georg BAUM).
* lib/chkconfig.ltx: Test for newly supported font packages
* lib/doc/LaTeXConfig.lyx.in: document newly supported font packages
* lib/doc/UserGuide.lyx: document new UI.
* lib/doc/Extended.lyx: update PostScript font documentation
* development/FORMAT: document file format change 246->247.
* src/tex-strings.[Ch]: new strings tex_fonts_roman, tex_fonts_sans,
tex_fonts_monospaced (with GUI equivalents).
* src/buffer.C: Format up to 247.
* src/bufferparams.C:
new params fontsRoman, fontsSans, fontsTypewriter, fontsDefaultFamily,
fontsSC, fontsOSF, fontsSansScale and fontsTypewriterScale
(LyXFont const BufferParams::getFont): consider switch of default family.
(string const BufferParams::loadFonts): new method to get all the LaTeX
font stuff done.
* src/paragraph.C
(LyXFont const Paragraph::getFont):
(LyXFont const Paragraph::getLabelFont):
(LyXFont const Paragraph::getLayoutFont): user buffer's not textclass's
default font
* src/text.C
(int LyXText::leftMargin):
(int LyXText::rightMargin): user buffer's not textclass's default font
* src/text2.C
(LyXFont LyXText::getFont):
(LyXFont LyXText::getLayoutFont):
(LyXFont LyXText::getLabelFont): check if the family of the default document
font has been customized.
* src/frontends/gtk/GDocument.[Ch]: implement new font ui (from Georg BAUM).
* src/frontends/gtk/glade/document.glade: implement new font ui (from Georg BAUM).
* src/frontends/qt3/Makefile.dialogs: add new FontModuleBase
* src/frontends/qt3/ui/FontModuleBase.ui: new File
* src/frontends/qt3/ui/TextLayoutModuleBase.ui: remove font widgets
* src/frontends/qt3/QDocument.C
* src/frontends/qt3/QDocumentDialog.[Ch]: implement new font ui
* src/frontends/qt4/Makefile.dialogs: add new FontUi
* src/frontends/qt4/QDocumentDialog.[Ch]: implement new font ui
* src/frontends/qt4/ui/FontUi.ui: new File
* src/frontends/qt4/ui/TextLayoutUi.ui: remove font widgets
* src/frontends/qt4/ui/compile_uic.sh: add new FontUi
* src/frontends/xforms/FormDocument.[Ch]: implement new font ui
* src/frontends/xforms/forms/form_document.fd: add new font tab.
* src/frontends/controllers/ControlDocument.[Ch]
(char ControlDocument::fontfamilies):
(char ControlDocument::fontfamilies_gui):
(bool ControlDocument::isFontAvailable):
(bool ControlDocument::providesSC):
(bool ControlDocument::providesOSF):
(bool ControlDocument::providesScale): new methods, providing font info.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@14143 a592a061-630c-0410-9148-cb99ea01b6c8
2006-06-19 08:10:17 +00:00
|
|
|
/// the scale factor of the tt font
|
2015-11-09 06:33:57 +00:00
|
|
|
int fontsTypewriterScale() const { return fonts_typewriter_scale[useNonTeXFonts]; }
|
2019-07-11 18:28:34 +00:00
|
|
|
// the options for the typewriter font
|
|
|
|
std::string font_typewriter_opts;
|
2008-06-05 06:18:34 +00:00
|
|
|
/// the font used by the CJK command
|
2010-11-26 18:32:29 +00:00
|
|
|
std::string fonts_cjk;
|
2016-06-03 05:40:21 +00:00
|
|
|
/// use LaTeX microtype package
|
|
|
|
bool use_microtype;
|
2017-03-19 19:50:34 +00:00
|
|
|
/// use font ligatures for en- and em-dashes
|
|
|
|
bool use_dash_ligatures;
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
2003-09-09 17:00:19 +00:00
|
|
|
Spacing & spacing();
|
|
|
|
Spacing const & spacing() const;
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
1999-11-04 01:40:20 +00:00
|
|
|
int secnumdepth;
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
1999-11-04 01:40:20 +00:00
|
|
|
int tocdepth;
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
2000-10-10 12:36:36 +00:00
|
|
|
Language const * language;
|
2011-02-03 14:17:31 +00:00
|
|
|
/// language package
|
|
|
|
std::string lang_package;
|
2003-08-17 11:28:23 +00:00
|
|
|
/// BranchList:
|
2003-09-09 17:00:19 +00:00
|
|
|
BranchList & branchlist();
|
|
|
|
BranchList const & branchlist() const;
|
2009-04-16 07:29:01 +00:00
|
|
|
/// IndicesList:
|
|
|
|
IndicesList & indiceslist();
|
|
|
|
IndicesList const & indiceslist() const;
|
2021-03-06 15:53:33 +00:00
|
|
|
///
|
|
|
|
typedef std::vector<WordLangTuple> IgnoreList;
|
|
|
|
///
|
|
|
|
IgnoreList & spellignore();
|
|
|
|
IgnoreList const & spellignore() const;
|
2006-08-15 07:08:58 +00:00
|
|
|
/**
|
2013-01-20 00:52:30 +00:00
|
|
|
* The LyX name of the input encoding for LaTeX. This can be one of
|
2007-01-13 14:36:54 +00:00
|
|
|
* - \c auto: find out the input encoding from the used languages
|
|
|
|
* - \c default: ditto
|
2013-01-20 00:52:30 +00:00
|
|
|
* - any encoding defined in the file lib/encodings
|
2006-08-15 07:08:58 +00:00
|
|
|
* The encoding of the LyX file is always utf8 and has nothing to
|
|
|
|
* do with this setting.
|
2007-01-13 14:36:54 +00:00
|
|
|
* The difference between \c auto and \c default is that \c auto also
|
2019-03-19 21:14:44 +00:00
|
|
|
* causes loading of the inputenc package and writes a \inputenc{} command
|
|
|
|
* to the file when switching to another encoding, while \c default does not.
|
2007-01-13 14:36:54 +00:00
|
|
|
* \c default will not work unless the user takes additional measures
|
|
|
|
* (such as using special environments like the CJK environment from
|
|
|
|
* CJK.sty).
|
2019-03-19 21:14:44 +00:00
|
|
|
* \c default can be seen as an unspecified mix of 8bit encodings, since LyX
|
2007-01-13 14:36:54 +00:00
|
|
|
* does not interpret it in any way apart from display on screen.
|
2006-08-15 07:08:58 +00:00
|
|
|
*/
|
2003-10-06 15:43:21 +00:00
|
|
|
std::string inputenc;
|
2006-12-10 16:08:52 +00:00
|
|
|
/// The main encoding used by this buffer for LaTeX output.
|
2019-03-19 21:14:44 +00:00
|
|
|
/// If the main encoding is \c auto or \c default,
|
|
|
|
/// individual pieces of text can use different encodings.
|
2015-11-13 12:59:17 +00:00
|
|
|
/// Output for XeTeX with 8-bit TeX fonts uses ASCII (set at runtime)
|
2019-03-19 21:14:44 +00:00
|
|
|
/// instead of the value returned by this function (cf. #10600).
|
2006-12-10 16:08:52 +00:00
|
|
|
Encoding const & encoding() const;
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
Fix bug #4812 (Layout in local directory lost on Save As, Copying)
The "save-as" part of the bug is fixed by extending the \textclass tag
such that, if a local layout file is used, its path relative to the
document directory is now stored together with the name. If a relative
path cannot be used, an absolute one is used but, in this case, the
document is not usable on a different platform.
The "copy" part is fixed by introducing a new \origin tag, which is
written when the file is saved. This tag stores the absolute path of
the document directory. If the document is manually copied to a
different location, the local layout file is retrivied by using
\origin (which is only updated on save).
This new tag may prove useful also for locating other files when the
document is manually moved to a different directory.
As in the original implementation the files needed for the layout
(for example, a latex class) had to be in the same directory as the
layout file, this directory has also to be added to TEXINPUTS.
2015-05-13 19:40:51 +00:00
|
|
|
std::string origin;
|
|
|
|
///
|
2016-09-25 10:37:40 +00:00
|
|
|
docstring preamble;
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
2003-10-06 15:43:21 +00:00
|
|
|
std::string options;
|
2008-10-12 09:36:00 +00:00
|
|
|
/// use the class options defined in the layout?
|
|
|
|
bool use_default_options;
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
2008-04-28 16:38:56 +00:00
|
|
|
std::string master;
|
|
|
|
///
|
2009-08-14 00:52:33 +00:00
|
|
|
bool suppress_date;
|
|
|
|
///
|
2003-10-06 15:43:21 +00:00
|
|
|
std::string float_placement;
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
2018-05-10 18:15:11 +00:00
|
|
|
std::string float_alignment;
|
|
|
|
///
|
1999-11-04 01:40:20 +00:00
|
|
|
unsigned int columns;
|
2011-12-07 22:33:25 +00:00
|
|
|
///
|
|
|
|
bool justification;
|
Add support for listings package. Two listings command \lstinline, \lstinputlisting and an environment \lstlisting are supported, along with preamble \lstset. \lstinputlisting is implemented through Include dialog, and the other two are implemented with a new inset listings, along with its dialog.
* src/LyXAction.cpp: listing-insert action
* src/insets/Inset.h,cpp: LISTINGS_CODE
* src/insets/InsetInclude.cpp: handle \lstinputlisting
* src/insets/InsetListings.h,cpp: new listings inset
* src/insets/InsetListingsParams.h,cpp: parameters from listings package
* src/insets/InsetCommandParams.h,cpp: handle lstinputlisting option
* src/Bidi.cpp: handle LISTINGS_CODE
* src/frontends/qt4/ui/TextLayoutUi.ui: update UI
* src/frontends/qt4/ui/ListingsUi.ui: new dialog
* src/frontends/qt4/ui/IncludeUi.ui: update UI
* src/frontends/qt4/QInclude.h,cpp: add lstinputlisting
* src/frontends/qt4/QDocument.h,cpp: add textedit for preamble listings_params
* src/frontends/qt4/QListings.h,cpp: new listings inset
* src/frontends/qt4/Dialogs.cpp: new listings dialog
* src/frontends/controllers/ControlInclude.h,cpp: add lstinputlisting
* src/frontends/controllers/ControlListings.h,cpp: new listings inset
* src/LyXFunc.cpp: handle LISTING_CODE
* src/Paragraph.cpp: handle LISTING_CODE
* src/factory.cpp: new listings inset
* src/CutAndPaste.cpp: handle LISTINGS_CODE
* src/LaTeXFeatures.cpp: require listings
* src/Text3.cpp: Handle LISTINGS_CODE
* src/lfuns.h: add LFUN_LISTING_INSERT
* src/Buffer.cpp: change lyx file format to 269
* src/BufferParams.h,cpp: add listings_params to preamble
* lib/lyx2lyx/LyX.py: lyx2lyx
* lib/lyx2lyx/lyx_1_5.py: lyx2lyx
* lib/ui/stdmenus.inc: new menu item (no shortcut!)
* src/insets/Makefile.am: update autotools
* src/frontends/controllers/Makefile.am
* src/frontends/qt4/Makefile.dialogs
* src/frontends/qt4/Makefile.am
* po/POTFILES.in: a few more translatable files.
* development/scons/scons_manifest.py: scons build system
* development/FORMAT: document format changes
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18243 a592a061-630c-0410-9148-cb99ea01b6c8
2007-05-09 19:11:42 +00:00
|
|
|
/// parameters for the listings package
|
|
|
|
std::string listings_params;
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
2007-11-07 23:25:08 +00:00
|
|
|
PageSides sides;
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
2003-10-06 15:43:21 +00:00
|
|
|
std::string pagestyle;
|
2009-04-11 21:40:11 +00:00
|
|
|
///
|
2019-03-26 15:23:34 +00:00
|
|
|
std::string tablestyle;
|
|
|
|
///
|
2009-04-11 21:40:11 +00:00
|
|
|
RGBColor backgroundcolor;
|
2010-03-31 00:46:50 +00:00
|
|
|
///
|
2010-04-05 20:31:10 +00:00
|
|
|
bool isbackgroundcolor;
|
|
|
|
///
|
2010-04-02 23:39:36 +00:00
|
|
|
RGBColor fontcolor;
|
|
|
|
///
|
|
|
|
bool isfontcolor;
|
|
|
|
///
|
2010-03-31 00:46:50 +00:00
|
|
|
RGBColor notefontcolor;
|
2010-04-08 00:14:08 +00:00
|
|
|
///
|
2021-01-20 12:58:24 +00:00
|
|
|
bool isnotefontcolor;
|
|
|
|
///
|
2010-04-08 00:14:08 +00:00
|
|
|
RGBColor boxbgcolor;
|
2021-01-20 13:15:48 +00:00
|
|
|
///
|
|
|
|
bool isboxbgcolor;
|
2003-09-09 17:00:19 +00:00
|
|
|
/// \param index should lie in the range 0 <= \c index <= 3.
|
2006-10-21 00:16:43 +00:00
|
|
|
Bullet & temp_bullet(size_type index);
|
|
|
|
Bullet const & temp_bullet(size_type index) const;
|
2003-09-09 17:00:19 +00:00
|
|
|
/// \param index should lie in the range 0 <= \c index <= 3.
|
2006-10-21 00:16:43 +00:00
|
|
|
Bullet & user_defined_bullet(size_type index);
|
|
|
|
Bullet const & user_defined_bullet(size_type index) const;
|
2003-03-06 11:07:55 +00:00
|
|
|
|
2006-11-13 17:35:18 +00:00
|
|
|
/// Whether to load a package such as amsmath or esint.
|
|
|
|
/// The enum values must not be changed (file format!)
|
|
|
|
enum Package {
|
|
|
|
/// Don't load the package. For experts only.
|
|
|
|
package_off = 0,
|
|
|
|
/// Load the package if needed (recommended)
|
|
|
|
package_auto = 1,
|
|
|
|
/// Always load the package (e.g. if the document contains
|
|
|
|
/// some ERT that needs the package)
|
|
|
|
package_on = 2
|
2003-03-06 11:07:55 +00:00
|
|
|
};
|
2012-01-03 20:51:07 +00:00
|
|
|
/// Whether to load a package such as amsmath or esint.
|
|
|
|
Package use_package(std::string const & p) const;
|
|
|
|
/// Set whether to load a package such as amsmath or esint.
|
|
|
|
void use_package(std::string const & p, Package u);
|
|
|
|
/// All packages that can be switched on or off
|
2013-03-01 14:59:37 +00:00
|
|
|
static std::map<std::string, std::string> const & auto_packages();
|
2017-02-04 11:02:00 +00:00
|
|
|
/// Do we use the bibtopic package?
|
2017-02-04 18:23:46 +00:00
|
|
|
bool useBibtopic() const;
|
2009-04-16 07:29:01 +00:00
|
|
|
/// Split bibliography?
|
2017-02-04 11:02:00 +00:00
|
|
|
bool splitbib() const { return use_bibtopic; }
|
2017-01-15 14:40:20 +00:00
|
|
|
/// Set split bibliography
|
2017-02-04 11:02:00 +00:00
|
|
|
void splitbib(bool const b) { use_bibtopic = b; }
|
|
|
|
/// Do we have multiple bibliographies (by chapter etc.)?
|
|
|
|
std::string multibib;
|
2009-04-16 07:29:01 +00:00
|
|
|
/// Split the index?
|
|
|
|
bool use_indices;
|
2016-07-13 15:46:52 +00:00
|
|
|
/// Save transient properties?
|
2015-12-20 16:37:29 +00:00
|
|
|
bool save_transient_properties;
|
|
|
|
/// revision tracking for this buffer ? (this is a transient property)
|
2014-03-29 22:52:36 +00:00
|
|
|
bool track_changes;
|
2007-05-08 17:46:03 +00:00
|
|
|
/** This param decides whether change tracking marks should be used
|
|
|
|
* in output (irrespective of how these marks are actually defined;
|
|
|
|
* for instance, they may differ for DVI and PDF generation)
|
2015-12-20 16:37:29 +00:00
|
|
|
* This is a transient property.
|
2005-01-24 17:12:19 +00:00
|
|
|
*/
|
2014-03-29 22:52:36 +00:00
|
|
|
bool output_changes;
|
2003-07-28 14:40:29 +00:00
|
|
|
///
|
2019-12-24 17:12:22 +00:00
|
|
|
bool change_bars;
|
|
|
|
///
|
2003-07-28 14:40:29 +00:00
|
|
|
bool compressed;
|
2020-01-10 09:21:09 +00:00
|
|
|
///
|
|
|
|
bool postpone_fragile_content;
|
2003-03-12 02:39:12 +00:00
|
|
|
|
2003-09-09 17:00:19 +00:00
|
|
|
/// the author list for the document
|
|
|
|
AuthorList & authors();
|
|
|
|
AuthorList const & authors() const;
|
2020-10-15 19:15:21 +00:00
|
|
|
void addAuthor(Author const & a);
|
2003-09-09 17:00:19 +00:00
|
|
|
|
2009-07-23 20:08:05 +00:00
|
|
|
/// map of the file's author IDs to AuthorList indexes
|
2020-11-02 22:09:13 +00:00
|
|
|
typedef std::map<int, int> AuthorMap;
|
2015-11-11 21:31:05 +00:00
|
|
|
AuthorMap author_map_;
|
|
|
|
|
2015-04-02 15:13:45 +00:00
|
|
|
/// the buffer's active font encoding
|
2017-02-25 11:49:49 +00:00
|
|
|
std::string const main_font_encoding() const;
|
2015-04-02 15:13:45 +00:00
|
|
|
/// all font encodings requested by the prefs/document/main language.
|
|
|
|
/// This does NOT include font encodings required by secondary languages
|
|
|
|
std::vector<std::string> const font_encodings() const;
|
|
|
|
|
2003-07-17 08:23:33 +00:00
|
|
|
///
|
2003-10-06 15:43:21 +00:00
|
|
|
std::string const dvips_options() const;
|
2008-01-25 12:54:25 +00:00
|
|
|
/** The return value of paperSizeName() depends on the
|
|
|
|
* purpose for which the paper size is needed, since they
|
|
|
|
* support different subsets of paper sizes.
|
|
|
|
*/
|
2008-03-15 00:22:54 +00:00
|
|
|
enum PapersizePurpose {
|
2008-01-25 12:54:25 +00:00
|
|
|
///
|
|
|
|
DVIPS,
|
|
|
|
///
|
|
|
|
DVIPDFM,
|
|
|
|
///
|
|
|
|
XDVI
|
|
|
|
};
|
2003-07-17 08:23:33 +00:00
|
|
|
///
|
2019-08-06 15:34:16 +00:00
|
|
|
std::string paperSizeName(PapersizePurpose purpose,
|
2019-09-13 14:23:49 +00:00
|
|
|
std::string const & psize = std::string()) const;
|
2008-10-12 17:21:18 +00:00
|
|
|
/// set up if and how babel is called
|
2010-11-14 10:35:35 +00:00
|
|
|
std::string babelCall(std::string const & lang_opts, bool const langoptions) const;
|
2008-12-19 09:32:04 +00:00
|
|
|
/// return supported drivers for specific packages
|
|
|
|
docstring getGraphicsDriver(std::string const & package) const;
|
2007-05-28 07:43:15 +00:00
|
|
|
/// handle inputenc etc.
|
2011-02-13 21:41:44 +00:00
|
|
|
void writeEncodingPreamble(otexstream & os, LaTeXFeatures & features) const;
|
2009-04-06 06:58:30 +00:00
|
|
|
///
|
|
|
|
std::string const parseFontName(std::string const & name) const;
|
The Grand Font Selection Redesign:
* lib/lyx2lyx/LyX.py (format_relation): add file format 247 (from Georg BAUM).
* lib/lyx2lyx/lyx_1_5.py: add convert_font_settings, revert_font_settings (from Georg BAUM).
* lib/chkconfig.ltx: Test for newly supported font packages
* lib/doc/LaTeXConfig.lyx.in: document newly supported font packages
* lib/doc/UserGuide.lyx: document new UI.
* lib/doc/Extended.lyx: update PostScript font documentation
* development/FORMAT: document file format change 246->247.
* src/tex-strings.[Ch]: new strings tex_fonts_roman, tex_fonts_sans,
tex_fonts_monospaced (with GUI equivalents).
* src/buffer.C: Format up to 247.
* src/bufferparams.C:
new params fontsRoman, fontsSans, fontsTypewriter, fontsDefaultFamily,
fontsSC, fontsOSF, fontsSansScale and fontsTypewriterScale
(LyXFont const BufferParams::getFont): consider switch of default family.
(string const BufferParams::loadFonts): new method to get all the LaTeX
font stuff done.
* src/paragraph.C
(LyXFont const Paragraph::getFont):
(LyXFont const Paragraph::getLabelFont):
(LyXFont const Paragraph::getLayoutFont): user buffer's not textclass's
default font
* src/text.C
(int LyXText::leftMargin):
(int LyXText::rightMargin): user buffer's not textclass's default font
* src/text2.C
(LyXFont LyXText::getFont):
(LyXFont LyXText::getLayoutFont):
(LyXFont LyXText::getLabelFont): check if the family of the default document
font has been customized.
* src/frontends/gtk/GDocument.[Ch]: implement new font ui (from Georg BAUM).
* src/frontends/gtk/glade/document.glade: implement new font ui (from Georg BAUM).
* src/frontends/qt3/Makefile.dialogs: add new FontModuleBase
* src/frontends/qt3/ui/FontModuleBase.ui: new File
* src/frontends/qt3/ui/TextLayoutModuleBase.ui: remove font widgets
* src/frontends/qt3/QDocument.C
* src/frontends/qt3/QDocumentDialog.[Ch]: implement new font ui
* src/frontends/qt4/Makefile.dialogs: add new FontUi
* src/frontends/qt4/QDocumentDialog.[Ch]: implement new font ui
* src/frontends/qt4/ui/FontUi.ui: new File
* src/frontends/qt4/ui/TextLayoutUi.ui: remove font widgets
* src/frontends/qt4/ui/compile_uic.sh: add new FontUi
* src/frontends/xforms/FormDocument.[Ch]: implement new font ui
* src/frontends/xforms/forms/form_document.fd: add new font tab.
* src/frontends/controllers/ControlDocument.[Ch]
(char ControlDocument::fontfamilies):
(char ControlDocument::fontfamilies_gui):
(bool ControlDocument::isFontAvailable):
(bool ControlDocument::providesSC):
(bool ControlDocument::providesOSF):
(bool ControlDocument::providesScale): new methods, providing font info.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@14143 a592a061-630c-0410-9148-cb99ea01b6c8
2006-06-19 08:10:17 +00:00
|
|
|
/// set up the document fonts
|
2012-09-22 10:14:24 +00:00
|
|
|
std::string const loadFonts(LaTeXFeatures & features) const;
|
2007-11-28 15:25:07 +00:00
|
|
|
|
2012-03-01 00:41:30 +00:00
|
|
|
/// the cite engine modules
|
2018-05-20 10:27:03 +00:00
|
|
|
std::string const & citeEngine() const { return cite_engine_; }
|
2012-01-09 13:16:38 +00:00
|
|
|
/// the type of cite engine (authoryear or numerical)
|
|
|
|
CiteEngineType const & citeEngineType() const
|
|
|
|
{ return cite_engine_type_; }
|
2012-03-01 00:41:30 +00:00
|
|
|
/// add the module to the cite engine modules
|
2018-05-20 10:27:03 +00:00
|
|
|
void setCiteEngine(std::string const & eng) { cite_engine_ = eng; }
|
2012-01-09 13:16:38 +00:00
|
|
|
/// set the cite engine type
|
|
|
|
void setCiteEngineType(CiteEngineType const & engine_type)
|
|
|
|
{ cite_engine_type_ = engine_type; }
|
|
|
|
|
2012-03-01 00:41:30 +00:00
|
|
|
/// the available citation commands
|
|
|
|
std::vector<std::string> citeCommands() const;
|
|
|
|
/// the available citation styles
|
|
|
|
std::vector<CitationStyle> citeStyles() const;
|
|
|
|
|
2017-01-01 09:49:22 +00:00
|
|
|
/// Return the actual bibtex command (lyxrc or buffer param)
|
2017-01-13 18:18:35 +00:00
|
|
|
std::string const bibtexCommand() const;
|
2017-01-01 09:49:22 +00:00
|
|
|
|
2017-01-08 08:39:46 +00:00
|
|
|
/// Are we using biblatex?
|
|
|
|
bool useBiblatex() const;
|
|
|
|
|
2017-01-01 07:37:56 +00:00
|
|
|
/// Set the default BibTeX style file for the document
|
|
|
|
void setDefaultBiblioStyle(std::string const & s){ biblio_style = s; }
|
|
|
|
/// Get the default BibTeX style file from the TextClass
|
2012-03-01 00:41:30 +00:00
|
|
|
std::string const & defaultBiblioStyle() const;
|
|
|
|
/// whether the BibTeX style supports full author lists
|
2020-10-15 19:15:21 +00:00
|
|
|
bool fullAuthorList() const;
|
2017-01-03 12:11:11 +00:00
|
|
|
/// Check if a citation style is an alias to another style
|
|
|
|
std::string getCiteAlias(std::string const & s) const;
|
2011-12-12 14:40:34 +00:00
|
|
|
|
2017-01-08 08:39:46 +00:00
|
|
|
/// Options of the bibiography package
|
|
|
|
std::string biblio_opts;
|
|
|
|
/// The biblatex bibliography style
|
|
|
|
std::string biblatex_bibstyle;
|
|
|
|
/// The biblatex citation style
|
|
|
|
std::string biblatex_citestyle;
|
2018-07-07 13:25:35 +00:00
|
|
|
/// Set the bib file encoding (for biblatex)
|
|
|
|
void setBibEncoding(std::string const & s) { bib_encoding = s; }
|
|
|
|
/// Get the bib file encoding (for biblatex)
|
|
|
|
std::string const & bibEncoding() const { return bib_encoding; }
|
2019-03-29 14:45:55 +00:00
|
|
|
/// Set encoding for individual bib file (for biblatex)
|
|
|
|
void setBibFileEncoding(std::string const & file, std::string const & enc);
|
|
|
|
///
|
|
|
|
std::string const bibFileEncoding(std::string const & file) const;
|
2017-01-08 08:39:46 +00:00
|
|
|
|
2007-09-20 22:31:18 +00:00
|
|
|
/// options for pdf output
|
|
|
|
PDFOptions & pdfoptions();
|
|
|
|
PDFOptions const & pdfoptions() const;
|
|
|
|
|
2010-11-02 15:42:45 +00:00
|
|
|
// do not change these values. we rely upon them.
|
2010-03-18 20:35:08 +00:00
|
|
|
enum MathOutput {
|
2010-11-02 14:50:07 +00:00
|
|
|
MathML = 0,
|
2010-11-02 15:42:45 +00:00
|
|
|
HTML = 1,
|
|
|
|
Images = 2,
|
|
|
|
LaTeX = 3
|
2010-03-18 20:35:08 +00:00
|
|
|
};
|
|
|
|
/// what to use for math output. present choices are above
|
|
|
|
MathOutput html_math_output;
|
2009-12-30 22:22:33 +00:00
|
|
|
/// whether to attempt to be XHTML 1.1 compliant or instead be
|
|
|
|
/// a little more mellow
|
|
|
|
bool html_be_strict;
|
2010-04-21 15:18:25 +00:00
|
|
|
///
|
|
|
|
double html_math_img_scale;
|
|
|
|
///
|
2014-10-18 13:30:58 +00:00
|
|
|
double display_pixel_ratio;
|
|
|
|
///
|
2010-04-21 15:18:25 +00:00
|
|
|
std::string html_latex_start;
|
|
|
|
///
|
|
|
|
std::string html_latex_end;
|
2011-02-15 17:44:17 +00:00
|
|
|
///
|
|
|
|
bool html_css_as_file;
|
2020-07-13 01:31:48 +00:00
|
|
|
|
|
|
|
// do not change these values. we rely upon them.
|
|
|
|
enum TableOutput {
|
|
|
|
HTMLTable = 0,
|
|
|
|
CALSTable = 1
|
|
|
|
};
|
|
|
|
/// what format to use for table output in DocBook. present choices are above
|
|
|
|
TableOutput docbook_table_output;
|
|
|
|
|
2017-08-03 11:07:41 +00:00
|
|
|
/// allow the LaTeX backend to run external programs
|
|
|
|
bool shell_escape;
|
2010-05-25 11:36:00 +00:00
|
|
|
/// generate output usable for reverse/forward search
|
|
|
|
bool output_sync;
|
|
|
|
/// custom LaTeX macro from user instead our own
|
|
|
|
std::string output_sync_macro;
|
2010-10-13 12:36:53 +00:00
|
|
|
/// use refstyle? or prettyref?
|
|
|
|
bool use_refstyle;
|
2017-06-06 22:55:23 +00:00
|
|
|
/// use minted? or listings?
|
|
|
|
bool use_minted;
|
2019-05-23 13:13:27 +00:00
|
|
|
//output line numbering
|
|
|
|
bool use_lineno;
|
|
|
|
//optional params for lineno package
|
|
|
|
std::string lineno_opts;
|
2009-12-30 22:22:33 +00:00
|
|
|
|
2011-05-08 23:51:44 +00:00
|
|
|
/// Return true if language could be set to lang,
|
|
|
|
/// otherwise return false and do not change language
|
|
|
|
bool setLanguage(std::string const & lang);
|
2016-10-19 21:22:58 +00:00
|
|
|
///
|
|
|
|
void invalidateConverterCache() const;
|
2018-05-04 16:37:52 +00:00
|
|
|
/// Copies over some of the settings from \param bp,
|
|
|
|
/// namely the ones need by Advanced F&R. We don't want
|
|
|
|
/// to copy them all, e.g., not the default master.
|
|
|
|
void copyForAdvFR(BufferParams const & bp);
|
2011-05-08 23:51:44 +00:00
|
|
|
|
2003-03-12 11:52:23 +00:00
|
|
|
private:
|
This is one of a series of patches that will merge the layout modules development in personal/branches/rgheck back into the tree.
Design goal: Allow the use of layout "modules", which are to LaTeX packages as layout files are to LaTeX document classes. Thus, one could have a module that defined certain character styles, environments, commands, or what have you, and include it in various documents, each of which uses a different document class, without having to modify the layout files themselves. For example, a theorems.module could be used with article.layout to provide support for theorem-type environments, without having to modify article.layout itself, and the same module could be used with book.layout, etc.
This first patch does some reworking of the infrastructrue. We need to distinguish between the TextClass that a particular document is using and the layout of that document, since modules, in particular, can modify the layout. The solution adopted here is to add a TextClass pointer to BufferParams, which will hold the layout. The layout itself is then constructed from the TextClass the document is using. At present, this is completely trivial, but that will change when modules are added.
The pointer in question is a boost::shared_ptr. This is needed because CutAndPaste saves a copy of the layout with each cut or copied selection. We cannot assume the selection vanishes when the document is closed, so there are two options: (i) keep a list of all the layouts that have ever been used by any document; (ii) used some kind of smart pointer. The latter seems preferable, as the former would waste memory. More importantly, the use of a smart pointer allows modules to be modified on disk and then reloaded while LyX is running, and it will eventually allow the same for layout files.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19756 a592a061-630c-0410-9148-cb99ea01b6c8
2007-08-23 16:41:13 +00:00
|
|
|
///
|
|
|
|
void readPreamble(Lexer &);
|
|
|
|
///
|
2013-05-15 05:19:49 +00:00
|
|
|
void readLocalLayout(Lexer &, bool);
|
2008-03-24 12:31:07 +00:00
|
|
|
///
|
This is one of a series of patches that will merge the layout modules development in personal/branches/rgheck back into the tree.
Design goal: Allow the use of layout "modules", which are to LaTeX packages as layout files are to LaTeX document classes. Thus, one could have a module that defined certain character styles, environments, commands, or what have you, and include it in various documents, each of which uses a different document class, without having to modify the layout files themselves. For example, a theorems.module could be used with article.layout to provide support for theorem-type environments, without having to modify article.layout itself, and the same module could be used with book.layout, etc.
This first patch does some reworking of the infrastructrue. We need to distinguish between the TextClass that a particular document is using and the layout of that document, since modules, in particular, can modify the layout. The solution adopted here is to add a TextClass pointer to BufferParams, which will hold the layout. The layout itself is then constructed from the TextClass the document is using. At present, this is completely trivial, but that will change when modules are added.
The pointer in question is a boost::shared_ptr. This is needed because CutAndPaste saves a copy of the layout with each cut or copied selection. We cannot assume the selection vanishes when the document is closed, so there are two options: (i) keep a list of all the layouts that have ever been used by any document; (ii) used some kind of smart pointer. The latter seems preferable, as the former would waste memory. More importantly, the use of a smart pointer allows modules to be modified on disk and then reloaded while LyX is running, and it will eventually allow the same for layout files.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19756 a592a061-630c-0410-9148-cb99ea01b6c8
2007-08-23 16:41:13 +00:00
|
|
|
void readLanguage(Lexer &);
|
|
|
|
///
|
|
|
|
void readGraphicsDriver(Lexer &);
|
|
|
|
///
|
|
|
|
void readBullets(Lexer &);
|
|
|
|
///
|
|
|
|
void readBulletsLaTeX(Lexer &);
|
This is one of a series of patches that will merge the layout modules development in personal/branches/rgheck back into the tree.
Design goal: Allow the use of layout "modules", which are to LaTeX packages as layout files are to LaTeX document classes. Thus, one could have a module that defined certain character styles, environments, commands, or what have you, and include it in various documents, each of which uses a different document class, without having to modify the layout files themselves. For example, a theorems.module could be used with article.layout to provide support for theorem-type environments, without having to modify article.layout itself, and the same module could be used with book.layout, etc.
This patch adds the backend. The ModuleList class holds a list of the available modules, which are retrieved from lyxmodules.lst, itself generated by configure.py. There are two LFUNs available: modules-clear and module-add, which do the obvious thing; you can test by typing these into the minibuffer, along with the name of one of the available modules: URL (a CharStyle), Endnote (a Custom Inset), and---with the spaces---End To Foot (View>LaTeX and look at the user preamble), which are themselves in lib/layouts. There are some others, too, that allow theorems to be added to classes like article and book.
The GUI will come next.
Issues: (i) The configure.py script could be improved. It'd be nice, for example, if it tested for the presence of the LaTeX packages a particular module needs. But this would mean re-working the LaTeX script, and I don't know how to do that. Note that at present, the packages are ignored. This will change shortly. (ii) I've used std::string in LyXModule, following what seemed to be a precedent in TextClass. If some of these should be docstrings, please let me know, and I'll change them. (iii) There is at present no distinction between LaTeX and DocBook modules. Should there be? That is: Should there be modules that are available when the document class is a LaTeX class and others that are available only when it is DocBook? Or should there just be one set of modules? Each module can of course indicate for what it is suitable in its description.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19893 a592a061-630c-0410-9148-cb99ea01b6c8
2007-08-29 17:59:49 +00:00
|
|
|
///
|
|
|
|
void readModules(Lexer &);
|
2008-07-27 17:46:27 +00:00
|
|
|
///
|
|
|
|
void readRemovedModules(Lexer &);
|
2010-01-07 10:01:26 +00:00
|
|
|
///
|
|
|
|
void readIncludeonly(Lexer &);
|
2011-05-13 19:39:56 +00:00
|
|
|
/// A cache for the default flavors
|
2020-11-30 22:00:40 +00:00
|
|
|
typedef std::map<std::string, Flavor> DefaultFlavorCache;
|
2011-05-13 19:39:56 +00:00
|
|
|
///
|
|
|
|
mutable DefaultFlavorCache default_flavors_;
|
2018-05-20 10:27:03 +00:00
|
|
|
/// the cite engine
|
|
|
|
std::string cite_engine_;
|
2012-01-09 13:16:38 +00:00
|
|
|
/// the type of cite engine (authoryear or numerical)
|
|
|
|
CiteEngineType cite_engine_type_;
|
2017-01-01 07:37:56 +00:00
|
|
|
/// the default BibTeX style file for the document
|
|
|
|
std::string biblio_style;
|
2019-03-29 14:45:55 +00:00
|
|
|
/// The main encoding of the bib files, for Biblatex
|
2018-07-07 13:25:35 +00:00
|
|
|
std::string bib_encoding;
|
2019-03-29 14:45:55 +00:00
|
|
|
/// Individual file encodings, for Biblatex
|
|
|
|
std::map<std::string, std::string> bib_encodings;
|
2017-01-15 14:40:20 +00:00
|
|
|
/// Split bibliography?
|
|
|
|
bool use_bibtopic;
|
2008-02-28 01:42:02 +00:00
|
|
|
///
|
2012-03-13 16:13:31 +00:00
|
|
|
DocumentClassPtr doc_class_;
|
2011-12-03 22:15:11 +00:00
|
|
|
///
|
2010-11-26 18:42:53 +00:00
|
|
|
LayoutModuleList layout_modules_;
|
2008-07-27 17:46:27 +00:00
|
|
|
/// this is for modules that are required by the document class but that
|
|
|
|
/// the user has chosen not to use
|
2010-11-26 18:42:53 +00:00
|
|
|
std::list<std::string> removed_modules_;
|
2013-05-15 05:19:49 +00:00
|
|
|
/// The local layouts without the forced ones
|
2016-09-25 10:37:40 +00:00
|
|
|
docstring local_layout_;
|
2013-05-15 05:19:49 +00:00
|
|
|
/// Forced local layouts only for reading (use getLocalLayout() instead)
|
2016-09-25 10:37:40 +00:00
|
|
|
docstring forced_local_layout_;
|
This is one of a series of patches that will merge the layout modules development in personal/branches/rgheck back into the tree.
Design goal: Allow the use of layout "modules", which are to LaTeX packages as layout files are to LaTeX document classes. Thus, one could have a module that defined certain character styles, environments, commands, or what have you, and include it in various documents, each of which uses a different document class, without having to modify the layout files themselves. For example, a theorems.module could be used with article.layout to provide support for theorem-type environments, without having to modify article.layout itself, and the same module could be used with book.layout, etc.
This first patch does some reworking of the infrastructrue. We need to distinguish between the TextClass that a particular document is using and the layout of that document, since modules, in particular, can modify the layout. The solution adopted here is to add a TextClass pointer to BufferParams, which will hold the layout. The layout itself is then constructed from the TextClass the document is using. At present, this is completely trivial, but that will change when modules are added.
The pointer in question is a boost::shared_ptr. This is needed because CutAndPaste saves a copy of the layout with each cut or copied selection. We cannot assume the selection vanishes when the document is closed, so there are two options: (i) keep a list of all the layouts that have ever been used by any document; (ii) used some kind of smart pointer. The latter seems preferable, as the former would waste memory. More importantly, the use of a smart pointer allows modules to be modified on disk and then reloaded while LyX is running, and it will eventually allow the same for layout files.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19756 a592a061-630c-0410-9148-cb99ea01b6c8
2007-08-23 16:41:13 +00:00
|
|
|
|
2010-01-07 10:01:26 +00:00
|
|
|
/// the list of included children (for includeonly)
|
2010-11-26 18:42:53 +00:00
|
|
|
std::list<std::string> included_children_;
|
2010-01-07 10:01:26 +00:00
|
|
|
|
2012-01-03 20:51:07 +00:00
|
|
|
typedef std::map<std::string, Package> PackageMap;
|
|
|
|
/** Whether and how to load packages like amsmath, esint, mhchem,
|
2012-12-28 18:51:28 +00:00
|
|
|
* mathdots, stackrel, stmaryrd and undertilde.
|
2012-01-03 20:51:07 +00:00
|
|
|
*/
|
|
|
|
PackageMap use_packages;
|
2016-10-19 22:11:58 +00:00
|
|
|
|
2003-09-09 17:00:19 +00:00
|
|
|
/** Use the Pimpl idiom to hide those member variables that would otherwise
|
2003-09-15 20:23:57 +00:00
|
|
|
* drag in other header files.
|
2003-09-09 17:00:19 +00:00
|
|
|
*/
|
|
|
|
class Impl;
|
2005-01-19 15:03:31 +00:00
|
|
|
class MemoryTraits {
|
|
|
|
public:
|
2003-09-15 20:23:57 +00:00
|
|
|
static Impl * clone(Impl const *);
|
|
|
|
static void destroy(Impl *);
|
|
|
|
};
|
2006-10-21 00:16:43 +00:00
|
|
|
support::copied_ptr<Impl, MemoryTraits> pimpl_;
|
1999-09-27 18:44:28 +00:00
|
|
|
};
|
|
|
|
|
2006-10-21 00:16:43 +00:00
|
|
|
} // namespace lyx
|
|
|
|
|
1999-09-27 18:44:28 +00:00
|
|
|
#endif
|