Commit Graph

285 Commits

Author SHA1 Message Date
Juergen Spitzmueller
62085642bc Fix indentation 2019-05-11 18:59:42 +02:00
Enrico Forestieri
56a14c3fde Refined fix for #9633
A branch inset modifies the layout of the internal structures in
which the text is organized. When a branch is active, it is as if it
was not there, but its only presence makes a paragraph which would not
be the last one to actually be the last one, or the check for the
language of the previous paragraph to fail because there is no
previous paragraph before the first one in a branch inset.
Oney way I found to tackle it, is tracking whether the typesetted
paragraphs are actually part of an active branch inset and acting
accordingly.
2019-05-10 08:09:26 +02:00
Günter Milde
af9838fd32 Fix spurious \end{CJK} in LaTeX output. 2019-05-07 23:37:30 +02:00
Juergen Spitzmueller
b77094a497 Only write btUnits if we have a bibliography
Fixes: #11562
2019-04-23 08:58:01 +02:00
Kornel Benko
6747b3fe97 Don't switch encodings if in search modus 2019-04-17 07:40:31 +02:00
Günter Milde
27ba6f282d Rename legacy input encoding settings.
Format incremented to 573
2019-04-16 20:17:32 +02:00
Günter Milde
da23637d7f Do not switch the input encoding inside documents using platex.
Fixes wrong and missing characters in text parts in other languages
(platex does not support "inputenc").

Fixes compilation errors due to desynchronized encoding switches.
2019-04-12 18:08:17 +02:00
Günter Milde
6fd263122d Typographical corrections. 2019-04-10 15:59:17 +02:00
Günter Milde
2183978f1a Amend 6def81f30f. Never switch encodings with XeTeX or LuaTeX. 2019-04-05 16:14:58 +02:00
Günter Milde
6def81f30f Fix #10600: XeTeX with 8-bit TeX fonts requires input encodings "utf8" or "ascii".
* New: support also utf8 (working around false positive test in "inputenc.sty").

* Do not force the change of input encoding to "ascii".

  Deny compilation with XeTeX if a document uses TeX fonts and a non-supported input encoding.
2019-04-03 15:32:44 +02:00
Enrico Forestieri
45e0ce2372 Fix bug #11528
The code was not doing what said in the description.
2019-03-31 15:14:28 +02:00
Juergen Spitzmueller
262e436fc3 Move labels and insets out of moving arguments
Fixes: #2154
2019-03-14 14:24:43 +01:00
Günter Milde
4a481975b6 Use CJKutf8 package if input encoding is "utf8" and a used language requires CJK.
CJKutf8 now used also if a secondary language requires CJK.
2019-03-13 11:31:25 +01:00
Juergen Spitzmueller
8b92a2a689 Add NeedMBoxProtect [inset]layout option
This accesses the inulemcmd output param which protects specific commands
(\cite, \ref) in an \mbox.

This is needed in ulem and soul commands, since their complex
detokenization makes such commands (who produce multiple words via local
assignment) fail.

So now it is possible to properly support ulem and soul via
[inset]layout

Fixes a case reported in #9404
2019-03-12 14:08:05 +01:00
Günter Milde
e665715fc4 Don't switch encodings when a document wide encoding is specified.
Remove special code for CJK that is no longer required after
we use CJKutf8 document-wide with inputenc "utf8-cjk"
(and "utf8" for languages requiring CJK) (since 7bbf333fa1).

CJK characters can no longer be used with a document-wide 8-bit encoding.
(Hint: Use utf8-cjk or one of the CJK legacy encodings if your document contains CJK characters.)
2019-02-28 22:55:43 +01:00
Kornel Benko
a298fc55d9 FindAdv: Added handling for latex environments
1.) Make sure the environment is mentioned in the string for search
  (Added the keyword \latexenvironment{...})
2.) Handle it similar to \textcolor{}

That way we can also search for 'conclusion*' or 'summary' etc
in Additional.lyx.
2019-02-20 14:14:50 +01:00
Günter Milde
7bbf333fa1 Don't switch encodings to/from CJK if the document encoding is using the CJK package.
Also, since we return earlier if the document encoding is an utf8-variant
since fc0ab1283, the wrapper around "setEncoding" is no longer required.
2019-02-09 20:42:24 +01:00
Günter Milde
fc0ab1283c Check for CJK instead of CJKutf8.
The specific test was introduced in ef6be5f4 because
CJKutf8 was relatively new (cf. lyx.org/trac/ticket/5386).

