Commit Graph

180 Commits

Author SHA1 Message Date
Juergen Spitzmueller
0aeeb78f3c Simplify cite engines code
As opposed to modules (from which the framework was initially borrowed),
we only allow one cite engine per document. Thus, we don't need to fiddle
with lists.
2018-05-20 12:27:03 +02:00
Juergen Spitzmueller
aa9543fa2b Add support for global float alignment
It is now possible in the float settings (doc dialog) to specify a global
(inner) alignment for floats, and in the float settings, this can be
overridden (just as with float placement)

Fixes: #8665

File format change.
2018-05-10 20:15:11 +02:00
Enrico Forestieri
f11bfe1697 The shell escape patch
Allow a LaTeX backend to run external commands after user confirmation.
This is a per document and per machine setting. The authorization has
to be given through the document settings pane, but is not recorded in
the document itself. Moving the document to either another computer or
another directory on the same computer revokes the authorization.
This can also be done by right clicking the red icon that appears in
the status bar when a document is marked as one requiring shell escape.
The patch also checks whether the user has added the -shell-escape
option to a LaTeX converter and nags the user to remove the option
(which would be used for all documents) in favor of the (per document)
support offered by LyX.
2017-08-03 13:07:41 +02:00
Richard Heck
51aebc9327 Fix whitespace at EOL. 2017-07-03 13:46:30 -04:00
Enrico Forestieri
8dab1cfe7e Fix bug #9101
Update the listings inset to optionally use the minted package
(instead of the listings one) for typesetting code listings.
Only one of the two packages can be used in a document, but it
is possible to switch packages without issues if the used options
are the same. If a switch is made and the options differ, one needs
to manually adjust them if they were entered in the advanced options
tab, or apply again the gui settings.
Note that minted requires the -shell-escape option for the latex
backend and the installation of additional software (python pygments).
2017-06-07 00:55:23 +02:00
Uwe Stöhr
0dd3311dd4 rename buffer parameter math_number_before to math_numbering_side
this is a fileformat change

also try to fix an UI issue that JMarc gets
2017-05-13 20:39:45 +02:00
Jean-Marc Lasgouttes
f1dd80f464 Proper GUI feedback for leqno option
With these changes, equation numbers are shown properly on screen.
When setting is default, we guess the side using these two rules

* ams(art|book) and siamltex classes are leqno by default. This is
  signalled because the classes provide "leqno" (in amsdefs.inc). If
  there are other classes that do this in output, the relevant classes
  should be updated.

* the language arabic_arabi also sets leqno by default. This is
  currently hardcoded for lack of a better idea.

Besides, a few bugs are fixed:
* use mathrm instead of mathbf for numbers metrics
* set spacing between maths and labels in inches
2017-05-12 15:32:14 +02:00
Jean-Marc Lasgouttes
d4685f2806 Never, never use a string for something that has 3 values
This commit replaces the string math_number_before by a proper math_number enum.

Note that the _before naming was misleading. It was chosen at a time
when we were not sure whether leqno was always left or could be right
in RtL documents.

Note that the token in LyX document is still \math_number_before and
this should be changed.

Fixup for 19cc4a1f.
2017-05-12 12:00:43 +02:00
Uwe Stöhr
19cc4a1fcb GuiDocument: support also the class option reqno
as discussed our support for the formula numbering side should be complete. There are document classes that uses left numbering as default and with the class option "reqno" this can be changed to right numbering. reqno requires the loading of amsamth.
2017-05-12 01:06:05 +02:00
Uwe Stöhr
3f8c15a7c6 support for the document class option leqno
- fileformat change
2017-04-25 02:28:10 +02:00
Jean-Marc Lasgouttes
df6b2f4470 Rewrite mathindent without HSpace class
Use Length instead of HSpace for math_indentation and rename it to mathindent.
Get rid of the string version.

Rename (g|s)etMathIndentation() to (g|s)etMathIndent().

Remove the HSpace class altogether.

Some cleanups to parindent support to look like mathindent.
2017-04-19 17:55:56 +02:00
Jean-Marc Lasgouttes
d86954eb81 Revert "BufferParams: get rid of the HSpace class for mathindent as requested by JMarc"
This reverts commit d9a2a40268.

This is not the right way of getting rid of HSpace. We need a proper
Length, not a string.
2017-04-19 16:19:18 +02:00
Uwe Stöhr
d9a2a40268 BufferParams: get rid of the HSpace class for mathindent as requested by JMarc 2017-04-17 20:32:31 +02:00
Jean-Marc Lasgouttes
fc4ca36403 Cleanup parindent support
Rename (g|s)etter to (get|set)ParIndent(), and rename member variables
accordingly.

