mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-22 18:08:10 +00:00
Some new quote styles
* b `british' (``inner quotation'') * w >>swedishg>> ('inner quotation') ["g" = Guillemets] * f <<french>> (``inner quotation'') * i <<frenchin>> (<<inner quotation>>) ["in" = Imprimerie Nationale] * r <<russian>> (,,inner quotation``) Rename "french" to "swiss" Also rename "single/double" to "secondary/primary" ("inner/outer" in the UI) and "left/right" to "opening/closing". Note that the inset identifier string is left as is ("s/d" and "l/r")
This commit is contained in:
parent
45df1e87a9
commit
237193f8a8
@ -11,6 +11,18 @@ adjustments are made to tex2lyx and bugs are fixed in lyx2lyx.
|
|||||||
|
|
||||||
-----------------------
|
-----------------------
|
||||||
|
|
||||||
|
2016-12-24 Jürgen Spitzmüller <spitz@lyx.org>
|
||||||
|
* Format incremented to 521:
|
||||||
|
Introduce new quote styles:
|
||||||
|
- british \begin_inset Quotes b..
|
||||||
|
- swiss \begin_inset Quotes c..
|
||||||
|
- swedishg \begin_inset Quotes w..
|
||||||
|
- frenchin \begin_inset Quotes i..
|
||||||
|
- russian \begin_inset Quotes r..
|
||||||
|
Change default behavior of French quote style:
|
||||||
|
- Inner quotes are now ``..''.
|
||||||
|
- Former french style is now called "swiss"
|
||||||
|
|
||||||
2016-12-21 Jürgen Spitzmüller <spitz@lyx.org>
|
2016-12-21 Jürgen Spitzmüller <spitz@lyx.org>
|
||||||
* Format incremented to 520: Introduce plain quote style:
|
* Format incremented to 520: Introduce plain quote style:
|
||||||
\begin_inset Quotes qls => \textquotesingle
|
\begin_inset Quotes qls => \textquotesingle
|
||||||
|
@ -12,7 +12,8 @@
|
|||||||
# PolyglossiaOpts "<language-specific options>"
|
# PolyglossiaOpts "<language-specific options>"
|
||||||
# Encoding <encoding>
|
# Encoding <encoding>
|
||||||
# FontEncoding <font encoding>
|
# FontEncoding <font encoding>
|
||||||
# QuoteStyle <danish|english|french|german|polish|swedish>
|
# QuoteStyle <british|danish|english|french|frenchin|
|
||||||
|
# german|polish|russian|swedish|swedishg|swiss|plain>
|
||||||
# InternalEncoding <true|false>
|
# InternalEncoding <true|false>
|
||||||
# RTL <true|false>
|
# RTL <true|false>
|
||||||
# AsBabelOptions <true|false>
|
# AsBabelOptions <true|false>
|
||||||
@ -43,13 +44,19 @@
|
|||||||
# (UK) -- try to select the entry that is most generic -- here
|
# (UK) -- try to select the entry that is most generic -- here
|
||||||
# English.
|
# English.
|
||||||
# * The QuoteStyle arguments correspond to the following styles:
|
# * The QuoteStyle arguments correspond to the following styles:
|
||||||
|
# PRIMARY SECONDARY
|
||||||
|
# - british: `text' ``text'' (6_9 -- 66_99)
|
||||||
# - danish: >>text<< >text< (inward guillemets)
|
# - danish: >>text<< >text< (inward guillemets)
|
||||||
# - english: ``text'' `text' (66_99)
|
# - english: ``text'' `text' (66_99 -- 6_9)
|
||||||
# - french: <<text>> <text> (outward guillemets)
|
# - french: <<text>> ``text'' (outward guillemets -- 66_99)
|
||||||
# - german: ,,text`` ,text` (99/66)
|
# - frenchin: <<text>> <<text>> (French Imprimerie Nationale style)
|
||||||
# - polish: ,,text'' ,text' (99/99)
|
# - german: ,,text`` ,text` (99/66 -- 9/6)
|
||||||
# - swedish: ''text'' 'text' (99_99)
|
# - polish: ,,text'' ,text' (99/99 -- 9/9)
|
||||||
# - plain: "text" 'text' (straight non-typographical quotes)
|
# - russian: <<text>> ,,text`` (outward guillemets -- 99/66)
|
||||||
|
# - swedish: ''text'' 'text' (99_99 -- 9_9)
|
||||||
|
# - swedishg: >>text>> 'text' (Swedish Guillemets)
|
||||||
|
# - swiss: <<text>> <text> (outward guillemets)
|
||||||
|
# - plain: "text" 'text' (non-typographical quotes)
|
||||||
# Note that the option names have been selected (rather arbitrarily)
|
# Note that the option names have been selected (rather arbitrarily)
|
||||||
# because the respective styles are common in the respective countries.
|
# because the respective styles are common in the respective countries.
|
||||||
# Of course this does not imply any fixed relation to those countries.
|
# Of course this does not imply any fixed relation to those countries.
|
||||||
@ -118,7 +125,7 @@ Language albanian
|
|||||||
GuiName "Albanian"
|
GuiName "Albanian"
|
||||||
BabelName albanian
|
BabelName albanian
|
||||||
PolyglossiaName albanian
|
PolyglossiaName albanian
|
||||||
QuoteStyle french
|
QuoteStyle swiss
|
||||||
Encoding iso8859-2
|
Encoding iso8859-2
|
||||||
LangCode sq_AL
|
LangCode sq_AL
|
||||||
End
|
End
|
||||||
@ -187,7 +194,7 @@ End
|
|||||||
Language armenian
|
Language armenian
|
||||||
GuiName "Armenian"
|
GuiName "Armenian"
|
||||||
PolyglossiaName armenian
|
PolyglossiaName armenian
|
||||||
QuoteStyle french
|
QuoteStyle swiss
|
||||||
Encoding utf8
|
Encoding utf8
|
||||||
LangCode hy_AM
|
LangCode hy_AM
|
||||||
End
|
End
|
||||||
@ -259,7 +266,7 @@ Language basque
|
|||||||
HasGuiSupport true
|
HasGuiSupport true
|
||||||
BabelName basque
|
BabelName basque
|
||||||
PolyglossiaName basque
|
PolyglossiaName basque
|
||||||
QuoteStyle french
|
QuoteStyle swiss
|
||||||
Encoding iso8859-15
|
Encoding iso8859-15
|
||||||
LangCode eu_ES
|
LangCode eu_ES
|
||||||
PostBabelPreamble
|
PostBabelPreamble
|
||||||
@ -310,7 +317,7 @@ Language british
|
|||||||
BabelName british
|
BabelName british
|
||||||
PolyglossiaName english
|
PolyglossiaName english
|
||||||
PolyglossiaOpts "variant=british"
|
PolyglossiaOpts "variant=british"
|
||||||
QuoteStyle english
|
QuoteStyle british
|
||||||
Encoding iso8859-15
|
Encoding iso8859-15
|
||||||
LangCode en_GB
|
LangCode en_GB
|
||||||
End
|
End
|
||||||
@ -462,7 +469,7 @@ Language estonian
|
|||||||
GuiName "Estonian"
|
GuiName "Estonian"
|
||||||
BabelName estonian
|
BabelName estonian
|
||||||
PolyglossiaName estonian
|
PolyglossiaName estonian
|
||||||
QuoteStyle polish
|
QuoteStyle german
|
||||||
Encoding iso8859-15
|
Encoding iso8859-15
|
||||||
LangCode et_EE
|
LangCode et_EE
|
||||||
PostBabelPreamble
|
PostBabelPreamble
|
||||||
@ -480,6 +487,7 @@ Language farsi
|
|||||||
FontEncoding "LFE,LAE"
|
FontEncoding "LFE,LAE"
|
||||||
RTL true
|
RTL true
|
||||||
LangCode fa_IR
|
LangCode fa_IR
|
||||||
|
QuoteStyle english
|
||||||
PostBabelPreamble
|
PostBabelPreamble
|
||||||
\DeclareTextSymbol{\guillemotright}{LFE}{62}
|
\DeclareTextSymbol{\guillemotright}{LFE}{62}
|
||||||
\DeclareTextSymbol{\guillemotleft}{LFE}{60}
|
\DeclareTextSymbol{\guillemotleft}{LFE}{60}
|
||||||
@ -577,7 +585,7 @@ Language german-ch
|
|||||||
BabelName nswissgerman
|
BabelName nswissgerman
|
||||||
PolyglossiaName german
|
PolyglossiaName german
|
||||||
PolyglossiaOpts "variant=swiss,spelling=new,babelshorthands=true"
|
PolyglossiaOpts "variant=swiss,spelling=new,babelshorthands=true"
|
||||||
QuoteStyle danish
|
QuoteStyle swiss
|
||||||
Encoding iso8859-15
|
Encoding iso8859-15
|
||||||
LangCode de_CH
|
LangCode de_CH
|
||||||
End
|
End
|
||||||
@ -590,7 +598,7 @@ Language german-ch-old
|
|||||||
BabelName swissgerman
|
BabelName swissgerman
|
||||||
PolyglossiaName german
|
PolyglossiaName german
|
||||||
PolyglossiaOpts "variant=swiss,spelling=old,babelshorthands=true"
|
PolyglossiaOpts "variant=swiss,spelling=old,babelshorthands=true"
|
||||||
QuoteStyle danish
|
QuoteStyle swiss
|
||||||
Encoding iso8859-15
|
Encoding iso8859-15
|
||||||
LangCode de_CH
|
LangCode de_CH
|
||||||
End
|
End
|
||||||
@ -652,6 +660,7 @@ End
|
|||||||
# BabelName hungarian
|
# BabelName hungarian
|
||||||
# Encoding iso8859-2
|
# Encoding iso8859-2
|
||||||
# LangCode hu_HU
|
# LangCode hu_HU
|
||||||
|
# QuoteStyle polish
|
||||||
#End
|
#End
|
||||||
|
|
||||||
Language icelandic
|
Language icelandic
|
||||||
@ -672,6 +681,7 @@ Language interlingua
|
|||||||
PolyglossiaName interlingua
|
PolyglossiaName interlingua
|
||||||
Encoding iso8859-15
|
Encoding iso8859-15
|
||||||
LangCode ia_IA
|
LangCode ia_IA
|
||||||
|
QuoteStyle english
|
||||||
End
|
End
|
||||||
|
|
||||||
Language irish
|
Language irish
|
||||||
@ -787,7 +797,7 @@ Language latvian
|
|||||||
GuiName "Latvian"
|
GuiName "Latvian"
|
||||||
BabelName latvian
|
BabelName latvian
|
||||||
PolyglossiaName latvian
|
PolyglossiaName latvian
|
||||||
QuoteStyle danish
|
QuoteStyle german
|
||||||
Encoding iso8859-4
|
Encoding iso8859-4
|
||||||
# FontEncoding L7x # (required for hyphenation but not set by babel)
|
# FontEncoding L7x # (required for hyphenation but not set by babel)
|
||||||
LangCode lv_LV
|
LangCode lv_LV
|
||||||
@ -871,7 +881,7 @@ Language norsk
|
|||||||
HasGuiSupport true
|
HasGuiSupport true
|
||||||
BabelName norsk
|
BabelName norsk
|
||||||
PolyglossiaName norsk
|
PolyglossiaName norsk
|
||||||
QuoteStyle french
|
QuoteStyle swiss
|
||||||
Encoding iso8859-15
|
Encoding iso8859-15
|
||||||
LangCode nb_NO
|
LangCode nb_NO
|
||||||
End
|
End
|
||||||
@ -881,7 +891,7 @@ Language nynorsk
|
|||||||
HasGuiSupport true
|
HasGuiSupport true
|
||||||
BabelName nynorsk
|
BabelName nynorsk
|
||||||
PolyglossiaName nynorsk
|
PolyglossiaName nynorsk
|
||||||
QuoteStyle french
|
QuoteStyle swiss
|
||||||
Encoding iso8859-15
|
Encoding iso8859-15
|
||||||
LangCode nn_NO
|
LangCode nn_NO
|
||||||
End
|
End
|
||||||
@ -905,6 +915,7 @@ End
|
|||||||
# PolyglossiaName russian
|
# PolyglossiaName russian
|
||||||
# PolyglossiaOpts "spelling=old"
|
# PolyglossiaOpts "spelling=old"
|
||||||
# LangCode ru_petr1708
|
# LangCode ru_petr1708
|
||||||
|
# QuoteStyle russian
|
||||||
# End
|
# End
|
||||||
|
|
||||||
Language piedmontese
|
Language piedmontese
|
||||||
@ -933,7 +944,7 @@ Language portuguese
|
|||||||
HasGuiSupport true
|
HasGuiSupport true
|
||||||
BabelName portuges
|
BabelName portuges
|
||||||
PolyglossiaName portuges
|
PolyglossiaName portuges
|
||||||
QuoteStyle english
|
QuoteStyle french
|
||||||
Encoding iso8859-15
|
Encoding iso8859-15
|
||||||
LangCode pt_PT
|
LangCode pt_PT
|
||||||
End
|
End
|
||||||
@ -963,7 +974,7 @@ Language russian
|
|||||||
HasGuiSupport true
|
HasGuiSupport true
|
||||||
BabelName russian
|
BabelName russian
|
||||||
PolyglossiaName russian
|
PolyglossiaName russian
|
||||||
QuoteStyle french
|
QuoteStyle russian
|
||||||
Encoding koi8-r
|
Encoding koi8-r
|
||||||
FontEncoding T2A
|
FontEncoding T2A
|
||||||
LangCode ru_RU
|
LangCode ru_RU
|
||||||
@ -1002,7 +1013,7 @@ Language serbian
|
|||||||
BabelName serbianc
|
BabelName serbianc
|
||||||
PolyglossiaName serbian
|
PolyglossiaName serbian
|
||||||
PolyglossiaOpts "script=Cyrillic"
|
PolyglossiaOpts "script=Cyrillic"
|
||||||
QuoteStyle german
|
QuoteStyle polish
|
||||||
Encoding utf8
|
Encoding utf8
|
||||||
FontEncoding T2A
|
FontEncoding T2A
|
||||||
LangCode sr_RS
|
LangCode sr_RS
|
||||||
@ -1016,7 +1027,7 @@ Language serbian-latin
|
|||||||
BabelName serbian
|
BabelName serbian
|
||||||
PolyglossiaName serbian
|
PolyglossiaName serbian
|
||||||
PolyglossiaOpts "script=Latin"
|
PolyglossiaOpts "script=Latin"
|
||||||
QuoteStyle german
|
QuoteStyle polish
|
||||||
Encoding iso8859-2
|
Encoding iso8859-2
|
||||||
LangCode sr_RS-Latin
|
LangCode sr_RS-Latin
|
||||||
End
|
End
|
||||||
@ -1127,7 +1138,7 @@ Language turkish
|
|||||||
HasGuiSupport true
|
HasGuiSupport true
|
||||||
BabelName turkish
|
BabelName turkish
|
||||||
PolyglossiaName turkish
|
PolyglossiaName turkish
|
||||||
QuoteStyle french
|
QuoteStyle english
|
||||||
Encoding iso8859-9
|
Encoding iso8859-9
|
||||||
LangCode tr_TR
|
LangCode tr_TR
|
||||||
PostBabelPreamble
|
PostBabelPreamble
|
||||||
@ -1141,7 +1152,7 @@ Language turkmen
|
|||||||
GuiName "Turkmen"
|
GuiName "Turkmen"
|
||||||
BabelName turkmen
|
BabelName turkmen
|
||||||
PolyglossiaName turkmen
|
PolyglossiaName turkmen
|
||||||
QuoteStyle french
|
QuoteStyle swiss
|
||||||
Encoding utf8
|
Encoding utf8
|
||||||
LangCode tk_TM
|
LangCode tk_TM
|
||||||
AsBabelOptions true
|
AsBabelOptions true
|
||||||
@ -1152,7 +1163,7 @@ Language ukrainian
|
|||||||
HasGuiSupport true
|
HasGuiSupport true
|
||||||
BabelName ukrainian
|
BabelName ukrainian
|
||||||
PolyglossiaName ukrainian
|
PolyglossiaName ukrainian
|
||||||
QuoteStyle french
|
QuoteStyle russian
|
||||||
Encoding koi8-u
|
Encoding koi8-u
|
||||||
FontEncoding T2A
|
FontEncoding T2A
|
||||||
LangCode uk_UA
|
LangCode uk_UA
|
||||||
@ -1183,7 +1194,7 @@ Language vietnamese
|
|||||||
GuiName "Vietnamese"
|
GuiName "Vietnamese"
|
||||||
BabelName vietnam
|
BabelName vietnam
|
||||||
PolyglossiaName vietnamese
|
PolyglossiaName vietnamese
|
||||||
QuoteStyle french
|
QuoteStyle english
|
||||||
Encoding utf8
|
Encoding utf8
|
||||||
LangCode vi_VN
|
LangCode vi_VN
|
||||||
AsBabelOptions true
|
AsBabelOptions true
|
||||||
@ -1194,7 +1205,7 @@ Language welsh
|
|||||||
GuiName "Welsh"
|
GuiName "Welsh"
|
||||||
BabelName welsh
|
BabelName welsh
|
||||||
PolyglossiaName welsh
|
PolyglossiaName welsh
|
||||||
QuoteStyle english
|
QuoteStyle british
|
||||||
Encoding iso8859-15
|
Encoding iso8859-15
|
||||||
LangCode cy_GB
|
LangCode cy_GB
|
||||||
End
|
End
|
||||||
|
@ -667,7 +667,7 @@ def revert_quotestyle(document):
|
|||||||
|
|
||||||
|
|
||||||
def revert_plainquote(document):
|
def revert_plainquote(document):
|
||||||
" Revert plain quote inset "
|
" Revert plain quote insets "
|
||||||
|
|
||||||
# First, revert style setting
|
# First, revert style setting
|
||||||
i = find_token(document.header, "\\quotes_style plain", 0)
|
i = find_token(document.header, "\\quotes_style plain", 0)
|
||||||
@ -693,6 +693,162 @@ def revert_plainquote(document):
|
|||||||
i = l
|
i = l
|
||||||
|
|
||||||
|
|
||||||
|
def convert_frenchquotes(document):
|
||||||
|
" Convert french quote insets to swiss "
|
||||||
|
|
||||||
|
# First, revert style setting
|
||||||
|
i = find_token(document.header, "\\quotes_style french", 0)
|
||||||
|
if i != -1:
|
||||||
|
document.header[i] = "\\quotes_style swiss"
|
||||||
|
|
||||||
|
# now the insets
|
||||||
|
i = 0
|
||||||
|
while True:
|
||||||
|
i = find_token(document.body, '\\begin_inset Quotes f', i)
|
||||||
|
if i == -1:
|
||||||
|
return
|
||||||
|
val = get_value(document.body, "\\begin_inset Quotes", i)[7:]
|
||||||
|
newval = val.replace("f", "c", 1)
|
||||||
|
document.body[i] = document.body[i].replace(val, newval)
|
||||||
|
i += 1
|
||||||
|
|
||||||
|
|
||||||
|
def revert_swissquotes(document):
|
||||||
|
" Revert swiss quote insets to french "
|
||||||
|
|
||||||
|
# First, revert style setting
|
||||||
|
i = find_token(document.header, "\\quotes_style swiss", 0)
|
||||||
|
if i != -1:
|
||||||
|
document.header[i] = "\\quotes_style french"
|
||||||
|
|
||||||
|
# now the insets
|
||||||
|
i = 0
|
||||||
|
while True:
|
||||||
|
i = find_token(document.body, '\\begin_inset Quotes c', i)
|
||||||
|
if i == -1:
|
||||||
|
return
|
||||||
|
val = get_value(document.body, "\\begin_inset Quotes", i)[7:]
|
||||||
|
newval = val.replace("c", "f", 1)
|
||||||
|
document.body[i] = document.body[i].replace(val, newval)
|
||||||
|
i += 1
|
||||||
|
|
||||||
|
|
||||||
|
def revert_britishquotes(document):
|
||||||
|
" Revert british quote insets to english "
|
||||||
|
|
||||||
|
# First, revert style setting
|
||||||
|
i = find_token(document.header, "\\quotes_style british", 0)
|
||||||
|
if i != -1:
|
||||||
|
document.header[i] = "\\quotes_style english"
|
||||||
|
|
||||||
|
# now the insets
|
||||||
|
i = 0
|
||||||
|
while True:
|
||||||
|
i = find_token(document.body, '\\begin_inset Quotes b', i)
|
||||||
|
if i == -1:
|
||||||
|
return
|
||||||
|
val = get_value(document.body, "\\begin_inset Quotes", i)[7:]
|
||||||
|
newval = val.replace("b", "e", 1)
|
||||||
|
if val[2] == "d":
|
||||||
|
# opening mark
|
||||||
|
newval = newval.replace("d", "s")
|
||||||
|
else:
|
||||||
|
# inner marks
|
||||||
|
newval = newval.replace("s", "d")
|
||||||
|
document.body[i] = document.body[i].replace(val, newval)
|
||||||
|
i += 1
|
||||||
|
|
||||||
|
|
||||||
|
def revert_swedishgquotes(document):
|
||||||
|
" Revert swedish quote insets "
|
||||||
|
|
||||||
|
# First, revert style setting
|
||||||
|
i = find_token(document.header, "\\quotes_style swedishg", 0)
|
||||||
|
if i != -1:
|
||||||
|
document.header[i] = "\\quotes_style danish"
|
||||||
|
|
||||||
|
# now the insets
|
||||||
|
i = 0
|
||||||
|
while True:
|
||||||
|
i = find_token(document.body, '\\begin_inset Quotes w', i)
|
||||||
|
if i == -1:
|
||||||
|
return
|
||||||
|
val = get_value(document.body, "\\begin_inset Quotes", i)[7:]
|
||||||
|
if val[2] == "d":
|
||||||
|
# outer marks
|
||||||
|
newval = val.replace("w", "a", 1).replace("r", "l")
|
||||||
|
else:
|
||||||
|
# inner marks
|
||||||
|
newval = val.replace("w", "s", 1)
|
||||||
|
document.body[i] = document.body[i].replace(val, newval)
|
||||||
|
i += 1
|
||||||
|
|
||||||
|
|
||||||
|
def revert_frenchquotes(document):
|
||||||
|
" Revert french inner quote insets "
|
||||||
|
|
||||||
|
i = 0
|
||||||
|
while True:
|
||||||
|
i = find_token(document.body, '\\begin_inset Quotes f', i)
|
||||||
|
if i == -1:
|
||||||
|
return
|
||||||
|
val = get_value(document.body, "\\begin_inset Quotes", i)[7:]
|
||||||
|
if val[2] == "s":
|
||||||
|
# inner marks
|
||||||
|
newval = val.replace("f", "e", 1).replace("s", "d")
|
||||||
|
document.body[i] = document.body[i].replace(val, newval)
|
||||||
|
i += 1
|
||||||
|
|
||||||
|
|
||||||
|
def revert_frenchinquotes(document):
|
||||||
|
" Revert inner frenchin quote insets "
|
||||||
|
|
||||||
|
# First, revert style setting
|
||||||
|
i = find_token(document.header, "\\quotes_style frenchin", 0)
|
||||||
|
if i != -1:
|
||||||
|
document.header[i] = "\\quotes_style french"
|
||||||
|
|
||||||
|
# now the insets
|
||||||
|
i = 0
|
||||||
|
while True:
|
||||||
|
i = find_token(document.body, '\\begin_inset Quotes i', i)
|
||||||
|
if i == -1:
|
||||||
|
return
|
||||||
|
val = get_value(document.body, "\\begin_inset Quotes", i)[7:]
|
||||||
|
newval = val.replace("i", "f", 1)
|
||||||
|
if val[2] == "s":
|
||||||
|
# inner marks
|
||||||
|
newval = newval.replace("s", "d")
|
||||||
|
document.body[i] = document.body[i].replace(val, newval)
|
||||||
|
i += 1
|
||||||
|
|
||||||
|
|
||||||
|
def revert_russianquotes(document):
|
||||||
|
" Revert russian quote insets "
|
||||||
|
|
||||||
|
# First, revert style setting
|
||||||
|
i = find_token(document.header, "\\quotes_style russian", 0)
|
||||||
|
if i != -1:
|
||||||
|
document.header[i] = "\\quotes_style french"
|
||||||
|
|
||||||
|
# now the insets
|
||||||
|
i = 0
|
||||||
|
while True:
|
||||||
|
i = find_token(document.body, '\\begin_inset Quotes r', i)
|
||||||
|
if i == -1:
|
||||||
|
return
|
||||||
|
val = get_value(document.body, "\\begin_inset Quotes", i)[7:]
|
||||||
|
newval = val
|
||||||
|
if val[2] == "s":
|
||||||
|
# inner marks
|
||||||
|
newval = val.replace("r", "g", 1).replace("s", "d")
|
||||||
|
else:
|
||||||
|
# outer marks
|
||||||
|
newval = val.replace("r", "f", 1)
|
||||||
|
document.body[i] = document.body[i].replace(val, newval)
|
||||||
|
i += 1
|
||||||
|
|
||||||
|
|
||||||
##
|
##
|
||||||
# Conversion hub
|
# Conversion hub
|
||||||
#
|
#
|
||||||
@ -710,10 +866,12 @@ convert = [
|
|||||||
[517, []],
|
[517, []],
|
||||||
[518, [convert_iopart]],
|
[518, [convert_iopart]],
|
||||||
[519, [convert_quotestyle]],
|
[519, [convert_quotestyle]],
|
||||||
[520, []]
|
[520, []],
|
||||||
|
[521, [convert_frenchquotes]]
|
||||||
]
|
]
|
||||||
|
|
||||||
revert = [
|
revert = [
|
||||||
|
[520, [revert_britishquotes, revert_swedishgquotes, revert_frenchquotes, revert_frenchinquotes, revert_russianquotes, revert_swissquotes]],
|
||||||
[519, [revert_plainquote]],
|
[519, [revert_plainquote]],
|
||||||
[518, [revert_quotestyle]],
|
[518, [revert_quotestyle]],
|
||||||
[517, [revert_iopart]],
|
[517, [revert_iopart]],
|
||||||
|
@ -400,8 +400,8 @@ Menuset
|
|||||||
Item "Symbols...|b" "dialog-show symbols"
|
Item "Symbols...|b" "dialog-show symbols"
|
||||||
Item "Ellipsis|i" "specialchar-insert dots"
|
Item "Ellipsis|i" "specialchar-insert dots"
|
||||||
Item "End of Sentence|E" "specialchar-insert end-of-sentence"
|
Item "End of Sentence|E" "specialchar-insert end-of-sentence"
|
||||||
Item "Plain Quotation Mark|Q" "quote-insert double auto plain"
|
Item "Plain Quotation Mark|Q" "quote-insert outer auto plain"
|
||||||
Item "Single Quotation Mark|S" "quote-insert single"
|
Item "Inner Quotation Mark|n" "quote-insert inner"
|
||||||
Item "Protected Hyphen|y" "specialchar-insert nobreakdash"
|
Item "Protected Hyphen|y" "specialchar-insert nobreakdash"
|
||||||
Item "Breakable Slash|a" "specialchar-insert slash"
|
Item "Breakable Slash|a" "specialchar-insert slash"
|
||||||
Item "Visible Space|V" "space-insert visible"
|
Item "Visible Space|V" "space-insert visible"
|
||||||
|
@ -72,7 +72,8 @@ static char const * const string_paragraph_separation[] = {
|
|||||||
|
|
||||||
|
|
||||||
static char const * const string_quotes_style[] = {
|
static char const * const string_quotes_style[] = {
|
||||||
"english", "swedish", "german", "polish", "french", "danish", "plain", ""
|
"english", "swedish", "german", "polish", "swiss", "danish", "plain",
|
||||||
|
"british", "swedishg", "french", "frenchin", "russian", ""
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@ -138,9 +139,14 @@ QuotesStyleTranslator const init_quotesstyletranslator()
|
|||||||
translator.addPair(string_quotes_style[1], InsetQuotesParams::SwedishQuotes);
|
translator.addPair(string_quotes_style[1], InsetQuotesParams::SwedishQuotes);
|
||||||
translator.addPair(string_quotes_style[2], InsetQuotesParams::GermanQuotes);
|
translator.addPair(string_quotes_style[2], InsetQuotesParams::GermanQuotes);
|
||||||
translator.addPair(string_quotes_style[3], InsetQuotesParams::PolishQuotes);
|
translator.addPair(string_quotes_style[3], InsetQuotesParams::PolishQuotes);
|
||||||
translator.addPair(string_quotes_style[4], InsetQuotesParams::FrenchQuotes);
|
translator.addPair(string_quotes_style[4], InsetQuotesParams::SwissQuotes);
|
||||||
translator.addPair(string_quotes_style[5], InsetQuotesParams::DanishQuotes);
|
translator.addPair(string_quotes_style[5], InsetQuotesParams::DanishQuotes);
|
||||||
translator.addPair(string_quotes_style[6], InsetQuotesParams::PlainQuotes);
|
translator.addPair(string_quotes_style[6], InsetQuotesParams::PlainQuotes);
|
||||||
|
translator.addPair(string_quotes_style[7], InsetQuotesParams::BritishQuotes);
|
||||||
|
translator.addPair(string_quotes_style[8], InsetQuotesParams::SwedishGQuotes);
|
||||||
|
translator.addPair(string_quotes_style[9], InsetQuotesParams::FrenchQuotes);
|
||||||
|
translator.addPair(string_quotes_style[10], InsetQuotesParams::FrenchINQuotes);
|
||||||
|
translator.addPair(string_quotes_style[11], InsetQuotesParams::RussianQuotes);
|
||||||
return translator;
|
return translator;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -404,17 +404,22 @@ void LyXAction::init()
|
|||||||
* \li Notion: Currently English, Swedish, German, Polish, French, Danish quotes
|
* \li Notion: Currently English, Swedish, German, Polish, French, Danish quotes
|
||||||
are distinguished.
|
are distinguished.
|
||||||
* \li Syntax: quote-insert [<LEVEL>] [<SIDE>] [<STYLE>]
|
* \li Syntax: quote-insert [<LEVEL>] [<SIDE>] [<STYLE>]
|
||||||
* \li Params: <LEVEL>: 'single' for single (i.e., inner or secondary) quotes, otherwise
|
* \li Params: <LEVEL>: 'inner' for (i.e., secondary, usually single) quotes, otherwise
|
||||||
* double quotes will be used.
|
* outer (i.e., primary, usually double) quotes will be used.
|
||||||
* <SIDE>: 'left' for opening quotes, 'right' for closing quotes, otherwise
|
* <SIDE>: 'opening' for opening quotes, 'closing' for closing quotes,
|
||||||
* the side will be guessed from the context.
|
* otherwise the side will be guessed from the context.
|
||||||
* <STYLE>: 'english' for ``English'' quote style
|
* <STYLE>: 'british' for `British' quote style (with ``inner quotation'')
|
||||||
* 'swedish' for ''Swedish'' quote style
|
* 'danish' for >>Danish<< quote style (with >inner quotation<)
|
||||||
* 'german' for ,,German`` quote style
|
* 'english' for ``English'' quote style (with `inner quotation')
|
||||||
* 'polish' for ,,Polish'' quote style
|
* 'french' for <<french>> quote style (with ``inner quotation'')
|
||||||
* 'french' for <<French>> quote style
|
* 'frenchin' for <<frenchin>> quote style (with <<inner quotation>>) ["in" = Imprimerie Nationale]
|
||||||
* 'danish' for >>Danish<< quote style
|
* 'german' for ,,German`` quote style (with ,inner quotation`)
|
||||||
* 'plain' for "Plain" quote style
|
* 'plain' for "Plain" quote style (with 'inner quotation')
|
||||||
|
* 'polish' for ,,Polish'' quote style (with ,inner quotation')
|
||||||
|
* 'swedish' for ''Swedish'' quote style (with 'inner quotation')
|
||||||
|
* 'swedishg' for >>swedishg>> quote style (with 'inner quotation') ["g" = Guillemets]
|
||||||
|
* 'swiss' for <<Swiss>> quote style (with <inner quotation>)
|
||||||
|
* 'russian' for <<Russian>> quote style (with ,,inner quotation``)
|
||||||
* If no quote style is specified, the document-wide will be used.
|
* If no quote style is specified, the document-wide will be used.
|
||||||
* \endvar
|
* \endvar
|
||||||
*/
|
*/
|
||||||
@ -2483,7 +2488,7 @@ void LyXAction::init()
|
|||||||
inset-modify note Note Comment \n
|
inset-modify note Note Comment \n
|
||||||
Change a Box into an Ovalbox: \n
|
Change a Box into an Ovalbox: \n
|
||||||
inset-modify changetype Ovalbox \n
|
inset-modify changetype Ovalbox \n
|
||||||
Change a quotation mark to e[nglish style], l[eft side], s[ingle] \n
|
Change a quotation mark to e[nglish style], l[eft side = opening], s[ingle = inner, secondary] \n
|
||||||
inset-modify changetype els \n
|
inset-modify changetype els \n
|
||||||
Change only the style of a quotation mark, maintaining the other aspects (. = wildcard) \n
|
Change only the style of a quotation mark, maintaining the other aspects (. = wildcard) \n
|
||||||
inset-modify changetype e.. \n
|
inset-modify changetype e.. \n
|
||||||
|
@ -1551,8 +1551,9 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd)
|
|||||||
char_type c = ' ';
|
char_type c = ' ';
|
||||||
if (pos > 0 && (!cur.prevInset() || !cur.prevInset()->isSpace()))
|
if (pos > 0 && (!cur.prevInset() || !cur.prevInset()->isSpace()))
|
||||||
c = par.getChar(pos - 1);
|
c = par.getChar(pos - 1);
|
||||||
InsetQuotesParams::QuoteLevel const quote_level = (cmd.getArg(0) == "single")
|
InsetQuotesParams::QuoteLevel const quote_level =
|
||||||
? InsetQuotesParams::SingleQuotes : InsetQuotesParams::DoubleQuotes;
|
(cmd.getArg(0) == "single" || cmd.getArg(0) == "inner")
|
||||||
|
? InsetQuotesParams::SecondaryQuotes : InsetQuotesParams::PrimaryQuotes;
|
||||||
cur.insert(new InsetQuotes(cur.buffer(), c, quote_level, cmd.getArg(1), cmd.getArg(2)));
|
cur.insert(new InsetQuotes(cur.buffer(), c, quote_level, cmd.getArg(1), cmd.getArg(2)));
|
||||||
cur.buffer()->updateBuffer();
|
cur.buffer()->updateBuffer();
|
||||||
cur.posForward();
|
cur.posForward();
|
||||||
|
@ -1679,9 +1679,14 @@ void MenuDefinition::expandQuotes(BufferView const * bv)
|
|||||||
MenuDefinition sqs;
|
MenuDefinition sqs;
|
||||||
MenuDefinition gqs;
|
MenuDefinition gqs;
|
||||||
MenuDefinition pqs;
|
MenuDefinition pqs;
|
||||||
MenuDefinition fqs;
|
MenuDefinition cqs;
|
||||||
MenuDefinition aqs;
|
MenuDefinition aqs;
|
||||||
MenuDefinition qqs;
|
MenuDefinition qqs;
|
||||||
|
MenuDefinition bqs;
|
||||||
|
MenuDefinition wqs;
|
||||||
|
MenuDefinition fqs;
|
||||||
|
MenuDefinition iqs;
|
||||||
|
MenuDefinition rqs;
|
||||||
for (; qq != end; ++qq) {
|
for (; qq != end; ++qq) {
|
||||||
docstring const style = from_ascii(qq->first);
|
docstring const style = from_ascii(qq->first);
|
||||||
FuncRequest const cmd = FuncRequest(LFUN_INSET_MODIFY, from_ascii("changetype ") + style);
|
FuncRequest const cmd = FuncRequest(LFUN_INSET_MODIFY, from_ascii("changetype ") + style);
|
||||||
@ -1697,12 +1702,22 @@ void MenuDefinition::expandQuotes(BufferView const * bv)
|
|||||||
gqs.add(MenuItem(MenuItem::Command, toqstr(desc), cmd));
|
gqs.add(MenuItem(MenuItem::Command, toqstr(desc), cmd));
|
||||||
else if (prefixIs(style, 'p') && !prefixIs(qtype, "p"))
|
else if (prefixIs(style, 'p') && !prefixIs(qtype, "p"))
|
||||||
pqs.add(MenuItem(MenuItem::Command, toqstr(desc), cmd));
|
pqs.add(MenuItem(MenuItem::Command, toqstr(desc), cmd));
|
||||||
else if (prefixIs(style, 'f') && !prefixIs(qtype, "f"))
|
else if (prefixIs(style, 'c') && !prefixIs(qtype, "c"))
|
||||||
fqs.add(MenuItem(MenuItem::Command, toqstr(desc), cmd));
|
cqs.add(MenuItem(MenuItem::Command, toqstr(desc), cmd));
|
||||||
else if (prefixIs(style, 'a') && !prefixIs(qtype, "a"))
|
else if (prefixIs(style, 'a') && !prefixIs(qtype, "a"))
|
||||||
aqs.add(MenuItem(MenuItem::Command, toqstr(desc), cmd));
|
aqs.add(MenuItem(MenuItem::Command, toqstr(desc), cmd));
|
||||||
else if (prefixIs(style, 'q') && !prefixIs(qtype, "q"))
|
else if (prefixIs(style, 'q') && !prefixIs(qtype, "q"))
|
||||||
qqs.add(MenuItem(MenuItem::Command, toqstr(desc), cmd));
|
qqs.add(MenuItem(MenuItem::Command, toqstr(desc), cmd));
|
||||||
|
else if (prefixIs(style, 'b') && !prefixIs(qtype, "b"))
|
||||||
|
bqs.add(MenuItem(MenuItem::Command, toqstr(desc), cmd));
|
||||||
|
else if (prefixIs(style, 'w') && !prefixIs(qtype, "w"))
|
||||||
|
wqs.add(MenuItem(MenuItem::Command, toqstr(desc), cmd));
|
||||||
|
else if (prefixIs(style, 'f') && !prefixIs(qtype, "f"))
|
||||||
|
fqs.add(MenuItem(MenuItem::Command, toqstr(desc), cmd));
|
||||||
|
else if (prefixIs(style, 'i') && !prefixIs(qtype, "i"))
|
||||||
|
iqs.add(MenuItem(MenuItem::Command, toqstr(desc), cmd));
|
||||||
|
else if (prefixIs(style, 'r') && !prefixIs(qtype, "r"))
|
||||||
|
rqs.add(MenuItem(MenuItem::Command, toqstr(desc), cmd));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!eqs.empty()) {
|
if (!eqs.empty()) {
|
||||||
@ -1729,10 +1744,10 @@ void MenuDefinition::expandQuotes(BufferView const * bv)
|
|||||||
item.setSubmenu(pqs);
|
item.setSubmenu(pqs);
|
||||||
add(item);
|
add(item);
|
||||||
}
|
}
|
||||||
if (!fqs.empty()) {
|
if (!cqs.empty()) {
|
||||||
MenuItem item(MenuItem::Submenu,
|
MenuItem item(MenuItem::Submenu,
|
||||||
toqstr(quoteparams.getGuiLabel(InsetQuotesParams::FrenchQuotes)));
|
toqstr(quoteparams.getGuiLabel(InsetQuotesParams::SwissQuotes)));
|
||||||
item.setSubmenu(fqs);
|
item.setSubmenu(cqs);
|
||||||
add(item);
|
add(item);
|
||||||
}
|
}
|
||||||
if (!aqs.empty()) {
|
if (!aqs.empty()) {
|
||||||
@ -1747,6 +1762,36 @@ void MenuDefinition::expandQuotes(BufferView const * bv)
|
|||||||
item.setSubmenu(qqs);
|
item.setSubmenu(qqs);
|
||||||
add(item);
|
add(item);
|
||||||
}
|
}
|
||||||
|
if (!bqs.empty()) {
|
||||||
|
MenuItem item(MenuItem::Submenu,
|
||||||
|
toqstr(quoteparams.getGuiLabel(InsetQuotesParams::BritishQuotes)));
|
||||||
|
item.setSubmenu(bqs);
|
||||||
|
add(item);
|
||||||
|
}
|
||||||
|
if (!wqs.empty()) {
|
||||||
|
MenuItem item(MenuItem::Submenu,
|
||||||
|
toqstr(quoteparams.getGuiLabel(InsetQuotesParams::SwedishGQuotes)));
|
||||||
|
item.setSubmenu(wqs);
|
||||||
|
add(item);
|
||||||
|
}
|
||||||
|
if (!fqs.empty()) {
|
||||||
|
MenuItem item(MenuItem::Submenu,
|
||||||
|
toqstr(quoteparams.getGuiLabel(InsetQuotesParams::FrenchQuotes)));
|
||||||
|
item.setSubmenu(fqs);
|
||||||
|
add(item);
|
||||||
|
}
|
||||||
|
if (!iqs.empty()) {
|
||||||
|
MenuItem item(MenuItem::Submenu,
|
||||||
|
toqstr(quoteparams.getGuiLabel(InsetQuotesParams::FrenchINQuotes)));
|
||||||
|
item.setSubmenu(iqs);
|
||||||
|
add(item);
|
||||||
|
}
|
||||||
|
if (!rqs.empty()) {
|
||||||
|
MenuItem item(MenuItem::Submenu,
|
||||||
|
toqstr(quoteparams.getGuiLabel(InsetQuotesParams::RussianQuotes)));
|
||||||
|
item.setSubmenu(rqs);
|
||||||
|
add(item);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -56,12 +56,17 @@ namespace {
|
|||||||
* s ''swedish'' ('inner quotation')
|
* s ''swedish'' ('inner quotation')
|
||||||
* g ,,german`` (,inner quotation`)
|
* g ,,german`` (,inner quotation`)
|
||||||
* p ,,polish'' (,inner quotation')
|
* p ,,polish'' (,inner quotation')
|
||||||
* f <<french>> (<inner quotation>)
|
* c <<swiss>> (<inner quotation>)
|
||||||
* a >>danish<< (>inner quotation<)
|
* a >>danish<< (>inner quotation<)
|
||||||
* q "plain" ('inner quotation')
|
* q "plain" ('inner quotation')
|
||||||
|
* b `british' (``inner quotation'')
|
||||||
|
* w >>swedishg>> ('inner quotation') ["g" = Guillemets]
|
||||||
|
* f <<french>> (``inner quotation'')
|
||||||
|
* i <<frenchin>> (<<inner quotation>>) ["in" = Imprimerie Nationale]
|
||||||
|
* r <<russian>> (,,inner quotation``)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
char const * const style_char = "esgpfaq";
|
char const * const style_char = "esgpcaqbwfir";
|
||||||
char const * const side_char = "lr" ;
|
char const * const side_char = "lr" ;
|
||||||
char const * const level_char = "sd";
|
char const * const level_char = "sd";
|
||||||
|
|
||||||
@ -124,7 +129,7 @@ char_type InsetQuotesParams::getQuoteChar(QuoteStyle const & style, QuoteLevel c
|
|||||||
right_secondary = 0x2019; // '
|
right_secondary = 0x2019; // '
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case FrenchQuotes: {
|
case SwissQuotes: {
|
||||||
left_primary = 0x00ab; // <<
|
left_primary = 0x00ab; // <<
|
||||||
right_primary = 0x00bb; // >>
|
right_primary = 0x00bb; // >>
|
||||||
left_secondary = 0x2039; // <
|
left_secondary = 0x2039; // <
|
||||||
@ -145,6 +150,41 @@ char_type InsetQuotesParams::getQuoteChar(QuoteStyle const & style, QuoteLevel c
|
|||||||
right_secondary = 0x0027; // '
|
right_secondary = 0x0027; // '
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case BritishQuotes: {
|
||||||
|
left_primary = 0x2018; // `
|
||||||
|
right_primary = 0x2019; // '
|
||||||
|
left_secondary = 0x201c; // ``
|
||||||
|
right_secondary = 0x201d; // ''
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case SwedishGQuotes: {
|
||||||
|
left_primary = 0x00bb; // >>
|
||||||
|
right_primary = 0x00bb; // >>
|
||||||
|
left_secondary = 0x2019; // '
|
||||||
|
right_secondary = 0x2019; // '
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case FrenchQuotes: {
|
||||||
|
left_primary = 0x00ab; // <<
|
||||||
|
right_primary = 0x00bb; // >>
|
||||||
|
left_secondary = 0x201c; // ``
|
||||||
|
right_secondary = 0x201d; // ''
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case FrenchINQuotes:{
|
||||||
|
left_primary = 0x00ab; // <<
|
||||||
|
right_primary = 0x00bb; // >>
|
||||||
|
left_secondary = 0x00ab; // <<
|
||||||
|
right_secondary = 0x00bb; // >>
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case RussianQuotes:{
|
||||||
|
left_primary = 0x00ab; // <<
|
||||||
|
right_primary = 0x00bb; // >>
|
||||||
|
left_secondary = 0x201e; // ,,
|
||||||
|
right_secondary = 0x201c; // ``
|
||||||
|
break;
|
||||||
|
}
|
||||||
default:
|
default:
|
||||||
// should not happen
|
// should not happen
|
||||||
left_primary = 0x003f; // ?
|
left_primary = 0x003f; // ?
|
||||||
@ -155,10 +195,10 @@ char_type InsetQuotesParams::getQuoteChar(QuoteStyle const & style, QuoteLevel c
|
|||||||
}
|
}
|
||||||
|
|
||||||
switch (level) {
|
switch (level) {
|
||||||
case SingleQuotes:
|
case SecondaryQuotes:
|
||||||
return (side == LeftQuote) ? left_secondary : right_secondary;
|
return (side == OpeningQuote) ? left_secondary : right_secondary;
|
||||||
case DoubleQuotes:
|
case PrimaryQuotes:
|
||||||
return (side == LeftQuote) ? left_primary : right_primary;
|
return (side == OpeningQuote) ? left_primary : right_primary;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -346,10 +386,10 @@ map<string, docstring> InsetQuotesParams::getTypes() const
|
|||||||
docstring const InsetQuotesParams::getGuiLabel(QuoteStyle const & qs)
|
docstring const InsetQuotesParams::getGuiLabel(QuoteStyle const & qs)
|
||||||
{
|
{
|
||||||
return bformat(_("%1$souter%2$s and %3$sinner%4$s[[quotation marks]]"),
|
return bformat(_("%1$souter%2$s and %3$sinner%4$s[[quotation marks]]"),
|
||||||
docstring(1, quoteparams.getQuoteChar(qs, DoubleQuotes, LeftQuote)),
|
docstring(1, quoteparams.getQuoteChar(qs, PrimaryQuotes, OpeningQuote)),
|
||||||
docstring(1, quoteparams.getQuoteChar(qs, DoubleQuotes, RightQuote)),
|
docstring(1, quoteparams.getQuoteChar(qs, PrimaryQuotes, ClosingQuote)),
|
||||||
docstring(1, quoteparams.getQuoteChar(qs, SingleQuotes, LeftQuote)),
|
docstring(1, quoteparams.getQuoteChar(qs, SecondaryQuotes, OpeningQuote)),
|
||||||
docstring(1, quoteparams.getQuoteChar(qs, SingleQuotes, RightQuote))
|
docstring(1, quoteparams.getQuoteChar(qs, SecondaryQuotes, ClosingQuote))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -379,10 +419,10 @@ InsetQuotes::InsetQuotes(Buffer * buf, char_type c, InsetQuotesParams::QuoteLeve
|
|||||||
fontenc_ = lyxrc.fontenc;
|
fontenc_ = lyxrc.fontenc;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (side == "left")
|
if (side == "left" || side == "opening")
|
||||||
side_ = InsetQuotesParams::LeftQuote;
|
side_ = InsetQuotesParams::OpeningQuote;
|
||||||
else if (side == "right")
|
else if (side == "right" || side == "closing")
|
||||||
side_ = InsetQuotesParams::RightQuote;
|
side_ = InsetQuotesParams::ClosingQuote;
|
||||||
else
|
else
|
||||||
setSide(c);
|
setSide(c);
|
||||||
}
|
}
|
||||||
@ -396,15 +436,15 @@ docstring InsetQuotes::layoutName() const
|
|||||||
|
|
||||||
void InsetQuotes::setSide(char_type c)
|
void InsetQuotes::setSide(char_type c)
|
||||||
{
|
{
|
||||||
// Decide whether left or right
|
// Decide whether opening or closing quote
|
||||||
switch (c) {
|
switch (c) {
|
||||||
case ' ':
|
case ' ':
|
||||||
case '(':
|
case '(':
|
||||||
case '[':
|
case '[':
|
||||||
side_ = InsetQuotesParams::LeftQuote; // left quote
|
side_ = InsetQuotesParams::OpeningQuote;// opening quote
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
side_ = InsetQuotesParams::RightQuote; // right quote
|
side_ = InsetQuotesParams::ClosingQuote;// closing quote
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -446,7 +486,7 @@ void InsetQuotes::parseString(string const & s, bool const allow_wildcards)
|
|||||||
if (i >= 2) {
|
if (i >= 2) {
|
||||||
LYXERR0("ERROR (InsetQuotes::InsetQuotes):"
|
LYXERR0("ERROR (InsetQuotes::InsetQuotes):"
|
||||||
" bad side specification.");
|
" bad side specification.");
|
||||||
side_ = InsetQuotesParams::LeftQuote;
|
side_ = InsetQuotesParams::OpeningQuote;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -461,7 +501,7 @@ void InsetQuotes::parseString(string const & s, bool const allow_wildcards)
|
|||||||
if (i >= 2) {
|
if (i >= 2) {
|
||||||
LYXERR0("ERROR (InsetQuotes::InsetQuotes):"
|
LYXERR0("ERROR (InsetQuotes::InsetQuotes):"
|
||||||
" bad level specification.");
|
" bad level specification.");
|
||||||
level_ = InsetQuotesParams::DoubleQuotes;
|
level_ = InsetQuotesParams::PrimaryQuotes;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -479,12 +519,20 @@ InsetQuotesParams::QuoteStyle InsetQuotes::getStyle(string const & s)
|
|||||||
qs = InsetQuotesParams::GermanQuotes;
|
qs = InsetQuotesParams::GermanQuotes;
|
||||||
else if (s == "polish")
|
else if (s == "polish")
|
||||||
qs = InsetQuotesParams::PolishQuotes;
|
qs = InsetQuotesParams::PolishQuotes;
|
||||||
else if (s == "french")
|
else if (s == "swiss")
|
||||||
qs = InsetQuotesParams::FrenchQuotes;
|
qs = InsetQuotesParams::SwissQuotes;
|
||||||
else if (s == "danish")
|
else if (s == "danish")
|
||||||
qs = InsetQuotesParams::DanishQuotes;
|
qs = InsetQuotesParams::DanishQuotes;
|
||||||
else if (s == "plain")
|
else if (s == "plain")
|
||||||
qs = InsetQuotesParams::PlainQuotes;
|
qs = InsetQuotesParams::PlainQuotes;
|
||||||
|
else if (s == "british")
|
||||||
|
qs = InsetQuotesParams::BritishQuotes;
|
||||||
|
else if (s == "swedishg")
|
||||||
|
qs = InsetQuotesParams::SwedishGQuotes;
|
||||||
|
else if (s == "french")
|
||||||
|
qs = InsetQuotesParams::FrenchQuotes;
|
||||||
|
else if (s == "frenchin")
|
||||||
|
qs = InsetQuotesParams::FrenchINQuotes;
|
||||||
|
|
||||||
return qs;
|
return qs;
|
||||||
}
|
}
|
||||||
@ -494,18 +542,20 @@ docstring InsetQuotes::displayString() const
|
|||||||
{
|
{
|
||||||
// In PassThru, we use straight quotes
|
// In PassThru, we use straight quotes
|
||||||
if (pass_thru_)
|
if (pass_thru_)
|
||||||
return (level_ == InsetQuotesParams::DoubleQuotes) ?
|
return (level_ == InsetQuotesParams::PrimaryQuotes) ?
|
||||||
from_ascii("\"") : from_ascii("'");
|
from_ascii("\"") : from_ascii("'");
|
||||||
|
|
||||||
docstring retdisp = docstring(1, quoteparams.getQuoteChar(style_, level_, side_));
|
docstring retdisp = docstring(1, quoteparams.getQuoteChar(style_, level_, side_));
|
||||||
|
|
||||||
// in French, thin spaces are added inside double guillemets
|
// in French, thin spaces are added inside double guillemets
|
||||||
if (prefixIs(context_lang_, "fr")
|
if (prefixIs(context_lang_, "fr")
|
||||||
&& level_ == InsetQuotesParams::DoubleQuotes
|
&& level_ == InsetQuotesParams::PrimaryQuotes
|
||||||
&& style_ == InsetQuotesParams::FrenchQuotes) {
|
&& (style_ == InsetQuotesParams::SwissQuotes
|
||||||
|
|| style_ == InsetQuotesParams::FrenchQuotes
|
||||||
|
|| style_ == InsetQuotesParams::FrenchINQuotes)) {
|
||||||
// THIN SPACE (U+2009)
|
// THIN SPACE (U+2009)
|
||||||
char_type const thin_space = 0x2009;
|
char_type const thin_space = 0x2009;
|
||||||
if (side_ == InsetQuotesParams::LeftQuote)
|
if (side_ == InsetQuotesParams::OpeningQuote)
|
||||||
retdisp += thin_space;
|
retdisp += thin_space;
|
||||||
else
|
else
|
||||||
retdisp = thin_space + retdisp;
|
retdisp = thin_space + retdisp;
|
||||||
@ -611,11 +661,11 @@ void InsetQuotes::latex(otexstream & os, OutputParams const & runparams) const
|
|||||||
|
|
||||||
// In pass-thru context, we output plain quotes
|
// In pass-thru context, we output plain quotes
|
||||||
if (runparams.pass_thru)
|
if (runparams.pass_thru)
|
||||||
qstr = (level_ == InsetQuotesParams::DoubleQuotes) ? from_ascii("\"") : from_ascii("'");
|
qstr = (level_ == InsetQuotesParams::PrimaryQuotes) ? from_ascii("\"") : from_ascii("'");
|
||||||
else if (style_ == InsetQuotesParams::PlainQuotes && runparams.isFullUnicode()) {
|
else if (style_ == InsetQuotesParams::PlainQuotes && runparams.isFullUnicode()) {
|
||||||
// For XeTeX and LuaTeX,we need to disable mapping to get straight
|
// For XeTeX and LuaTeX,we need to disable mapping to get straight
|
||||||
// quotes. We define our own commands that do this
|
// quotes. We define our own commands that do this
|
||||||
qstr = (level_ == InsetQuotesParams::DoubleQuotes) ?
|
qstr = (level_ == InsetQuotesParams::PrimaryQuotes) ?
|
||||||
from_ascii("\\textquotedblplain") : from_ascii("\\textquotesingleplain");
|
from_ascii("\\textquotedblplain") : from_ascii("\\textquotesingleplain");
|
||||||
}
|
}
|
||||||
else if (runparams.use_polyglossia) {
|
else if (runparams.use_polyglossia) {
|
||||||
@ -624,11 +674,11 @@ void InsetQuotes::latex(otexstream & os, OutputParams const & runparams) const
|
|||||||
qstr = docstring(1, quotechar);
|
qstr = docstring(1, quotechar);
|
||||||
}
|
}
|
||||||
else if (style_ == InsetQuotesParams::FrenchQuotes
|
else if (style_ == InsetQuotesParams::FrenchQuotes
|
||||||
&& level_ == InsetQuotesParams::DoubleQuotes
|
&& level_ == InsetQuotesParams::PrimaryQuotes
|
||||||
&& prefixIs(runparams.local_font->language()->code(), "fr")) {
|
&& prefixIs(runparams.local_font->language()->code(), "fr")) {
|
||||||
// Specific guillemets of French babel
|
// Specific guillemets of French babel
|
||||||
// including correct French spacing
|
// including correct French spacing
|
||||||
if (side_ == InsetQuotesParams::LeftQuote)
|
if (side_ == InsetQuotesParams::OpeningQuote)
|
||||||
qstr = from_ascii("\\og");
|
qstr = from_ascii("\\og");
|
||||||
else
|
else
|
||||||
qstr = from_ascii("\\fg");
|
qstr = from_ascii("\\fg");
|
||||||
@ -690,11 +740,11 @@ docstring InsetQuotes::getQuoteEntity() const {
|
|||||||
docstring res = quoteparams.getHTMLQuote(quoteparams.getQuoteChar(style_, level_, side_));
|
docstring res = quoteparams.getHTMLQuote(quoteparams.getQuoteChar(style_, level_, side_));
|
||||||
// in French, thin spaces are added inside double guillemets
|
// in French, thin spaces are added inside double guillemets
|
||||||
if (prefixIs(context_lang_, "fr")
|
if (prefixIs(context_lang_, "fr")
|
||||||
&& level_ == InsetQuotesParams::DoubleQuotes
|
&& level_ == InsetQuotesParams::PrimaryQuotes
|
||||||
&& style_ == InsetQuotesParams::FrenchQuotes) {
|
&& style_ == InsetQuotesParams::FrenchQuotes) {
|
||||||
// THIN SPACE (U+2009)
|
// THIN SPACE (U+2009)
|
||||||
docstring const thin_space = from_ascii(" ");
|
docstring const thin_space = from_ascii(" ");
|
||||||
if (side_ == InsetQuotesParams::LeftQuote)
|
if (side_ == InsetQuotesParams::OpeningQuote)
|
||||||
res += thin_space;
|
res += thin_space;
|
||||||
else
|
else
|
||||||
res = thin_space + res;
|
res = thin_space + res;
|
||||||
|
@ -36,25 +36,35 @@ public:
|
|||||||
///
|
///
|
||||||
PolishQuotes,
|
PolishQuotes,
|
||||||
///
|
///
|
||||||
FrenchQuotes,
|
SwissQuotes,
|
||||||
///
|
///
|
||||||
DanishQuotes,
|
DanishQuotes,
|
||||||
///
|
///
|
||||||
PlainQuotes
|
PlainQuotes,
|
||||||
|
///
|
||||||
|
BritishQuotes,
|
||||||
|
///
|
||||||
|
SwedishGQuotes,
|
||||||
|
///
|
||||||
|
FrenchQuotes,
|
||||||
|
///
|
||||||
|
FrenchINQuotes,
|
||||||
|
///
|
||||||
|
RussianQuotes
|
||||||
};
|
};
|
||||||
///
|
///
|
||||||
enum QuoteSide {
|
enum QuoteSide {
|
||||||
///
|
///
|
||||||
LeftQuote,
|
OpeningQuote,
|
||||||
///
|
///
|
||||||
RightQuote
|
ClosingQuote
|
||||||
};
|
};
|
||||||
///
|
///
|
||||||
enum QuoteLevel {
|
enum QuoteLevel {
|
||||||
///
|
///
|
||||||
SingleQuotes,
|
SecondaryQuotes,
|
||||||
///
|
///
|
||||||
DoubleQuotes
|
PrimaryQuotes
|
||||||
};
|
};
|
||||||
/// Returns the unicode character of a given quote
|
/// Returns the unicode character of a given quote
|
||||||
char_type getQuoteChar(QuoteStyle const &, QuoteLevel const &,
|
char_type getQuoteChar(QuoteStyle const &, QuoteLevel const &,
|
||||||
|
@ -86,6 +86,17 @@ Format LaTeX feature LyX feature
|
|||||||
520 Plain InsetQuote Style:
|
520 Plain InsetQuote Style:
|
||||||
\textquotesingle \begin_inset Quotes qls, \begin_inset Quotes qrs
|
\textquotesingle \begin_inset Quotes qls, \begin_inset Quotes qrs
|
||||||
\textquotedbl \begin_inset Quotes qld, \begin_inset Quotes qrd
|
\textquotedbl \begin_inset Quotes qld, \begin_inset Quotes qrd
|
||||||
|
521 New Quote Styles InsetQuote
|
||||||
|
- british \begin_inset Quotes b..
|
||||||
|
- swiss \begin_inset Quotes c..
|
||||||
|
- swedishg \begin_inset Quotes w..
|
||||||
|
- frenchin \begin_inset Quotes i..
|
||||||
|
- russian \begin_inset Quotes r..
|
||||||
|
Change default behavior \begin_inset Quotes f..
|
||||||
|
of French quote style:
|
||||||
|
- Inner quotes are now ``..''.
|
||||||
|
- Former french style is now
|
||||||
|
called "swiss"
|
||||||
|
|
||||||
General
|
General
|
||||||
|
|
||||||
|
@ -32,8 +32,8 @@ extern char const * const lyx_version_info;
|
|||||||
|
|
||||||
// Do not remove the comment below, so we get merge conflict in
|
// Do not remove the comment below, so we get merge conflict in
|
||||||
// independent branches. Instead add your own.
|
// independent branches. Instead add your own.
|
||||||
#define LYX_FORMAT_LYX 520 // spitz: plain quotes style
|
#define LYX_FORMAT_LYX 521 // spitz: new quotes styles
|
||||||
#define LYX_FORMAT_TEX2LYX 520
|
#define LYX_FORMAT_TEX2LYX 521
|
||||||
|
|
||||||
#if LYX_FORMAT_TEX2LYX != LYX_FORMAT_LYX
|
#if LYX_FORMAT_TEX2LYX != LYX_FORMAT_LYX
|
||||||
#ifndef _MSC_VER
|
#ifndef _MSC_VER
|
||||||
|
Loading…
Reference in New Issue
Block a user