10 years on, CJKutf8 is an established part of the CJK bundle
and we can skip the special test for CJKutf8 to make the logic
considerabely simpler to read, maintain and debug.
2019-02-05 11:31:27 +01:00
Kornel Benko
50550a215f Findadv: Handle \lettrine{} in initials.module
The problem here is, that selecting any subset of a \lettrine{}
line always creates an initials header. That makes it impossible
to our search engine to find strings, because the regex does not
contain that info. So we have to discard the leading \lettrine part
completely.
We place now a marker (\endarguments) to determine that removable
part.
2019-02-05 08:04:47 +01:00
Günter Milde
319a986fc0 Do not use \inputencoding when the buffer input encoding is one of the "legacy" CJK encodings.
If Document>Settings>Language>Encoding is set to any value except "auto" or "default", we
expect the whole document to use this encoding. Wiht encodings from the CJK package, this means
one big "CJK" environment and no encoding switches.

Characters that are not handled by the CJK package need to be "forced" in lib/unicodesymbols.
This is completed for "euc-cn", the others will follow.
2019-01-30 15:14:45 +01:00
Günter Milde
62865d190d Fix CJK environment nesting issue.
If the last paragraph is nested in an environment,
we'll have to \end that first.
2019-01-28 23:02:33 +01:00
Günter Milde
34f5ba3c54 Fix for CJK-documents with input-encoding "utf8". 2019-01-28 17:49:58 +01:00
Günter Milde
5ebc0b3f43 Fix second part of #5386.
A \clearpage command issued right before \end{CJK} is recommended by the
package author to prevent any un-processed CJK chars outside the
\begin{CJK} and \end{CJK} scope. Otherwise, TOC, header, footer,
and may contain CJK chars but get processed outside the CJK environment scope.

Tha new dedicated export test fails without the fix.
2019-01-24 14:40:19 +01:00
Günter Milde
197735747e Support for documents in other scripts with parts in CJK scripts.
Fix CJK support for documents using input-encoding "utf8-cjk"
when the main language is not Chinese, Korean, or Japanese.
2019-01-24 00:40:51 +01:00
Günter Milde
41055bab88 Fix handling of Thai tis620-0 input encoding.
The Thai tis620-0 input encoding is supported via the inputenc "plug in"
(data) file tis620.def from https://ctan.org/pkg/babel-thai.

We can handle it like the other contributed input encodings, e.g.,
Greek (ISO 8859-7) and the several Cyrillic encodings from
http://www.ctan.org/pkg/latex-cyrillic.

Under TeXLive 2018, the input encoding defaults to utf8, if there is no call to
inputenc. The added test file fails without the patch but compiles fine, if the
file "tis620.def" is present in the TEXPATH.
2019-01-09 09:23:16 +01:00
Juergen Spitzmueller
9982651fd6 CJKutf8 is only to be used with the dedicated utf8-cjk encoding 2019-01-09 08:29:41 +01:00
Juergen Spitzmueller
c9dd349bee Don't output CJK environment with non-TeX fonts
This amends d193cd05a8.
2019-01-06 16:40:36 +01:00
Juergen Spitzmueller
d193cd05a8 Properly implement CJKutf8
If we use that, the document actually needs to be in utf8 encoding, and
the CJK environment needs to account for it.

Candidate for stable.
2019-01-06 14:36:11 +01:00
Kornel Benko
17ee4cafb1 FindAdv: Enable search for different languages in Korean documents too
The problem here was that for european languages only the encoding
was visible in latex output. Now also the language is provided.
2018-11-18 10:40:42 +01:00
Kornel Benko
5c2f29d024 findadv: Output language chage in ANY case, if outputting for search
Without this, the first \item entry in a list does not specify the language
in latex output. But we need it if we do not ignore language in search.
2018-11-03 15:05:38 +01:00
Kornel Benko
e6418431dd Findadv: Handle the problem with list environments
The problem was, that the different list ennvironments
did not look different in tha latex output used for
search.
So the input of "\item ..." did not give information
if it is description, lyxlist, enumeration or labeling.