Do not rely on HSpace anymore, since Length does have all we need.
2017-04-17 18:30:33 +02:00
Uwe Stöhr
fc1c5c6f28 BufferParams: rename formula_indent to math_indent etc. as requested
- also add flyx2lyx feature to import existing document class option as requested by JMarc
- also don't use a real default indentation length
2017-04-13 02:31:26 +02:00
Uwe Stöhr
808339790c support to indent formulas
- adds support for the general document class option fleqn
- adds support to specify the formula indentation
- fileformat change
2017-04-05 22:22:47 +02:00
Enrico Forestieri
72a488d7e6 Fix output of en- and em-dashes with TeX fonts
This commit fixes the regression introduced in 2.2 about the
output of en- and em-dashes. In 2.2 en- and em-dashes are output as
the \textendash and \textemdash macros when using TeX fonts, causing
changed output in old documents and also bugs (for example, #10490).

Now documents produced with older versions work again as intended,
while documents produced with 2.2 can be made to produce the exact
same output by simply checking "Don't use ligatures for en-and
em-dashes" in Document->Settings->Fonts.

When exporting documents using TeX fonts to earlier versions, in order
to avoid changed output, a zero-width space character is inserted after
each en/em-dash if dash ligatures are allowed. These characters are
removed when reloading  documents with 2.3, so that they don't accumulate.
2017-03-19 20:50:34 +01:00
Juergen Spitzmueller
73ccee113e rename BufferParams::font_encoding() to ::main_font_encoding()
Because that's what's actually returned.
2017-02-25 12:49:49 +01:00
Juergen Spitzmueller
bedebfc45a Support for multiple bibliographies setting "per child"
This adds support for the chapterbib package, but also adds ways to
produce this sort of multibib with biblatex and bibtopic (which are
both incompatible with chapterbib).

File format change.
2017-02-04 19:23:45 +01:00
Juergen Spitzmueller
7ca20b292c Support for multiple bibliographies
Using refsection=unit in biblatex, or bibtopic's btUnit environments
in BibTeX.

File format change.
2017-02-04 12:02:00 +01:00
Juergen Spitzmueller
4859a1f6bb Don't load bibtopic with Biblatex 2017-01-15 15:40:20 +01:00
Juergen Spitzmueller
1eb43536da Add an "Automatic" bibliography processor pref option
This is now set as default. It selects biber for Biblatex (with
fall-back to first bibtex8, then bibtex, if the former is not
installed), and bibtex for BibTeX-based engines.

With this, users do not normally need to care for the processor when
they switch cite engines.
2017-01-13 19:18:35 +01:00
Juergen Spitzmueller
8319b3e9d6 Biblatex support
File format change
2017-01-08 09:39:46 +01:00
Juergen Spitzmueller
958f6193ed Differentiate InsetCite
Next to the cmd name, introduce optional latex names (that might differ
from the cmd name) and aliases (that are "obsoleted by" the cmd).

This enhances portability between the engines.
2017-01-03 13:11:11 +01:00
Juergen Spitzmueller
8239e66c94 Add BufferParams::bibtexCommand()
This function returns the real command (either per lyxrc or bufferparam)
2017-01-01 10:49:22 +01:00
Juergen Spitzmueller
5d58bfadbc Make biblio_style private
This should never ever be accessed directly
2017-01-01 08:37:56 +01:00
Juergen Spitzmueller
36a679344a Implement dynamic quotation marks
File format change.
2016-12-25 12:19:02 +01:00
Juergen Spitzmueller
2e255b1c4f Restructure InsetQuotes for better extensibilty
The current char-based implementation gets increasingly unreadable,
especially if styles are added that do not follow the strict
single-double paradigm.
2016-12-24 10:13:51 +01:00
Juergen Spitzmueller
cce4639b55 Rename some quote-related params
Quote Language -> Quote Style
Quote Times-> Quote Level

No change in functionality.
2016-12-20 17:55:43 +01:00
Richard Heck
c19794a013 These two routines are now redundant. 2016-10-20 23:07:13 -04:00
Richard Heck
014bc7805e Use a typedef for vector<Format const *>, which is what gets used
for lists of exportable and importable formats.
2016-10-20 23:07:13 -04:00
Richard Heck
0b67e103e9 Simple cache for information on exportable formats, since we seem
to access this information a lot.
2016-10-20 23:07:13 -04:00
Guillaume Munch
1f945177b9 Docstringify getLongString in general and preamble snippets in particular
Prepare ground for TexRow InPreamble
2016-10-17 00:16:59 +02:00
José Matos
b41300d819 Fix typo 2016-07-13 16:46:52 +01:00
Pavel Sanda
ba2b86fa5d Introduce basic support for microtype.sty.
https://www.mail-archive.com/lyx-devel@lists.lyx.org/msg192743.html
2016-06-02 22:48:58 -07:00
Jean-Marc Lasgouttes
b639056981 Remove declaration of classes that do not exist
Some headers contain
  class Foo;
whereas there is no class Foo.

The list of class statements is given by
  classes=`git grep  '^\(class\|struct\) [a-zA-Z_:]*;' src | sed 's/^.* \(.*\);/\1/'|sort -u`

The ones that are useless are:
  for c in $classes ; do grep -r "\\<$c\\>" src| grep -vq '^[^:]*:\(class\|struct\) [a-zA-Z_:]*;' || echo "$c"; done
2016-05-29 17:55:45 -04:00
Guillaume Munch
5c2d049996 Add \save_transient_properties parameter (#9841)
Increment LyX format to 504.

With this new parameter, the user can indicate that some other parameters that
are frequently switched must not be recorded in the file (as if they were a
setting specific to the user or transient, rather than a document setting). This
will play nicer with version control systems.

See the discussion, e.g.:
http://thread.gmane.org/gmane.editors.lyx.devel/157824/focus=157993 (third
solution mentioned)

TODO:
* The interface remains to be set up. We cannot change this setting from LyX
  for now.
* If save_transient_properties is false, we should read the user setting as a
  per-user-per-document (session) setting (e.g. like the cursor position).
* Once the above is done, we can treat \justification the same way (but it would
  be even better if \justification was moved to lyxrc).
2016-01-12 21:25:34 +00:00
Guillaume Munch
86bd1cd641 Fix bug #9854 "Dataloss after git merge with change tracking"
A plausible scenario is that change tracking is used together with a versioning
system. In this case, parallel modifications might remove an \author line on one
side, and add another change of this author on the other side. This scenario
causes a bad merge after which the added change has no associated author. In
this case, LyX used to display a list of errors on opening and deliberately
removed the corresponding change tracking information.

* If ever a tracked change refers to an author that does not exist, then add a
  dummy author. This dummy author is not saved to the file afterwards.

* Have a very clear error message on opening such a corrupt file.
2015-11-18 02:50:25 +00:00
Günter Milde
8021c0b0dc Update comments after solving #9740. 2015-11-13 13:59:17 +01:00
Georg Baum
2fc430d5ae Store both sets of font selections
This is one part of bug 9744: If you toggle between TeX fonts and non-TeX
fonts, the settings of the other choice are no longer thrown away, but stored
and re-activated if you switch back. Most parts of the patch are purely
mechanical (duplicating some BufferParams members), the only non-mechanical
change is in the GUI logic.
2015-11-09 07:36:42 +01:00
Georg Baum
60a648c572 Remove unused declarations 2015-11-04 21:41:00 +01:00
Scott Kostyshak
0911915b6a Typo 2015-10-31 02:12:31 -04:00
Enrico Forestieri
306b136cc0 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 22:02:13 +02:00
Juergen Spitzmueller
5fec78f69f Properly determine active font encoding 2015-04-02 17:13:45 +02:00
Jean-Marc Lasgouttes
9448e89879 Remove unused variable BufferParams::quotes_times
This was pointed out inadvertently by coverity issue 23484: the
variable was not properly initialized.
2015-03-04 18:21:58 +01:00
Stephan Witt
f9bff2d9b1 #9130 Text in main work area isn't rendered with high resolution
Add display_pixel_ratio to buffer params to use it for displays with high resolution.
It holds the highest ratio between physical pixels and device-independent pixels of the LyX application.
Preview snippets will be generated using this value to get high resolution preview.
2014-10-18 15:39:58 +02:00
Jean-Marc
93a43742a5 Fix a bunch of small performance issues spotted by cppcheck
Most of these are about passing const strings parameters as references.
2014-07-05 19:13:10 +02:00
Richard Heck
0a6ff99f28 Typos and style. 2014-04-21 11:51:59 -04:00
Juergen Spitzmueller
fa6b388cb3 Do not issue module warnings when just cloning a buffer (#8864) 2014-02-09 11:16:20 +01:00
Georg Baum
7bdc34a987 Implement forced local layouts
These should be used if any new style needs to be introduced in the stable
2.1 series: If the ForceLocal flag of the style is set, it will always be
written to the document header, so that even older 2.1 versions can read
and correctly output the document.
2013-05-15 07:19:49 +02:00