Commit Graph

152 Commits

Author SHA1 Message Date
Uwe Stöhr
6c6cf5e071 use https:// in the first line of .lyx files
- also support to detect https via tex2lyx
2017-12-17 02:24:26 +01:00
Jean-Marc Lasgouttes
4cfa5a9d2a Avoid assignment in if() clause
The optimization they provide is not worth it IMO.

Fixes bugs #10898, #10899, #10940.
2017-12-14 12:56:02 +01:00
Jean-Marc Lasgouttes
15a87dd3a8 Check whether a class is known before loading it
Fixes bug #10719.
2017-07-25 11:57:29 +02:00
Juergen Spitzmueller
3c7b75c5bc Properly import \newtheorem*
Fixes: #10622
2017-07-23 13:20:56 +02:00
Jean-Marc Lasgouttes
64667735f4 h_use_minted is a bool, not a string
We have a mix in this file of boolean stored as such or as strings.
This translates to values written as true/false or 1/0 in .lyx files.

In this case, the value of use_minted could only be true, since the
char * pointer is non null.

Also add some else clauses.

Spotted by coverity.
2017-07-06 14:11:30 +02:00
Richard Heck
75bfed5507 Fix trailing whitespace in cpp files. 2017-07-03 13:53:14 -04:00
Enrico Forestieri
7a9bb85184 tex2lyx: import minted listings
This commit updates tex2lyx in order to also import minted listings.
For the floating version of a listing, minted uses the listing
environment, a concept that is not shared with the listings package,
towards which our listings inset is geared.
For this reason, a kludge is necessary when importing minted listings
not previously exported by LyX itself.
If the floating listing contains only a caption and a label (other
than the listing itself), everything is fine and the import is (or
aims to be) perfect. But, as in all other floating ebvironments,
one can also stick there other elements, which don't have a place
in the listings inset. So, in order to avoid a data loss, tex2lyx
sticks everything into the caption. In this way, things may be
rearranged in the GUI, if necessary. There is no other way, apart
from a complete redesign of the listings inset, of course. However,
I think that this is an acceptable compromise.
2017-06-17 02:23:00 +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
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
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
1c2d056cfc tex2lyx: fix the preamble output
- LyX has new preamble tags. Although that they are not relevant for LaTeX they must be created by tex2lyx nevertheless
- also fix an issue that the formula indentation was always output
- update the tex2lyx tests accordingly
2017-04-08 04:55:22 +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
Uwe Stöhr
7aaa85915f latexfonts: support for the Noto fonts
- fileformat change
- the support to scale the sf and the tt fonts can be added later, see enhancement #10611
2017-04-04 23:02:47 +02:00
Uwe Stöhr
86cd1a9c97 tex2lyx: support for the cochineal fonts 2017-04-04 00:19:14 +02:00
Juergen Spitzmueller
857506e992 Rename \\quotes_language to\\quotes_style
File format change.
2016-12-20 18:54:07 +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
Uwe Stöhr
87c00f3383 add support for Urdu and Syriac
- fileformat change
- I could not update the tex2lyx testfiles because of bug #10440 (there is now a probable fix)
2016-10-28 00:21:58 +02:00
Uwe Stöhr
d9c52c7a3f support for Amharic, Asturian, Kannada and Khmer
- fileformat change
- I could not update the tex2lyx test files because of bug #10440
- maybe the lyx2lyx routine could be improved but since a document can also begin with another layout than "Standard" I could not use the lyx2lyx function put_cmd_in_ert
2016-10-22 15:33:59 +02:00
Uwe Stöhr
5adf949abb tex2lyx/Preamble.cpp: forgot this in r[f179173e/lyxgit]
- polyglossia supports Romansh, Piedmontese and Friulian
2016-10-21 00:20:27 +02:00
Uwe Stöhr
fe542e7989 tex2lyx/Preamble.cpp: sort alphabetically to keep overview
- also comment out the unsupported languages
2016-10-21 00:14:09 +02:00
Uwe Stöhr
f179173e42 support for the languages Bosnian, Friulian, Macedonian, Piedmontese and Romansh
- file format change
- note that I could not update the tex2lyx test files because of bug #10440
2016-10-16 15:33:23 +02:00
Pavel Sanda
d5933fc5b5 Comment only 2016-06-02 22:48:58 -07: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
Georg Baum
de3e5280f6 Open tex2lyx input files with correct encoding
We open the input file now twice: The first time in latin1 encoding to read
the document encoding from the preamble. This does always work, since
traditional TeX does not allow non-ASCII contents without an encoding changing
command (except for comments, but we do not need them, and using latin1 rather
than utf8 ensures that they do not produce an iconv exception, but are simply
recored with wrong characters), and we do detect the utf8 based TeX engines
XeTeX and LuaTeX as well. The second time we open the file directly with the
document encoding.