In search modus we use now "\item{enumeration}" etc.
2018-11-03 11:15:12 +01:00
Kornel Benko
b78bdf80a8 Added better handling for languages and colors for advanced F&R
The change is significant if the search format is not disabled.
We try to analyze the pattern string first to get needed features
for the search.
We try to analyse the searched string and if it does not
contain all expected featers (color, language, char style, char decoration)

Still some problems though
2018-10-05 20:26:44 +02:00
Juergen Spitzmueller
e158d661b9 Amend 2d4ac90fd2 once more
Only use local switch in RTL environment.
2018-09-10 12:29:22 +02:00
Juergen Spitzmueller
1116335977 Amend 2d4ac90fd2
Properly close local language switch.
2018-09-08 12:50:42 +02:00
Juergen Spitzmueller
d10c3bceb0 whitespace 2018-08-24 15:33:48 +02:00
Juergen Spitzmueller
2d4ac90fd2 Fix text direction problem with polyglossia
If an RTL language is set via environment in polyglossia, only a nested
\\text<lang> command will reset the direction for LTR languages

Fixes rest of # 10111.
2018-08-24 15:02:26 +02:00
Juergen Spitzmueller
b124adbd38 Introduce listpreamble argument type
This uses the InsetArgument interface to provide access to a document
part hitherto inaccessible by LyX: the part between \begin and the first
\item in a list (where lengths and counters can be redefined, for
instance).

Fixes: #11098

File format change, layout format change
2018-08-17 10:22:32 +02:00
Juergen Spitzmueller
2009469219 Group the switch of encoding for listings in utf8 documents
Else, \cprotect'ed documents fail.
2018-05-01 14:21:05 +02:00
Juergen Spitzmueller
768c9a552e cprotect allows to place environments in fragile contexts.
use that possibility.

Fixes parts of #5128.
2018-04-30 09:06:15 +02:00
Juergen Spitzmueller
15df033bce PassThru paragraphs have latex_language; consider this when checking
previous language

Fixes: #10793.
2018-04-29 13:19:27 +02:00
Juergen Spitzmueller
7018d3641f Don't add localswitch if no language changes 2018-04-27 18:27:21 +02:00
Juergen Spitzmueller
f778870338 Close/reopen local language switches at each par
Fixes: #11128
2018-04-27 09:48:14 +02:00
Juergen Spitzmueller
2ba584957c Add basic support for cprotect
This allows (some) verbatim contents in macros, such as \url's with
specific chars (#, % etc.) in section headings or footnotes (#449)
or comments in captions (#9313).

The mentioned two bugs are fixed by this commit.

Note that the implementation is still rather basic and might need
extension for other cases.
2018-04-13 17:46:37 +02:00
Juergen Spitzmueller
27584f5f70 Fix local polyglossia switch for Arabic
We need to lowercase the language again (it's \begin{Arabic},
but \textarabic)

Fixes: #11057.
2018-03-06 15:31:43 +01:00
Richard Heck
c86184ce3d Fix bug #10934. 2018-02-24 00:35:27 -05:00
Juergen Spitzmueller
87960e3dd8 Open intitle command explicitly also for passthru. 2017-12-27 11:49:54 +01:00
Juergen Spitzmueller
a2f886d526 Use TeXOnePar for the inpreamble layouts
This considers paragraph language and spacing (and simplifies the code)
2017-12-26 13:11:00 +01:00
Juergen Spitzmueller
931f87f508 Introduce "inherit" encoding for latex_language
This gets rid of the hardcoded latin1 encoding for verbatim. Instead,
verbatim now inherits the encoding from the context, which is what is
actually wanted here.

Fixes: #9012, #9258
2017-12-24 17:10:42 +01:00
Juergen Spitzmueller
49e3f8e830 Fix switch of language and line spacing in InTitle commands.
Fixes: #9332, #10849
2017-12-23 13:27:10 +01:00
Enrico Forestieri
7e51b5f301 Fix #10778 (issue with CJK and language nesting)
When using CJK, don't try to close a language that was never
opened before, such as when it is the main language.
2017-11-02 10:41:08 +01:00