The OpenNET Project / Index page

[ новости /+++ | форум | теги | ]

Проблемы ввода русского текста в системной раскладке в Lyx (rus lyx tex)


<< Предыдущая ИНДЕКС Поиск в статьях src Установить закладку Перейти на закладку Следующая >>
Ключевые слова: rus, lyx, tex,  (найти похожие документы)
Date: Sat, 12 Jun 2004 03:09:00 +0600 From: Kirill Frolov <Kirill_Frolov@p2.f827.n5030.z2.fidonet.org.> Newsgroups: ftn.ru.linux Subject: Проблемы ввода русского текста в системной раскладке в Lyx При использовании Lyx можно столкнуться с некоторыми проблемами с вводом русского текста: Lyx предлагает свою схему "русификации" клавиатуры и Lyx не позволяет вводить текст в обход этой схемы и использовать системный "русификатор" (как это делают все остальные программы)... Предлагаемая в Lyx схема русификации содержит только одну единственную раскладку для русского языка, и та ЙЦУКЕH. Её несложно переделать под ЯВЕРТЫ: === koi8-r.kmap === # Lyx keyboad mapping. ЯВЕРТЫ (YAWERTY), russian. # Can be used in any encoding (this file must be recoded in proper encoding) # Made by [email protected] \kmap q я \kmap w в \kmap e е \kmap r р \kmap t т \kmap y ы \kmap u у \kmap i и \kmap o о \kmap p п \kmap [ ш \kmap ] щ \kmap a а \kmap s с \kmap d д \kmap f ф \kmap g г \kmap h х \kmap j й \kmap k к \kmap l л \kmap z з \kmap x ь \kmap c ц \kmap v ж \kmap b б \kmap n н \kmap m м \kmap Q Я \kmap W В \kmap E Е \kmap R Р \kmap T Т \kmap Y Ы \kmap U У \kmap I И \kmap O О \kmap P П \kmap { Ш \kmap } Щ \kmap A А \kmap S С \kmap D Д \kmap F Ф \kmap G Г \kmap H Х \kmap J Й \kmap K К \kmap L Л \kmap Z З \kmap X Ь \kmap C Ц \kmap V Ж \kmap B Б \kmap N H \kmap M М \kmap "#" "ё" \kmap "$" "Ё" \kmap "_" "ъ" \kmap "@" "Ъ" \kmap "\\" "э" \kmap "|" "Э" \kmap "#" "ё" \kmap "$" "Ё" \kmap "=" "ч" \kmap "+" "Ч" \kmap "`" "ю" \kmap "~" "Ю" === koi8-r.kmap === Данный файл следует просто записать в ~/.lyx/kbd/koi8-r.kmap и указать путь к нему в конфигурации Lyx (это делается в меню Edit --> Preference --> Lang Opts --> Language, опция Keymaps). Данный файл устанавливается как вторая (или первая) раскладка и обязательно нужно установить первую (вторую) раскладку как american.kmap (из /usr/share/lyx/kmap...) И переключаться потом можно будет Meta-K-1 -- латинская раскладка, Meta-K-2 -- русская. При этом системный русификатор должен выдавать латинские буквы всегда. Если вы используете отличную от KOI8-R локаль, файл достаточно перекодировать согласно вашей локали -- т.е. он подходит для любой локали и "koi8" в названии ничего не значит. Чаще всё же в силу привычки возникает желание использовать системный русификатор. Это возможно, с одной оговоркой -- вводить текст в ячейки таблицы вы таким образом не сможете. Это, по всей видимости, ошибка в Lyx. Делается это посредством связывания клавиатурного кода с последовательностью символов вводимых в Lyx, директивой \bind. Кроме того, для большего удобства, аналогичным образом можно "русифицировать" и все комбинации горячих клавиш, чтобы их можно было использовать независимо от текущей системной раскладки (русская или английская -- любая). Горячие клавиши всегда будут восприниматься будто они вводятся в английской раскладке. Всё перечисленное (русификация вводимого текста и горячих клавиш) реализовано в приводимом ниже файле. Отмечу особо -- горячие клавиши рассчитаны на использование ЯВЕРТЫ раскладки русской клавиатуры. В раскладке ЙЦУКЕH от горячих клавиш придётся отказаться (они все будут перепутаны!) или переделать файл согласно используемой вами раскладке. Следующий файл следует поместить в ~/.lyx/bind/cua-ru.bind и в меню конфигурации (Edit --> Preferences --> Look&Feel --> Interface, опция Bind File) установить именно этот файл. А сам файл можно отредактировать по вкусу. Опять же файл не зависит от локали. === cua.bind === === cua.bind == # Lyx keyboard CUA bindings file adapted to russian ЯВЕРТЫ (yawerty) keymap # Made by [email protected] # vim: set foldmethod=marker: # normal bindings # NOTE: only and only cua.bind may be used with this file. \bind_file cua.bind #\bind "ISO_Next_Group" "keymap-toggle" # kmap1-kmap2-off-kmap1... #\bind "Multi_key" "keymap-toggle" #\bind "Mode_switch" "keymap-secondary" # This won't work # {{{ russian alphabet # NOTE: this won't work with tables! Use keymaps instead. \bind "Cyrillic_a" "self-insert" \bind "Cyrillic_A" "self-insert" \bind "Cyrillic_be" "self-insert" \bind "Cyrillic_BE" "self-insert" \bind "Cyrillic_ve" "self-insert" \bind "Cyrillic_VE" "self-insert" \bind "Cyrillic_ghe" "self-insert" \bind "Cyrillic_GHE" "self-insert" \bind "Cyrillic_de" "self-insert" \bind "Cyrillic_DE" "self-insert" \bind "Cyrillic_ie" "self-insert" \bind "Cyrillic_IE" "self-insert" \bind "Cyrillic_io" "self-insert" \bind "Cyrillic_IO" "self-insert" \bind "Cyrillic_zhe" "self-insert" \bind "Cyrillic_ZHE" "self-insert" \bind "Cyrillic_ze" "self-insert" \bind "Cyrillic_ZE" "self-insert" \bind "Cyrillic_i" "self-insert" \bind "Cyrillic_I" "self-insert" \bind "Cyrillic_shorti" "self-insert" \bind "Cyrillic_SHORTI" "self-insert" \bind "Cyrillic_ka" "self-insert" \bind "Cyrillic_KA" "self-insert" \bind "Cyrillic_el" "self-insert" \bind "Cyrillic_EL" "self-insert" \bind "Cyrillic_em" "self-insert" \bind "Cyrillic_EM" "self-insert" \bind "Cyrillic_en" "self-insert" \bind "Cyrillic_EN" "self-insert" \bind "Cyrillic_o" "self-insert" \bind "Cyrillic_O" "self-insert" \bind "Cyrillic_pe" "self-insert" \bind "Cyrillic_PE" "self-insert" \bind "Cyrillic_er" "self-insert" \bind "Cyrillic_ER" "self-insert" \bind "Cyrillic_es" "self-insert" \bind "Cyrillic_ES" "self-insert" \bind "Cyrillic_te" "self-insert" \bind "Cyrillic_TE" "self-insert" \bind "Cyrillic_u" "self-insert" \bind "Cyrillic_U" "self-insert" \bind "Cyrillic_ef" "self-insert" \bind "Cyrillic_EF" "self-insert" \bind "Cyrillic_ha" "self-insert" \bind "Cyrillic_HA" "self-insert" \bind "Cyrillic_tse" "self-insert" \bind "Cyrillic_TSE" "self-insert" \bind "Cyrillic_che" "self-insert" \bind "Cyrillic_CHE" "self-insert" \bind "Cyrillic_sha" "self-insert" \bind "Cyrillic_SHA" "self-insert" \bind "Cyrillic_shcha" "self-insert" \bind "Cyrillic_SHCHA" "self-insert" \bind "Cyrillic_softsign" "self-insert" \bind "Cyrillic_SOFTSIGN" "self-insert" \bind "Cyrillic_yeru" "self-insert" \bind "Cyrillic_YERU" "self-insert" \bind "Cyrillic_hardsign" "self-insert" \bind "Cyrillic_HARDSIGN" "self-insert" \bind "Cyrillic_e" "self-insert" \bind "Cyrillic_E" "self-insert" \bind "Cyrillic_yu" "self-insert" \bind "Cyrillic_YU" "self-insert" \bind "Cyrillic_ya" "self-insert" \bind "Cyrillic_YA" "self-insert" \bind "S-Cyrillic_a" "self-insert" \bind "S-Cyrillic_A" "self-insert" \bind "S-Cyrillic_be" "self-insert" \bind "S-Cyrillic_BE" "self-insert" \bind "S-Cyrillic_ve" "self-insert" \bind "S-Cyrillic_VE" "self-insert" \bind "S-Cyrillic_ghe" "self-insert" \bind "S-Cyrillic_GHE" "self-insert" \bind "S-Cyrillic_de" "self-insert" \bind "S-Cyrillic_DE" "self-insert" \bind "S-Cyrillic_ie" "self-insert" \bind "S-Cyrillic_IE" "self-insert" \bind "S-Cyrillic_io" "self-insert" \bind "S-Cyrillic_IO" "self-insert" \bind "S-Cyrillic_zhe" "self-insert" \bind "S-Cyrillic_ZHE" "self-insert" \bind "S-Cyrillic_ze" "self-insert" \bind "S-Cyrillic_ZE" "self-insert" \bind "S-Cyrillic_i" "self-insert" \bind "S-Cyrillic_I" "self-insert" \bind "S-Cyrillic_shorti" "self-insert" \bind "S-Cyrillic_SHORTI" "self-insert" \bind "S-Cyrillic_ka" "self-insert" \bind "S-Cyrillic_KA" "self-insert" \bind "S-Cyrillic_el" "self-insert" \bind "S-Cyrillic_EL" "self-insert" \bind "S-Cyrillic_em" "self-insert" \bind "S-Cyrillic_EM" "self-insert" \bind "S-Cyrillic_en" "self-insert" \bind "S-Cyrillic_EN" "self-insert" \bind "S-Cyrillic_o" "self-insert" \bind "S-Cyrillic_O" "self-insert" \bind "S-Cyrillic_pe" "self-insert" \bind "S-Cyrillic_PE" "self-insert" \bind "S-Cyrillic_er" "self-insert" \bind "S-Cyrillic_ER" "self-insert" \bind "S-Cyrillic_es" "self-insert" \bind "S-Cyrillic_ES" "self-insert" \bind "S-Cyrillic_te" "self-insert" \bind "S-Cyrillic_TE" "self-insert" \bind "S-Cyrillic_u" "self-insert" \bind "S-Cyrillic_U" "self-insert" \bind "S-Cyrillic_ef" "self-insert" \bind "S-Cyrillic_EF" "self-insert" \bind "S-Cyrillic_ha" "self-insert" \bind "S-Cyrillic_HA" "self-insert" \bind "S-Cyrillic_tse" "self-insert" \bind "S-Cyrillic_TSE" "self-insert" \bind "S-Cyrillic_che" "self-insert" \bind "S-Cyrillic_CHE" "self-insert" \bind "S-Cyrillic_sha" "self-insert" \bind "S-Cyrillic_SHA" "self-insert" \bind "S-Cyrillic_shcha" "self-insert" \bind "S-Cyrillic_SHCHA" "self-insert" \bind "S-Cyrillic_softsign" "self-insert" \bind "S-Cyrillic_SOFTSIGN" "self-insert" \bind "S-Cyrillic_yeru" "self-insert" \bind "S-Cyrillic_YERU" "self-insert" \bind "S-Cyrillic_hardsign" "self-insert" \bind "S-Cyrillic_HARDSIGN" "self-insert" \bind "S-Cyrillic_e" "self-insert" \bind "S-Cyrillic_E" "self-insert" \bind "S-Cyrillic_yu" "self-insert" \bind "S-Cyrillic_YU" "self-insert" \bind "S-Cyrillic_ya" "self-insert" \bind "S-Cyrillic_YA" "self-insert" # }}} # {{{ CUA.bind adapted to russian ЯВЕРТЫ (yawerty) keymap # Free bindings: #\bind "C-a" #\bind "C-h" #\bind "C-j" #\bind "C-y" \bind "C-Cyrillic_en" "buffer-new" \bind "C-S-Cyrillic_EN" "buffer-new-template" \bind "C-Cyrillic_o" "buffer-open" \bind "C-Cyrillic_er" "buffer-reload" \bind "C-Cyrillic_ve" "buffer-close" \bind "C-Cyrillic_es" "buffer-write" \bind "C-S-Cyrillic_ES" "buffer-write-as" \bind "C-Cyrillic_pe" "buffer-print" \bind "C-Cyrillic_de" "buffer-view dvi" # 'd' for dvi \bind "C-Cyrillic_te" "buffer-view ps" \bind "C-S-Cyrillic_DE" "buffer-update dvi" # 'd' for dvi \bind "C-S-Cyrillic_TE" "buffer-update ps" \bind "C-Cyrillic_ya" "lyx-quit" \bind "C-Cyrillic_be" "font-bold" \bind "C-Cyrillic_ie" "font-emph" # used below for line-delete-forward #\bind "C-Cyrillic_ka" "font-noun" # 'k' for capitals \bind "C-Cyrillic_el" "tex-mode" # 'l' for LaTeX \bind "C-Cyrillic_u" "font-underline" \bind "C-S-Cyrillic_PE" "font-code" # 'P' for program \bind "C-Cyrillic_em" "math-mode" \bind "C-S-Cyrillic_EM" "math-display" \bind "C-Cyrillic_ef" "find-replace" \bind "C-Cyrillic_ghe" "error-next" \bind "C-Cyrillic_i" "open-stuff" # 'i' for Inset \bind "C-Cyrillic_tse" "copy" \bind "C-Cyrillic_softsign" "cut" \bind "C-Cyrillic_zhe" "paste" \bind "C-S-Cyrillic_TSE" "layout-copy" \bind "C-S-Cyrillic_ZHE" "layout-paste" \bind "C-Cyrillic_ze" "undo" \bind "C-S-Cyrillic_ZE" "redo" \bind "M-Cyrillic_softsign" "command-execute" \bind "C-Cyrillic_ka" "line-delete-forward" # }}} # {{{ menus.bind adapted to russian ЯВЕРТЫ (yawerty) keymap # Font size menu \bind "M-Cyrillic_es Cyrillic_te" "font-size tiny" \bind "M-Cyrillic_es S-Cyrillic_ES" "font-size footnotesize" \bind "M-Cyrillic_es Cyrillic_es" "font-size small" \bind "M-Cyrillic_es Cyrillic_en" "font-size normal" \bind "M-Cyrillic_es Cyrillic_el" "font-size large" \bind "M-Cyrillic_es S-Cyrillic_EL" "font-size larger" \bind "M-Cyrillic_es Cyrillic_ha" "font-size huge" \bind "M-Cyrillic_es S-Cyrillic_HA" "font-size giant" \bind "M-Cyrillic_es 1" "font-size tiny" \bind "M-Cyrillic_es 2" "font-size scriptsize" \bind "M-Cyrillic_es 3" "font-size footnotesize" \bind "M-Cyrillic_es 4" "font-size small" \bind "M-Cyrillic_es 5" "font-size normal" \bind "M-Cyrillic_es 6" "font-size large" \bind "M-Cyrillic_es 7" "font-size larger" \bind "M-Cyrillic_es 8" "font-size largest" \bind "M-Cyrillic_es 9" "font-size huge" \bind "M-Cyrillic_es 0" "font-size giant" \bind "M-Cyrillic_es plus" "font-size increase" \bind "M-Cyrillic_es Cyrillic_CHE" "font-size increase" \bind "M-Cyrillic_es minus" "font-size decrease" # Alignment menu -- NOTE: these function not implemented in current version of Lyx #bind "M-Cyrillic_a Cyrillic_el" "para-align left" # Not yet implemented! #bind "M-Cyrillic_a Cyrillic_er" "para-align right" # Not yet implemented! #bind "M-Cyrillic_a Cyrillic_tse" "para-align center" # Not yet implemented! #bind "M-Cyrillic_a Cyrillic_be" "para-align block" # Not yet implemented! #bind "M-Cyrillic_a Cyrillic_ef" "para-align block" # Not yet implemented! #bind "M-Cyrillic_a Cyrillic_de" "para-align default" # Not yet implemented! # Paragraph style menu \bind "M-Cyrillic_pe 1" "layout Chapter" \bind "M-Cyrillic_pe 2" "layout Section" \bind "M-Cyrillic_pe 3" "layout Subsection" \bind "M-Cyrillic_pe 4" "layout Subsubsection" \bind "M-Cyrillic_pe 5" "layout Paragraph" \bind "M-Cyrillic_pe 6" "layout Subparagraph" \bind "M-Cyrillic_pe Cyrillic_a" "layout Abstract" \bind "M-Cyrillic_pe S-Cyrillic_A" "layout Author" \bind "M-Cyrillic_pe M-Cyrillic_a" "layout Address" \bind "M-Cyrillic_pe C-Cyrillic_a" "layout RightAddress" \bind "M-Cyrillic_pe Cyrillic_be" "layout Itemize" # bulleted list \bind "M-Cyrillic_pe S-Cyrillic_BE" "layout Bibliography" \bind "M-Cyrillic_pe Cyrillic_tse" "layout LyX-Code" \bind "M-Cyrillic_pe S-Cyrillic_TSE" "layout Comment" \bind "M-Cyrillic_pe M-Cyrillic_tse" "layout Caption" \bind "M-Cyrillic_pe Cyrillic_de" "layout Description" \bind "M-Cyrillic_pe S-Cyrillic_DE" "layout Date" \bind "M-Cyrillic_pe Cyrillic_ie" "layout Enumerate" # numbered list \bind "M-Cyrillic_pe Cyrillic_ef" "layout ShortFoilhead" # Foils!! \bind "M-Cyrillic_pe S-Cyrillic_EF" "layout Foilhead" # Foils!! \bind "M-Cyrillic_pe Cyrillic_i" "layout Itemize" # bulleted list \bind "M-Cyrillic_pe Cyrillic_el" "layout List" \bind "M-Cyrillic_pe S-Cyrillic_EL" "layout LaTeX" \bind "M-Cyrillic_pe Cyrillic_en" "layout Enumerate" # numbered list \bind "M-Cyrillic_pe Cyrillic_ya" "layout Quote" \bind "M-Cyrillic_pe S-Cyrillic_YA" "layout Quotation" \bind "M-Cyrillic_pe Cyrillic_er" "layout ShortRotatefoilhead" # Foils!! \bind "M-Cyrillic_pe S-Cyrillic_ER" "layout Rotatefoilhead" # Foils!! \bind "M-Cyrillic_pe Cyrillic_es" "layout Standard" \bind "M-Cyrillic_pe Cyrillic_te" "layout Title" \bind "M-Cyrillic_pe Cyrillic_softsign" "layout LaTeX" \bind "M-Cyrillic_pe space" "drop-layouts-choice" \bind "M-Cyrillic_pe S-at" "layout Section*" # M-p S-2 \bind "M-Cyrillic_pe S-Cyrillic_hardsign" "layout Section*" # M-p S-2 \bind "M-Cyrillic_pe S-dollar" "layout Subsubsection*" # M-p S-4 \bind "M-Cyrillic_pe S-Cyrillic_io" "layout Subsubsection*" # M-p S-4 \bind "M-Cyrillic_pe S-numbersign" "layout Subsection*" # M-p S-3 \bind "M-Cyrillic_pe S-Cyrillic_IO" "layout Subsection*" # M-p S-3 \bind "M-Cyrillic_pe Cyrillic_zhe" "layout Verse" \bind "M-Cyrillic_pe Left" "depth-decrement" \bind "M-Cyrillic_pe Right" "depth-increment" # Character style menu \bind "M-Cyrillic_tse Cyrillic_be" "font-bold" \bind "M-Cyrillic_tse Cyrillic_tse" "font-noun" \bind "M-Cyrillic_tse Cyrillic_ie" "font-emph" \bind "M-Cyrillic_tse Cyrillic_em" "math-mode" \bind "M-Cyrillic_tse Cyrillic_pe" "font-code" \bind "M-Cyrillic_tse Cyrillic_er" "font-roman" \bind "M-Cyrillic_tse Cyrillic_es" "font-sans" \bind "M-Cyrillic_tse Cyrillic_te" "tex-mode" \bind "M-Cyrillic_tse Cyrillic_u" "font-underline" \bind "M-Cyrillic_tse Down" "word-lowcase" \bind "M-Cyrillic_tse Up" "word-upcase" \bind "M-Cyrillic_tse Right" "word-capitalize" \bind "M-Cyrillic_tse space" "font-default" # Keyboard menu \bind "M-Cyrillic_ka 1" "keymap-primary" \bind "M-Cyrillic_ka 2" "keymap-secondary" \bind "M-Cyrillic_ka Cyrillic_o" "keymap-off" \bind "M-Cyrillic_ka Cyrillic_te" "keymap-toggle" \bind "M-Cyrillic_ka Cyrillic_softsign" "keymap-off" # }}} # {{{ math.bind adapted to russian ЯВЕРТЫ (yawerty) keymap \bind "M-Cyrillic_em Cyrillic_ef" "math-insert frac" \bind "M-Cyrillic_em Cyrillic_es" "math-insert sqrt" \bind "M-Cyrillic_em Cyrillic_ie" "math-insert ^" \bind "M-Cyrillic_em Cyrillic_softsign" "math-insert _" \bind "M-Cyrillic_em Cyrillic_u" "math-insert sum" \bind "M-Cyrillic_em Cyrillic_i" "math-insert int" \bind "M-Cyrillic_em Cyrillic_em" "math-mode" \bind "M-Cyrillic_em Cyrillic_de" "math-display" \bind "M-Cyrillic_em Cyrillic_ghe" "math-greek" \bind "M-Cyrillic_em S-Cyrillic_GHE" "math-greek-toggle" \bind "M-Cyrillic_em Cyrillic_o" "math-insert oint" \bind "M-Cyrillic_em Cyrillic_pe" "math-insert partial" \bind "M-Cyrillic_em Cyrillic_er" "math-insert root" \bind "M-Cyrillic_em Cyrillic_el" "math-limits" \bind "M-Cyrillic_em Cyrillic_en" "math-number" \bind "M-Cyrillic_em S-Cyrillic_EN" "math-nonumber" \bind "M-Cyrillic_em 8" "math-insert infty" \bind "M-Cyrillic_em Cyrillic_zhe" "accent-vector" # The accent-circumflex is 'h' for 'hat', which is what most math # folks call it verbally. \bind "M-Cyrillic_em Cyrillic_be" "math-insert overline" \bind "M-Cyrillic_em Cyrillic_ha" "accent-circumflex" \bind "M-Cyrillic_em ~S-period" "accent-dot" \bind "M-Cyrillic_em ~S-asciitilde" "accent-tilde" \bind "M-Cyrillic_em ~S-Cyrillic_YU" "accent-tilde" \bind "M-Cyrillic_em ~S-apostrophe" "math-insert prime" \bind "M-Cyrillic_em ~S-Cyrillic_yu" "math-insert prime" \bind "M-Cyrillic_em ~S-quotedbl" "accent-umlaut" # These do pairs of: () {} [] <> || \bind "M-Cyrillic_em ~S-parenleft" "math-delim ( )" \bind "M-Cyrillic_em ~S-bracketleft" "math-delim [ ]" \bind "M-Cyrillic_em ~S-Cyrillic_sha" "math-delim [ ]" \bind "M-Cyrillic_em ~S-braceleft" "math-delim { }" \bind "M-Cyrillic_em ~S-Cyrillic_SHA" "math-delim { }" \bind "M-Cyrillic_em ~S-less" "math-delim langle rangle" \bind "M-Cyrillic_em ~S-greater" "math-delim rangle langle" \bind "M-Cyrillic_em ~S-bar" "math-delim | |" \bind "M-Cyrillic_em ~S-Cyrillic_E" "math-delim | |" # Note: it's easy to insert binary relations like \pm, \mp, \neq, \geq, # and \leq just by typing them. However it's easier to remember these: \bind "M-Cyrillic_em ~S-plus" "math-insert pm" \bind "M-Cyrillic_em ~S-Cyrillic_CHE" "math-insert pm" \bind "M-Cyrillic_em ~S-equal" "math-insert neq" \bind "M-Cyrillic_em ~S-Cyrillic_che" "math-insert neq" # }}} === cua.bind ===

<< Предыдущая ИНДЕКС Поиск в статьях src Установить закладку Перейти на закладку Следующая >>

 Добавить комментарий
Имя:
E-Mail:
Заголовок:
Текст:




Партнёры:
PostgresPro
Inferno Solutions
Hosting by Hoster.ru
Хостинг:

Закладки на сайте
Проследить за страницей
Created 1996-2024 by Maxim Chirkov
Добавить, Поддержать, Вебмастеру