This fixes a few tex2lyx tests on OS X, since changing the encoding of an
open file steam does not work with clang on OS X. Files using more than one
encoding are still broken, but all single-encoding files are fixed now.
2016-01-31 12:54:59 +01:00
Georg Baum
250b058192 Do not use static objects in Preamble
This does not make any difference currently, since the only instance of the
Preamble class is a global one, but it is cleaner and will be needed for
parsing the encoding with a second Preamble instance.
2016-01-31 12:37:22 +01: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
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
Jean-Marc Lasgouttes
a5822a2976 Allow quotes in PDF text properties
PDF properties (Author, Title...) need to be quoted properly when writing (normal operation and tex2lyx). Also, reading them requires to use Lexer::getString() directly, because >> uses next(), which does not handle escapes.

Fixes bug #9830.
2015-11-04 12:18:01 +01:00
Uwe Stöhr
a06b3900d2 tex2lyx/Preamble.cpp: revert a part of [041a3add/lyxgit]
There is a general problem of tex2lyx handling theorems. it is not sufficient to cure only one instance as I did. For more info see bug #9561.

Update the references accordingly.
2015-05-25 17:49:54 +02:00
Uwe Stöhr
9960709fc2 tex2lyx/Preamble.cpp: handle \LyX
The definition for \LyX is re-added if the file contains \LyX
2015-05-25 02:02:10 +02:00
Uwe Stöhr
111df7b600 tex2lyx/Preamble.cpp: handle \lyxline 2015-05-25 01:48:28 +02:00
Uwe Stöhr
a7db473445 tex2lyx/Preamble.cpp: handle \lyxarrow
this fixes error 20 in bug #9565
2015-05-25 01:40:59 +02:00
Uwe Stöhr
041a3add6c tex2lyx/Preamble.cpp: fix bug #9561
there were 2 issues:
- the body was not output to the Preamble
- the theorem module already defines a theorem. It must not be output to the preamble to avoid a redefinition error of LaTeX

update the test files accordingly
2015-05-24 17:03:13 +02:00
Juergen Spitzmueller
ee41b0f193 Forgotten tex2lyx change in dbe0096c12 2015-05-24 14:21:36 +02:00
Uwe Stöhr
6ae2a8bcbe tex2lyx/Preamble.cpp: forgot a package in previous commit 2015-05-19 00:21:12 +02:00
Uwe Stöhr
0471fe366a tex2lyx: register required packages for boxes 2015-05-19 00:17:08 +02:00
Uwe Stöhr
699f4b49a9 tex2lyx/Preamble.cpp: correct capitalization 2015-05-14 23:05:05 +02:00
Uwe Stöhr
e35bb3126a support for all default colors of the package xcolor
fileformat change
2015-05-14 22:23:44 +02:00
Enrico Forestieri
7144f8dad8 Update tex2lyx and tests after 306b136c 2015-05-14 01:02:37 +02:00
Uwe Stöhr
c6b17b685a support for Georgian
add support to set Georgian as document language, fileformat change
2015-04-06 06:00:11 +02:00
Georg Baum
59b705dcd9 Move global variable to preamble
This will be needed in the future, when I need to parse the preamble twice
for detecting japanese encoding (bug #8218).
2015-01-06 19:21:34 +01:00
Georg Baum
bf1006a22c Fix misparsing of \textgreek without polyglossia
This is the first part of bug #8553. \textgreek was interpreted as the
polyglossia version even if polyglossia was not used. Now it is not recognized
at all and converted to ERT, but this ensures at least correct LaTeX output.
2014-12-30 17:44:08 +01:00
Uwe Stöhr
c2e0f22385 tex2lyx/Preamble.cpp: add support for all \defskip lengths
- support for percentage length was missing and the fix is really that simple
2014-11-23 03:28:07 +01:00
Uwe Stöhr
2a1ab8b6f0 tex2lyx/Preamble.cpp: whitespace fix
- revert unnecessary change from previous commit
2014-11-20 02:03:06 +01:00
Uwe Stöhr
5c9667d8b8 tex2lyx: support for the libertine fonts
- all libertine font variants are now supported
2014-11-20 02:01:05 +01:00
Uwe Stöhr
73f2b01678 tex2lyx: support for bibtopic
can also go to branch
2014-11-07 03:29:53 +01:00
Uwe Stöhr
b119f849d7 tex2lyx/Preamble.cpp: support 2 math fonts
- support for kurier and iwona as math font
can also go to branch
2014-11-07 01:28:42 +01:00
Enrico Forestieri
b60b505fd8 Fix import of latex documents with scaled fonts. 2014-07-11 11:21:45 +02:00
Georg Baum
98fc5e518f Support new languages in tex2lyx
I forgot that this was part of the file format update as well.
Also fix a mixup of "english" and "uppersorbian".
2014-07-10 22:15:34 +02:00