lyx_mirror/lib/doc/ja/Customization.lyx
Uwe Stöhr 63148de4a0 - Customization.lyx: add new possible font types uuline, strikeout and uwave
- German Customization.lyx: lot of refactoring

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/branches/BRANCH_2_0_X@39606 a592a061-630c-0410-9148-cb99ea01b6c8
2011-09-06 02:46:23 +00:00

18147 lines
334 KiB
Plaintext
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#LyX 2.0 created this file. For more info see http://www.lyx.org/
\lyxformat 413
\begin_document
\begin_header
\textclass jbook
\begin_preamble
% DO NOT ALTER THIS PREAMBLE!!!
%
% This preamble is designed to ensure that this document prints
% out as advertised. If you mess with this preamble,
% parts of this document may not print out as expected. If you
% have problems LaTeXing this file, please contact
% the documentation team
% email: lyx-docs@lists.lyx.org
\usepackage{ifpdf} % part of the hyperref bundle
\ifpdf % if pdflatex is used
% set fonts for nicer pdf view
\IfFileExists{lmodern.sty}
{\usepackage{lmodern}}{}
\fi % end if pdflatex is used
% the pages of the TOC is numbered roman
% and a pdf-bookmark for the TOC is added
\let\myTOC\tableofcontents
\renewcommand\tableofcontents{%
\frontmatter
\pdfbookmark[1]{\contentsname}{}
\myTOC
\mainmatter }
% Added only for Japanese translation
% This is needed to use \textquotedbl (this doesn't exist in OT1 encoding)
\usepackage[T1]{fontenc}
% Below is to correct PDF bookmarks
% but doesn't work because hyperref is automatically called.
% Modify \usepackage{hyperref} line manually
%\usepackage[dvipdfm,bookmarks=true,bookmarksnumbered=true,bookmarkstype=toc]{hyperref}
%\ifnum 42146=\euc"A4A2 \AtBeginDvi{\special{pdf:tounicode EUC-UCS2}}\else
%\AtBeginDvi{\special{pdf:tounicode 90ms-RKSJ-UCS2}}\fi
\end_preamble
\options fleqn,bibliography=totoc,index=totoc,BCOR7.5mm,titlepage,captions=tableheading
\use_default_options false
\begin_modules
logicalmkup
\end_modules
\maintain_unincluded_children false
\begin_local_layout
Format 7
InsetLayout CharStyle:MenuItem
LyxType charstyle
LabelString menu
LatexType command
LatexName menuitem
Font
Family Sans
EndFont
Preamble
\newcommand*{\menuitem}[1]{{\sffamily #1}}
EndPreamble
End
\end_local_layout
\language japanese
\language_package default
\inputencoding auto
\fontencoding global
\font_roman default
\font_sans default
\font_typewriter default
\font_default_family default
\use_non_tex_fonts false
\font_sc false
\font_osf false
\font_sf_scale 100
\font_tt_scale 100
\graphics default
\default_output_format default
\output_sync 0
\bibtex_command default
\index_command default
\paperfontsize 12
\spacing single
\use_hyperref true
\pdf_title "LyX Configuration Manual"
\pdf_author "LyX Team"
\pdf_subject "LyX-Documentation Customization"
\pdf_keywords "LyX, documentation, customization"
\pdf_bookmarks true
\pdf_bookmarksnumbered true
\pdf_bookmarksopen true
\pdf_bookmarksopenlevel 1
\pdf_breaklinks false
\pdf_pdfborder false
\pdf_colorlinks true
\pdf_backref false
\pdf_pdfusetitle false
\pdf_quoted_options "linkcolor=black, citecolor=black, urlcolor=blue, filecolor=blue,pdfpagelayout=OneColumn, pdfnewwindow=true, pdfstartview=XYZ, plainpages=false"
\papersize default
\use_geometry false
\use_amsmath 0
\use_esint 0
\use_mhchem 0
\use_mathdots 0
\cite_engine basic
\use_bibtopic false
\use_indices false
\paperorientation portrait
\suppress_date false
\use_refstyle 0
\branch OutDated
\selected 0
\filename_suffix 0
\color #f5fae7
\end_branch
\index 索引
\shortcut idx
\color #008000
\end_index
\secnumdepth 3
\tocdepth 3
\paragraph_separation indent
\paragraph_indentation default
\quotes_language english
\papercolumns 1
\papersides 2
\paperpagestyle headings
\tracking_changes false
\output_changes false
\html_math_output 0
\html_css_as_file 0
\html_be_strict true
\end_header
\begin_body
\begin_layout Title
LyXの高度設定
\begin_inset Newline newline
\end_inset
熟練ユーザのための各機能
\end_layout
\begin_layout Author
LyX開発チーム
\begin_inset Foot
status collapsed
\begin_layout Plain Layout
\noindent
もしコメントや誤りの修正をお持ちでしたら、LyX文書化メーリングリスト
\begin_inset CommandInset href
LatexCommand href
target "lyx-docs@lists.lyx.org"
type "mailto:"
\end_inset
宛お送りください。件名ヘッダに「[Customization]」という文字を入れ、このファイルの現在のメンテナRichard Heck <rgheck@comc
ast.net>をccにして送ってください。
\end_layout
\end_inset
\begin_inset Newline newline
\end_inset
\begin_inset Newline newline
\end_inset
第2.0.x版
\end_layout
\begin_layout Standard
\begin_inset CommandInset toc
LatexCommand tableofcontents
\end_inset
\begin_inset Note Note
status open
\begin_layout Plain Layout
本文書を修正する際には、変更追跡機能を使用してください。これによって、
\end_layout
\begin_layout Plain Layout
LyX翻訳者陣が変更点を認識しやすくなり、メンテナが最新の状態を維持することが容易になります。
\end_layout
\end_inset
\end_layout
\begin_layout Chapter
はじめに
\end_layout
\begin_layout Standard
この取扱説明書は、LyXに備わっている高度設定機能を取り扱います。ここでは、短絡キーや画面プレビューオプション、プリンタオプション、LyXサーバ経由でのLyXへ
のコマンド送信、国際化、新しいLaTeXクラスやLyXレイアウトの導入などの題材について論じます。おそらくは変更可能なことすべてについて触れることは無理でしょう
が—私たちの開発者たちは私たちが文書化できる速さよりも速く新しい機能を付け加えてしまうので—、もっとも一般的な高度設定については説明を行い、わかりにくいものにつ
いては正しい方向を指し示すことができるようにしていくつもりです。
\end_layout
\begin_layout Standard
\begin_inset Branch OutDated
status collapsed
\begin_layout Standard
Information from previous versions of this document that now seems to be
outdated is contained in the OutDated branch of this document.
By default, this information will not appear in the LaTeX output.
\end_layout
\end_inset
\end_layout
\begin_layout Chapter
LyX設定ファイル
\end_layout
\begin_layout Standard
本章の目的は、LyX設定ファイル群を理解するための一助となることです。本章を読み進める前に、
\begin_inset Flex MenuItem
status collapsed
\begin_layout Plain Layout
ヘルプ\SpecialChar \menuseparator
L
\begin_inset ERT
status collapsed
\begin_layout Plain Layout
{}
\end_layout
\end_inset
yXについて
\end_layout
\end_inset
を使って、LyXライブラリとユーザディレクトリがどこにあるかを確認しておいてください。ライブラリディレクトリは、LyXがシステム全体の設定ファイルを置いておくと
ころです。一方、ユーザディレクトリは、自身がそれを修正した版を置いておくところです。私たちは、本書の以下の部分で、前者を
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
L
\begin_inset ERT
status collapsed
\begin_layout Plain Layout
{}
\end_layout
\end_inset
yXDir
\end_layout
\end_inset
と呼び、後者を
\begin_inset Flex MenuItem
status collapsed
\begin_layout Plain Layout
UserDir
\end_layout
\end_inset
と呼ぶことにします。
\end_layout
\begin_layout Section
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
L
\begin_inset ERT
status collapsed
\begin_layout Plain Layout
{}
\end_layout
\end_inset
yXDir
\end_layout
\end_inset
にはなにがあるの?
\end_layout
\begin_layout Standard
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
L
\begin_inset ERT
status collapsed
\begin_layout Plain Layout
{}
\end_layout
\end_inset
yXDir
\end_layout
\end_inset
とそのサブディレクトリには、多くのファイルがあり、LyXの挙動を高度設定するのに使用されます。これらのファイルの多くは、LyX内の
\begin_inset Flex MenuItem
status collapsed
\begin_layout Plain Layout
ツール\SpecialChar \menuseparator
設定
\end_layout
\end_inset
ダイアログから変更することができます。LyX中で行いたいと思うような高度設定は、ほとんどこのダイアログから行うことができるようになっています。しかしながら、Ly
Xの他の多くの内部動作は、
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
L
\begin_inset ERT
status collapsed
\begin_layout Plain Layout
{}
\end_layout
\end_inset
yXDir
\end_layout
\end_inset
のファイルを修正することで高度設定されます。これらのファイルは様々なカテゴリに分類しうるので、以下の各小節で説明します。
\end_layout
\begin_layout Subsection
自動的に生成されるファイル
\end_layout
\begin_layout Standard
\begin_inset Flex MenuItem
status collapsed
\begin_layout Plain Layout
UserDir
\end_layout
\end_inset
にある各ファイルは、LyXが自動設定を行ったときに生成されます。これらのファイルは、内部調査中に推測された様々な既定値が置かれています。これらは、随時上書きされ
てしまうので、一般的には修正しないことが望まれます。
\end_layout
\begin_layout Labeling
\labelwidthstring 00.00.0000
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
lyxrc.defaults
\end_layout
\end_inset
このファイルには、様々な既定コマンドが置かれています。
\end_layout
\begin_layout Labeling
\labelwidthstring 00.00.0000
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
packages.lst
\end_layout
\end_inset
このファイルには、LyXが認識したパッケージの一覧が収められています。現在のところ、これはLyXプログラム自体には使用されていませんが、抽出された情報その他は
\begin_inset Flex MenuItem
status collapsed
\begin_layout Plain Layout
ヘルプ\SpecialChar \menuseparator
LaT
\begin_inset ERT
status collapsed
\begin_layout Plain Layout
{}
\end_layout
\end_inset
eXの設定
\end_layout
\end_inset
で見ることができます。
\end_layout
\begin_layout Labeling
\labelwidthstring 00.00.0000
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
textclass.lst
\end_layout
\end_inset
ユーザの
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
layout/
\end_layout
\end_inset
ディレクトリで検出されたテキストクラスと、関連したLaTeX文書クラスおよびその説明の一覧です。
\end_layout
\begin_layout Labeling
\labelwidthstring 00.00.0000
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
lyxmodules.lst
\end_layout
\end_inset
ユーザの
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
layout/
\end_layout
\end_inset
ディレクトリで検出されたレイアウトモジュールの一覧です。
\end_layout
\begin_layout Labeling
\labelwidthstring 00.00.0000
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
*files.lst
\end_layout
\end_inset
ご使用のシステムで検出された様々な種類のLaTeX関連ファイルの一覧です。
\end_layout
\begin_layout Labeling
\labelwidthstring 00.00.0000
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
doc/LaT
\begin_inset ERT
status collapsed
\begin_layout Plain Layout
{}
\end_layout
\end_inset
eXConfig.lyx
\end_layout
\end_inset
このファイルは、自動設定中に
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
LaT
\begin_inset ERT
status collapsed
\begin_layout Plain Layout
{}
\end_layout
\end_inset
eXConfig.lyx.in
\end_layout
\end_inset
から自動的に生成されます。ご使用中のLaTeXの設定に関する情報が納められています。
\end_layout
\begin_layout Subsection
ディレクトリ
\end_layout
\begin_layout Standard
以下の各ディレクトリは、
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
L
\begin_inset ERT
status collapsed
\begin_layout Plain Layout
{}
\end_layout
\end_inset
yXDir
\end_layout
\end_inset
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
UserDir
\end_layout
\end_inset
に重複して存在します。特定のファイルが両方の場所にある場合には、
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
UserDir
\end_layout
\end_inset
の方にあるものが使用されます。
\end_layout
\begin_layout Labeling
\labelwidthstring 00.00.0000
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
bind/
\end_layout
\end_inset
このディレクトリには、LyXで使用されるキー割当を定義している、拡張子が
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
.bind
\end_layout
\end_inset
のファイルが置かれています。
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
$LANG_xxx.bind
\end_layout
\end_inset
という名称の割当ファイルの各国語版がある場合には、そちらが用いられます。
\end_layout
\begin_layout Labeling
\labelwidthstring 00.00.0000
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
clipart/
\end_layout
\end_inset
このディレクトリには、文書に取り込むことのできる画像ファイルが納められています。
\end_layout
\begin_layout Labeling
\labelwidthstring 00.00.0000
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
doc/
\end_layout
\end_inset
このディレクトリには、LyXの取扱説明書ファイル今お読みのものも含めてが納められています。上述のように、
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
LaT
\begin_inset ERT
status collapsed
\begin_layout Plain Layout
{}
\end_layout
\end_inset
eXConfig.lyx
\end_layout
\end_inset
ファイルは特に注目に値します。各国語版のヘルプ文書は、
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
doc/xx
\end_layout
\end_inset
「xx」はISO言語コードサブディレクトリにあります。詳しくは、第
\begin_inset CommandInset ref
LatexCommand ref
reference "cha:LyXの各国語対応"
\end_inset
章をご覧ください。
\end_layout
\begin_layout Labeling
\labelwidthstring 00.00.0000
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
examples/
\end_layout
\end_inset
このディレクトリには、何らかの機能の使い方を説明する例示ファイルが納められています。ファイルブラウザ中で
\begin_inset Flex MenuItem
status collapsed
\begin_layout Plain Layout
用例
\end_layout
\end_inset
ボタンを押すと、このディレクトリが表示されます。
\end_layout
\begin_layout Labeling
\labelwidthstring 00.00.0000
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
images/
\end_layout
\end_inset
このディレクトリには、
\begin_inset Flex MenuItem
status collapsed
\begin_layout Plain Layout
文書
\end_layout
\end_inset
ダイアログで使用される画像ファイルが納められています。さらに、ツールバーの各アイコンや、LyXを起動したときに現れるバナーも納められています。
\end_layout
\begin_layout Labeling
\labelwidthstring 00.00.0000
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
kbd/
\end_layout
\end_inset
このディレクトリには、キーボードのキー割当ファイルが納められています。詳細については、第
\begin_inset CommandInset ref
LatexCommand ref
reference "sec:国際キー配列"
\end_inset
章をご覧ください。
\end_layout
\begin_layout Labeling
\labelwidthstring 00.00.0000
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
layouts/
\end_layout
\end_inset
このディレクトリには、第
\begin_inset CommandInset ref
LatexCommand ref
reference "cha:新規文書を導入"
\end_inset
章に述べられているテキストクラスおよびモジュールのファイルが納められています。
\end_layout
\begin_layout Labeling
\labelwidthstring 00.00.0000
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
lyx2lyx
\end_layout
\end_inset
このディレクトリには、LyXの各バージョン間の変換に使用される
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
lyx2lyx
\end_layout
\end_inset
Pythonスクリプトが納められています。たとえば、複数のファイルの変換をバッチ処理したい場合には、これらをコマンドラインから実行することもできます。
\end_layout
\begin_layout Labeling
\labelwidthstring 00.00.0000
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
scripts/
\end_layout
\end_inset
このディレクトリには、
\begin_inset Flex MenuItem
status collapsed
\begin_layout Plain Layout
外用ひな型
\end_layout
\end_inset
機能の有用性を示すためのファイルがいくつか納められています。LyX自身が使用するスクリプトもいくつか収められています。
\end_layout
\begin_layout Labeling
\labelwidthstring 00.00.0000
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
templates/
\end_layout
\end_inset
このディレクトリには、第
\begin_inset CommandInset ref
LatexCommand ref
reference "sec:ひな型を作成する"
\end_inset
章で述べられている標準のLyXひな型ファイルが納められています。
\end_layout
\begin_layout Labeling
\labelwidthstring 00.00.0000
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
ui/
\end_layout
\end_inset
このディレクトリには、LyXの操作画面を定義する拡張子
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
.ui
\end_layout
\end_inset
のファイルが納められています。つまり、これらのファイルは、どのメニュー項目がどのメニューに現れるかを定義し、どの項目がツールバーに現れるかを定義しています。
\end_layout
\begin_layout Subsection
変更を加えない方がよいファイル
\end_layout
\begin_layout Standard
これらのファイルはLyXが内部的に使用するもので、あなたが開発者でない限りは、凡そこれらに変更を加える必要はありません。
\end_layout
\begin_layout Labeling
\labelwidthstring 00.00.0000
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
CREDITS
\end_layout
\end_inset
このファイルは、LyX開発陣の名簿です。この内容は、メニュー項目
\begin_inset Flex MenuItem
status collapsed
\begin_layout Plain Layout
ヘルプ\SpecialChar \menuseparator
L
\begin_inset ERT
status collapsed
\begin_layout Plain Layout
{}
\end_layout
\end_inset
yXについて
\end_layout
\end_inset
で表示されます。
\end_layout
\begin_layout Labeling
\labelwidthstring 00.00.0000
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
chkconfig.ltx
\end_layout
\end_inset
これは、自動設定プロセスによって使用されるLaTeXスクリプトです。直接実行しないでください。
\end_layout
\begin_layout Labeling
\labelwidthstring 00.00.0000
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
configure.py
\end_layout
\end_inset
これは、LyXの再設定によって使用されるスクリプトです。これは、このスクリプトを実行したディレクトリに設定ファイルを生成します。
\end_layout
\begin_layout Subsection
ひとこと必要なファイル群...
\end_layout
\begin_layout Labeling
\labelwidthstring 00.00.0000
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
encodings
\end_layout
\end_inset
このファイルには、各文字エンコーディングがどのようにUnicodeにマップされるかを示した表が載っています。
\end_layout
\begin_layout Labeling
\labelwidthstring 00.00.0000
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
external_templates
\end_layout
\end_inset
このファイルには、新しく導入された
\begin_inset Flex MenuItem
status collapsed
\begin_layout Plain Layout
外用ひな型
\end_layout
\end_inset
機能で使用できるひな型が載っています。
\end_layout
\begin_layout Labeling
\labelwidthstring 00.00.0000
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
languages
\end_layout
\end_inset
このファイルには、現在LyXがサポートしている言語の全一覧が載っています。
\end_layout
\begin_layout Section
ユーザのローカル設定ディレクトリ
\end_layout
\begin_layout Standard
LyXを非特権ユーザとして利用している場合でも、自分自身で使うために、LyXの設定を変更したいと思うかもしれません。
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
UserDir
\end_layout
\end_inset
ディレクトリには、すべての個人設定ファイルが収められています。これは、
\begin_inset Flex MenuItem
status collapsed
\begin_layout Plain Layout
ヘルプ\SpecialChar \menuseparator
L
\begin_inset ERT
status collapsed
\begin_layout Plain Layout
{}
\end_layout
\end_inset
\begin_inset ERT
status collapsed
\begin_layout Plain Layout
{}
\end_layout
\end_inset
yXについて
\end_layout
\end_inset
で「ユーザーディレクトリ」として言及されているディレクトリです。このディレクトリは、
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
L
\begin_inset ERT
status collapsed
\begin_layout Plain Layout
{}
\end_layout
\end_inset
yXDir
\end_layout
\end_inset
のミラーとして使用されており、これは
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
UserDir
\end_layout
\end_inset
内のすべてのファイルが、
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
L
\begin_inset ERT
status collapsed
\begin_layout Plain Layout
{}
\end_layout
\end_inset
yXDir
\end_layout
\end_inset
の対応するファイルを置き換えるものとして機能していることを意味します。前節で述べられた設定はどれも、全ユーザに影響する全システム用ディレクトリに置くこともできま
すし、自分自身で使うために個人のローカルディレクトリに置くこともできます。
\end_layout
\begin_layout Standard
わかりやすくするために、いくつか例を挙げましょう。
\end_layout
\begin_layout Itemize
\begin_inset Flex MenuItem
status collapsed
\begin_layout Plain Layout
ツール\SpecialChar \menuseparator
設定
\end_layout
\end_inset
ダイアログで設定されるユーザ設定は、
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
UserDir
\end_layout
\end_inset
中の
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
preferences
\end_layout
\end_inset
ファイルに保存されます。
\end_layout
\begin_layout Itemize
\begin_inset Flex MenuItem
status collapsed
\begin_layout Plain Layout
ツール\SpecialChar \menuseparator
再設定
\end_layout
\end_inset
を使用して再設定を行うと、LyXは
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
configure.py
\end_layout
\end_inset
スクリプトを実行し、その結果のファイルは、ご自身のローカル設定ディレクトリに書き込まれます。これはすなわち、
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
UserDir/layouts
\end_layout
\end_inset
にご自身で追加したテキストファイルは、
\begin_inset Flex MenuItem
status collapsed
\begin_layout Plain Layout
文書\SpecialChar \menuseparator
設定
\end_layout
\end_inset
ダイアログのクラス一覧に表示されるようになることを意味します。
\end_layout
\begin_layout Itemize
たとえば、LyXのFTPサイトから最新の取扱説明書をとってきたものの、使用中のシステム上で管理者権限がないために、それをインストールすることができなかったとして
も、それらのファイルを
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
UserDir/doc/
\end_layout
\end_inset
ディレクトリにコピーすれば、
\begin_inset Flex MenuItem
status collapsed
\begin_layout Plain Layout
ヘルプ
\end_layout
\end_inset
メニュー項目はこれらを開くようになります!
\end_layout
\begin_layout Section
LyXを複数の設定を使って実行するには
\end_layout
\begin_layout Standard
ローカル設定ディレクトリにおいて設定の自由度があるだけでは、2つ以上の設定を自由に使いこなしたい場合には充分ではないかもしれません。たとえば、使用する度に異なる
キー割当を使用したり、異なるプリンタ設定を使用したいことがあるかもしれません。これは、複数の設定ディレクトリを作ることで実現することができます。そして、実行時に
どのディレクトリを使用するか指定するのです。
\end_layout
\begin_layout Standard
LyXをコマンドラインスイッチ
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
-userdir
\end_layout
\end_inset
\emph on
<ディレクトリ名>
\emph default
と共に起動すると、設定を既定のディレクトリではなく、指定したディレクトリから読み込むように、指示することになりますLyXを
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
-userdir
\end_layout
\end_inset
スイッチなしで実行すれば、既定ディレクトリを指定することになります。指定したディレクトリが存在しない場合には、LyXは、初めてLyXを実行したときに既定ディレ
クトリを訊いてくるのと同様に、そのディレクトリを作るかどうか訊いてきます。この追加したユーザディレクトリでは、既定ディレクトリで行うのと全く同じように設定オプシ
ョンを修正することができます。これらのディレクトリは完全に独立しています(が、読み進めてください)。また、環境変数
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
LYX_USERDIR_VER
\end_layout
\end_inset
を特定の値に設定しても、全く同じ効果があります。
\end_layout
\begin_layout Standard
複数の設定を持つことはまた、維持の手間も増えるということです。もし新しいレイアウトを
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
NewUserDir/layouts
\end_layout
\end_inset
に加えて、これをすべての設定で利用できるようにしたいならば、これをすべての設定ディレクトリで個々に付け加えなくてはなりません。これを避けるには、次のようなトリッ
クを使用してください。LyXが新しい設定ディレクトリを生成すると、そのサブディレクトリ上記参照はほとんど空です。新しい設定が既存のものをミラーするようにする
には、空のサブディレクトリを、既存の設定の対応するサブディレクトリへのシンボリックリンクに置き換えてください。ただし
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
doc/
\end_layout
\end_inset
サブディレクトリには、設定スクリプト(
\begin_inset Flex MenuItem
status collapsed
\begin_layout Plain Layout
ツール\SpecialChar \menuseparator
再設定
\end_layout
\end_inset
で使用可能)が書き出した、設定毎に異なるファイルが含まれていますので、注意を払ってください。
\end_layout
\begin_layout Chapter
設定ダイアログ
\end_layout
\begin_layout Standard
設定ダイアログのオプションのすべては、
\emph on
ユーザーの手引き
\emph default
の付録
\emph on
設定ダイアログ
\emph default
に述べられています。オプションのうちいくつかについて、ここでさらに詳細に説明します。
\end_layout
\begin_layout Section
書式
\begin_inset CommandInset label
LatexCommand label
name "sec:書式"
\end_inset
\end_layout
\begin_layout Standard
ファイル書式が定義されていない場合、はじめの一歩は、使いたいと思うファイル書式を定義することです。それには、
\begin_inset Flex MenuItem
status collapsed
\begin_layout Plain Layout
ツール\SpecialChar \menuseparator
設定
\end_layout
\end_inset
ダイアログを開いてください。
\begin_inset Flex MenuItem
status collapsed
\begin_layout Plain Layout
ファイル処理\SpecialChar \menuseparator
ファイル書式
\end_layout
\end_inset
の中で
\begin_inset Flex MenuItem
status collapsed
\begin_layout Plain Layout
新規\SpecialChar \ldots{}
\end_layout
\end_inset
ボタンを押して、登録する新しい書式を定義してください。
\begin_inset Flex MenuItem
status collapsed
\begin_layout Plain Layout
書式
\end_layout
\end_inset
フィールドは、GUI中で書式を認識するために用いられる名称です。
\begin_inset Flex MenuItem
status collapsed
\begin_layout Plain Layout
短縮名
\end_layout
\end_inset
は、書式を内部的に識別するために用いられます。さらにファイル拡張子も入力する必要があります。これらはすべて必須事項です。オプションの
\begin_inset Flex MenuItem
status collapsed
\begin_layout Plain Layout
短絡キー
\end_layout
\end_inset
フィールドは、メニュー中で短絡キーを提供するのに使用されます(たとえば、
\begin_inset Flex MenuItem
status collapsed
\begin_layout Plain Layout
Alt-V D
\end_layout
\end_inset
を押すと
\begin_inset Flex MenuItem
status collapsed
\begin_layout Plain Layout
表示\SpecialChar \menuseparator
DVI
\end_layout
\end_inset
となります)。
\end_layout
\begin_layout Standard
書式には、
\begin_inset Flex MenuItem
status collapsed
\begin_layout Plain Layout
閲覧プログラム
\end_layout
\end_inset
\begin_inset Flex MenuItem
status collapsed
\begin_layout Plain Layout
編集プログラム
\end_layout
\end_inset
を関連づけることができます。たとえば、PostScriptファイルを閲覧するのに
\begin_inset Flex MenuItem
status collapsed
\begin_layout Plain Layout
Ghostview
\end_layout
\end_inset
を使用したいとしましょう。このプログラムを起動するのに必要なコマンドを対応するフィールドに入力します。ここで、コマンドを定義するのに、次節に掲げる4つの変数を用
いることができます。この閲覧プログラムは、LyX中で画像を閲覧したり
\begin_inset Flex MenuItem
status collapsed
\begin_layout Plain Layout
表示
\end_layout
\end_inset
メニューを使用したときに起動されます。一方、編集プログラムは、たとえば、画像を右クリックして現れるコンテクストメニューで
\begin_inset Flex MenuItem
status collapsed
\begin_layout Plain Layout
外部で編集
\end_layout
\end_inset
を選択したときに起動します。
\end_layout
\begin_layout Standard
\begin_inset Flex MenuItem
status collapsed
\begin_layout Plain Layout
文書書式
\end_layout
\end_inset
オプションは、LyXに、この書式が文書として書き出すのに適していることを指示するものです。このオプションが有効となっていて、適切な変換経路が存在する場合には
\begin_inset CommandInset ref
LatexCommand ref
reference "sec:変換子"
\end_inset
節を参照)、この書式が
\begin_inset Flex MenuItem
status collapsed
\begin_layout Plain Layout
ファイル\SpecialChar \menuseparator
書き出し
\end_layout
\end_inset
メニューに表示されます。また、この書式に閲覧プログラムが指定されている場合には、この書式は
\begin_inset Flex MenuItem
status collapsed
\begin_layout Plain Layout
表示
\end_layout
\end_inset
メニューにも表示されます。
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
png
\end_layout
\end_inset
のような純粋な画像書式は、このオプションを有効にしてはいけません。
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
pdf
\end_layout
\end_inset
のようにベクター画像であると同時に文書でもあるような書式は、これを有効にします。
\end_layout
\begin_layout Standard
\begin_inset Flex MenuItem
status collapsed
\begin_layout Plain Layout
ベクター画像書式
\end_layout
\end_inset
オプションは、LyXにこの書式がベクター画像を含みうることを教示するものです。この情報は、
\begin_inset Flex MenuItem
status collapsed
\begin_layout Plain Layout
pdflatex
\end_layout
\end_inset
を書き出す際に、内包されている画像をどの書式に変換するかを決定するのに使用されます。
\begin_inset Flex MenuItem
status collapsed
\begin_layout Plain Layout
pdflatex
\end_layout
\end_inset
は、
\begin_inset Flex MenuItem
status collapsed
\begin_layout Plain Layout
pdf
\end_layout
\end_inset
\begin_inset Flex MenuItem
status collapsed
\begin_layout Plain Layout
png
\end_layout
\end_inset
\begin_inset Flex MenuItem
status collapsed
\begin_layout Plain Layout
jpg
\end_layout
\end_inset
以外の画像書式を取り扱うことができないので、内包されている画像は、これらの書式に変換される必要があるかもしれない為です。内包されている画像が既に
\begin_inset Flex MenuItem
status collapsed
\begin_layout Plain Layout
pdf
\end_layout
\end_inset
\begin_inset Flex MenuItem
status collapsed
\begin_layout Plain Layout
png
\end_layout
\end_inset
\begin_inset Flex MenuItem
status collapsed
\begin_layout Plain Layout
jpg
\end_layout
\end_inset
のいずれかになっていない場合には、ベクター画像書式オプションが有効になっている場合には
\begin_inset Flex MenuItem
status collapsed
\begin_layout Plain Layout
pdf
\end_layout
\end_inset
に変換され、そうでない場合には
\begin_inset Flex MenuItem
status collapsed
\begin_layout Plain Layout
png
\end_layout
\end_inset
に変換されます。
\end_layout
\begin_layout Section
複写子
\end_layout
\begin_layout Standard
書式の変換はすべて、LyXの一時ディレクトリで行われるため、変換用にファイルを一時ディレクトリにコピーする前段階で、ファイルに変更を加える必要のあることがありま
\begin_inset Foot
status collapsed
\begin_layout Plain Layout
たとえば、ファイルが他のファイル—たとえば画像—を、相対ファイル名を用いて参照している場合、このファイルが一時ディレクトリにコピーされると参照が無効になる場合が
あります。
\end_layout
\end_inset
。これは複写子によって取り扱われ、複写子は、ファイルを一時ディレクトリに(あるいは一時ディレクトリから)コピーすると同時に、その過程でファイルに変更を加えます。
\end_layout
\begin_layout Standard
複写子の定義においては、以下の4つの変数を用いることができます。
\end_layout
\begin_layout Labeling
\labelwidthstring 00.00.0000
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
$$s
\end_layout
\end_inset
LyXのシステムディレクトリ
\begin_inset Flex MenuItem
status collapsed
\begin_layout Plain Layout
/usr/share/lyx
\end_layout
\end_inset
\end_layout
\begin_layout Labeling
\labelwidthstring 00.00.0000
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
$$i
\end_layout
\end_inset
入力ファイル
\end_layout
\begin_layout Labeling
\labelwidthstring 00.00.0000
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
$$o
\end_layout
\end_inset
出力ファイル
\end_layout
\begin_layout Labeling
\labelwidthstring 00.00.0000
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
$$l
\end_layout
\end_inset
「LaTeX名」
\end_layout
\begin_layout Standard
最後の変数は、LaTeXの
\series bold
\backslash
include
\series default
コマンドで使用されるのと同形式のファイル名です。これは、書き出すファイルがそのようなインクルードに適している場合のみ、使用さるべきものです。
\end_layout
\begin_layout Standard
複写子は、出力ファイルに関する操作であれば、ほとんどすべてに対応することができます。たとえば、生成したPDFファイルを、
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
/home/you/pdf/
\end_layout
\end_inset
という特別なディレクトリにコピーしたいものとしましょう。その場合には、以下のようなシェルスクリプトを書きます。
\end_layout
\begin_layout Standard
\begin_inset listings
inline false
status open
\begin_layout Plain Layout
#!/bin/bash
\end_layout
\begin_layout Plain Layout
FROMFILE=$1
\end_layout
\begin_layout Plain Layout
TOFILE=`basename $2`
\end_layout
\begin_layout Plain Layout
cp $FROMFILE /home/you/pdf/$TOFILE
\end_layout
\end_inset
これを、自身のローカルLyXディレクトリ—たとえば
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
/home/you/.lyx/scripts/pdfcopier.sh
\end_layout
\end_inset
—に保存し、お使いのプラットフォームが必要とするならば、実行可能属性を付与します。それから、
\begin_inset Flex MenuItem
status collapsed
\begin_layout Plain Layout
ツール\SpecialChar \menuseparator
設定
\end_layout
\end_inset
ダイアログの
\begin_inset Flex MenuItem
status collapsed
\begin_layout Plain Layout
ファイル処理\SpecialChar \menuseparator
ファイル書式
\end_layout
\end_inset
の中で、
\begin_inset Flex MenuItem
status collapsed
\begin_layout Plain Layout
PDF(pdflatex)
\end_layout
\end_inset
書式—あるいは他のPDF書式のうちどれか—を選択し、
\begin_inset Flex MenuItem
status collapsed
\begin_layout Plain Layout
複写子
\end_layout
\end_inset
フィールドに
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
pdfcopier.sh $$i $$o
\end_layout
\end_inset
と入力します。
\end_layout
\begin_layout Standard
複写子は、LyX自身が様々な変換に使用します。たとえば、適切なプログラムが検出された場合、LyXは自動的に
\begin_inset Flex MenuItem
status collapsed
\begin_layout Plain Layout
HTML
\end_layout
\end_inset
書式と
\begin_inset Flex MenuItem
status collapsed
\begin_layout Plain Layout
HTML
\begin_inset space ~
\end_inset
(MS Word)
\end_layout
\end_inset
書式の複写子を導入します。これらの書式を書き出す際、複写子は、本体のHTMLファイルだけでなく、関連した様々なファイルスタイルファイルや画像などもコピーされ
るように手配します。これらのファイルはすべて、元のLyXファイルのあるディレクトリのサブディレクトリに書き込まれます
\begin_inset Foot
status collapsed
\begin_layout Plain Layout
この複写子の挙動は調整することができます。非必須の「-e」オプションは、コピーする拡張子をコンマ区切りで羅列したものを引数にとります。これを省略した場合には、す
べてのファイルがコピーされます。「-t」引数は、生成したディレクトリに書き加える拡張子を指定するものです。既定値では、これは「
\begin_inset Flex MenuItem
status collapsed
\begin_layout Plain Layout
L
\begin_inset ERT
status collapsed
\begin_layout Plain Layout
{}
\end_layout
\end_inset
yXconv
\end_layout
\end_inset
」となっているので、
\begin_inset Flex MenuItem
status collapsed
\begin_layout Plain Layout
/path/to/filename.lyx
\end_layout
\end_inset
から生成されたHTMLファイルは、
\begin_inset Flex MenuItem
status collapsed
\begin_layout Plain Layout
/path/to/filename.html.L
\begin_inset ERT
status collapsed
\begin_layout Plain Layout
{}
\end_layout
\end_inset
yXconv
\end_layout
\end_inset
となります。.
\end_layout
\end_inset
\end_layout
\begin_layout Section
変換子
\begin_inset CommandInset label
LatexCommand label
name "sec:変換子"
\end_inset
\end_layout
\begin_layout Standard
各書式間でファイルを変換するために、ご自身の変換子を定義することができます。これは、
\begin_inset Flex MenuItem
status collapsed
\begin_layout Plain Layout
ツール\SpecialChar \menuseparator
設定\SpecialChar \menuseparator
ファイル処理\SpecialChar \menuseparator
変換子
\end_layout
\end_inset
ダイアログで行います。
\end_layout
\begin_layout Standard
新規に変換子を定義するには、ドロップダウンリストから
\begin_inset Flex MenuItem
status collapsed
\begin_layout Plain Layout
変換元の書式
\end_layout
\end_inset
\begin_inset Flex MenuItem
status collapsed
\begin_layout Plain Layout
変換先の書式
\end_layout
\end_inset
を選択し、変換に必要なコマンドを入力してから
\begin_inset Flex MenuItem
status collapsed
\begin_layout Plain Layout
追加
\end_layout
\end_inset
ボタンを押してください。変換子の定義には、以下のような変数を使用することができます。
\end_layout
\begin_layout Labeling
\labelwidthstring 00.00.0000
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
$$s
\end_layout
\end_inset
LyXシステムディレクトリ
\end_layout
\begin_layout Labeling
\labelwidthstring 00.00.0000
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
$$i
\end_layout
\end_inset
入力ファイル
\end_layout
\begin_layout Labeling
\labelwidthstring 00.00.0000
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
$$o
\end_layout
\end_inset
出力ファイル
\end_layout
\begin_layout Labeling
\labelwidthstring 00.00.0000
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
$$b
\end_layout
\end_inset
入力ファイルのベースファイル名(拡張子をとった部分)
\end_layout
\begin_layout Labeling
\labelwidthstring 00.00.0000
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
$$p
\end_layout
\end_inset
入力ファイルのパス
\end_layout
\begin_layout Labeling
\labelwidthstring 00.00.0000
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
$$r
\end_layout
\end_inset
元の入力ファイルのパス(変換子が連鎖して呼び出されたときの挙動が$$pとは異なります
\end_layout
\begin_layout Labeling
\labelwidthstring 00.00.0000
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
$$e
\end_layout
\end_inset
文書エンコーディングのiconv名
\end_layout
\begin_layout Standard
\begin_inset Flex MenuItem
status collapsed
\begin_layout Plain Layout
追加フラグ
\end_layout
\end_inset
フィールドには、以下のフラグをコンマで区切って入力することができます。
\end_layout
\begin_layout Labeling
\labelwidthstring 00.00.0000
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
latex
\end_layout
\end_inset
この変換子がLaTeXの一種を実行することを示します。これによって、LyXのLaTeXエラーログに記録を残せるようになります。
\end_layout
\begin_layout Labeling
\labelwidthstring 00.00.0000
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
needaux
\end_layout
\end_inset
変換にLaTeXの
\begin_inset Flex MenuItem
status collapsed
\begin_layout Plain Layout
.aux
\end_layout
\end_inset
ファイルが必要であることを示します。
\end_layout
\begin_layout Labeling
\labelwidthstring 00.00.0000
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
xml
\end_layout
\end_inset
出力がXMLであることを示します。
\end_layout
\begin_layout Standard
以下の3つのフラグは
\begin_inset Flex MenuItem
status collapsed
\begin_layout Plain Layout
key
\begin_inset space ~
\end_inset
=
\begin_inset space ~
\end_inset
value
\end_layout
\end_inset
形式の引数をとります(したがって厳密にはフラグとは呼べません)。
\end_layout
\begin_layout Labeling
\labelwidthstring 00.00.0000
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
parselog
\end_layout
\end_inset
これを指定すると、変換子の標準エラーが
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
infile.out
\end_layout
\end_inset
ファイルにリダイレクトされ、引数に指定されたスクリプトが
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
script < infile.out > infile.log
\end_layout
\end_inset
の形で実行されるようになります。引数には
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
$$s
\end_layout
\end_inset
を指定することができます。
\end_layout
\begin_layout Labeling
\labelwidthstring 00.00.0000
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
resultdir
\end_layout
\end_inset
これには、変換子が生成したファイルをダンプするディレクトリ名を指定します。LyXはこのディレクトリを作成せず、ここに何もコピーしませんが、このディレクトリを宛
先にコピーします。引数には、
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
$$b
\end_layout
\end_inset
を使用することができ、これはディレクトリがコピーされる際に、入力ファイルおよび出力ファイルのベース名で置換されます。
\begin_inset Newline newline
\end_inset
resultdirとusetempdirは、同時に用いることはできませんのでご注意ください。前者が指定されているときには、後者は無視されます。
\end_layout
\begin_layout Labeling
\labelwidthstring 00.00.0000
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
resultfile
\end_layout
\end_inset
これは出力ファイル名を指定するもので、
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
$$b
\end_layout
\end_inset
を使用することができます。resultdirが指定されているときのみ有効で、必ず用いる必要はありません。指定されていなければ、既定値は「index」です。
\end_layout
\begin_layout Standard
最後の3つは、LyXとともに導入される変換子には、現在いずれも使用されておりません。
\end_layout
\begin_layout Standard
変換しようとするすべての書式のあいだに変換子を定義する必要はありません。たとえば、「LyXからPostScript」変換子が定義されていないのに、LyXはPos
tScriptを書き出していることに気づかれることでしょう。これは、まずLaTeXファイルを生成した後にこれには変換子を定義する必要はありません、「LaTe
XからDVI」変換子を使用してDVIに変換し、最後に、得られたDVIをPostScriptに変換することによって実現しています。LyXはこのような変換子の「連鎖
」を自動的に見つけ、つねに最も短い連鎖を選択します。しかしながら、なお書式間に複数の変換方法を定義することも可能です。たとえば、標準的なLyX設定は、LaTeX
からPDFへ変換するのに、以下の3つの方法を用意しています。(1)
\begin_inset space ~
\end_inset
直接
\begin_inset Flex MenuItem
status collapsed
\begin_layout Plain Layout
pdflatex
\end_layout
\end_inset
を使用するもの。(2)
\begin_inset space ~
\end_inset
DVIとPostScriptを経由して
\begin_inset Flex MenuItem
status collapsed
\begin_layout Plain Layout
ps2pdf
\end_layout
\end_inset
を使用するもの。(3)
\begin_inset space ~
\end_inset
DVI経由で
\begin_inset Flex MenuItem
status collapsed
\begin_layout Plain Layout
dvipdfm
\end_layout
\end_inset
を使用するもの。このように代替連鎖を定義するには、第
\begin_inset CommandInset ref
LatexCommand ref
reference "sec:書式"
\end_inset
節に述べられているように、ターゲットとなる「ファイル書式」を複数定義しなくてはなりません。たとえば、標準設定では、
\begin_inset Flex MenuItem
status collapsed
\begin_layout Plain Layout
pdf
\end_layout
\end_inset
\begin_inset Flex MenuItem
status collapsed
\begin_layout Plain Layout
pdf2
\end_layout
\end_inset
\begin_inset Flex MenuItem
status collapsed
\begin_layout Plain Layout
pdf3
\end_layout
\end_inset
と命名された書式が定義されていて、すべて共通の拡張子
\begin_inset Flex MenuItem
status collapsed
\begin_layout Plain Layout
.pdf
\end_layout
\end_inset
を持ち、上記で言及した各変換方法に対応しています。
\end_layout
\begin_layout Chapter
LyXの各国語対応
\begin_inset CommandInset label
LatexCommand label
name "cha:LyXの各国語対応"
\end_inset
\end_layout
\begin_layout Standard
LyXは、翻訳された操作画面の利用をサポートしています。私たちが最後に確かめたところでは、LyXは30言語の翻訳を提供しています。選択した言語は、使用する
\emph on
ロケール
\emph default
と呼ばれますロケール設定についての詳しい資料は、お使いの基本ソフトに添付のロケール関連説明書をご覧ください。Linuxの場合は、マニュアルページの
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
locale(5)
\end_layout
\end_inset
から見ると良いかもしれません)。
\end_layout
\begin_layout Standard
これらの翻訳は適切に機能しますが、欠点もいくつかあることに注意してください。たとえば、ダイアログはすべて英文を念頭にデザインされているため、翻訳文の一部は、割り
当てられたスペースに収めるには大きすぎるかもしれません。これは表示上の問題に過ぎず、他の障害は引き起こしません。また、翻訳によっては、すべての短絡キーが定義され
ていないことに気づかれるでしょう。短絡キーのために空いている文字が十分ないことが時々あるのです。単に翻訳者がまだ短絡キーを定義していないこともあるでしょう。もち
ろん、私たちの各国語対応チーム—あなたも参加したいと思われるかもしれません
\begin_inset Foot
status collapsed
\begin_layout Plain Layout
もしあなたが英語以外の言語を流暢に操れるならば、これらのチームに参加することは、LyXコミュニティに報いるたいへん素晴らしい方法です
\end_layout
\end_inset
—は、LyXの将来のバージョンでこれらの欠点を修正しようとするでしょう。
\end_layout
\begin_layout Section
LyXを翻訳する
\end_layout
\begin_layout Subsection
グラフィカル・ユーザ・インタフェース(テキスト・メッセージ)を翻訳する
\begin_inset Argument
status collapsed
\begin_layout Plain Layout
GUIテキストメッセージを翻訳する
\end_layout
\end_inset
\end_layout
\begin_layout Standard
LyXは、操作画面の国際化対応にGNU
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
gettext
\end_layout
\end_inset
ライブラリを使用します。LyXのすべてのメニューやダイアログでお好みの言語を話させたいときには、その言語の
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
po
\end_layout
\end_inset
ファイルが必要です。このファイルが利用可能であれば、そこから
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
mo
\end_layout
\end_inset
ファイルを生成して、この
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
mo
\end_layout
\end_inset
ファイルをインストールしなくてはなりません。この全過程は、GNU
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
gettext
\end_layout
\end_inset
の取扱説明書に説明があります。この作業をあなたのためだけに行うこともできますが、もしせっかくするのであれば、あなたの骨折りの結果をLyXコミュニティの他の人々と
分かち合いませんか。どのように段取りを進めればよいか、詳しくはLyX開発者メーリングリストにメールを送ってください。
\end_layout
\begin_layout Standard
要約すれば、以下のように行いますxxは言語コードを表します
\end_layout
\begin_layout Itemize
LyXソースコードをチェックアウトしてください
\begin_inset CommandInset href
LatexCommand href
name "ウェブ上の情報"
target "http://www.lyx.org/devel/cvs.php"
\end_inset
参照)。
\end_layout
\begin_layout Itemize
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
lyx.pot
\end_layout
\end_inset
ファイルを
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
**.po
\end_layout
\end_inset
ファイルのあるフォルダにコピーして、
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
xx.po
\end_layout
\end_inset
に名前を付け替えてください(
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
lyx.pot
\end_layout
\end_inset
がどこにもない場合には、コンソールからそのディレクトリで
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
make lyx.pot
\end_layout
\end_inset
コマンドを実行し、作成し直すか、他言語の既存のpoファイルをひな型として使用することができます
\end_layout
\begin_layout Itemize
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
xx.po
\end_layout
\end_inset
を編集します
\begin_inset Foot
status collapsed
\begin_layout Plain Layout
これは単なるテキストファイルなので、どのテキストエディタでも編集できます。しかし、
\family typewriter
Poedit
\family default
(全プラットフォーム用)や
\family typewriter
KBabel
\family default
KDE用のように、この目的の編集をサポートする特別なプログラムがあります。
\family typewriter
Emacs
\family default
にも
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
po
\end_layout
\end_inset
ファイルを編集するための「モード」があります。
\end_layout
\end_inset
。メニューラベルやウィジェットラベルのうちには、翻訳しなくてはならない短絡キーがある場合があります。これらのキーは「|」の後に記されており、当該言語の単語やフレ
ーズに対応して翻訳しなくてはなりません。さらに、新しい
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
po
\end_layout
\end_inset
ファイルの冒頭に、あなたの電子メールアドレスなどの情報も書き加えて、人々があなたに提案や、滑稽な怒りのメッセージを届けることができるようにしてください。
\end_layout
\begin_layout Standard
もし、あなたがこれを自身のためだけに行っているのであれば、
\end_layout
\begin_layout Itemize
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
xx.mo
\end_layout
\end_inset
を生成してください。これは
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
msgfmt -o xx.mo < xx.po
\end_layout
\end_inset
でできます。
\end_layout
\begin_layout Itemize
この
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
mo
\end_layout
\end_inset
ファイルを、お使いのロケールツリー中、言語xxのアプリケーションメッセージ用の正式なディレクトリにコピーして、
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
lyx.mo
\end_layout
\end_inset
という名称にしてください(例:
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
/usr/local/share/locale/xx/LC_MESSAGES/lyx.mo
\end_layout
\end_inset
)。
\end_layout
\begin_layout Standard
しかしながら前述のように、この新しい
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
po
\end_layout
\end_inset
ファイルを他の人たちが使用できるよう、LyX頒布版に追加できることが最善です。これを追加するには、LyXに変更を加える必要がありますので、もしその気があれば、開
発者メーリングリストに電子メールを送ってください。
\end_layout
\begin_layout Subsubsection
多義訳語メッセージ
\end_layout
\begin_layout Standard
時には、一つの英語のメッセージが、翻訳先の言語では複数のメッセージに翻訳されなくてはならないことが判明することがあります。一つの例は、
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
To
\end_layout
\end_inset
というメッセージで、これは英語で「to」がどういう意味を持っているかによって、独語ではNachと訳されたりBisと訳されたりします。GNU
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
gettext
\end_layout
\end_inset
は、このような多義訳語を
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
To
\end_layout
\end_inset
の代わりに、
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
To[[as in 'From format x to format y']]
\end_layout
\end_inset
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
To[[as in 'From page x to page y']]
\end_layout
\end_inset
としなくてはなりません。これによって、これら2つの
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
To
\end_layout
\end_inset
は、
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
gettext
\end_layout
\end_inset
には別物と解釈され、それぞれ正しくNachとBisに訳すことができるようになります。
\end_layout
\begin_layout Standard
もちろん、この文脈情報は、翻訳が存在しないときには取り去られる必要がありますので、メッセージの終わりに二重大括弧で囲わなくてはなりません上例参照。LyXの翻
訳機構では、メッセージの終わりに二重大括弧で囲われているものはすべて、メッセージを表示する前に取り去るようにされています。
\end_layout
\begin_layout Subsection
説明書を翻訳する
\end_layout
\begin_layout Standard
\begin_inset Flex MenuItem
status collapsed
\begin_layout Plain Layout
Help
\end_layout
\end_inset
メニュー中の)オンライン説明書は翻訳することができます(そして翻訳されるべきです!)。説明書の翻訳版が利用可能であり
\begin_inset Foot
status collapsed
\begin_layout Plain Layout
2008年3月現在、説明書の少なくとも一部が翻訳されている言語は14言語に上り、入門編が訳されているものはさらにいくつかあります。
\end_layout
\end_inset
、ロケールがその言語に設定されている場合、LyXはこれを自動的に使用します。LyXは、翻訳版を
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
L
\begin_inset ERT
status collapsed
\begin_layout Plain Layout
{}
\end_layout
\end_inset
yXDir/doc/xx/DocName.lyx
\end_layout
\end_inset
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
xx
\end_layout
\end_inset
は現在使用している言語コード)で探します。翻訳文書がない場合には、既定の英語版が表示されます。翻訳版は、原典と同じファイル名(上述の
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
DocName
\end_layout
\end_inset
)を持っていなくてはならないことに注意してください。説明書を翻訳する気がおありであれば(これは原典の校正としてもたいへん役立ちます!)、以下のような点をすぐに行
うべきです。
\end_layout
\begin_layout Itemize
説明書翻訳ウェブページ
\begin_inset CommandInset href
LatexCommand href
name "http://www.lyx.org/Translation"
target "http://www.lyx.org/Translation"
\end_inset
を確認してください。ここで、どの文書が(もしあれば)お使いの言語に既に翻訳されているかを見つけることができます。また、説明書をお使いの言語に翻訳する作業の面倒を
見ている人を(もしいれば)見つけることができます。この作業の面倒を見ている人がいない場合には、私たちにあなたが興味をお持ちであることを知らせてください。
\end_layout
\begin_layout Standard
いったん実際の翻訳の仕事に取りかかったならば、トラブルを回避するいくつかのヒントがあります。
\end_layout
\begin_layout Itemize
文書化チームに所属してください!そのための情報が
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
Intro.lyx
\end_layout
\end_inset
\begin_inset Flex MenuItem
status collapsed
\begin_layout Plain Layout
ヘルプ\SpecialChar \menuseparator
はじめの一歩
\end_layout
\end_inset
)にあります。また、この
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
Intro.lyx
\end_layout
\end_inset
が最初に訳すべき文書です。
\end_layout
\begin_layout Itemize
翻訳しようとする言語での印刷慣行を学んでください。活版印刷は古来の技術であり、何世紀にもわたって世界の至る所で、様々な慣行を発達させてきました。また、あなたの国
で活版工が用いる専門用語も学んでください。自分で勝手な専門用語を捻出するとユーザを混乱させるだけです。(
\emph on
警告!活版技術は病みつきになる可能性があるので注意してくさい!
\emph default
\end_layout
\begin_layout Itemize
文書のコピーをとってください。これを作業用コピーとします。これをお使いの
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
UserDir/doc/xx/
\end_layout
\end_inset
ディレクトリにコピーすれば、個人用の翻訳ヘルプファイルとして使用することができます。
\end_layout
\begin_layout Itemize
LyXチームが維持している原典の説明書は、時折更新されます。変更点については、
\begin_inset CommandInset href
LatexCommand href
name "http://www.lyx.org/trac/timeline"
target "http://www.lyx.org/trac/timeline"
\end_inset
のソースビューアでご覧ください。この方法で、翻訳文書のどの部分を更新しなくてはならないか、たやすく見つけることができます。
\end_layout
\begin_layout Standard
もし原典に誤りを見つけたならば、修正して文書化チームの他のメンバーに変更したことを知らせてください(文書化チームに参加することをお忘れになっていませんよね)。
\end_layout
\begin_layout Standard
\begin_inset Branch OutDated
status collapsed
\begin_layout Section
International Keyboard Support
\end_layout
\begin_layout Standard
\emph on
[Editor's Note: The following section is by
\emph default
\shape smallcaps
\emph on
Ivan Schreter
\shape default
.
It needs to be fixed to conform to the new Documentation Style sheet and
to make use of the new v1.0 features.
The whole thing also needs to be merged with the section following it.-jw
It may also be badly out of date.-rh (2008)]
\end_layout
\begin_layout Subsection
Defining Own Keymaps: Keymap File Format
\end_layout
\begin_layout Standard
Let's look at a keyboard definition file a little closer.
It is a plain text file defining
\end_layout
\begin_layout Itemize
key-to-key or key-to-string translations
\end_layout
\begin_layout Itemize
dead keys
\end_layout
\begin_layout Itemize
dead keys exceptions
\end_layout
\begin_layout Standard
To define key-to-key or key-to-string translation, use this command:
\end_layout
\begin_layout Quotation
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
\backslash
kmap
\end_layout
\end_inset
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
key
\end_layout
\end_inset
outstring
\end_layout
\begin_layout Standard
where
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
key
\end_layout
\end_inset
is the key to be translated and
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
outstring
\end_layout
\end_inset
is the string to be inserted into the document.
To define dead keys, use:
\end_layout
\begin_layout Quotation
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
\backslash
kmod
\end_layout
\end_inset
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
key
\end_layout
\end_inset
deadkey
\end_layout
\begin_layout Standard
where
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
key
\end_layout
\end_inset
is a keyboard key and
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
deadkey
\end_layout
\end_inset
is dead key name.
The following dead keys are supported (shortcut name is in parentheses):
\end_layout
\begin_layout Quotation
\emph on
Name
\begin_inset space \hfill{}
\end_inset
Example
\end_layout
\begin_layout Quotation
acute (acu)
\begin_inset space \hfill{}
\end_inset
\lang english
áéíóú
\end_layout
\begin_layout Quotation
grave (gra)
\begin_inset space \hfill{}
\end_inset
\lang english
àèìòù
\end_layout
\begin_layout Quotation
macron (mac)
\begin_inset space \hfill{}
\end_inset
\lang english
ō
\end_layout
\begin_layout Quotation
tilde (til)
\begin_inset space \hfill{}
\end_inset
\lang english
ñÑ
\end_layout
\begin_layout Quotation
underbar (underb)
\begin_inset space \hfill{}
\end_inset
\begin_inset ERT
status open
\begin_layout Plain Layout
\backslash
b o
\end_layout
\end_inset
\end_layout
\begin_layout Quotation
cedilla (ced)
\begin_inset space \hfill{}
\end_inset
\lang english
çÇ
\end_layout
\begin_layout Quotation
underdot (underd)
\begin_inset space \hfill{}
\end_inset
\begin_inset ERT
status open
\begin_layout Plain Layout
\backslash
d o
\end_layout
\end_inset
\end_layout
\begin_layout Quotation
circumflex (circu)
\begin_inset space \hfill{}
\end_inset
\lang english
âêîôû
\end_layout
\begin_layout Quotation
circle (circl)
\begin_inset space \hfill{}
\end_inset
\lang english
ÅůŮ
\end_layout
\begin_layout Quotation
tie (tie)
\begin_inset space \hfill{}
\end_inset
\begin_inset ERT
status open
\begin_layout Plain Layout
\backslash
t o
\end_layout
\end_inset
\end_layout
\begin_layout Quotation
breve (bre)
\begin_inset space \hfill{}
\end_inset
\lang english
ă
\lang japanese
\begin_inset ERT
status open
\begin_layout Plain Layout
\backslash
u o
\end_layout
\end_inset
\end_layout
\begin_layout Quotation
caron (car)
\begin_inset space \hfill{}
\end_inset
\lang english
čšž
\end_layout
\begin_layout Quotation
hungarian umlaut (hug)
\begin_inset space \hfill{}
\end_inset
\lang english
őű
\end_layout
\begin_layout Quotation
umlaut (uml)
\begin_inset space \hfill{}
\end_inset
\lang english
äöü
\end_layout
\begin_layout Quotation
dot (dot)
\begin_inset space \hfill{}
\end_inset
\lang english
ż
\lang japanese
\begin_inset ERT
status open
\begin_layout Plain Layout
\backslash
.s
\end_layout
\end_inset
\end_layout
\begin_layout Standard
Since in many international keyboards there are exceptions to what some
dead keys should do, you can define them using
\end_layout
\begin_layout Quotation
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
\backslash
kxmod
\end_layout
\end_inset
deadkey key outstring
\end_layout
\begin_layout Standard
For example, on Slovak keyboard, if you enter caron-o, it generates circumflex-o
, so you put in
\end_layout
\begin_layout Quotation
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
\backslash
kxmod
\end_layout
\end_inset
caron o "
\backslash
^o"
\end_layout
\begin_layout Standard
to make it work correctly.
Also, you have to define as exceptions dead keys over i and j, to remove
the dot from them before inserting an accent mark.
I will change this when the time comes, but so far I haven't had time.
\end_layout
\begin_layout Standard
Oh, and about characters: backslash is escaped, so to enter it, you'll need
double backslash.
Also, quotes and
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
#
\end_layout
\end_inset
have different meaning.
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
#
\end_layout
\end_inset
marks comments, quotes start and end LaTeX-style commands.
To enter quote, you'll need to use
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
\backslash
"
\end_layout
\end_inset
, to enter
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
#
\end_layout
\end_inset
, use
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
\backslash
#
\end_layout
\end_inset
.
\end_layout
\begin_layout Standard
If you make a keyboard description file that works for your language, please
mail it to me, so I can include it in the next keymap distribution.
\end_layout
\begin_layout Standard
More keywords will be supported in keymap configuration file in future,
like
\end_layout
\begin_layout Itemize
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
\backslash
kinclude filename
\end_layout
\end_inset
\emph on
\begin_inset space \hfill{}
\end_inset
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
include
\end_layout
\end_inset
another file
\end_layout
\begin_layout Itemize
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
\backslash
kprog program
\end_layout
\end_inset
\emph on
\begin_inset space \hfill{}
\end_inset
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
define
\end_layout
\end_inset
an external keymap translation program
\end_layout
\begin_layout Standard
Also, it should look into
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
lyxrc
\end_layout
\end_inset
file for defaults, too (for example, a
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
\backslash
kinclude
\end_layout
\end_inset
option to include default keyboard).
\end_layout
\end_inset
\end_layout
\begin_layout Section
国際キー配列
\begin_inset CommandInset label
LatexCommand label
name "sec:国際キー配列"
\end_inset
\end_layout
\begin_layout Standard
\begin_inset Note Note
status open
\begin_layout Plain Layout
2008年3月にこの文書を改訂するに当たって、改訂者が本節の内容に詳しくなかったために、本節は改訂されていません。他に改訂してくださる方がおられれば幸いです。
\end_layout
\begin_layout Plain Layout
(RH)
\end_layout
\end_inset
\end_layout
\begin_layout Standard
以下の2節では、
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
.kmap
\end_layout
\end_inset
および
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
.cdef
\end_layout
\end_inset
ファイルの文法を詳細に解説します。これらの節は、提供されているキー配列があなたのニーズに合わない場合に、自身用のキー配列をデザインする手助けとなるでしょう。
\end_layout
\begin_layout Subsection
.kmapファイル
\end_layout
\begin_layout Standard
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
.kmap
\end_layout
\end_inset
ファイルは、打鍵したものを文字や文字列に割り当てます。名前が示唆するように、これはキーボード配列表を定義します。
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
.kmap
\end_layout
\end_inset
ファイルは、以下の各項で説明するように、
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
kmap
\end_layout
\end_inset
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
kmod
\end_layout
\end_inset
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
ksmod
\end_layout
\end_inset
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
kcomb
\end_layout
\end_inset
のキーワードを定義します。
\end_layout
\begin_layout Labeling
\labelwidthstring 00.00.0000
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
kmap
\end_layout
\end_inset
文字を文字列に割り当てる
\end_layout
\begin_layout LyX-Code
\backslash
kmap
\family roman
\emph on
文字
\family default
\emph default
\family roman
\emph on
文字列
\end_layout
\begin_layout Standard
これは、
\emph on
文字
\emph default
\emph on
文字列
\emph default
に割り当てます。
\emph on
文字列
\emph default
中では、二重引用符(")とバックスラッシュ(
\backslash
)は、前にバックスラッシュ(
\backslash
)を付けてエスケープしなくてはならないことに注意してください。
\end_layout
\begin_layout Standard
\begin_inset Flex MenuItem
status collapsed
\begin_layout Plain Layout
&
\end_layout
\end_inset
を打鍵すると
\begin_inset Flex MenuItem
status collapsed
\begin_layout Plain Layout
/
\end_layout
\end_inset
記号が出力される
\begin_inset Flex MenuItem
status collapsed
\begin_layout Plain Layout
kmap
\end_layout
\end_inset
ステートメントを、一例としてあげると、
\end_layout
\begin_layout LyX-Code
\backslash
kmap & /
\end_layout
\begin_layout Standard
のようになります。
\end_layout
\begin_layout Labeling
\labelwidthstring 00.00.0000
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
kmod
\end_layout
\end_inset
アクセント文字を指定する
\end_layout
\begin_layout LyX-Code
\backslash
kmod
\family roman
\emph on
文字 アクセント 許可文字
\end_layout
\begin_layout Standard
これは
\emph on
文字
\emph default
\emph on
許可文字
\emph default
のアクセントとするものです。これはデッドキー
\begin_inset Foot
status collapsed
\begin_layout Plain Layout
\emph on
デッドキー
\emph default
という用語は、それ自身で文字を出力しないけれども、別のキーを続けて打つと、望んだアクセント文字を出力するキーのことを指し示します。たとえば、独語で
\emph on
ä
\emph default
のようなウムラウトのついた文字は、このようにして出すことができます。
\end_layout
\end_inset
機構です。
\end_layout
\begin_layout Standard
\emph on
文字
\emph default
を打鍵してから
\emph on
許可文字
\emph default
にないキーを打鍵すると、
\emph on
文字
\emph default
の後に許可文字ではないその文字が出力として表示されます。
\begin_inset Flex MenuItem
status collapsed
\begin_layout Plain Layout
Backspace
\end_layout
\end_inset
はデッドキーを取り消しますので、
\emph on
文字
\emph default
\begin_inset Flex MenuItem
status collapsed
\begin_layout Plain Layout
Backspace
\end_layout
\end_inset
と打鍵すると、カーソルは一文字戻ることなく、文字が次の打鍵したものに及ぼしたはずの効力を取り消します。
\end_layout
\begin_layout Standard
以下の例は、'文字をacuteアクセントとして、a・e・i・o・u・A・E・I・O・Uの文字に許可するものです。
\end_layout
\begin_layout LyX-Code
\backslash
kmod ' acute aeiouAEIOU
\end_layout
\begin_layout Labeling
\labelwidthstring 00.00.0000
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
ksmod
\end_layout
\end_inset
アクセント文字に例外を指定する
\end_layout
\begin_layout LyX-Code
\backslash
kxmod
\family roman
\emph on
アクセント 文字 結果
\end_layout
\begin_layout Standard
これは
\emph on
文字
\emph default
上の
\emph on
アクセント
\emph default
について例外を指定するものです。ここで
\emph on
アクセント
\emph default
には、前出の
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
\backslash
kmod
\end_layout
\end_inset
宣言で打鍵キーを既に割り当てられてなくてはならず、
\emph on
文字
\emph default
\emph on
アクセント
\emph default
\emph on
許可文字
\emph default
の集合に属していてはなりません。こうして
\emph on
アクセント
\emph default
\emph on
文字
\emph default
の順に入力すると、
\emph on
結果
\emph default
が出力されるようになります。
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
.kmap
\end_layout
\end_inset
ファイルにこの宣言がない場合には、
\emph on
アクセント
\emph default
\emph on
文字
\emph default
と入力すると、
\emph on
アクセントキー
\emph default
\emph on
文字
\emph default
\emph on
アクセントキー
\emph default
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
\backslash
kmod
\end_layout
\end_inset
宣言の最初の変数)と出力されます。
\end_layout
\begin_layout Standard
以下のコマンドを用いると、acute-i'iと入力した場合、äiと出力されるようになります。
\end_layout
\begin_layout LyX-Code
\backslash
kxmod acute i "
\backslash
\backslash
'{
\backslash
\backslash
i}"
\end_layout
\begin_layout Labeling
\labelwidthstring 00.00.0000
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
kcomb
\end_layout
\end_inset
2つのアクセント文字を結合する
\end_layout
\begin_layout LyX-Code
\backslash
kcomb
\family roman
\emph on
アクセント1 アクセント2 許可文字
\end_layout
\begin_layout Standard
これはなかなか難解になってきます。これは
\emph on
アクセント1
\emph default
\emph on
アクセント2
\emph default
を(この順番で)結びつけて、
\emph on
許可文字
\emph default
に効果を及ぼすようにします。
\emph on
アクセント1
\emph default
\emph on
アクセント2
\emph default
の打鍵キーは、ファイル内のこのコマンド
\emph on
よりも前に
\emph default
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
\backslash
kmod
\end_layout
\end_inset
コマンドで設定されていなくてはなりません。
\end_layout
\begin_layout Standard
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
greek.kmap
\end_layout
\end_inset
ファイル上にある例をとってみましょう。
\end_layout
\begin_layout LyX-Code
\backslash
kmod ; acute aeioyvhAEIOYVH
\backslash
kmod : umlaut iyIY
\backslash
kcomb acute umlaut iyIY
\end_layout
\begin_layout Standard
これは
\begin_inset Flex MenuItem
status collapsed
\begin_layout Plain Layout
;:i
\end_layout
\end_inset
を押すと
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
\backslash
'{
\backslash
"{i}}
\end_layout
\end_inset
という効果を得るようにするものです。この場合のバックスペースは、最後のデッドキーを取り消すので、
\begin_inset Flex MenuItem
status collapsed
\begin_layout Plain Layout
;: Backspace i
\end_layout
\end_inset
と押した場合には、
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
\backslash
'{i}
\end_layout
\end_inset
となります。
\end_layout
\begin_layout Subsection
.cdefファイル
\end_layout
\begin_layout Standard
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
.kmap
\end_layout
\end_inset
による割り当てが行われた後、
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
.cdef
\end_layout
\end_inset
ファイルは、記号の作り出す文字列を現在のフォントの文字に割り当てます。LyX頒布版には、現在のところ、少なくとも
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
iso8859-1.cdef
\end_layout
\end_inset
ファイルと
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
iso8859-2.cdef
\end_layout
\end_inset
ファイルが含まれています。
\end_layout
\begin_layout Standard
一般的に
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
.cdef
\end_layout
\end_inset
ファイルは、
\end_layout
\begin_layout LyX-Code
\family roman
\emph on
セット中の文字番号
\family default
\emph default
\family roman
\emph on
文字列
\end_layout
\begin_layout Standard
という形の宣言の羅列です。たとえば、
\begin_inset Flex MenuItem
status collapsed
\begin_layout Plain Layout
\backslash
'{e}
\end_layout
\end_inset
をiso-8859-1セットの対応する文字(233)に割り当てるには、以下の宣言を用います。
\end_layout
\begin_layout LyX-Code
233 "
\backslash
\backslash
'{e}"
\end_layout
\begin_layout Standard
ここで、
\emph on
文字列
\emph default
中の
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
\backslash
\end_layout
\end_inset
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
"
\end_layout
\end_inset
はエスケープされています。同一の文字を二つ以上の文字列に充てることができることに注意してください。
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
iso-8859-7.cdef
\end_layout
\end_inset
ファイルには、
\end_layout
\begin_layout LyX-Code
192 "
\backslash
\backslash
'{
\backslash
\backslash
\backslash
"{i}}"
\begin_inset Newline newline
\end_inset
192 "
\backslash
\backslash
\backslash
"{
\backslash
\backslash
'{i}}"
\end_layout
\begin_layout Standard
という例があります。LyXは、キー打鍵やデッドキーの組み合わせで生成される文字列の割り当てを見つけることができないとき、それがアクセント付き文字のように解釈がで
きないかどうかチェックして、画面上の文字にアクセントを引くことを試みます。
\end_layout
\begin_layout Subsection
デッドキー
\end_layout
\begin_layout Standard
国際文字のサポートを追加する第2の方法として、いわゆるデッドキーによる方法があります。デッドキーは文字と一緒に用いて、アクセント付き文字を生成します。ここではそ
の機能を説明するために、きわめて単純なデッドキーの作り方を説明します。
\end_layout
\begin_layout Standard
仮に、曲折アクセント記号「 ̂」が必要になったものとしましょう。この場合、自身の
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
lyxrc
\end_layout
\end_inset
ファイル中で、
\begin_inset Flex MenuItem
status collapsed
\begin_layout Plain Layout
^
\end_layout
\end_inset
キー(すなわち
\begin_inset Flex MenuItem
status collapsed
\begin_layout Plain Layout
Shift-6
\end_layout
\end_inset
キーを、LyXコマンドの
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
accent-circumflex
\end_layout
\end_inset
に結びつけることができます。すると
\begin_inset Flex MenuItem
status collapsed
\begin_layout Plain Layout
^
\end_layout
\end_inset
キーの後に文字を打ったときはいつでも、この文字上に曲折アクセントが付けられるようになります。たとえば「
\begin_inset Flex MenuItem
status collapsed
\begin_layout Plain Layout
^e
\end_layout
\end_inset
」という打鍵順は「ê」という文字を生成します。しかしながら、もし「
\begin_inset Flex MenuItem
status collapsed
\begin_layout Plain Layout
^t
\end_layout
\end_inset
」と打鍵したならば、「
\begin_inset Flex MenuItem
status collapsed
\begin_layout Plain Layout
t
\end_layout
\end_inset
」は曲折アクセントをとることは決してないために、LyXはビープを鳴らして文句を付けます。デッドキーの後に
\begin_inset Flex MenuItem
status collapsed
\begin_layout Plain Layout
スペース
\end_layout
\end_inset
を打つと、アクセントだけが生成されます。この最後の点に注意してください。あるキーをデッドキーに割り当てる場合には、このキー上の文字を別のキーに割り当て直す必要が
あります。たとえば、
\begin_inset Flex MenuItem
status collapsed
\begin_layout Plain Layout
,キー
\end_layout
\end_inset
をセディーユに割り当てるのはよくありません。コンマを入力しようとすると必ずセディーユが出てくるようになるためです。
\end_layout
\begin_layout Standard
デッドキーを割り当てるのによく用いられる方法は、
\begin_inset Flex MenuItem
status collapsed
\begin_layout Plain Layout
Meta-
\end_layout
\end_inset
\begin_inset Flex MenuItem
status collapsed
\begin_layout Plain Layout
Ctrl-
\end_layout
\end_inset
\begin_inset Flex MenuItem
status collapsed
\begin_layout Plain Layout
Shift-
\end_layout
\end_inset
キーを、「
\begin_inset Flex MenuItem
status collapsed
\begin_layout Plain Layout
~
\end_layout
\end_inset
」・「
\begin_inset Flex MenuItem
status collapsed
\begin_layout Plain Layout
,
\end_layout
\end_inset
」・「
\begin_inset Flex MenuItem
status collapsed
\begin_layout Plain Layout
^
\end_layout
\end_inset
」のようなアクセントと一緒に用いる方法です。また、
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
xmodmap
\end_layout
\end_inset
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
xkeycaps
\end_layout
\end_inset
を使って、特別な
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
Mode_Switch
\end_layout
\end_inset
キーを設定する方法もあります。
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
Mode_Switch
\end_layout
\end_inset
キーは、ちょうど
\begin_inset Flex MenuItem
status collapsed
\begin_layout Plain Layout
Shift
\end_layout
\end_inset
キーのように機能するので、アクセント文字を割り当てるのに使用できます。また、特定のキーを
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
usldead_cedilla
\end_layout
\end_inset
などに割り当てることで、これらのキーをデッドキーに仕立て、このシンボリックキーを対応するLyXコマンドに割り当てることもできます
\begin_inset Foot
status collapsed
\begin_layout Plain Layout
\noun on
John Weiss
\noun default
からの註:これはまさに私が、自分の
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
~/.lyx/lyxrc
\end_layout
\end_inset
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
~/.xmodmap
\end_layout
\end_inset
で行っていることです。私は、
\begin_inset Flex MenuItem
status collapsed
\begin_layout Plain Layout
Scroll
\begin_inset space ~
\end_inset
Lock
\end_layout
\end_inset
キーを
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
Mode_Shift
\end_layout
\end_inset
に仕立てて、多数の
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
usldead_*
\end_layout
\end_inset
シンボリックキーを
\begin_inset Flex MenuItem
status collapsed
\begin_layout Plain Layout
Scroll
\begin_inset space ~
\end_inset
Lock-^
\end_layout
\end_inset
\begin_inset Flex MenuItem
status collapsed
\begin_layout Plain Layout
Scroll
\begin_inset space ~
\end_inset
Lock-~
\end_layout
\end_inset
などに割り当てています。私はこの方法でアクセント文字を入力しています。
\end_layout
\end_inset
。この
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
Mode_Switch
\end_layout
\end_inset
キーには、
\begin_inset Flex MenuItem
status collapsed
\begin_layout Plain Layout
Ctrl-
\end_layout
\end_inset
キーの片方や使われていないファンクションキーなど、ほぼ何でも指定することができます。アクセントを生み出すLyXコマンドについては、
\emph on
LyX関数説明書
\emph default
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
LFUN_ACCENT_*
\end_layout
\end_inset
の項をご覧ください。ここには完備した一覧があります。
\end_layout
\begin_layout Subsection
自分の言語設定を保存する
\end_layout
\begin_layout Standard
\begin_inset Flex MenuItem
status collapsed
\begin_layout Plain Layout
ツール\SpecialChar \menuseparator
設定
\end_layout
\end_inset
ダイアログを使えば、LyXを起動したときに、ご希望の言語環境に自動的に設定されるように、設定を編集することができます。
\end_layout
\begin_layout Chapter
文書クラスやレイアウトやひな型を新規に導入する
\begin_inset CommandInset label
LatexCommand label
name "cha:新規文書を導入"
\end_inset
\begin_inset Argument
status collapsed
\begin_layout Plain Layout
文書クラスを新規に導入する
\end_layout
\end_inset
\end_layout
\begin_layout Standard
この章では、新しくLyXのレイアウトファイルやひな型ファイルを作成して、導入する手順を説明すると共に、新規にLaTeX文書クラスドキュメントクラスを正しく導
入する方法を復習します。
\end_layout
\begin_layout Standard
まず、LyXとLaTeXの間の関係をどのように考えるべきか、若干の注釈を加えておくことにしましょう。理解していただきたいことは、ある意味において、LyXは、La
TeXについて何も知らないと云うことです。実際のところ、LyXの観点からは、LaTeXは、LyXが出力を生成することができる、複数の「バックエンド書式」のうちの
一つに過ぎないということです。同種のバックエンド書式には、DocBook・平文・XHTMLがあります。もちろんLaTeXは、とくに重要な書式ですが、LyXがLa
TeXについて持っている情報のほとんどは、実はプログラム本体には含まれていないのです
\begin_inset Foot
status collapsed
\begin_layout Plain Layout
過度に複雑なため、LyXに「ハードコード化」されているコマンドもありますが、一般的に開発者は、これを「わるいこと」とみなしています。
\end_layout
\end_inset
。このような情報は、
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
article.cls
\end_layout
\end_inset
のような標準クラスでも、「レイアウトファイル」に保管されています。同様に、LyXは、DocBookやXHTMLについてもほとんど知りません。LyXが知っているこ
とは、レイアウトファイルの中にあります。
\end_layout
\begin_layout Standard
文書クラス用のレイアウトファイルは、LyX構成体---対応する様式や何らかの差込枠などを有する段落群---と、それに対応するLaTeX構成体・DocBook構成
体・XHTML構成体との間の翻訳指南書のようなものです。たとえば、LyXが
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
article.cls
\end_layout
\end_inset
について知っていることのほとんど総ては、
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
article.layout
\end_layout
\end_inset
と、それが呼び出す他の様々なファイルに書き込まれています。このことから、レイアウトファイルを書こうとする人は、既存のファイルを研究することを勧めます。とっかかり
としては、
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
article.layout
\end_layout
\end_inset
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
book.layout
\end_layout
\end_inset
や、文書クラス用の他のレイアウトファイルに取り込まれている
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
stdsections.inc
\end_layout
\end_inset
から見始めるのがよいでしょう。このファイルは、節などの定義が為されている場所です。
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
stdsections.inc
\end_layout
\end_inset
は、節様式や小節様式などとしてマークされている段落を、対応するLaTeX・DocBook・XHTMLのコマンドやタグにどのように翻訳すべきかをLyXに知らせるも
のです。基本的に
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
article.layout
\end_layout
\end_inset
ファイルは、これらの
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
std*.inc
\end_layout
\end_inset
ファイルを取り込んでいるだけのものです。
\end_layout
\begin_layout Standard
しかしながら、LyX--LaTeX間の対応を定義するだけが、レイアウトファイルが行うことではありません。レイアウトファイルが行うもう一つの仕事は、LyX構成体自
身が画面上にどのように表示されるべきかを定義することです。この2つの仕事は全く独立したものであるので、レイアウトファイルが2つの仕事を行うという事実は、しばしば
混乱を引き起こす元となります。ある段落様式をLaTeXに翻訳する仕方をLyXに指示することは、その表示の仕方をLyXに指示するものではありません。逆に、ある段落
様式の表示の仕方をLyXに指示することは、その段落様式をどのようにLaTeXに翻訳するかをLyXに指示するものではありませんましてやLaTeXに表示の仕方を指
示するものではありません。つまり、一般的に、新しいLyX構成体を定義する際には、(i)
\begin_inset space ~
\end_inset
LaTeXにどのように翻訳するかをLyXに指示する、(ii)
\begin_inset space ~
\end_inset
それをどのように表示するかをLyXに指示する、という、二つのかなり異なることを行わなくてはならないのです。
\end_layout
\begin_layout Standard
もちろん、LyXの他のバックエンド書式に関しても、ほぼ同じことが言えますが、XHTMLの場合には若干事情が異なり、LyXが、ブラウザ中での段落の表示方法をCS
Sの形で出力するにあたって、当該段落をLyXが画面上に出力する仕方の情報を、ある程度利用することができます。しかし、この場合でも、LyXが内部的に行うことと、
外部的に行う物事の間の区別は、依然として有効であり、この2つは独立して制御することができます。詳細に関しては、第
\begin_inset CommandInset ref
LatexCommand ref
reference "sec:XHTML出力のタグ"
\end_inset
節をご覧ください。
\end_layout
\begin_layout Section
新しいLaTeXファイルの導入
\end_layout
\begin_layout Standard
頒布版によっては、LyXで使いたいLaTeXパッケージやクラスファイルが含まれていないことがあるかもしれません。たとえば、オーバーヘッドプロジェクタ用のスライド
を準備するためのパッケージである、FoilTeXがないかもしれません。TeXLive2008年以降やMiKTeXのような最近のLaTeX頒布版には、これらの
パッケージを導入するためのユーザーインタフェースが用意されています。たとえば、MiKTeXでは、付属の「Package
\begin_inset space ~
\end_inset
Manager」プログラムを起動すると、利用できるパッケージの一覧を得ることができます。どれかを導入するには、その上で右クリックするかツールバーボタンを押してく
ださい。
\end_layout
\begin_layout Standard
お使いのLaTeX頒布版がこのような「パッケージマネジャー」を提供していなかったり、使用中の頒布版にそのパッケージが入っていない場合には、以下のステップに従って
手動で導入してください。
\end_layout
\begin_layout Enumerate
\begin_inset CommandInset href
LatexCommand href
name "CTAN"
target "http://www.ctan.org/"
\end_inset
などから欲しいパッケージを入手してください。
\end_layout
\begin_layout Enumerate
パッケージに「
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
.ins
\end_layout
\end_inset
」で終わるファイル名が入っている場合FoilTeXがその一例ですは、コンソールを開いて、このファイルのフォルダに移動し、コマンド
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
latex foiltex.ins
\end_layout
\end_inset
を実行してください。すると、パッケージが解凍されて、導入すべきすべてのファイルが展開されます。たいていのLaTeXパッケージは圧縮されていないので、このステップ
は飛ばすことができます。
\end_layout
\begin_layout Enumerate
ここで、パッケージを全ユーザーに使用可能にするか自分自身だけで使うかを決定する必要があります。
\end_layout
\begin_deeper
\begin_layout Enumerate
Linux・OSXなどの*nix系システムでは、システム上の全ユーザーに新パッケージを利用可能にしたければ、「ローカル」TeXツリーに導入し、そうでなければ
「ユーザー」TeXツリーに導入してください。これらのツリーが存在しない場合にどこに作成すればよいかは、お使いのシステムに依存します。これを見いだすには、
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
texmf.cnf
\end_layout
\end_inset
ファイルを参照してください
\begin_inset Foot
status collapsed
\begin_layout Plain Layout
このファイルは、通常
\family sans
$TEXMF/web2c
\family default
ディレクトリにありますが、コマンド
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
kpsewhich texmf.cnf
\end_layout
\end_inset
を実行してその場所を見つけることもできます。
\end_layout
\end_inset
。「ローカル」TeXツリーの場所は、
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
TEXMFLOCAL
\end_layout
\end_inset
変数で定義されており、通常は
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
/usr/local/share/texmf/
\end_layout
\end_inset
のような場所になっています。「ユーザー」TeXツリーの場所は、
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
TEXMFHOME
\end_layout
\end_inset
で定義されており、通常は
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
$HOME/texmf/
\end_layout
\end_inset
ですもしこれらの変数が事前定義されていなければ、定義しなくてはなりません。「ローカル」ツリーを作成したり変更したりするには、おそらくroot権限が必要ですが
、「ユーザー」ツリーにはこのような制限はありません。
\begin_inset Newline newline
\end_inset
一般的に、システムをアップグレードした際に、ユーザーが修正されたり上書きされたりということが起こらないので、ユーザーツリーに導入することが推奨されます。こうする
と、自分のホームディレクトリをバックアップする際に、パッケージも他のものと一緒にバックアップされます(もちろん通常行われるようにすればの話です)。
\end_layout
\begin_layout Enumerate
Windowでは、システム上の全ユーザーに新パッケージを利用可能にしたければ、LaTeXの導入されているフォルダに移動し、それからサブフォルダ
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
~
\backslash
tex
\backslash
latex
\end_layout
\end_inset
に移動しますMiKTeXでは、これは既定では
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
~:Programs
\backslash
MiKTeX
\backslash
tex
\backslash
latex
\end_layout
\end_inset
です)
\begin_inset Foot
status collapsed
\begin_layout Plain Layout
これは、英語版でのみ正しいパスになっています。独語版では
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
~:Programme
\backslash
MiKTeX
\backslash
tex
\backslash
latex
\end_layout
\end_inset
となり、他の言語でも同様です。
\end_layout
\end_inset
。ここに新規フォルダ
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
foiltex
\end_layout
\end_inset
を作成し、パッケージの全ファイルをそこにコピーしてください。パッケージを自分だけで使用したい場合や、admin権限を持っていない場合には、ローカルLaTeXフォ
ルダで同じことを行います。たとえばMiKTeX
\begin_inset space ~
\end_inset
2.8では、これはWinXP上では
\begin_inset Newline newline
\end_inset
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
~:
\backslash
Documents and Settings
\backslash
<ユーザー名>
\backslash
Application Data
\backslash
\end_layout
\end_inset
\begin_inset Newline newline
\end_inset
\begin_inset Phantom HPhantom
status open
\begin_layout Plain Layout
\family typewriter
~:
\backslash
\end_layout
\end_inset
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
MiKTeX
\backslash
2.8
\backslash
tex
\backslash
latex
\end_layout
\end_inset
\begin_inset Newline newline
\end_inset
フォルダ、WinVista上では
\begin_inset Newline newline
\end_inset
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
~:
\backslash
Users
\backslash
<ユーザー名>
\backslash
AppData
\backslash
Roaming
\backslash
2.8
\backslash
MiKTeX
\backslash
tex
\backslash
latex
\end_layout
\end_inset
\begin_inset Newline newline
\end_inset
フォルダになります。
\end_layout
\end_deeper
\begin_layout Enumerate
ここまで来れば、あとはLaTeXに新しいファイルがあることを告げるだけです。これは使用しているLaTeX頒布版に依存します。
\end_layout
\begin_deeper
\begin_layout Enumerate
TeXLiveの場合には、コンソールから
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
texhash
\end_layout
\end_inset
コマンドを実行してください。パッケージを全ユーザー用に導入した場合には、おそらくroot権限で行う必要があります。
\end_layout
\begin_layout Enumerate
MiKTeXでは、パッケージを全ユーザー用に導入した場合には、「Settings
\begin_inset space ~
\end_inset
(Admin)」を起動し、「Refresh FNDB」と記してあるボタンを押してください。そうでない場合には、「Settings」を起動して同様に行ってください
\end_layout
\end_deeper
\begin_layout Enumerate
最後に、LyXに新しいパッケージがあることを告げなくてはなりません。そこで、LyXからツール\SpecialChar \menuseparator
再初期設定メニューを実行して、LyXを再起動します。
\end_layout
\begin_layout Standard
これでパッケージが導入されました。この例では、文書クラス
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
Slides
\begin_inset space ~
\end_inset
(FoilTe
\begin_inset ERT
status collapsed
\begin_layout Plain Layout
{}
\end_layout
\end_inset
X)
\end_layout
\end_inset
\begin_inset Flex MenuItem
status collapsed
\begin_layout Plain Layout
文書\SpecialChar \menuseparator
設定\SpecialChar \menuseparator
文書クラス
\end_layout
\end_inset
で利用可能になっているはずです。
\end_layout
\begin_layout Standard
\begin_inset Flex MenuItem
status collapsed
\begin_layout Plain Layout
文書\SpecialChar \menuseparator
設定\SpecialChar \menuseparator
文書クラス
\end_layout
\end_inset
メニューに列挙されてもいないLaTeX文書クラスを使用したい場合には、その「レイアウト」ファイルを作り出さなくてはなりません。これが次節のトピックです。
\end_layout
\begin_layout Section
レイアウトファイルの型
\end_layout
\begin_layout Standard
この節は、レイアウト情報を含む各種LyXファイルについて述べます。これらのファイルは、各種段落様式や文字様式についての記述がされているものであり、LyXがそれら
をどのように表示すべきなのか、また、それらをどのようにLaTeXやDocBook、XHTMLその他の出力書式に翻訳すればよいのかが記されています。
\end_layout
\begin_layout Standard
ここでは、レイアウトファイル作成過程の包括的な解説を試みたいと思いますが、LaTeXクラスだけでもサポートする文書の種類があまりにたくさんあるので、読者が出会い
うるケースや問題をすべてカバーすることはとても望めません。LyXユーザーメーリングリストには、自身の経験を人々と分かち合いたいと望む、レイアウトデザインの経験豊
かな人々がよく顔を出していますので、気軽に質問を投げかけてみてください。
\end_layout
\begin_layout Standard
新しいレイアウトを準備するに当たっては、LyXと共に頒布されているレイアウトの例を見るのがたいへん役立ちます。他の人々も使用できるLaTeX文書クラス用のLyX
レイアウトを作ったり、他の人々にも有用なモジュールをお書きになった場合には、
\begin_inset CommandInset href
LatexCommand href
name "LyX Wikiのレイアウトに関する節"
target "http://wiki.lyx.org/Layouts/Layouts"
\end_inset
か、LyX開発者メーリングリストに投稿して、LyX頒布版に同梱することができるようにしてください
\begin_inset Foot
status collapsed
\begin_layout Plain Layout
LyXはGeneral Public Licenseの下でライセンスされていますので、LyXに寄贈されたものは総て同じライセンス下に置かれることに注意してくださ
い。
\end_layout
\end_inset
\end_layout
\begin_layout Subsection
レイアウトモジュール
\begin_inset CommandInset label
LatexCommand label
name "sub:レイアウトモジュール"
\end_inset
\end_layout
\begin_layout Standard
ここまで、「レイアウトファイル」についてお話してきました。しかし、レイアウト情報を含むものには、他の種類のファイルもあります。厳密にレイアウトファイルと呼ぶとき
、それは
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
.layout
\end_layout
\end_inset
拡張子を持ち、文書クラスに関する情報をLyXに提供するものを指します。しかしながら、LyX 1.6以降、レイアウト情報は、拡張子が
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
.module
\end_layout
\end_inset
のレイアウト
\emph on
モジュール
\emph default
にも含めることができます。レイアウトがLaTeXクラスに対応しているように、モジュールはLaTeXパッケージに対応するものであり、
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
endnotes
\end_layout
\end_inset
モジュールのように、特定のパッケージにサポートを提供するためのモジュールもあります。レイアウトモジュールは、特定の文書レイアウトに特化したものではなく、多くのレ
イアウトで使用できるという意味において、一面、
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
stdsections.inc
\end_layout
\end_inset
等のインクルードファイル
\begin_inset Foot
status collapsed
\begin_layout Plain Layout
これらは任意の拡張子をつけることができますが、慣習的に
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
.inc
\end_layout
\end_inset
拡張子が用いられます。
\end_layout
\end_inset
のようなものです。相異なる点といえば、
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
article.cls
\end_layout
\end_inset
でインクルードファイルを使用するには、そのファイルを編集しなくてはなりませんが、モジュールの場合は、
\begin_inset Flex MenuItem
status collapsed
\begin_layout Plain Layout
文書\SpecialChar \menuseparator
設定
\end_layout
\end_inset
ダイアログで選択するだけですみます。
\end_layout
\begin_layout Standard
モジュール作成は、新しく段落様式を一つ加えたり、任意設定差込枠を加えたりするだけで済むことも多いので、レイアウト編集を学ぶ上でもっとも易しい方法です。しかし原理
的には、レイアウトファイルに入れることのできるものはすべて入れることができます。
\end_layout
\begin_layout Standard
新しいモジュールを作成し、それを
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
layout/
\end_layout
\end_inset
フォルダにコピーした後、モジュールがメニューに現れるようにするためには、LyXの再設定を行って再起動しなくてはなりません。しかしながら、モジュールの修正の場合に
は、
\begin_inset Flex MenuItem
status collapsed
\begin_layout Plain Layout
文書\SpecialChar \menuseparator
設定
\end_layout
\end_inset
を開いてどれかを選択し「OK」を押せば、直ちに反映されます。
\emph on
これを実行する前に、作業中の文書を保存しておくことを強く勧めます
\emph default
。もっと言えば、
\emph on
実際の文書で作業しているときに、同時にモジュールの編集をしようとしないことを強く勧めます
\emph default
。もちろん開発陣は、そのような場合でもLyXが安定性を維持するように努力していますが、あなたが作成したモジュール中の文法エラー等によって、奇妙な挙動が引き起こさ
れることがあるからです。
\end_layout
\begin_layout Subsection
\begin_inset Flex MenuItem
status collapsed
\begin_layout Plain Layout
.sty
\end_layout
\end_inset
ファイル用のレイアウト
\end_layout
\begin_layout Standard
新しくLaTeX文書クラスをサポートしようとするとき、LaTeX2eクラス
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
.cls
\end_layout
\end_inset
)ファイルが絡む場合と、スタイル(
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
.sty
\end_layout
\end_inset
ファイルが絡む場合の2つの状況があり得ます。スタイルファイルのサポートは、通常は、かなり容易ですが、新しくクラスファイルをサポートすることは、もう少し難しくな
ります。この節では、前者について述べることとし、後者については次節に譲ります。当然のことながら、新しくDocBook DTDをサポートしたい場合にも、同様の所見
が当てはまります。
\end_layout
\begin_layout Standard
この易しい方の場合では、新しい文書クラスは、既にサポートされている文書クラスと共に使うスタイルファイルとして提供されています。例示のために、スタイルファイルは
\begin_inset Flex MenuItem
status collapsed
\begin_layout Plain Layout
myclass.sty
\end_layout
\end_inset
という名称で、標準的なクラスである
\begin_inset Flex MenuItem
status collapsed
\begin_layout Plain Layout
report.cls
\end_layout
\end_inset
と共に用いられるものと仮定しましょう。
\end_layout
\begin_layout Standard
既存の文書クラスのレイアウトファイルを、以下のように、お使いのローカルディレクトリにコピーすることから始めてください
\begin_inset Foot
status collapsed
\begin_layout Plain Layout
もちろん、どのディレクトリがローカルディレクトリとなるかは、プラットフォームに依存します。LyXでは、起動時に
\begin_inset Flex MenuItem
status collapsed
\begin_layout Plain Layout
-userdir
\end_layout
\end_inset
オプションを指定することによって、ローカルディレクトリを指定することも可能です。
\end_layout
\end_inset
\end_layout
\begin_layout LyX-Code
cp report.layout ~/.lyx/layouts/myclass.layout
\end_layout
\begin_layout Standard
それから、
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
myclass.layout
\end_layout
\end_inset
を編集して、
\end_layout
\begin_layout LyX-Code
\backslash
DeclareLaT
\begin_inset ERT
status collapsed
\begin_layout Plain Layout
{}
\end_layout
\end_inset
eXClass{report}
\end_layout
\begin_layout Standard
という行を
\end_layout
\begin_layout LyX-Code
\backslash
DeclareLaT
\bar under
\lang english
\begin_inset ERT
status collapsed
\begin_layout Plain Layout
{}
\end_layout
\end_inset
\bar default
\lang japanese
eXClass[report, myclass.sty]{report (myclass)}
\end_layout
\begin_layout Standard
のように変更してください。それから、ファイル冒頭辺りに
\end_layout
\begin_layout LyX-Code
Preamble
\begin_inset Newline newline
\end_inset
\backslash
usepackage{myclass}
\begin_inset Newline newline
\end_inset
EndPreamble
\end_layout
\begin_layout Standard
と書き加えてください。
\end_layout
\begin_layout Standard
LyXを起動して
\begin_inset Flex MenuItem
status collapsed
\begin_layout Plain Layout
ツール\SpecialChar \menuseparator
再設定
\end_layout
\end_inset
を選択してください。それからLyXを再起動し、新規文書を作成してみてください。すると、
\begin_inset Flex MenuItem
status collapsed
\begin_layout Plain Layout
文書\SpecialChar \menuseparator
設定
\end_layout
\end_inset
ダイアログの文書クラスオプションに「
\begin_inset Flex MenuItem
status collapsed
\begin_layout Plain Layout
report (myclass)
\end_layout
\end_inset
」が現れるはずです。新しいクラスにおいて、節区切り用コマンドなどの一部が、基礎となったクラス—この例では
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
report
\end_layout
\end_inset
—とは違う挙動をすることはよくありますので、希望に応じて、各節の設定をいじると良いでしょう。各節のレイアウト情報は、
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
stdsections.inc
\end_layout
\end_inset
に含まれていますが、このファイルをコピーしたり変更したりする必要はありません。代わりに、自身のレイアウトファイル中、
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
stdsections.inc
\end_layout
\end_inset
も取り込む
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
Input stdclass.inc
\end_layout
\end_inset
の後に変更を加えるだけです。たとえば、章見だしのフォントをサンセリフ体に変更するには、以下のような行を加えます。
\end_layout
\begin_layout LyX-Code
Style Chapter
\end_layout
\begin_layout LyX-Code
Font
\end_layout
\begin_layout LyX-Code
Family Sans
\end_layout
\begin_layout LyX-Code
EndFont
\end_layout
\begin_layout LyX-Code
End
\end_layout
\begin_layout Standard
これは、既存の章様式宣言を上書き(あるいはこの場合には追加)します。
\end_layout
\begin_layout Standard
新しいパッケージでは、基礎となったクラスには存在しないコマンドや環境を提供することもできます。この場合には、これらをレイアウトファイルに加えます。そのやり方につ
いては、第
\begin_inset CommandInset ref
LatexCommand ref
reference "sec:テキストクラス"
\end_inset
節の情報を参照してください。
\end_layout
\begin_layout Standard
もし
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
myclass.sty
\end_layout
\end_inset
が他の文書クラスで使用することができたり、あるいはできない場合でも、基礎となるクラスから読み込むことのできるモジュールを書くのが最も簡単であることがわかるでしょ
う。最も簡単なモジュールの例としては、以下のようなものになります。
\end_layout
\begin_layout LyX-Code
#
\backslash
DeclareLyXModule{My Package}
\end_layout
\begin_layout LyX-Code
#DescriptionBegin
\end_layout
\begin_layout LyX-Code
#Support for mypkg.sty.
\end_layout
\begin_layout LyX-Code
#DescriptionEnd
\begin_inset Newline newline
\end_inset
\end_layout
\begin_layout LyX-Code
Format 21
\begin_inset Newline newline
\end_inset
\end_layout
\begin_layout LyX-Code
Preamble
\begin_inset Newline newline
\end_inset
\backslash
usepackage{mypkg}
\begin_inset Newline newline
\end_inset
EndPreamble
\end_layout
\begin_layout Standard
もう少し複雑なモジュールでは、既存の構成物の挙動を修正したり、新しい構成物を定義したりすることになるでしょう。この辺りの議論については、第
\begin_inset CommandInset ref
LatexCommand ref
reference "sec:テキストクラス"
\end_inset
節を参照してください。
\end_layout
\begin_layout Subsection
\begin_inset Flex MenuItem
status collapsed
\begin_layout Plain Layout
.cls
\end_layout
\end_inset
ファイル用のレイアウト
\end_layout
\begin_layout Standard
これには2つのケースがありえます。ひとつは、クラスファイル自体が既存の文書クラスに立脚している場合です。たとえば、多くの学位論文用クラスは
\begin_inset Flex MenuItem
status collapsed
\begin_layout Plain Layout
book.cls
\end_layout
\end_inset
に基づいています。お使いのものがどうであるかを見るには、クラスファイル中に
\end_layout
\begin_layout LyX-Code
\backslash
LoadClass{book}
\end_layout
\begin_layout Standard
という行がないかどうか探してください。もしこれがあれば、
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
DeclareLaTeXClass
\end_layout
\end_inset
行は異なりますが、おおよそ前節のように進めることができます。あなたが新しく作るクラスが
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
thesis
\end_layout
\end_inset
であり、
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
book
\end_layout
\end_inset
クラスに基づいていれば、
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
DeclareLaTeXClass
\end_layout
\end_inset
行は以下のようにします
\begin_inset Foot
status collapsed
\begin_layout Plain Layout
さらにLyXは、文書クラス名がレイアウトファイル名と同じだと仮定するので、クラスファイルを
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
thesis.layout
\end_layout
\end_inset
という名前で保存するのが最も簡単です。
\end_layout
\end_inset
\end_layout
\begin_layout LyX-Code
\backslash
DeclareLaT
\begin_inset ERT
status collapsed
\begin_layout Plain Layout
{}
\end_layout
\end_inset
eXClass[thesis,book]{thesis}
\end_layout
\begin_layout Standard
他方、新しいクラスが既存のクラスに基づいていない場合には、おそらくあなた自身のレイアウトをしたためる必要があります。もし可能であれば、類似したLaTeXクラスを
使用している既存のレイアウトファイルをコピーして、それに修正を加えるようにすることを強くお勧めします。少なくとも、どの項目を考慮すべきかがわかるように、既存のフ
ァイルを作業の開始点としてください。
\end_layout
\begin_layout Subsection
ひな型を作成する
\begin_inset CommandInset label
LatexCommand label
name "sec:ひな型を作成する"
\end_inset
\end_layout
\begin_layout Standard
新しい文書クラス用のレイアウトファイルを書いたならば、そのレイアウト用のひな型も書くことを検討されるかもしれません。ひな型は、内容はダミーですが、レイアウトの使
い方を示す一種のチュートリアルとして動作します。もちろん、イメージを得るために、LyX添付のひな型をあれこれ見てみるのもよいでしょう。
\end_layout
\begin_layout Standard
ひな型は、通常の文書と同様、LyXを使って作成することができます。唯一違う点は、通常の文書では、フォント構成や用紙寸法を含め、すべてのあり得る設定が為されている
点です。これらの場合、通常ユーザーはひな型が彼の設定値を上書きすることを望みません。この理由から、ひな型の設計者は、
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
\backslash
fontscheme
\end_layout
\end_inset
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
\backslash
papersize
\end_layout
\end_inset
などの対応するコマンドをひな型LyXファイルから取り除く必要があります。これは、たとえば
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
vi
\end_layout
\end_inset
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
notepad
\end_layout
\end_inset
のような、どの軽いテキストエディタでも行うことができます。
\end_layout
\begin_layout Standard
編集したひな型を
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
UserDir/templates/
\end_layout
\end_inset
に置き、グローバルなひな型ディレクトリ
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
LyXDir/templates/
\end_layout
\end_inset
から使用したいものを同じ場所にコピーし、
\begin_inset Flex MenuItem
status collapsed
\begin_layout Plain Layout
ツール\SpecialChar \menuseparator
設定\SpecialChar \menuseparator
パス
\end_layout
\end_inset
ダイアログのひな型パスを再定義してください。
\end_layout
\begin_layout Standard
ところで、特別な意味を持つひな型
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
defaults.lyx
\end_layout
\end_inset
があることに注意してください。このひな型は、
\begin_inset Flex MenuItem
status collapsed
\begin_layout Plain Layout
ファイル\SpecialChar \menuseparator
新規
\end_layout
\end_inset
を使って新規文書を作成する際、便利な既定値を提供する目的で必ず読み込まれます。このひな型をLyX内部から作成するのにしなくてはならないことは、対応する設定を持つ
文書を開き、
\begin_inset Flex MenuItem
status collapsed
\begin_layout Plain Layout
文書既定値として保存
\end_layout
\end_inset
ボタンを押すことです。
\end_layout
\begin_layout Subsection
旧レイアウトファイルの更新
\end_layout
\begin_layout Standard
レイアウトファイルの書式は、LyXのリリース毎に変更されますので、古いレイアウトファイルは変換されなくてはなりません。この過程は、LyX第1.4版から自動化されま
した。LyXが古い書式のレイアウトファイルを読み込むと、LyXは、自動的に変換ツール
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
LyXDir/scripts/layout2layout.py
\end_layout
\end_inset
を呼び出し、それを現在の書式の一時ファイルに変換します。元のファイルは変更を加えられずに措かれます。もしこのレイアウトファイルをよく使うならば、LyXがこれを毎
回行なわくて済むように、レイアウトファイルを恒久的に変換しておきたいと思うかもしれません。これを行うには、以下のように変換子を手動で呼び出してください。
\end_layout
\begin_layout LyX-Code
mv myclass.layout myclass.old
\end_layout
\begin_layout LyX-Code
python LyXDir/scripts/layout2layout.py myclass.old myclassnew.layout
\end_layout
\begin_layout Standard
もちろん、
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
LyXDir
\end_layout
\end_inset
は、お使いのLyXシステムディレクトリ名に置き換えてください。
\end_layout
\begin_layout Standard
手動変換は、インクルードされているファイル内部の変更までは取り扱いませんので、それらのファイルは別に変換されなくてはなりません。
\end_layout
\begin_layout Section
\begin_inset CommandInset label
LatexCommand label
name "sec:テキストクラス"
\end_inset
レイアウトファイルの書式
\end_layout
\begin_layout Standard
以下の各節では、いよいよ自分の手を汚してレイアウトファイルを作成したり編集したりする段階になった際、直面することの説明を行います。私たちからのアドバイスとしては
、ゆっくりと進めるようにして、ちょっと進むごとに保存やテストを行い、心休まる音楽を聴き、好きな大人の飲み物を一二杯口にしながら行うのがいいでしょう。特に行き詰ま
ってしまったときにはそうです。実際にはそんなに難しいことではないのですが、特に一度に多くのことをやろうとすると、選択肢が多くありすぎて圧倒されてしまうのです。さ
て、もう一杯大人向け飲料をどうぞ。適量ね。
\end_layout
\begin_layout Standard
この章で述べられているタグは、すべて大文字小文字を区別しません。つまり、
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
Style
\end_layout
\end_inset
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
style
\end_layout
\end_inset
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
StYlE
\end_layout
\end_inset
は同じコマンドとなります。機能名の後にある角括弧は、その機能が取り得る値を示します。テキストクラス設定内で機能が特定されていない場合には、既定値は
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
\emph on
強調
\end_layout
\end_inset
で表記されます。引数が「文字列」や「浮動小数点型」などのデータ型をとる場合には、既定値は
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
浮動小数点型=
\emph on
既定値
\end_layout
\end_inset
のように表示されます。
\end_layout
\begin_layout Subsection
文書クラス宣言
\end_layout
\begin_layout Standard
レイアウトファイル中の
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
#
\end_layout
\end_inset
で始まる行はコメントです。この規則には一つだけ例外があります。すべての
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
*.layout
\end_layout
\end_inset
ファイルは、以下のような行で始めなくてはならないのです。
\end_layout
\begin_layout LyX-Code
\size small
#% Do not delete the line below; configure depends on this
\end_layout
\begin_layout LyX-Code
\size small
#
\backslash
DeclareLaT
\size default
\begin_inset ERT
status collapsed
\begin_layout Plain Layout
{}
\end_layout
\end_inset
\size small
eXClass{article}
\end_layout
\begin_layout Standard
この2行目は、LyXを初期設定や(再)設定するときに用いられるのです。このレイアウトファイルは、LaTeXスクリプト
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
chkconfig.ltx
\end_layout
\end_inset
が、
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
#
\end_layout
\end_inset
を無視する特別なモードで読み込みます。1行目は単なるLaTeXコメントですが、2行目にはテキストクラスの宣言が書かれています。これらの行が
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
article.layout
\end_layout
\end_inset
と名付けられたファイルにあると、
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
article
\end_layout
\end_inset
レイアウトファイル名という名称のテキストクラスを定義し、LaTeX文書クラス
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
article.cls
\end_layout
\end_inset
を使用するようになります既定ではレイアウトと同じ名称のものを使用します。上記に現れる「article」という文字列は、
\begin_inset Flex MenuItem
status collapsed
\begin_layout Plain Layout
文書\SpecialChar \menuseparator
設定
\end_layout
\end_inset
ダイアログのテキストクラスの説明に使用されます。
\end_layout
\begin_layout Standard
節見出し表示に変更を加えた、
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
article.cls
\end_layout
\end_inset
文書クラスを使用するテキストクラスを自分で書いたものとしましょう。これを
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
myarticle.layout
\end_layout
\end_inset
というファイルに置いたとすると、このファイルのヘッダは以下のようになります。
\end_layout
\begin_layout LyX-Code
\size small
#% Do not delete the line below; configure depends on this
\end_layout
\begin_layout LyX-Code
\size small
#
\backslash
DeclareLaT
\size default
\begin_inset ERT
status collapsed
\begin_layout Plain Layout
{}
\end_layout
\end_inset
\size small
eXClass[article]{article (with my own headings)}
\end_layout
\begin_layout Standard
これは、LaTeX文書クラス
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
article.cls
\end_layout
\end_inset
に関連づけられ、「article (with my own headings)」と表示される、
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
myarticle
\end_layout
\end_inset
テキストクラスを宣言するものです。もしこのテキストクラスが複数のパッケージに依存するならば、以下のように宣言すると良いでしょう。
\end_layout
\begin_layout LyX-Code
\size small
#% Do not delete the line below; configure depends on this
\end_layout
\begin_layout LyX-Code
\size small
#
\backslash
DeclareLaT
\size default
\begin_inset ERT
status collapsed
\begin_layout Plain Layout
{}
\end_layout
\end_inset
\size small
eXClass[article,foo.sty]{article (with my own headings)}
\end_layout
\begin_layout Standard
これは、このテキストクラスが
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
foo.sty
\end_layout
\end_inset
パッケージを使用することを示しています。最後に、DocBookコード向けのクラスを宣言することもできることを見ます。典型的な宣言は以下のようになります。
\end_layout
\begin_layout LyX-Code
\size small
#% Do not delete the line below; configure depends on this
\end_layout
\begin_layout LyX-Code
\size small
#
\backslash
DeclareDocBookClass[article]{SGML (DocBook article)}
\end_layout
\begin_layout Standard
これらの宣言には、文書クラス名を宣言する非必須パラメータ(ただしリストではない)を与えることができることに注意してください。
\end_layout
\begin_layout Standard
できる限り明示的に要約すると、レイアウト宣言は以下の形をとります。
\end_layout
\begin_layout LyX-Code
\size small
#
\backslash
DeclareLaT
\size default
\begin_inset ERT
status collapsed
\begin_layout Plain Layout
{}
\end_layout
\end_inset
\size small
eXClass[クラス,パッケージ名.sty]{レイアウトの説明}
\end_layout
\begin_layout Standard
ここで「クラス」は、LaTeXクラスファイル名とレイアウトファイル名が異なるときのみ、指定する必要があります。クラスファイル名が指定されなければ、LyXは単純に
、クラスファイル名がレイアウトファイル名と同じであると仮定します。
\end_layout
\begin_layout Standard
テキストクラスがあなたの嗜好に合うように修正できたならば、他にしなくてはならないことは、それを
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
L
\begin_inset ERT
status collapsed
\begin_layout Plain Layout
{}
\end_layout
\end_inset
yXDir/layouts/
\end_layout
\end_inset
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
UserDir/layouts
\end_layout
\end_inset
にコピーし、
\begin_inset Flex MenuItem
status collapsed
\begin_layout Plain Layout
ツール\SpecialChar \menuseparator
再初期設定
\end_layout
\end_inset
を実行し、LyXを終了して再起動するだけです。そうすれば、この新しいテキストクラスが、他のテキストクラスと同様に使用できるようになります。
\end_layout
\begin_layout Standard
レイアウトファイルが導入されたならば、これを編集して、再初期設定したりLyXを再起動したりすることなく、その変更を確認することができます
\begin_inset Foot
status collapsed
\begin_layout Plain Layout
第1.6版よりも前のLyXでは、これを行うことはできませんでした。その結果、レイアウトファイルに加えた変更を反映させるには、その度にLyXを再起動しなくてはならな
かったので、レイアウトファイルを編集する作業は、たいへん時間を浪費する作業だったのです。
\end_layout
\end_inset
。LyX関数
\begin_inset Flex MenuItem
status collapsed
\begin_layout Plain Layout
layout-reload
\end_layout
\end_inset
を使用すれば、現在使っているレイアウトの再読み込みを強制することができるのです。この関数への既定のキー割り当てはありません—もちろん自分でどれかのキーに割り当て
ることもできますが—。しかし、通常は、この関数を使用する場合は、これをミニバッファに入力します。
\end_layout
\begin_layout Standard
\emph on
注意
\emph default
\begin_inset Flex MenuItem
status collapsed
\begin_layout Plain Layout
layout-reload
\end_layout
\end_inset
はかなり「高度な機能」です。この機能を利用する前に、作業中の文書を保存しておくことを
\emph on
強く
\emph default
勧めます。もっと言えば、大事な文書の作業をしているときに、同時にレイアウト情報の編集をしようとしないことを
\emph on
強く
\emph default
勧めます。テスト用文書を使用してください。レイアウトファイル中の文法エラー等が奇妙な挙動を引き起こす可能性があります。特に、そのようなエラーが起こると、LyXは
現在のレイアウトが無効であるものと判断して、別のレイアウトに切り替えようとする可能性があります
\begin_inset Foot
status collapsed
\begin_layout Plain Layout
非常に悪質な文法エラーの場合には、LyXが終了してしまうことさえあります。これは、ある種のエラーでは、LyXがレイアウト情報を全く読めなくなる可能性があるからで
す。ご注意ください。
\end_layout
\end_inset
。LyX開発陣は、このような状況下でも安定性を保つよう努力していますが、後悔よりも安心の方が良いでしょう
\begin_inset Foot
status collapsed
\begin_layout Plain Layout
重ねての助言ですが、つねにバックアップを取ってください。それから、お母さんのお片づけに注意。
\end_layout
\end_inset
\end_layout
\begin_layout Subsection
モジュール宣言
\end_layout
\begin_layout Standard
モジュールは、以下のような行で始まらなくてはなりません。
\end_layout
\begin_layout LyX-Code
#
\backslash
DeclareL
\begin_inset ERT
status collapsed
\begin_layout Plain Layout
{}
\end_layout
\end_inset
yXModule[endnotes.sty]{Endnotes}
\end_layout
\begin_layout Standard
波括弧内に入っている必須引数はモジュール名で、これは
\begin_inset Flex MenuItem
status collapsed
\begin_layout Plain Layout
文書\SpecialChar \menuseparator
設定
\end_layout
\end_inset
内に表示されます。角括弧内の引数は非必須です。これは、モジュールが依存するLaTeXパッケージをすべて宣言します。角括弧の中には、LyXにとって既知のパッケージ
だけしか、列挙することはできないことに注意してください。
\begin_inset Foot
status collapsed
\begin_layout Plain Layout
既知のパッケージのリストは、ソースコード中でしか、ドキュメント化されていません。
\end_layout
\end_inset
LyXは、任意のパッケージをチェックすることはしません。また、非必須引数として、
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
変換元->変換先
\end_layout
\end_inset
の形を使用することができます。これは、
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
変換元
\end_layout
\end_inset
書式から
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
変換先
\end_layout
\end_inset
書式への変換鎖が存在するときのみ、このモジュールを使用できることを宣言するものです。
\end_layout
\begin_layout Standard
それから、以下のようなモジュール宣言を行います。
\end_layout
\begin_layout LyX-Code
#DescriptionBegin
\end_layout
\begin_layout LyX-Code
#Adds an endnote command, in addition to footnotes.
\end_layout
\begin_layout LyX-Code
#You will need to add
\backslash
theendnotes in T
\begin_inset ERT
status collapsed
\begin_layout Plain Layout
{}
\end_layout
\end_inset
eX code where you
\end_layout
\begin_layout LyX-Code
#want the endnotes to appear.
\end_layout
\begin_layout LyX-Code
#DescriptionEnd
\end_layout
\begin_layout LyX-Code
#Requires: somemodule | othermodule
\end_layout
\begin_layout LyX-Code
#Excludes: badmodule
\end_layout
\begin_layout Standard
ここで説明Descriptionは、
\begin_inset Flex MenuItem
status collapsed
\begin_layout Plain Layout
文書\SpecialChar \menuseparator
設定
\end_layout
\end_inset
でこのモジュールが何をするものか、ユーザに情報を与えるために使用されます。
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
Requires
\end_layout
\end_inset
行は、このモジュールが共に使用する必要がある、他のモジュールを特定するのに用いられます。一方、
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
Excludes
\end_layout
\end_inset
行は、このモジュールが共に使用してはならない、他のモジュールを特定するのに用いられます。この2つの行は必須ではなく、上記のようにモジュールが複数ある場合には、パ
イプ記号「|」で区切らなくてはなりません。
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
Requires
\end_layout
\end_inset
に指定されたモジュールは、選言的に取り扱われることに注意してください。つまり、
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
Requires
\end_layout
\end_inset
に指定されたモジュールのうち、
\emph on
少なくとも一つ
\emph default
が使用されていればよいということです。同様に、
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
Excludes
\end_layout
\end_inset
に指定されたモジュールは、一つも使用されてはなりません。ここでモジュールは、
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
.module
\end_layout
\end_inset
拡張子を除いた
\emph on
ファイル名
\emph default
で認識されることに注意してください。つまり
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
somemodule
\end_layout
\end_inset
とは、実のところ
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
somemodule.module
\end_layout
\end_inset
のことです。
\end_layout
\begin_layout Subsection
ファイル書式
\end_layout
\begin_layout Standard
レイアウトファイルやインクルードされたファイル、またはモジュールの最初の非コメント行には、以下のように、かならずファイル書式番号が記されていなくてはなりません。
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
Format
\end_layout
\end_inset
[
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
整数型
\end_layout
\end_inset
] このレイアウトファイルの書式
\end_layout
\begin_layout Standard
このタグはLyX 1.4.0で導入されました。LyX 1.3.x以前のレイアウトファイルには、明示されたファイル書式がないため、書式1と解されます。LyX現行版のファイ
ル書式は、書式21です。しかし、LyXの各版は、旧版のLyXで作成されたファイルを読むことができるように、旧版のレイアウトファイルも読むことができます。しかしな
がら、以前の書式に変換する方法はありません。したがって、LyX 1.6.xは、書式11以前のファイルのみを読むことができますが、書式21は読むことができません。
\end_layout
\begin_layout Subsection
\begin_inset CommandInset label
LatexCommand label
name "sub:汎用テキストクラスパラメータ"
\end_inset
汎用テキストクラスパラメータ
\end_layout
\begin_layout Standard
以下は、文書クラス全体の挙動を決定する汎用パラメータです(これは、
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
.layout
\end_layout
\end_inset
ファイルのみに使用されるべきで、モジュールでは使ってはならない、ということを意味するものでは
\emph on
ありません
\emph default
。モジュールには、すべてのレイアウトタグを使用することができます)。
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
AddToHTMLPreamble
\end_layout
\end_inset
この文書クラスがXHTMLに出力されるときに、
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
<head>
\end_layout
\end_inset
ブロックに追加出力される情報です。典型的には、これはCSSスタイル情報を出力するのに用いられますが、
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
<head>
\end_layout
\end_inset
に出力するものであれば、何でも使用することができます。「
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
EndPreamble
\end_layout
\end_inset
」で閉じる必要があります。
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
AddToPreamble
\end_layout
\end_inset
文書プリアンブルに書き加えられる情報です。「
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
EndPreamble
\end_layout
\end_inset
」で閉じる必要があります。
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
CiteFormat
\end_layout
\end_inset
書誌情報の表示に使う書式を定義します。詳細については、第
\begin_inset CommandInset ref
LatexCommand ref
reference "sub:引用書式指定"
\end_inset
節をご覧ください。「
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
End
\end_layout
\end_inset
」で閉じる必要があります。
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
ClassOptions
\end_layout
\end_inset
文書クラスがサポートする様々な大域オプションを記します。説明は、第
\begin_inset CommandInset ref
LatexCommand ref
reference "sub:ClassOptions"
\end_inset
節を参照してください。「
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
End
\end_layout
\end_inset
」で閉じる必要があります。
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
Columns
\end_layout
\end_inset
[
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
\emph on
1
\end_layout
\end_inset
,
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
2
\end_layout
\end_inset
] 文書クラスが既定で1段組か2段組かを指定します。
\begin_inset Flex MenuItem
status collapsed
\begin_layout Plain Layout
文書\SpecialChar \menuseparator
設定
\end_layout
\end_inset
ダイアログで変更することができます。
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
Counter
\end_layout
\end_inset
[
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
文字列
\end_layout
\end_inset
] この部分はカウンタの特性を定義します。カウンタがまだ存在していなければ、生成されます。もし存在しなければ修正されます。「
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
End
\end_layout
\end_inset
」で閉じる必要があります。
\begin_inset Newline newline
\end_inset
カウンタについての詳細は、第
\begin_inset CommandInset ref
LatexCommand ref
reference "sub:カウンタ"
\end_inset
節を参照してください。
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
DefaultFont
\end_layout
\end_inset
文書を表示するのに用いられる既定フォントを設定します。フォントの宣言の仕方については、第
\begin_inset CommandInset ref
LatexCommand ref
reference "sub:フォント指定"
\end_inset
節を参照してください。「
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
EndFont
\end_layout
\end_inset
」で閉じる必要があります。
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
DefaultModule
\end_layout
\end_inset
[
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
文字列
\end_layout
\end_inset
] この文書クラスに、既定で取り込むモジュールを指定します。モジュールは、
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
.module
\end_layout
\end_inset
拡張子を除いたファイル名で指定します。ユーザはこのモジュールを除外することができますが、当初は有効の状態になっています(これは新しいファイルが作成されたときや、
既存の文書にこの文書クラスが選択したときのみ該当します)。
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
DefaultStyle
\end_layout
\end_inset
[
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
文字列
\end_layout
\end_inset
] これは新規段落に割り当てられる様式であり、通常は
\begin_inset Flex MenuItem
status collapsed
\begin_layout Plain Layout
標準
\end_layout
\end_inset
です。もしこれを指定しなければ、最初に定義される様式がこれに割り当てられるようにはなっていますが、このディレクティブを使用することが推奨されます。
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
ExcludesModule
\end_layout
\end_inset
[
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
文字列
\end_layout
\end_inset
] このタグは、指定されたモジュール—
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
.module
\end_layout
\end_inset
拡張子を除いたファイル名で指定します—が、この文書クラスでは使用できないように設定します。これはたとえば、特定の学術誌用レイアウトファイルの中で、定理番号を節毎
に振る
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
theorems-sec
\end_layout
\end_inset
モジュールが使用されるのを防ぐために用いたりすることができます。このタグは、モジュール内で
\emph on
使用してはいけません
\emph default
。モジュールは、他のモジュールを排除する独自の枠組みがあります(第
\begin_inset CommandInset ref
LatexCommand ref
reference "sub:レイアウトモジュール"
\end_inset
節参照)。
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
Float
\end_layout
\end_inset
フロートを新規に定義します。詳細は、第
\begin_inset CommandInset ref
LatexCommand ref
reference "sub:フロート"
\end_inset
節を参照してください。「
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
End
\end_layout
\end_inset
」で閉じる必要があります。
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
HTMLPreamble
\end_layout
\end_inset
この文書クラスがXHTMLに出力されるときに、
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
<head>
\end_layout
\end_inset
ブロックに出力される情報です。これより前に出現した
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
HTMLPreamble
\end_layout
\end_inset
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
AddToHTMLPreamble
\end_layout
\end_inset
宣言は、すべて完全に上書きされることに注意してください。(プリアンブルに何かを追加したい時には、
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
AddToHTMLPreamble
\end_layout
\end_inset
を使用してください。)「
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
EndPreamble
\end_layout
\end_inset
」で閉じる必要があります。
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
HTMLTOCSection
\end_layout
\end_inset
[
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
文字列
\end_layout
\end_inset
] 文書がHTMLに出力されるときに、目次や書誌情報などに使用されるレイアウトです。articleの場合には、これは通常「節」であり、bookの場合は「章」です
。これを指定しない場合には、LyXはどのレイアウトを使用するべきか、解析しようと試みます。
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
IfCounter
\end_layout
\end_inset
[
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
文字列
\end_layout
\end_inset
] 与えられたカウンタの特性を修正します。カウンタが存在しない場合には、この節は無視されます。「
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
End
\end_layout
\end_inset
」で閉じる必要があります。
\begin_inset Newline newline
\end_inset
カウンタについての詳細は、第
\begin_inset CommandInset ref
LatexCommand ref
reference "sub:カウンタ"
\end_inset
節をご覧ください。
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
IfStyle
\end_layout
\end_inset
[
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
文字列
\end_layout
\end_inset
] 与えられた段落様式の特性を修正します。様式が存在しない場合には、この節は無視されます。「
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
End
\end_layout
\end_inset
」で閉じる必要があります。
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
Input
\end_layout
\end_inset
名称の指し示すように、このコマンドは、同じコマンドを何度も指定せずに済むように、別のレイアウト定義ファイルを取り込ませます。よく使われる例は、基本的なレイアウ
トのほとんどを収録している
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
stdclass.inc
\end_layout
\end_inset
のような標準レイアウトファイルです。
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
InsetLayout
\end_layout
\end_inset
このセクションは、差込枠のレイアウトを定義(再定義)します。これは、既存の差込枠にも、新しい文字様式のような新規のユーザ定義差込枠にも使用することができます。
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
End
\end_layout
\end_inset
」で閉じる必要があります。
\begin_inset Newline newline
\end_inset
詳しい情報は、第
\begin_inset CommandInset ref
LatexCommand ref
reference "sub:任意設定差込枠"
\end_inset
節をご覧ください。
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
LeftMargin
\end_layout
\end_inset
画面上の左余白の幅を指示する文字列。例「MMMMM」。これは、「2ex」のような「長さ」ではないことに注意してください。
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
NoFloat
\end_layout
\end_inset
このコマンドは既存のフロートを削除します。これは特に、Inputで取り込んだファイルに定義されていたフロートを抑制するのに便利です。
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
NoStyle
\end_layout
\end_inset
このコマンドは既存の様式を削除します。これは特に、Inputで取り込んだファイルに定義されていた様式を抑制するのに便利です。
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
OutputFormat
\end_layout
\end_inset
このクラスによって生成されるファイル書式を示す文字列(
\family sans
設定
\family default
ダイアログで定義される形のもの)。おもに、
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
OutputType
\end_layout
\end_inset
が「literate」になっていて、新しい型のliterate文書を定義したい時に便利です。対応する
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
OutputType
\end_layout
\end_inset
パラメーターに遭遇したときには、この文字列は、「docbook」・「latex」・「literate」のいずれかにリセットされます。
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
OutputType
\end_layout
\end_inset
このクラスを使用する文書がどのような種類の出力をするかを示す文字列。現在のところ、取り得る値は「docbook」・「latex」・「literate」です。
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
PageStyle
\end_layout
\end_inset
[
\emph on
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
plain
\end_layout
\end_inset
\emph default
,
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
empty
\end_layout
\end_inset
,
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
headings
\end_layout
\end_inset
] 既定ページ様式。
\begin_inset Flex MenuItem
status collapsed
\begin_layout Plain Layout
文書\SpecialChar \menuseparator
設定
\end_layout
\end_inset
ダイアログで変更することができます。
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
Preamble
\end_layout
\end_inset
LaTeX文書のプリアンブルを設定します。前に行った
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
Preamble
\end_layout
\end_inset
宣言や
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
AddToPreamble
\end_layout
\end_inset
宣言は、すべて上書きされてしまうので注意してください。(プリアンブルに何かを追加したい時には、
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
AddToPreamble
\end_layout
\end_inset
を使用してください。)「
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
EndPreamble
\end_layout
\end_inset
」で閉じる必要があります。
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
Provides
\end_layout
\end_inset
[
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
文字列
\end_layout
\end_inset
] [
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
\emph on
0
\end_layout
\end_inset
,
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
1
\end_layout
\end_inset
] このクラスが
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
文字列
\end_layout
\end_inset
で示される機能を既に提供しているかどうかを示します。機能は、一般的にパッケージ名(
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
amsmath
\end_layout
\end_inset
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
makeidx
\end_layout
\end_inset
・\SpecialChar \ldots{}
)やマクロ名(
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
url
\end_layout
\end_inset
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
boldsymbol
\end_layout
\end_inset
・\SpecialChar \ldots{}
です。サポートされている機能の全覧は、LyXソースコード以外には残念ながら文書化されていませんが、興味があれば
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
LaTeXFeatures.cpp
\end_layout
\end_inset
をご覧ください。
\begin_inset Flex MenuItem
status collapsed
\begin_layout Plain Layout
ヘルプ\SpecialChar \menuseparator
LaTeXの設定
\end_layout
\end_inset
もサポートされているパッケージの概要を提供します。
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
ProvidesModule
\end_layout
\end_inset
[
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
文字列
\end_layout
\end_inset
] このレイアウトが
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
文字列
\end_layout
\end_inset
で表されているモジュールの機能を提供することを示し、
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
.module
\end_layout
\end_inset
拡張子を除いたファイル名で指定します。
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
DefaultModule
\end_layout
\end_inset
タグを使用すると、モジュールを使用しなくてはならないことを示しますが、このタグは主に、このレイアウトがモジュールを直接取り込んでしまっていることを示すのに用いら
れます。同じ機能を別に実装しているモジュール中で使用するなどすることもできます。
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
Requires
\end_layout
\end_inset
[
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
文字列
\end_layout
\end_inset
] このクラスが
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
文字列
\end_layout
\end_inset
で表されている機能を要求することを示します。機能が複数ある場合には、コンマで区切らなくてはなりません。サポートされている機能以外は要求できないことに注意してくだ
さい。(機能一覧については、これも
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
LaTeXFeatures.cpp
\end_layout
\end_inset
をご覧ください。)
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
RightMargin
\end_layout
\end_inset
画面上の右余白の幅を指示する文字列。例「MMMMM」。
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
SecNumDepth
\end_layout
\end_inset
どの節区切りまで連番を振るかを指定します。LaTeXにおける
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
secnumdepth
\end_layout
\end_inset
カウンタに対応します。
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
Sides
\end_layout
\end_inset
[
\emph on
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
1
\end_layout
\end_inset
\emph default
,
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
2
\end_layout
\end_inset
] クラスの既定値として、用紙の片面に印字するか両面に印字するかを指定します。
\begin_inset Flex MenuItem
status collapsed
\begin_layout Plain Layout
文書\SpecialChar \menuseparator
設定
\end_layout
\end_inset
ダイアログで変更することができます。
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
Style
\end_layout
\end_inset
この部分は段落様式を定義します。様式がまだ存在していなければ、生成されます。既に存在していれば、そのパラメータが修正されます。「
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
End
\end_layout
\end_inset
」で閉じる必要があります。
\begin_inset Newline newline
\end_inset
段落様式に関する詳細は、第
\begin_inset CommandInset ref
LatexCommand ref
reference "sub:段落様式-XHTML"
\end_inset
節をご覧ください。
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
TitleLatexName
\end_layout
\end_inset
[
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
文字列="maketitle"
\end_layout
\end_inset
]
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
TitleLatexType
\end_layout
\end_inset
で使用すべきコマンド名あるいは環境名。The name of the command or environment to be used with
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
TitleLatexType
\end_layout
\end_inset
.
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
TitleLatexType
\end_layout
\end_inset
[
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
\emph on
CommandAfter
\end_layout
\end_inset
,
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
Environment
\end_layout
\end_inset
] 文書のタイトルを定義するのに、どのようなマークアップを使用するのかを示します。
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
CommandAfter
\end_layout
\end_inset
は、「
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
InTitle 1
\end_layout
\end_inset
」が指定されている最後のレイアウトの後に、
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
TitleLatexName
\end_layout
\end_inset
で指定したマクロ名を挿入することを意味します。
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
Environment
\end_layout
\end_inset
は、「
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
InTitle 1
\end_layout
\end_inset
」を持つ段落群を
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
TitleLatexName
\end_layout
\end_inset
で指定した環境でくるむ場合に対応します。
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
TocDepth
\end_layout
\end_inset
どの節区切りまで目次に取り込むかを指定します。LaTeXの
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
tocdepth
\end_layout
\end_inset
カウンタに対応します。
\end_layout
\begin_layout Subsection
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
ClassOptions
\end_layout
\end_inset
\begin_inset CommandInset label
LatexCommand label
name "sub:ClassOptions"
\end_inset
\end_layout
\begin_layout Standard
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
ClassOptions
\end_layout
\end_inset
部は、以下の項目を取り得ます。
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
FontSize
\end_layout
\end_inset
[
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
文字列="10|11|12"
\end_layout
\end_inset
] 文書のメインフォントが使用できるフォント寸法の一覧です。「
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
|
\end_layout
\end_inset
」で区切ります。
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
Header
\end_layout
\end_inset
XMLベースの出力クラスで、DTD行を設定するのに使用されます。例PUBLIC
\begin_inset Quotes eld
\end_inset
-//OASIS//DTD DocBook V4.2//EN
\begin_inset Quotes erd
\end_inset
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
PageStyle
\end_layout
\end_inset
[
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
文字列="empty|plain|headings|fancy"
\end_layout
\end_inset
] 使用できるページ様式の一覧です。「
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
|
\end_layout
\end_inset
」で区切ります。
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
Other
\end_layout
\end_inset
[
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
文字列=""
\end_layout
\end_inset
]
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
\backslash
documentclass
\end_layout
\end_inset
コマンドの非必須パラメータとして付け加える文書クラスオプションです。コンマで区切ります。
\end_layout
\begin_layout Standard
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
ClassOptions
\end_layout
\end_inset
部は「
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
End
\end_layout
\end_inset
」で閉じる必要があります。
\end_layout
\begin_layout Subsection
段落様式
\begin_inset CommandInset label
LatexCommand label
name "sub:段落様式"
\end_inset
\end_layout
\begin_layout Standard
段落様式の記述は、以下のようになります
\begin_inset Foot
status collapsed
\begin_layout Plain Layout
これは新しいレイアウトを定義するか、既存のレイアウトを修正することになることに注意してください。
\end_layout
\end_inset
\end_layout
\begin_layout LyX-Code
Style
\family roman
\emph on
名称
\end_layout
\begin_layout LyX-Code
...
\end_layout
\begin_layout LyX-Code
End
\end_layout
\begin_layout Standard
ここでは、以下のコマンドを使用することができます。
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
Align
\end_layout
\end_inset
[
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
\emph on
block
\emph default
, left, right, center
\end_layout
\end_inset
] 段落の揃え。
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
AlignPossible
\end_layout
\end_inset
[
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
\emph on
block
\emph default
, left, right, center
\end_layout
\end_inset
] 使用できる揃えのコンマ区切りリストLaTeXスタイルには、意味を成さない一部の揃えが禁じられているものがあります。たとえば、連番箇条書きを右揃えや中央揃え
にすることはできません)。
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
BabelPreamble
\end_layout
\end_inset
これは、前に現れたこの様式の
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
BabelPreamble
\end_layout
\end_inset
宣言をすべて、完全に上書きしますので注意してください。「
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
EndBabelPreamble
\end_layout
\end_inset
」で閉じる必要があります。これの利用法についての詳細は、第
\begin_inset CommandInset ref
LatexCommand ref
reference "sub:段落様式の国際化"
\end_inset
節をご覧ください。
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
BottomSep
\end_layout
\end_inset
[
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
浮動小数点型=0
\end_layout
\end_inset
]
\begin_inset Foot
status collapsed
\begin_layout Plain Layout
ここで「浮動小数点型」とは1.5のような実数を指します。
\end_layout
\end_inset
このレイアウト型の段落塊の最後の段落と、次の段落とを分離する垂直空白。次の段落が別のレイアウト型である場合、分離幅は足し上げられるのではなく、最大値がとられま
す。
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
Category
\end_layout
\end_inset
[
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
文字列
\end_layout
\end_inset
] この様式のカテゴリです。これは、ツールバーのレイアウト・コンボボックスで関連した様式をグループ化するのに用いられます。任意の文字列を使用することができますが
、作成した様式に既存のカテゴリを使用したいと思うことが多いでしょう。
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
CommandDepth
\end_layout
\end_inset
XMLコマンドの深度。XML型の書式でのみ使用されます。
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
CopyStyle
\end_layout
\end_inset
\begin_inset CommandInset label
LatexCommand label
name "des:CopyStyle"
\end_inset
[
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
文字列
\end_layout
\end_inset
] 既存の様式から、すべての機能を現在の様式にコピーします。
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
DependsOn
\end_layout
\end_inset
この
\emph on
前に
\emph default
プリアンブルを出力させる様式名。マクロ定義がお互いに依存関係にある場合に、プリアンブルの断片の順序を確実にするためのものです
\begin_inset Foot
status collapsed
\begin_layout Plain Layout
この機能以外には、プリアンブルの順序を確定する方法はないことに注意してください。LyXの特定のバージョンで観察された順序は、将来のバージョンで警告なしに変わる可
能性があります。
\end_layout
\end_inset
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
EndLabeltype
\end_layout
\end_inset
[
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
\emph on
No_Label
\emph default
, Box, Filled_Box, Static
\end_layout
\end_inset
] 段落の最後(あるいは
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
LatexType
\end_layout
\end_inset
が、
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
Environment
\end_layout
\end_inset
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
Item_Environment
\end_layout
\end_inset
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
List_Environment
\end_layout
\end_inset
のいずれかの場合は、段落群の最後)に置くラベル。
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
No_Label
\end_layout
\end_inset
の場合は「何もない」ことを指し、
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
Box
\end_layout
\end_inset
(あるいは
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
Filled_Box
\end_layout
\end_inset
)の場合は、証明終了マーカ用の白い箱型(あるいは黒い箱型)を指し、
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
Static
\end_layout
\end_inset
は明示したテキスト文字列を指します。
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
EndLabelString
\end_layout
\end_inset
[
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
文字列=""
\end_layout
\end_inset
]
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
Static
\end_layout
\end_inset
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
EndLabelType
\end_layout
\end_inset
のラベルで用いる文字列。
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
Fill_Bottom
\end_layout
\end_inset
[
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
\emph on
0
\emph default
,1
\end_layout
\end_inset
]
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
Fill_Top
\end_layout
\end_inset
と同様。
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
Fill_Top
\end_layout
\end_inset
[
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
\emph on
0
\emph default
,1
\end_layout
\end_inset
] このパラメータは、この様式で段落を初期化する際に設定される、
\begin_inset Flex MenuItem
status collapsed
\begin_layout Plain Layout
編集\SpecialChar \menuseparator
段落設定
\end_layout
\end_inset
ダイアログの「上部垂直余白」リストの
\begin_inset Flex MenuItem
status collapsed
\begin_layout Plain Layout
Fill
\end_layout
\end_inset
値を設定します
\begin_inset Foot
status collapsed
\begin_layout Plain Layout
\emph on
Jean-Marcによる註
\emph default
:この設定にどれほど使途があるかは定かでなく、おそらく将来のバージョンで取り除かれます。
\end_layout
\end_inset
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
Font
\end_layout
\end_inset
本文テキストとラベルの
\emph on
両方で
\emph default
用いられるフォント。第
\begin_inset CommandInset ref
LatexCommand ref
reference "sub:フォント指定"
\end_inset
節を参照。このフォントを定義すると、自動的に
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
LabelFont
\end_layout
\end_inset
も同じ値で定義されることに注意してください。したがって、
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
LabelFont
\end_layout
\end_inset
も同時に定義したい場合には、これを先に定義してください。
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
FreeSpacing
\end_layout
\end_inset
\begin_inset CommandInset label
LatexCommand label
name "des:FreeSpacing"
\end_inset
[
\emph on
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
0
\end_layout
\end_inset
\emph default
,
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
1
\end_layout
\end_inset
] LyXは、空白をそれ自体文字や記号ではなく、2つの単語の間の分割子として捉えているため、単語間に2つ以上の空白を入れることは、通常許可していません。これ自体
はとても素晴らしいことですが、たとえばプログラムコードや生のLaTeXコードを入力しようとするときなどに、煩わしくなることがあります。このことから、
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
FreeSpacing
\end_layout
\end_inset
を有効にすることが認められています。LyXは、LaTeXモード以外では2つめ以降の空白には、保護された空白を使用することに注意してください。
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
HTML*
\end_layout
\end_inset
これらのタグは、XHTML出力で使用されます。第
\begin_inset CommandInset ref
LatexCommand ref
reference "sub:段落様式-XHTML"
\end_inset
節をご覧ください。
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
InnerTag
\end_layout
\end_inset
[[FIXME]] XML型書式でのみ使用されます。
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
InTitle
\end_layout
\end_inset
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
[1, 0]
\end_layout
\end_inset
1の場合、このレイアウトをタイトルブロックの一部としてマークします大域項目の
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
TitleLatexType
\end_layout
\end_inset
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
TitleLatexName
\end_layout
\end_inset
も参照)。
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
ItemSep
\end_layout
\end_inset
[
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
浮動小数点型=0
\end_layout
\end_inset
] これは、同じレイアウトを持つ段落群の間に追加する空白を与えるものです。複数のレイアウトを一つの環境に入れると、それぞれのレイアウトは、その環境の
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
Parsep
\end_layout
\end_inset
だけ分離されます。しかし、その環境の項目全体は、さらにこの
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
Itemsep
\end_layout
\end_inset
分だけ離されます。これは
\emph on
乗数
\emph default
であることに注意してください。
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
ItemTag
\end_layout
\end_inset
[[FIXME]] XML型書式でのみ使用されます。
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
KeepEmpty
\end_layout
\end_inset
\begin_inset CommandInset label
LatexCommand label
name "des:KeepEmpty"
\end_inset
[
\emph on
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
0
\end_layout
\end_inset
\emph default
,
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
1
\end_layout
\end_inset
] 段落を空のままにすると、LaTeX出力が空になってしまうので、通常、LyXは段落を空にすることを許可しません。しかしながら、これを無効にすることが望ましい場
合が存在します。たとえば、書簡のひな型では、必須フィールドを人々が忘れないように、空のフィールドのまま提供する手もあります。特別なクラスにおいては、レイアウトを
実際には文章を含まないある種の改行として使用することもあります。
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
LabelBottomsep
\end_layout
\end_inset
[
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
浮動小数点型=0
\end_layout
\end_inset
] ラベルと本文テキストとの間の垂直余白。本文テキストの上に来るラベルにのみ使用されます(
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
Top_Environment
\end_layout
\end_inset
および
\begin_inset Newline linebreak
\end_inset
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
Centered_Top_Environment
\end_layout
\end_inset
)。
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
LabelCounter
\end_layout
\end_inset
[
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
文字列=""
\end_layout
\end_inset
]
\begin_inset Newline newline
\end_inset
自動連番に使われるカウンタ名(詳しくは第
\begin_inset CommandInset ref
LatexCommand ref
reference "sub:カウンタ"
\end_inset
節参照)。
\begin_inset Newline newline
\end_inset
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
LabelType
\end_layout
\end_inset
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
Counter
\end_layout
\end_inset
型のときには、本項目は
\emph on
必須
\emph default
です。この場合には、この様式が出現するたびにカウンタが増えます。
\begin_inset Newline newline
\end_inset
また、
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
LabelType
\end_layout
\end_inset
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
Enumerate
\end_layout
\end_inset
型のときにも、若干複雑にはなりますが、本項目を使うことができます。たとえば、「
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
LabelCounter myenum
\end_layout
\end_inset
」と宣言したものとしましょう。すると、LaTeXにおけるのと同様、実際に使われるカウンタは、
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
myenumi
\end_layout
\end_inset
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
myenumii
\end_layout
\end_inset
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
myenumii
\end_layout
\end_inset
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
myenumiv
\end_layout
\end_inset
のようになります。これらのカウンタは、全て別々に宣言されなくてはなりません。
\begin_inset Newline newline
\end_inset
カウンタの詳細については、第
\begin_inset CommandInset ref
LatexCommand ref
reference "sub:カウンタ"
\end_inset
節をご覧ください。
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
LabelFont
\end_layout
\end_inset
ラベルに使用されるフォント。第
\begin_inset CommandInset ref
LatexCommand ref
reference "sub:フォント指定"
\end_inset
節を参照。
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
LabelIndent
\end_layout
\end_inset
ラベルをどれくらい行頭下げすべきかを示す文字列。
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
Labelsep
\end_layout
\end_inset
[
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
文字列=""
\end_layout
\end_inset
] ラベルと本文テキストの間の水平余白。本文テキストの上に来ないラベルにのみ使用されます。
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
LabelString
\end_layout
\end_inset
[
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
文字列=""
\end_layout
\end_inset
]
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
Static
\end_layout
\end_inset
ラベル型でラベルに使用する文字列。
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
LabelCounter
\end_layout
\end_inset
を設定している場合、第
\begin_inset CommandInset ref
LatexCommand ref
reference "sub:カウンタ"
\end_inset
節に述べられている特別な整形コマンドを含めることができます
\begin_inset Foot
status collapsed
\begin_layout Plain Layout
後方互換性のために、
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
@
\emph on
style-name
\emph default
@
\end_layout
\end_inset
という文字列は、
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
\emph on
style-name
\end_layout
\end_inset
様式の
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
LabelString
\end_layout
\end_inset
を展開したものに置換されます。この機能は既に廃されたものとなっているので、第
\begin_inset CommandInset ref
LatexCommand ref
reference "sub:カウンタ"
\end_inset
節の機構に置き換えられなくてはなりません。
\end_layout
\end_inset
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
LabelStringAppendix
\end_layout
\end_inset
[
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
文字列=""
\end_layout
\end_inset
] これは付録の中で
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
LabelString
\end_layout
\end_inset
の代わりに用いられます。各
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
LabelString
\end_layout
\end_inset
ステートメントは、
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
LabelStringAppendix
\end_layout
\end_inset
をもリセットすることに注意してください。
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
LabelTag
\end_layout
\end_inset
[FIXME] XML型書式でのみ使用されます。
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
LabelType
\end_layout
\end_inset
[
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
\emph on
No_Label
\emph default
, Manual, Static, Top_Environment, Centered_Top_Environment, Counter, Sensitive,
Enumerate, Itemize, Bibliography
\end_layout
\end_inset
]
\end_layout
\begin_deeper
\begin_layout Itemize
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
Manual
\end_layout
\end_inset
は、ラベルが最初の単語最初の本当の空白までであることを示します。ラベルに2単語以上使用したいときは、保護された空白を使用してください。
\end_layout
\begin_layout Itemize
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
Static
\end_layout
\end_inset
は、ラベルが
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
LabelString
\end_layout
\end_inset
で宣言したものであることを示します。これは「静的」であることに注意してください。
\end_layout
\begin_layout Itemize
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
Top_Environment
\end_layout
\end_inset
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
Centered_Top_Environment
\end_layout
\end_inset
は、
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
Static
\end_layout
\end_inset
の特別な場合です。ラベルは段落の上に印字されるのですが、それは単一の環境の上か、このレイアウトを持つ連続した段落群の上だけに印字されます。たとえば、
\begin_inset Flex MenuItem
status collapsed
\begin_layout Plain Layout
Abstract
\end_layout
\end_inset
レイアウトが使用したりします。
\end_layout
\begin_layout Itemize
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
Sensitive
\end_layout
\end_inset
はキャプションラベルの「図」や「表」の特別な場合です。
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
Sensitive
\end_layout
\end_inset
は、ハードコードされたラベル文字列がフロートの種類に依存することを示します。これは、フロートに関連付けられたカウンタの値がNであるものとすると、「Float
Type N」にハードコードされています。
\end_layout
\begin_layout Itemize
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
Counter
\end_layout
\end_inset
ラベル型は、自動的に連番が付されるラベルを定義します。
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
LabelString
\end_layout
\end_inset
は、それが含むカウンタ参照をすべて解決するために展開されます。これは、たとえば
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
Section
\backslash
thechapter.
\backslash
thesection
\end_layout
\end_inset
のようになります。第
\begin_inset CommandInset ref
LatexCommand ref
reference "sub:カウンタ"
\end_inset
節を参照してください。
\end_layout
\begin_layout Itemize
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
Enumerate
\end_layout
\end_inset
は、通常の連番ラベルを生成します。現在のところ、これは、第4階層まで順に、アラビア数字・小文字・小文字ローマ数字・大文字を使用するようにハードコードされています
\end_layout
\begin_layout Itemize
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
Itemize
\end_layout
\end_inset
は、各階層でさまざまなブリットを生成します。これもハードコードされています。
\end_layout
\begin_layout Itemize
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
Bibliography
\end_layout
\end_inset
は、LyXで内部的に使用され、
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
LatexType BibEnvironment
\end_layout
\end_inset
とともにのみ使用されます。
\end_layout
\end_deeper
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
LangPreamble
\end_layout
\end_inset
これは、この様式で既に出現した
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
LangPreamble
\end_layout
\end_inset
宣言をすべて、完全に上書きしますので、注意してください。使用法についての詳細は、第
\begin_inset CommandInset ref
LatexCommand ref
reference "sub:段落様式の国際化"
\end_inset
節をご覧ください。
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
LatexName
\end_layout
\end_inset
対応するLaTeXの名称です。環境名かコマンド名を指します。
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
LatexParam
\end_layout
\end_inset
対応する
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
LatexName
\end_layout
\end_inset
の非必須パラメータです。このパラメータは、LyX内部から変更することはできません。
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
LatexType
\end_layout
\end_inset
\begin_inset CommandInset label
LatexCommand label
name "des:LatexType"
\end_inset
[
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
\emph on
Paragraph
\emph default
, Command, Environment, Item_Environment,
\end_layout
\end_inset
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
List_Environmen, Bib_Environment
\end_layout
\end_inset
] レイアウトがどのようにLaTeXに変換されるべきかを示します
\begin_inset Foot
status collapsed
\begin_layout Plain Layout
これらのルールはSGMLクラスにも適用されるので、
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
LatexType
\end_layout
\end_inset
の名称は、少しミスリーディングかもしれません。特定の例については、SGMLクラスファイルを見てください。
\end_layout
\end_inset
\end_layout
\begin_deeper
\begin_layout Itemize
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
Paragraph
\end_layout
\end_inset
は、何も特別なことは意味しません。
\end_layout
\begin_layout Itemize
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
Command
\end_layout
\end_inset
は、
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
\backslash
\emph on
LatexName
\emph default
{\SpecialChar \ldots{}
}
\end_layout
\end_inset
を意味します。
\end_layout
\begin_layout Itemize
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
Environment
\end_layout
\end_inset
は、
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
\backslash
begin{
\emph on
LatexName
\emph default
}\SpecialChar \ldots{}
\backslash
end{
\emph on
LatexName
\emph default
}
\end_layout
\end_inset
を意味します。
\end_layout
\begin_layout Itemize
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
Item_Environment
\end_layout
\end_inset
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
Environment
\end_layout
\end_inset
と同じですが、
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
\backslash
item
\end_layout
\end_inset
がこの環境のすべての段落に付けられるところだけが異なっています。
\end_layout
\begin_layout Itemize
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
List_Environment
\end_layout
\end_inset
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
Item_Environment
\end_layout
\end_inset
と同じですが、
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
LabelWidthString
\end_layout
\end_inset
が環境の引数として渡されるところだけが異なっています。
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
LabelWidthString
\end_layout
\end_inset
は、
\begin_inset Flex MenuItem
status collapsed
\begin_layout Plain Layout
編集\SpecialChar \menuseparator
段落設定
\end_layout
\end_inset
ダイアログで定義することができます。
\end_layout
\begin_layout Standard
上記最後のいくつかをまとめると、LaTeX出力は、LaTeX型に依存して
\end_layout
\begin_layout LyX-Code
\backslash
latexname[latexparam]{\SpecialChar \ldots{}
}
\end_layout
\begin_layout Standard
のようになるか、
\end_layout
\begin_layout LyX-Code
\backslash
begin{latexname}[latexparam] \SpecialChar \ldots{}
\backslash
end{latexname}.
\end_layout
\begin_layout Standard
となります。
\end_layout
\end_deeper
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
LeftMargin
\end_layout
\end_inset
[
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
文字列=""
\end_layout
\end_inset
] レイアウトを環境の中に入れた場合、左余白は単純に加えられるのではなく、因子
\begin_inset Formula $\frac{4}{depth+4}$
\end_inset
をかけて加えられます。このパラメータは、
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
Margin
\end_layout
\end_inset
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
Manual
\end_layout
\end_inset
あるいは
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
Dynamic
\end_layout
\end_inset
に設定されているときにも用いられることに注意してください。その場合には、これは手動設定余白または動的設定余白に加えられることに注意してください。
\begin_inset Newline newline
\end_inset
引数は文字列として渡されます。たとえば「
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
MM
\end_layout
\end_inset
」と指定すると、段落を通常フォントの「
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
MM
\end_layout
\end_inset
」の幅だけ行頭下げを行います。文字列の前に「
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
-
\end_layout
\end_inset
」を付けると、負の幅を与えることができます。この方法が採用されたのは、どの画面フォントでも見かけが同じになるようにするためです。
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
Margin
\end_layout
\end_inset
[
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
\emph on
Static
\emph default
, Manual, Dynamic, First_Dynamic, Right_Address_Box
\end_layout
\end_inset
]
\begin_inset Newline newline
\end_inset
このレイアウトの左余白の種類です。
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
Static
\end_layout
\end_inset
は固定余白を示します。
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
Manual
\end_layout
\end_inset
は、左余白が
\begin_inset Flex MenuItem
status collapsed
\begin_layout Plain Layout
編集\SpecialChar \menuseparator
段落設定
\end_layout
\end_inset
ダイアログで入力した文字列によって決められることを示します。これは、タブを用いずに整った一覧表を組むのに使用されます。
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
Dynamic
\end_layout
\end_inset
は、余白がラベルの大きさに依存することを示します。これは、自動連番の見出しに使用されます。「5.4.3.2.1 非常に長い見出し」という見出し行が、「3.2
非常に長い見出し」よりも広い左余白5.4.3.2.1足す空白と同じ幅)を必要とすることは明らかでしょう(標準的「ワープロ」はこんなことはやってくれませんが)。
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
First_Dynamic
\end_layout
\end_inset
は似ていますが、段落の最初の行だけがDynamicでその他の行はStaticです。これは、たとえば、箇条書き記述に使用されます。
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
Right_Address_Box
\end_layout
\end_inset
は、段落中、最も長い行が右余白に合うように余白を選択します。これは、ページの右端に住所を組版するのに用いられます。
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
NeedProtect
\end_layout
\end_inset
[
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
\emph on
0
\end_layout
\end_inset
,
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
1
\end_layout
\end_inset
] このレイアウト中の脆弱なコマンドが
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
\backslash
protect
\end_layout
\end_inset
されるべきか否か(註:これはこのコマンド自体が
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
\backslash
protect
\end_layout
\end_inset
されるべきかでは
\emph on
ありません
\emph default
)。
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
Newline
\end_layout
\end_inset
[
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
0
\end_layout
\end_inset
,
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
\emph on
1
\end_layout
\end_inset
] 新規行をLaTeXの新規行
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
\backslash
\backslash
\end_layout
\end_inset
に変換するか否か。LyX中でLaTeX編集をやりやすくするために、変換は無効にすることができます。
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
NextNoIndent
\end_layout
\end_inset
[
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
1
\end_layout
\end_inset
,
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
\emph on
0
\end_layout
\end_inset
] 次の段落に最初の行の行頭下げを許すか否か。
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
1
\end_layout
\end_inset
は許可しないことを意味し、
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
0
\end_layout
\end_inset
は望むならば行頭下げできることを意味します。
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
ObsoletedBy
\end_layout
\end_inset
このレイアウトが置き換えられたレイアウト名。これは、後方互換性を維持しながら、レイアウトの名称を変更するのに使用されます。
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
OptionalArgs
\end_layout
\end_inset
[
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
整数型=0
\end_layout
\end_inset
] このレイアウトに使用することのできる非必須引数の数。節見出しのようなものに有用であり、LaTeXでのみ意味を持ちます。出力時には、非必須引数は、すべての必須
引数の前に来ることに注意してください(以下参照)。つまり、
\end_layout
\begin_deeper
\begin_layout LyX-Code
\backslash
mycmd[非必須引数1]{必須引数1}{段落の内容}
\end_layout
\begin_layout Standard
のようなコマンドは生成できますが、
\end_layout
\begin_layout LyX-Code
\backslash
mycmd[非必須引数1]{必須引数1}[非必須引数2]{段落の内容}
\end_layout
\begin_layout Standard
のようなコマンドは、TeXコードこれを使えば何でもできますを使用することなしには、生成することができません。
\end_layout
\end_deeper
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
ParbreakIsNewline
\end_layout
\end_inset
\begin_inset CommandInset label
LatexCommand label
name "des:ParbreakIsNewline"
\end_inset
[
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
\emph on
0
\end_layout
\end_inset
,
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
1
\end_layout
\end_inset
] LaTeX出力中で、段落を空行ではなく、改行で区切るよう指定します。
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
PassThru 1
\end_layout
\end_inset
と併用すれば、TeXコードを使用したときのようにテキストエディタをエミュレートすることができます。
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
ParIndent
\end_layout
\end_inset
[
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
文字列=""
\end_layout
\end_inset
] 段落の最初の行の行頭下げ。レイアウトによっては
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
Parindent
\end_layout
\end_inset
は固定されています。例外には標準レイアウトがあり、標準レイアウトの段落の行頭下げは、
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
NextNoIndent
\end_layout
\end_inset
で禁止することができるようになっています。また、環境中の標準レイアウト段落は、当該段落の
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
Parindent
\end_layout
\end_inset
ではなく、この環境の
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
Parindent
\end_layout
\end_inset
を使用します。たとえば、箇条書き(連番)内の標準段落は、行頭下げされません。
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
Parsep
\end_layout
\end_inset
[
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
浮動小数点型=0
\end_layout
\end_inset
] このレイアウトの2段落間の垂直余白。
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
Parskip
\end_layout
\end_inset
[
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
浮動小数点型=0
\end_layout
\end_inset
] LyXでは、文書を組版するのに、ユーザが「行頭下げ」か「スキップ」を選ぶことができます。「行頭下げ」を選択した際には、この値は完全に無視されます。「スキップ
」を選択した際には、LaTeX型「段落」レイアウトの
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
ParIndent
\end_layout
\end_inset
は無視され、すべての段落はこの
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
Parskip
\end_layout
\end_inset
引数分だけ引き離されます。垂直余白は、
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
DefaultHeight
\end_layout
\end_inset
を標準フォントでの1行の高さとすると、
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
Parskipの値
\end_layout
\end_inset
\begin_inset Formula $\times$
\end_inset
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
DefaultHeight
\end_layout
\end_inset
によって計算されます。このようにして、画面フォントを変更しても同じように表示されるのです。
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
PassThru
\end_layout
\end_inset
\begin_inset CommandInset label
LatexCommand label
name "des:PathThru"
\end_inset
[
\emph on
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
0
\end_layout
\end_inset
\emph default
,
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
1
\end_layout
\end_inset
] この段落の内容が、LaTeXが必要とするような特別な変換を行わずに、生の形で出力されるべきかどうか。
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
Preamble
\end_layout
\end_inset
\begin_inset CommandInset label
LatexCommand label
name "des:Preamble"
\end_inset
この様式が使用されたときに、LaTeXプリアンブルに付け加えるべき情報。この特定の様式が要求するマクロを定義したり、パッケージを読み込んだりと言ったことに使用し
ます。「
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
EndPreamble
\end_layout
\end_inset
」で閉じる必要があります。
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
RefPrefix
\end_layout
\end_inset
[
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
文字列
\end_layout
\end_inset
] この型の段落を参照する際、生成されるラベルに使用する前置句。これによって、整形参照を使用することができるようになります。
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
RequiredArgs
\end_layout
\end_inset
[
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
整数型=0
\end_layout
\end_inset
] このレイアウトに対応するLaTeXコマンドやLaTeX環境が予期している、必須引数の数。コマンドの場合には、段落の内容自体に関連付けられている引数
\emph on
以外に
\emph default
、必要な引数の数のことです。これらの引数は、実際には渡されなくても構いません。必要な場合は、LyXが空の引数を生成します。非必須引数は、必須引数の前に出力される
ことに注意してください。詳細については、上記
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
OptionalArgs
\end_layout
\end_inset
タグにおける議論をご覧ください。
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
Requires
\end_layout
\end_inset
[
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
文字列
\end_layout
\end_inset
]
\begin_inset CommandInset label
LatexCommand label
name "des:Requires"
\end_inset
このレイアウトが
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
文字列
\end_layout
\end_inset
で表される機能を必要するか否か。「機能」に関する情報は、上記
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
Provides
\end_layout
\end_inset
の説明(
\begin_inset CommandInset ref
LatexCommand pageref
reference "des:FreeSpacing"
\end_inset
ページ)をご参照ください。
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
RightMargin
\end_layout
\end_inset
[
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
文字列=""
\end_layout
\end_inset
]
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
LeftMargin
\end_layout
\end_inset
に同様。
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
Spacing
\end_layout
\end_inset
[
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
\emph on
single
\emph default
, onehalf, double, other
\end_layout
\end_inset
\emph on
\emph default
] これはレイアウト中の既定の行間をどうすべきか定義するものです。引数の
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
single
\end_layout
\end_inset
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
onehalf
\end_layout
\end_inset
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
double
\end_layout
\end_inset
は、それぞれ乗数1・1.25・1.667に対応します。引数
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
other
\end_layout
\end_inset
を指定した場合には、実際の乗数値も引数として指定しなくてはなりません。他のパラメータと違って
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
Spacing
\end_layout
\end_inset
は、
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
setspace.sty
\end_layout
\end_inset
パッケージを使用した、限定的なLaTeXコードを生成することを意味することにご注意ください。
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
Spellcheck
\end_layout
\end_inset
[
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
0
\end_layout
\end_inset
,
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
1
\end_layout
\end_inset
] この様式の段落をスペルチェックするか否か。既定値は真です。
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
TextFont
\end_layout
\end_inset
本文に使うフォント。第
\begin_inset CommandInset ref
LatexCommand ref
reference "sub:フォント指定"
\end_inset
節参照。
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
TocLevel
\end_layout
\end_inset
[
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
整数型
\end_layout
\end_inset
] 目次中でのこの様式の階層。これは、節見出しの自動連番に使用されます。
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
TopSep
\end_layout
\end_inset
[
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
浮動小数点型=0
\end_layout
\end_inset
] このレイアウトを持つ一連の段落群の最初の段落と、その前の段落の間の垂直余白。前の段落が別のレイアウトを持っていれば、余白は単純に追加されるのではなく、それら
の最大値がとられます。
\end_layout
\begin_layout Subsection
\begin_inset CommandInset label
LatexCommand label
name "sub:段落様式の国際化"
\end_inset
段落様式の国際化
\end_layout
\begin_layout Standard
LyXは、長きにわたってレイアウト情報の国際化をサポートしてきましたが、第2.0版までは、これは操作画面にのみ適用されるものであって、たとえばPDF出力には適用さ
れませんでした。たとえば、フランスの著者が、「Theorem 1」の代わりに「
\lang french
Théorème
\lang japanese
1」としたければ、醜いハックに頼るしかありませんでした。Georg Baumのおかげで、これは解消されました。
\end_layout
\begin_layout Standard
もし
\begin_inset Flex MenuItem
status collapsed
\begin_layout Plain Layout
Style
\end_layout
\end_inset
が、組版文書に出力される文字列を定義するのであれば、非英語文書や複数言語文書をサポートするために、
\begin_inset Flex MenuItem
status collapsed
\begin_layout Plain Layout
LangPreamble
\end_layout
\end_inset
\begin_inset Flex MenuItem
status collapsed
\begin_layout Plain Layout
BabelPreamble
\end_layout
\end_inset
を使用することができます。以下の抜粋(
\begin_inset Flex MenuItem
status collapsed
\begin_layout Plain Layout
theorems-ams.inc
\end_layout
\end_inset
より)は、これがどう動作するかを示すものです。
\end_layout
\begin_layout LyX-Code
Preamble
\end_layout
\begin_deeper
\begin_layout LyX-Code
\backslash
theoremstyle{remark}
\end_layout
\begin_layout LyX-Code
\backslash
newtheorem{claim}[thm]{
\backslash
protect
\backslash
claimname}
\end_layout
\begin_layout LyX-Code
EndPreamble
\end_layout
\begin_layout LyX-Code
LangPreamble
\end_layout
\begin_layout LyX-Code
\backslash
providecommand{
\backslash
claimname}{_(Claim)}
\end_layout
\begin_layout LyX-Code
EndLangPreamble
\end_layout
\begin_layout LyX-Code
BabelPreamble
\end_layout
\begin_layout LyX-Code
\backslash
addto
\backslash
captions$$lang{
\backslash
renewcommand{
\backslash
claimname}{_(Claim)}}
\end_layout
\begin_layout LyX-Code
EndBabelPreamble
\end_layout
\end_deeper
\begin_layout Standard
原則として、
\begin_inset Flex MenuItem
status collapsed
\begin_layout Plain Layout
LangPreamble
\end_layout
\end_inset
\begin_inset Flex MenuItem
status collapsed
\begin_layout Plain Layout
BabelPreamble
\end_layout
\end_inset
タグ内には、有効なLaTeXコードはすべて用いることができますが、実際においては、ここで典型的に示したような形になるでしょう。組版文字列が正しく翻訳されるための
鍵となるのは、LaTeXコマンド
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
\backslash
claimname
\end_layout
\end_inset
とその
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
\backslash
newtheorem
\end_layout
\end_inset
中での用い方です。
\end_layout
\begin_layout Standard
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
LangPreamble
\end_layout
\end_inset
タグは、文書全体の言語に基づいた国際化を提供します。タグの内容は、
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
Preamble
\end_layout
\end_inset
タグと同様、プリアンブルに置かれるのですが、これを特別なものにしているのは、「関数」
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
_()
\end_layout
\end_inset
が使用されていることです。これは、LyXがLaTeX出力を生成する際、その引数を文書言語に翻訳したもので置き換えられます。
\end_layout
\begin_layout Standard
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
BabelPreamble
\end_layout
\end_inset
タグは、複数言語文書をサポートし、
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
babel
\end_layout
\end_inset
パッケージへのインタフェースを提供することを意図しているので、もう少し複雑です。その内容は、文書に現れる言語それぞれについて一度、プリアンブルに追加されます。こ
の場合には、
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
_()
\end_layout
\end_inset
の引数は、その当該言語への翻訳で置き換えられ、
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
$$lang
\end_layout
\end_inset
は言語名babelパッケージで使用されるもので置き換えられます。
\end_layout
\begin_layout Standard
したがって、フランス語のセクションを持つドイツ語文書では、以下のような内容がプリアンブルに追加されます
\end_layout
\begin_layout LyX-Code
\backslash
addto
\backslash
captionsfrench{
\backslash
renewcommand{
\backslash
claimname}{Affirmation}}
\backslash
addto
\backslash
captionsngerman{
\backslash
renewcommand{
\backslash
claimname}{Behauptung}}
\backslash
providecommand{
\backslash
claimname}{Behauptung}
\end_layout
\begin_layout Standard
それから、LaTeXと
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
babel
\end_layout
\end_inset
は協力して、出力に正しい文字列を生成します。
\end_layout
\begin_layout Standard
ここで注意しなくてはならない重要な点は、翻訳は、操作画面の国際化に使われるのと同じ機構を通じて、LyX自身によって提供されるということです。つまり、ユーザー作成
のレイアウトファイルに入力された文字列は、LyXの国際化ルーチンでは取り扱われないので、
\begin_inset Flex MenuItem
status collapsed
\begin_layout Plain Layout
LangPreamble
\end_layout
\end_inset
\begin_inset Flex MenuItem
status collapsed
\begin_layout Plain Layout
BabelPreamble
\end_layout
\end_inset
は、事実上、LyXとともに提供されるレイアウトファイルでのみ、使うことができるということを意味します。とはいえ、こういうことでありますので、将来的にLyXに同梱
させようという意図を以て作成されたレイアウトは、適切なところではすべて、これらのタグを使用するべきです。
\end_layout
\begin_layout Subsection
フロート
\begin_inset CommandInset label
LatexCommand label
name "sub:フロート"
\end_inset
\end_layout
\begin_layout Standard
LyX第1.3.0版以来、テキストクラス自体の中でフロート(
\begin_inset Flex MenuItem
status collapsed
\begin_layout Plain Layout
figure
\end_layout
\end_inset
\begin_inset Flex MenuItem
status collapsed
\begin_layout Plain Layout
table
\end_layout
\end_inset
・\SpecialChar \ldots{}
)を定義することが可能となり、かつ必要となりました。標準的なフロートは
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
stdfloats.inc
\end_layout
\end_inset
ファイルに含まれているので、作業中のレイアウトファイルに
\end_layout
\begin_layout LyX-Code
Input stdfloats.inc
\end_layout
\begin_layout Standard
と加えるだけで済むことも多いでしょう。LyXに同梱されているAGUクラスのように、それ以外のフロート型を提供するテキストクラスを実装するには、以下の情報が役立つ
でありましょう。
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
Extension
\end_layout
\end_inset
[
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
文字列
\end_layout
\end_inset
=
\begin_inset Quotes erd
\end_inset
\begin_inset Quotes erd
\end_inset
] 図などのリストを含む外部ファイルのファイル拡張子名。LaTeXがキャプションを書き込むファイルです。
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
GuiName
\end_layout
\end_inset
[
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
文字列
\end_layout
\end_inset
=
\begin_inset Quotes erd
\end_inset
\begin_inset Quotes erd
\end_inset
] メニューとキャプションに使用される文字列。babelが使用される場合には、これは現在の言語に翻訳されます。
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
HTML*
\end_layout
\end_inset
これらは、XHTML出力で使用されます。第
\begin_inset CommandInset ref
LatexCommand ref
reference "sec:XHTML出力のタグ"
\end_inset
節をご覧ください。
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
ListCommand
\end_layout
\end_inset
[
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
文字列
\end_layout
\end_inset
=
\begin_inset Quotes erd
\end_inset
\begin_inset Quotes erd
\end_inset
] この型のフロートの一覧を生成するのに使用するコマンド。頭部の「
\backslash
」は書きません。
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
NeedsFloatPkg
\end_layout
\end_inset
が偽の時には、このコマンドを生成する標準的な方法はないので、これは
\emph on
必ず
\emph default
指定しなくてはなりません。
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
NeedsFloatPkg
\end_layout
\end_inset
が真の時は、標準的な方法が存在するので、これは無視されます。
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
ListName
\end_layout
\end_inset
[
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
文字列
\end_layout
\end_inset
=
\begin_inset Quotes erd
\end_inset
\begin_inset Quotes erd
\end_inset
] この種類のフロート一覧図一覧・表一覧などに使用される見出し。LyX中では、これは画面上のラベルとして使用されます。また、見出しとして使用するために、La
TeXに渡され、XHTML出力でも見出しとして使用されます。これは、文書言語に翻訳されます。
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
NeedsFloatPkg
\end_layout
\end_inset
[
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
0
\end_layout
\end_inset
,
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
\emph on
1
\end_layout
\end_inset
] フロートが文書クラス中に既に定義されているか、あるいは代わりに
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
float.sty
\end_layout
\end_inset
を読み込んで、それが提供しているものを使用する必要があるかを示します。既定値は
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
1
\end_layout
\end_inset
であり、
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
float.sty
\end_layout
\end_inset
を使用します。LaTeX文書クラスでフロートが既に定義されているときには、
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
0
\end_layout
\end_inset
に設定しなくてはなりません。
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
NumberWithin
\end_layout
\end_inset
[
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
文字列
\end_layout
\end_inset
=
\begin_inset Quotes erd
\end_inset
\begin_inset Quotes erd
\end_inset
] この(非必須の)引数は、このクラスのフロートが文書中のある節単位ごとに番号を振り直されるべきかどうかを規定します。たとえば、引数に
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
chapter
\end_layout
\end_inset
と指定されていれば、フロートは章ごとに番号が振り直されます。
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
Placement
\end_layout
\end_inset
[
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
文字列
\end_layout
\end_inset
=
\begin_inset Quotes erd
\end_inset
\begin_inset Quotes erd
\end_inset
] このクラスのフロートの既定の配置法。文字列は、標準的なLaTeX表記に従い、
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
t
\end_layout
\end_inset
ならば上部top
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
b
\end_layout
\end_inset
ならば下部bottom
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
p
\end_layout
\end_inset
ならばページpage
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
h
\end_layout
\end_inset
ならばここhereを表します
\begin_inset Foot
status collapsed
\begin_layout Plain Layout
LaTeX同様、文字列中でのこれらの文字の順序は関係ありません。
\end_layout
\end_inset
。これらの他に新しい型
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
H
\end_layout
\end_inset
があり、これはフロートを「ここ」に置いていいけれども他の場所はだめ、というものなので、本当はフロートにあるものではありません。しかし、
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
H
\end_layout
\end_inset
指定子は特別なものであり、その細かい実装上の理由で、組み込み以外のフロート型では使用することができません。これが何を意味するかおわかりにならない場合には、代わり
に「
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
tbp
\end_layout
\end_inset
」を指定してください。
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
RefPrefix
\end_layout
\end_inset
[
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
文字列
\end_layout
\end_inset
] この型のフロートを参照する際、生成されるラベルに使用する前置句。これによって、整形参照を使用することができるようになります。コピーした様式が設定した
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
RefPrefix
\end_layout
\end_inset
は、特別な文字列「OFF」すべて大文字を使えば、いつでも削除することができます。
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
Style
\end_layout
\end_inset
[
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
文字列
\end_layout
\end_inset
=
\begin_inset Quotes erd
\end_inset
\begin_inset Quotes erd
\end_inset
]
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
\backslash
newfloat
\end_layout
\end_inset
を使用してフロートを定義する際に使用される様式。
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
Type
\end_layout
\end_inset
[
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
文字列
\end_layout
\end_inset
=
\begin_inset Quotes erd
\end_inset
\begin_inset Quotes erd
\end_inset
] プログラムやアルゴリズムのような、フロートの新しいクラス「型」。適切な
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
\backslash
newfloat
\end_layout
\end_inset
の後で、
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
\backslash
begin{program}
\end_layout
\end_inset
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
\backslash
end{algorithm*}
\end_layout
\end_inset
といったコマンドが利用できます。
\end_layout
\begin_layout Standard
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
\emph on
type
\end_layout
\end_inset
型のフロートを定義すると、自動的に
\emph on
対応する
\emph default
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
\emph on
type
\end_layout
\end_inset
名カウンタが定義されます。
\end_layout
\begin_layout Subsection
任意設定差込枠と差込枠レイアウト
\begin_inset CommandInset label
LatexCommand label
name "sub:任意設定差込枠"
\end_inset
\end_layout
\begin_layout Standard
LyXは第1.4.0版から文字様式をサポートしています。第1.6.0版以降、これは任意設定差込枠と呼ばれています。
\end_layout
\begin_layout Standard
任意設定差込枠には次の3種類があります。
\end_layout
\begin_layout Itemize
文字様式(
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
CharStyle
\end_layout
\end_inset
)。これは、
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
\backslash
noun
\end_layout
\end_inset
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
\backslash
code
\end_layout
\end_inset
などのLaTeXコマンドに対応した意味論的マークアップを定義するものです。
\end_layout
\begin_layout Itemize
ユーザ設定(
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
Custom
\end_layout
\end_inset
。これは、TeXコードや脚注などに似たユーザ設定の折りたたみ式差込枠を定義するのに使用することができます。わかりやすい例はendnote差込枠で、これは
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
endnote
\end_layout
\end_inset
モジュール中で定義されています。
\end_layout
\begin_layout Itemize
XML要素
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
Element
\end_layout
\end_inset
。DocBookクラスで使用するものです。
\end_layout
\begin_layout Standard
任意設定差込枠は、以下で説明する
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
InsetLayout
\end_layout
\end_inset
タグを使用して定義されます。
\end_layout
\begin_layout Standard
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
InsetLayout
\end_layout
\end_inset
タグは、もう一つ別の機能も提供します。これを使えば、いろいろな種類の差込枠全体のレイアウトを設定するのに使用することができるのです。現在のところ、
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
InsetLayout
\end_layout
\end_inset
は任意設定差込枠を定義することの他に、脚注・傍注・注釈差込枠・TeXコードERT差込枠・派生枝・リスト・索引・ボックス・表・アルゴリズム・URL・オプション
引数のレイアウトパラメータを設定するのに使用することができます。
\end_layout
\begin_layout Standard
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
InsetLayout
\end_layout
\end_inset
定義は以下の形の行では始まらなくてはなりません。
\end_layout
\begin_layout LyX-Code
InsetLayout <型>
\end_layout
\begin_layout Standard
ここで
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
<型>
\end_layout
\end_inset
は、レイアウトを定義しようとしている差込枠を指し、以下の2つの場合がありえます。
\end_layout
\begin_layout Enumerate
既存の差込枠のレイアウトを変更する場合。この場合、
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
<型>
\end_layout
\end_inset
は以下のいずれかになります:
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
Algorithm
\end_layout
\end_inset
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
Branch
\end_layout
\end_inset
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
Box
\end_layout
\end_inset
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
Box:shaded
\end_layout
\end_inset
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
ERT
\end_layout
\end_inset
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
Figure
\end_layout
\end_inset
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
Foot
\end_layout
\end_inset
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
Index
\end_layout
\end_inset
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
Info
\end_layout
\end_inset
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
Info:menu
\end_layout
\end_inset
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
Info:shortcut
\end_layout
\end_inset
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
Info:shortcuts
\end_layout
\end_inset
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
Listings
\end_layout
\end_inset
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
Marginal
\end_layout
\end_inset
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
Note:Comment
\end_layout
\end_inset
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
Note:Note
\end_layout
\end_inset
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
Note:GreyedOut
\end_layout
\end_inset
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
OptArg
\end_layout
\end_inset
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
Table
\end_layout
\end_inset
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
URL
\end_layout
\end_inset
\end_layout
\begin_layout Enumerate
任意設定差込枠のレイアウトを定義する場合。この場合には、
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
<型>
\end_layout
\end_inset
は既存の差込枠で使用されていないもので有効な識別子であれば、何でも指定できます。任意設定差込枠の定義には、
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
LyXType
\end_layout
\end_inset
項目も
\emph on
同時に
\emph default
含まれていて、これがどの型の差込枠なのかが宣言されている必要があります。
\end_layout
\begin_layout Standard
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
InsetLayout
\end_layout
\end_inset
定義には以下の項目を入れることができます。
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
BgColor
\end_layout
\end_inset
差込枠の背景色。有効な色彩は
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
src/ColorCode.h
\end_layout
\end_inset
で定義されています。
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
ContentAsLabel
\end_layout
\end_inset
[
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
\emph on
0
\end_layout
\end_inset
,
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
1
\end_layout
\end_inset
] 差込枠を閉じた際、差込枠の内容をラベルとして使用するか否か。既定値は偽です。
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
CopyStyle
\end_layout
\end_inset
段落様式と同様です(
\begin_inset CommandInset ref
LatexCommand ref
reference "des:CopyStyle"
\end_inset
)ページ参照)。
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
CustomPars
\end_layout
\end_inset
[
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
\emph on
0
\end_layout
\end_inset
,
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
1
\end_layout
\end_inset
] 段落を設定するのに、段落設定ダイアログをユーザが使えるかどうかを指定します。
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
Decoration
\end_layout
\end_inset
差込枠の枠とボタンをレンダリングするのに使用する様式を指定するもので、
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
Classic
\end_layout
\end_inset
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
Minimalistic
\end_layout
\end_inset
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
Conglomerate
\end_layout
\end_inset
のいずれかを指定することができます。脚注は通常
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
Classic
\end_layout
\end_inset
を使用し、TeXコード差込枠は通常
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
Minimalistic
\end_layout
\end_inset
、文字様式は
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
Conglomerate
\end_layout
\end_inset
を使用します。
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
End
\end_layout
\end_inset
InsetLayout宣言を閉じるのに必要です。
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
Font
\end_layout
\end_inset
本文本体とラベル
\emph on
両方に
\emph default
使用されるフォントです。第
\begin_inset CommandInset ref
LatexCommand ref
reference "sub:フォント指定"
\end_inset
節を参照。このフォントを定義すると自動的に
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
LabelFont
\end_layout
\end_inset
も同じ値に定義されるので、これらを別々の値にしたいときは、これを先に定義してから後に
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
LabelFont
\end_layout
\end_inset
を定義しなくてはならないことに注意してください。
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
ForceLTR
\end_layout
\end_inset
たとえばTeXコードやURLで「latex」言語が「左から右」ラテン式出力になるように強制します。うまく機能しません。
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
ForcePlain
\end_layout
\end_inset
[
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
\emph on
0
\end_layout
\end_inset
,
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
1
\end_layout
\end_inset
] PlainLayoutを使用するべきなのか、それともユーザが差込枠で使用されている段落様式を変更できるのかを指定します。既定値は偽です。
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
FreeSpacing
\end_layout
\end_inset
段落様式と同様です(
\begin_inset CommandInset ref
LatexCommand pageref
reference "des:FreeSpacing"
\end_inset
ページ参照)。既定値は偽です。
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
HTML*
\end_layout
\end_inset
これらは、XHTML出力で使用されます。第
\begin_inset CommandInset ref
LatexCommand ref
reference "sec:XHTML出力のタグ"
\end_inset
節をご覧ください。
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
InToc
\end_layout
\end_inset
[
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
\emph on
0
\end_layout
\end_inset
,
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
1
\end_layout
\end_inset
] 「文書構造」ペイン用に出力される文字列に、この差込枠の内容を含めるかどうか。たとえば、節見出しの脚注の内容が、文書構造の目次に表示されることは望まないでしょ
うが、通常、文字様式の内容は表示されることを望むでしょう。既定値は偽、すなわち含めません。
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
KeepEmpty
\end_layout
\end_inset
段落様式と同様です(
\begin_inset CommandInset ref
LatexCommand pageref
reference "des:KeepEmpty"
\end_inset
ページ参照)。既定値は偽です。
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
LabelFont
\end_layout
\end_inset
ラベルに使用されるフォント。第
\begin_inset CommandInset ref
LatexCommand ref
reference "sub:フォント指定"
\end_inset
節を参照。非効率を回避するため、この定義は
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
Font
\end_layout
\end_inset
の前には決して現れてはなりません。
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
LabelString
\end_layout
\end_inset
ボタンなどに差込枠のラベルとして表示されるもの。差込枠型によってはTeXコードや派生枝、ラベルが動的に変更されます。
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
LatexName
\end_layout
\end_inset
対応するLaTeX関連物の名称。環境名ないしはコマンド名。
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
LatexParam
\end_layout
\end_inset
対応する
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
LatexName
\end_layout
\end_inset
関連物の非必須パラメータ。
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
[]
\end_layout
\end_inset
のような括弧対を含む。このパラメータはLyX内部から変更することはできません。
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
LatexType
\end_layout
\end_inset
段落様式と同様です(
\begin_inset CommandInset ref
LatexCommand pageref
reference "des:LatexType"
\end_inset
ページ参照)。
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
LyxType
\end_layout
\end_inset
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
charstyle
\end_layout
\end_inset
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
custom
\end_layout
\end_inset
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
element
\end_layout
\end_inset
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
end
\end_layout
\end_inset
charstyleの定義の終わりなどを示すダミー定義の各値を取ることができます。この項目は、任意設定差込枠に必須であり、かつ任意設定差込枠でしか意味を持ちま
せん。この項目は、就中、差込枠がどのメニューに表示されるかを決定します。
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
LyxType
\end_layout
\end_inset
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
charstyle
\end_layout
\end_inset
に設定すると、
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
MultiPar
\end_layout
\end_inset
が偽に設定されます。文字様式差込枠で
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
MultiPar
\end_layout
\end_inset
を真にしたい時には、
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
LyxType
\end_layout
\end_inset
を設定した
\emph on
後に
\emph default
設定すれば、真に設定することができます。
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
MultiPar
\end_layout
\end_inset
[
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
\emph on
0
\end_layout
\end_inset
,
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
1
\end_layout
\end_inset
] この差込枠中に複数の段落を入れることができるかどうか。これは同時に、
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
CustomPars
\end_layout
\end_inset
を同じ値に設定し、
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
ForcePlain
\end_layout
\end_inset
を逆の値に設定します。これらは、
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
MultiPar
\end_layout
\end_inset
\emph on
後に
\emph default
指定されれば、他の値に指定し直すことができます。既定値は真です。
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
NeedProtect
\end_layout
\end_inset
[
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
\emph on
0
\end_layout
\end_inset
,
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
1
\end_layout
\end_inset
] 本レイアウト中で脆弱なコマンドを
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
\backslash
protect
\end_layout
\end_inset
するか否か当該コマンド自身をprotectするかどうかでは
\emph on
ありません
\emph default
)。既定値は偽です。
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
ParbreakIsNewline
\end_layout
\end_inset
[
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
\emph on
0
\end_layout
\end_inset
,
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
1
\end_layout
\end_inset
] 段落様式と同様です(
\begin_inset CommandInset ref
LatexCommand ref
reference "des:PathThru"
\end_inset
ページ参照)。既定値は偽です。
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
PassThru
\end_layout
\end_inset
[
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
\emph on
0
\end_layout
\end_inset
,
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
1
\end_layout
\end_inset
] 段落様式と同様です(
\begin_inset CommandInset ref
LatexCommand ref
reference "des:PathThru"
\end_inset
ページ参照)。既定値は偽です。
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
Preamble
\end_layout
\end_inset
段落様式と同様です(
\begin_inset CommandInset ref
LatexCommand pageref
reference "des:Preamble"
\end_inset
ページ参照)。
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
RefPrefix
\end_layout
\end_inset
[
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
文字列
\end_layout
\end_inset
] この型の差込枠を参照する際、生成されるラベルに使用する前置句。これによって、整形参照を使用することができるようになります。
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
Requires
\end_layout
\end_inset
[
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
文字列
\end_layout
\end_inset
] 段落様式と同様です(
\begin_inset CommandInset ref
LatexCommand pageref
reference "des:Requires"
\end_inset
ページ参照)。
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
ResetFont
\end_layout
\end_inset
[
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
0
\end_layout
\end_inset
,
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
\emph on
1
\end_layout
\end_inset
] この差込枠が周囲の環境と同じフォントを用いるか、独自のフォントを用いるか。既定値は真、すなわち独自のフォントを用います。
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
Spellcheck
\end_layout
\end_inset
[
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
0
\end_layout
\end_inset
,
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
\emph on
1
\end_layout
\end_inset
] この差込枠の内容をスペルチェックするか否か。既定値は真です。
\end_layout
\begin_layout Subsection
カウンタ
\begin_inset CommandInset label
LatexCommand label
name "sub:カウンタ"
\end_inset
\end_layout
\begin_layout Standard
LyX第1.3.0版以来、テキストクラス自体の中でカウンタ(
\begin_inset Flex MenuItem
status collapsed
\begin_layout Plain Layout
chapter
\end_layout
\end_inset
\begin_inset Flex MenuItem
status collapsed
\begin_layout Plain Layout
figure
\end_layout
\end_inset
・\SpecialChar \ldots{}
)を定義することが可能となり、かつ必要となりました。標準的なフロートは
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
stdcounters.inc
\end_layout
\end_inset
ファイルに含まれているので、作業中のレイアウトファイルに
\end_layout
\begin_layout LyX-Code
Input stdcounters.inc
\end_layout
\begin_layout Standard
と加えるだけで済むことも多いでしょう。しかし自製カウンタを定義したければ、そうすることもできます。カウンタ宣言は、
\end_layout
\begin_layout LyX-Code
Counter 名称
\end_layout
\begin_layout Standard
で始まらなくてはなりません。ここで「
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
名称
\end_layout
\end_inset
」はカウンタ名で置き換えます。また、宣言は「
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
End
\end_layout
\end_inset
」で終わらなくてはなりません。以下のパラメータを使用することができます。
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
LabelString [文字列=""]
\end_layout
\end_inset
定義されていると、ここで指定した文字列がカウンタの表示の仕方を定義します。この値を指定すると、
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
LabelStringAppendix
\end_layout
\end_inset
も同じ値に設定されます。文字列中では、以下の構成要素を使用することができます。
\end_layout
\begin_deeper
\begin_layout Itemize
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
\backslash
thecounter
\end_layout
\end_inset
は、カウンタ
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
counter
\end_layout
\end_inset
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
LabelString
\end_layout
\end_inset
(または
\begin_inset Newline linebreak
\end_inset
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
LabelStringAppendix
\end_layout
\end_inset
)を展開したもので置き換えられます。
\end_layout
\begin_layout Itemize
カウンタ値は、LaTeX型マクロ
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
\backslash
\emph on
numbertype
\emph default
{
\emph on
カウンタ
\emph default
}
\end_layout
\end_inset
を用いて表現することができます。ここで
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
\emph on
numbertype
\end_layout
\end_inset
は以下のいずれかです
\begin_inset Foot
status collapsed
\begin_layout Plain Layout
実は、事態はもう少し複雑です。以下に説明されているもの以外の
\emph on
numbertype
\emph default
は何であれ、アラビア数字を生成します。これが将来変更されたとしても不思議ではないでしょう。
\end_layout
\end_inset
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
arabic
\end_layout
\end_inset
1, 2, 3,\SpecialChar \ldots{}
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
alph
\end_layout
\end_inset
a, b, c, \SpecialChar \ldots{}
(小文字);
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
Alph
\end_layout
\end_inset
A, B, C, \SpecialChar \ldots{}
(大文字);
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
roman
\end_layout
\end_inset
i, ii, iii, \SpecialChar \ldots{}
(小文字ローマ数字);
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
Roman
\end_layout
\end_inset
I, II, III\SpecialChar \ldots{}
(大文字ローマ数字);
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
hebrew
\end_layout
\end_inset
(ヘブライ語数字)。
\end_layout
\end_deeper
\begin_layout Standard
LabelStringが定義されていないときは、既定値は以下のように組み立てられます。このカウンタに親カウンタ
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
master
\end_layout
\end_inset
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
Within
\end_layout
\end_inset
で定義)があるときには、文字列
\begin_inset Newline linebreak
\end_inset
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
\backslash
themaster.
\backslash
arabic{カウンタ}
\end_layout
\end_inset
が使用されます。それ以外の場合は、
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
\backslash
arabic{カウンタ}
\end_layout
\end_inset
が使用されます。
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
LabelStringAppendix
\end_layout
\end_inset
[
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
文字列
\end_layout
\end_inset
=""]
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
LabelString
\end_layout
\end_inset
と同様ですが、付録で使用するためのものです。
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
PrettyFormat
\end_layout
\end_inset
[
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
文字列
\end_layout
\end_inset
=
\begin_inset Quotes erd
\end_inset
\begin_inset Quotes erd
\end_inset
] このカウンタの整形参照で使用する書式。たとえば、節番号への参照を「Section 2.4」のように表示させたい場合には、文字列に「##」を含めます。これは、カ
ウンタ番号で置換されます。したがって、節の場合には「Section ##」のようにします。
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
Within
\end_layout
\end_inset
[
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
文字列
\end_layout
\end_inset
=
\begin_inset Quotes erd
\end_inset
\begin_inset Quotes erd
\end_inset
] これを別のカウンタ名に設定すると、現在のカウンタは、別のカウンタが増加する毎にリセットされます。たとえば、
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
subsection
\end_layout
\end_inset
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
section
\end_layout
\end_inset
毎に番号がリセットされます。
\end_layout
\begin_layout Subsection
フォント指定
\begin_inset CommandInset label
LatexCommand label
name "sub:フォント指定"
\end_inset
\end_layout
\begin_layout Standard
フォント指定は、以下のような形を取ります。
\end_layout
\begin_layout LyX-Code
Font
\family roman
\emph on
または
\family default
\emph default
LabelFont
\end_layout
\begin_layout LyX-Code
...
\end_layout
\begin_layout LyX-Code
EndFont
\end_layout
\begin_layout Standard
以下のコマンドを使用することができます。
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
Color
\end_layout
\end_inset
[
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
\emph on
none
\end_layout
\end_inset
,
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
black
\end_layout
\end_inset
,
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
white
\end_layout
\end_inset
,
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
red
\end_layout
\end_inset
,
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
green
\end_layout
\end_inset
,
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
blue
\end_layout
\end_inset
,
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
cyan
\end_layout
\end_inset
,
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
magenta
\end_layout
\end_inset
,
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
yellow
\end_layout
\end_inset
]
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
Family
\end_layout
\end_inset
[
\emph on
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
Roman
\end_layout
\end_inset
\emph default
,
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
Sans
\end_layout
\end_inset
,
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
Typewriter
\end_layout
\end_inset
]
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
Misc
\end_layout
\end_inset
[
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
文字列
\end_layout
\end_inset
] 有効な引数は、
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
emph
\end_layout
\end_inset
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
noun
\end_layout
\end_inset
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
strikeout
\end_layout
\end_inset
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
underbar
\end_layout
\end_inset
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
uuline
\end_layout
\end_inset
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
uwave
\end_layout
\end_inset
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
no_emph
\end_layout
\end_inset
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
no_noun
\end_layout
\end_inset
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
no_strikeout
\end_layout
\end_inset
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
no_bar
\end_layout
\end_inset
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
no_uuline
\end_layout
\end_inset
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
no_uwave
\end_layout
\end_inset
です。それぞれ、対応する属性を有効にしたり無効にしたりします。
\begin_inset Newline newline
\end_inset
たとえば、
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
emph
\end_layout
\end_inset
は強調を有効にし、
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
no_emph
\end_layout
\end_inset
はそれを無効にします。もし後者がわかりにくければ、現在のコンテクストのフォント設定は、一般的に周囲のコンテクストから継承していることを思い出してください。ですか
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
no_emph
\end_layout
\end_inset
は、たとえば定理環境で、何をせずとも有効となっている強調を無効にするのです。
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
Series
\end_layout
\end_inset
[
\emph on
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
Medium
\end_layout
\end_inset
\emph default
,
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
Bold
\end_layout
\end_inset
]
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
Shape
\end_layout
\end_inset
[
\emph on
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
Up
\end_layout
\end_inset
\emph default
,
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
Italic
\end_layout
\end_inset
,
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
SmallCaps
\end_layout
\end_inset
,
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
Slanted
\end_layout
\end_inset
]
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
Size
\end_layout
\end_inset
[
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
tiny
\end_layout
\end_inset
,
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
small
\end_layout
\end_inset
,
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
\emph on
normal
\end_layout
\end_inset
,
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
large
\end_layout
\end_inset
,
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
larger
\end_layout
\end_inset
,
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
largest
\end_layout
\end_inset
,
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
huge
\end_layout
\end_inset
,
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
giant
\end_layout
\end_inset
]
\end_layout
\begin_layout Subsection
\begin_inset CommandInset label
LatexCommand label
name "sub:引用書式指定"
\end_inset
引用書式指定
\end_layout
\begin_layout Standard
引用ダイアログやツールチップなどのLyX内部やXHTML出力において、書誌情報をどのように表示するべきかの叙述には、
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
CiteFormat
\end_layout
\end_inset
ブロックが使用されています。このブロックは、以下のような形をしています。
\end_layout
\begin_layout LyX-Code
CiteFormat
\end_layout
\begin_layout LyX-Code
article ...
\end_layout
\begin_layout LyX-Code
book ...
\end_layout
\begin_layout LyX-Code
End
\end_layout
\begin_layout Standard
上記の各行は、それぞれarticleやbookに関連付けられた書誌情報をどのように表示するべきかを定義するものですが、このような定義は、BibTeXファイル中に
存在しうる「項目型」すべてについて与えることができます。特定の定義が与えられなければ、LyXは、ソースコード中に定義されている既定書式を使用します。LyXは、い
くつかの書式を
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
stdciteformats.inc
\end_layout
\end_inset
ファイルで事前定義しており、これはほとんどのLyX文書クラスにインクルードされています。
\end_layout
\begin_layout Standard
この定義は、BibTeXキーをその値で置換できる機能を持った、簡単な言語を使用しています。キーは、
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
%author%
\end_layout
\end_inset
のように
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
%
\end_layout
\end_inset
記号でくくらなくてはなりません。したがって、簡単な定義は以下のようになります。
\end_layout
\begin_layout LyX-Code
misc %author%,
\begin_inset Quotes eld
\end_inset
%title%
\begin_inset Quotes erd
\end_inset
\end_layout
\begin_layout Standard
これは、「著者名・コンマ・引用に囲まれたタイトル・終止符」を出力します。
\end_layout
\begin_layout Standard
もちろん、キーが存在するときのみ、キーを出力したい時があるはずです。このようなときには
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
{%volume%[[vol.
\begin_inset space ~
\end_inset
%volume%]]}
\end_layout
\end_inset
のように、条件付きの構成を使用することができます。これは、
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
volume
\end_layout
\end_inset
が存在するならば「vol.
\begin_inset space ~
\end_inset
」とvolumeキーを出力するという意味です。また、
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
{%author%[[%author%]][[%editor%, ed.]]}
\end_layout
\end_inset
のように、条件の中にelse節を含めることも可能です。ここでは、もし
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
author
\end_layout
\end_inset
キーが存在するならば出力され、そうでなければeditorキーと「,
\begin_inset space ~
\end_inset
ed.」が出力されます。ここでもキーは、
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
%
\end_layout
\end_inset
記号でくくられていることに注意してください。条件全体は、波括弧で囲まれています。if節およびelse節は、「
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
[[
\end_layout
\end_inset
」と「
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
]]
\end_layout
\end_inset
」の二重角括弧で囲まれています。これらすべてのあいだには,空白は入ってはなりません。
\end_layout
\begin_layout Standard
もう一つ、定義中で使用することのできる文法として、
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
{!<i>!}
\end_layout
\end_inset
という形をしたものがあります。これは、「リッチテキスト」を生成するときに使われる整形情報を定義するものです。当然のことながら、平文を書き出すときには、HTMLタ
グを出力させたくはありませんから、HTMLタグは「
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
{!
\end_layout
\end_inset
」と「
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
!}
\end_layout
\end_inset
」でくるんでやらなくてはならないのです。
\end_layout
\begin_layout Standard
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
CiteFormat
\end_layout
\end_inset
ブロックでは、他に2つの特殊な定義が可能です。一つめの例としては、
\end_layout
\begin_layout LyX-Code
!quotetitle
\begin_inset Quotes eld
\end_inset
%title%
\begin_inset Quotes erd
\end_inset
\end_layout
\begin_layout Standard
といった例が挙げられます。これは、短縮形ないしはマクロであり、
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
%!quotetitle%
\end_layout
\end_inset
のように、これがキーであるかのように扱って使用することができます。LyXは、
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
%!quotetitle%
\end_layout
\end_inset
を、そこで定義されているものを扱う場合と同じように取り扱います。ですから、明白な警告を敢えてさせて頂くと、
\end_layout
\begin_layout LyX-Code
!funfun %funfun%
\end_layout
\begin_layout Standard
のようなことはしないでください。LyXは、無限ループに陥るようなことはありませんが、諦めるまでに長いループに入るかもしれません。
\end_layout
\begin_layout Standard
特殊な定義の二つめは、
\end_layout
\begin_layout LyX-Code
_pptext pp.
\end_layout
\begin_layout Standard
のようなものです。これは、文字列の翻訳可能な部分を定義するもので、書誌情報中の関連部分が翻訳されるようにすることができます。
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
%_pptext%
\end_layout
\end_inset
のように、これをキーとして扱って、定義の中に入れることもできます。これらのうちいくつかは、
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
stdciteformats.inc
\end_layout
\end_inset
中に事前定義されています。これは、上記で述べたような意味でのマクロではないことに注意してください。
\end_layout
\begin_layout Standard
以下は、これらの機能を全て使った例です。
\end_layout
\begin_layout LyX-Code
!authoredit {%author%[[%author%, ]][[{%editor%[[%editor%, %_edtext%, ]]}]]}
\end_layout
\begin_layout Standard
これは、
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
author
\end_layout
\end_inset
キーが定義されているならば、著者とコンマを出力し、
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
author
\end_layout
\end_inset
キーが定義されておらず、
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
editor
\end_layout
\end_inset
キーが定義されているならば、編集者名の後に
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
_edtext
\end_layout
\end_inset
ないしはその翻訳既定では「ed.」)を出力します。これは実は
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
stdciteformats.inc
\end_layout
\end_inset
の中で定義されていますので、このファイルをまず読みこめば、ご自身の定義ないしは再定義の中で使用することができます。
\end_layout
\begin_layout Section
\begin_inset CommandInset label
LatexCommand label
name "sec:XHTML出力のタグ"
\end_inset
XHTML出力のタグ
\end_layout
\begin_layout Standard
LaTeXやDocBookと同様、LyXのXHTML出力の書式も、レイアウト情報によって制御することができます。一般的に、LyXは適切な既定値を提供し、前述した
ように、他のレイアウトタグに基づいて、既定のCSSスタイルの構成まで行ないます。たとえば、章見出しを適切に整形するためのCSSを書き出すために、LyXは、章様式
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
Font
\end_layout
\end_inset
宣言で提供されている情報を利用しようと試みます。
\end_layout
\begin_layout Standard
したがって、多くの場合、使いたい環境や任意設定差込枠などのために満足のいくXHTML出力を得るために、まったく何もしなくてよいことになるでしょう。しかしながら、
これが必要になる場合もあるので、LyXは、生成されるXHTMLやCSSをカスタマイズするために使用できるレイアウトタグを、たくさん提供しています。
\end_layout
\begin_layout Standard
様式宣言や差込枠宣言の外で使用することができるタグに、
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
HTMLPreamble
\end_layout
\end_inset
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
AddToHTMLPreamble
\end_layout
\end_inset
の2つがあることに注意してください。これらの詳細については、第
\begin_inset CommandInset ref
LatexCommand ref
reference "sub:汎用テキストクラスパラメータ"
\end_inset
節をご覧ください。
\end_layout
\begin_layout Subsection
\begin_inset CommandInset label
LatexCommand label
name "sub:段落様式-XHTML"
\end_inset
段落様式
\end_layout
\begin_layout Standard
LyXが段落のために出力するXHTMLの種類は、通常の段落を取り扱っているのか、コマンドを取り扱っているのか、あるいは環境を取り扱っているのかに依存し、これは対
応する
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
LaTeXType
\end_layout
\end_inset
タグの内容によって決定されます。
\end_layout
\begin_layout Standard
コマンドや通常の段落の場合には、XHTML出力は以下の形になります。
\end_layout
\begin_layout LyX-Code
<tag attr=
\begin_inset Quotes erd
\end_inset
value
\begin_inset Quotes erd
\end_inset
>
\end_layout
\begin_layout LyX-Code
<labeltag attr=
\begin_inset Quotes erd
\end_inset
value
\begin_inset Quotes erd
\end_inset
>ラベル</labeltag>
\end_layout
\begin_layout LyX-Code
段落の内容
\end_layout
\begin_layout LyX-Code
</tag>
\end_layout
\begin_layout Standard
もちろん、段落にラベルがなければ、ラベルタグは省略することができます。
\end_layout
\begin_layout Standard
環境のうち、リストの変種でないものに関しては、XHTMLは以下の形を取ります。
\end_layout
\begin_layout LyX-Code
<tag attr=
\begin_inset Quotes erd
\end_inset
value
\begin_inset Quotes erd
\end_inset
>
\end_layout
\begin_layout LyX-Code
<itemtag attr=
\begin_inset Quotes erd
\end_inset
value
\begin_inset Quotes erd
\end_inset
><labeltag attr=
\begin_inset Quotes erd
\end_inset
value
\begin_inset Quotes erd
\end_inset
>環境ラベル</labeltag>最初の段落。
\end_layout
\begin_layout LyX-Code
</itemtag>
\end_layout
\begin_layout LyX-Code
<itemtag>二つめの段落。</itemtag>
\end_layout
\begin_layout LyX-Code
</tag>
\end_layout
\begin_layout Standard
ラベルは、たとえば定理の場合にそうであるように、最初の段落にだけ出力されることに注意してください。
\end_layout
\begin_layout Standard
リストに関しては、次のような形になります。
\end_layout
\begin_layout LyX-Code
<tag attr=
\begin_inset Quotes erd
\end_inset
value
\begin_inset Quotes erd
\end_inset
>
\end_layout
\begin_layout LyX-Code
<itemtag attr=
\begin_inset Quotes erd
\end_inset
value
\begin_inset Quotes erd
\end_inset
><labeltag attr=
\begin_inset Quotes erd
\end_inset
value
\begin_inset Quotes erd
\end_inset
>リストのラベル</labeltag>最初の項目。</itemtag>
\end_layout
\begin_layout LyX-Code
<itemtag attr=
\begin_inset Quotes erd
\end_inset
value
\begin_inset Quotes erd
\end_inset
><labeltag attr=
\begin_inset Quotes erd
\end_inset
value
\begin_inset Quotes erd
\end_inset
>リストのラベル</labeltag>二つめの項目。</itemtag>
\end_layout
\begin_layout LyX-Code
</tag>
\end_layout
\begin_layout LyX-Code
\end_layout
\begin_layout LyX-Code
<tag attr=
\begin_inset Quotes erd
\end_inset
value
\begin_inset Quotes erd
\end_inset
>
\end_layout
\begin_layout LyX-Code
<labeltag attr=
\begin_inset Quotes erd
\end_inset
value
\begin_inset Quotes erd
\end_inset
>リストのラベル</labeltag><itemtag attr=
\begin_inset Quotes erd
\end_inset
value
\begin_inset Quotes erd
\end_inset
>最初の項目。</itemtag>
\end_layout
\begin_layout LyX-Code
<labeltag attr=
\begin_inset Quotes erd
\end_inset
value
\begin_inset Quotes erd
\end_inset
>リストのラベル</labeltag><itemtag attr=
\begin_inset Quotes erd
\end_inset
value
\begin_inset Quotes erd
\end_inset
>二つめの項目</itemtag>
\end_layout
\begin_layout LyX-Code
</tag>
\end_layout
\begin_layout Standard
ここで
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
labeltag
\end_layout
\end_inset
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
itemtag
\end_layout
\end_inset
の順序が違っていることに注意してください。どちらの順序になるかは、
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
HTMLLabelFirst
\end_layout
\end_inset
の設定に依存します。もし
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
HTMLLabelFirst
\end_layout
\end_inset
が偽であれば既定値、最初のケースのようになり、これが真であれば、二番めのケースのように、labelがitemの外側に来るようになります。
\end_layout
\begin_layout Standard
各段落の特定のタグ出力や属性出力は、以下に述べるようなレイアウトタグを使って制御することができます。しかしながら、前述のように、多くの場合、LyXは適切な既定値
を生成するので、たいしたことをしなくても、望ましいXHTML出力を得ることができるということになるはずです。ここで利用出来るタグは、自分の好みにあわせて微調整す
る目的でここにあるものと考えてください。
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
HTMLAttr
\end_layout
\end_inset
[
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
文字列
\end_layout
\end_inset
] 主幹タグと共に出力される属性情報を指定します。たとえば、「
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
class=`mydiv'
\end_layout
\end_inset
」のようなものです。既定においては、LyXは「
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
class=`レイアウト名'
\end_layout
\end_inset
」と出力します。ここで
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
レイアウト名
\end_layout
\end_inset
は、レイアウトのLyX名であり、chapterのように小文字で記述します。
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
HTMLForceCSS
\end_layout
\end_inset
[
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
\emph on
0
\emph default
,1
\end_layout
\end_inset
] 
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
HTMLStyle
\end_layout
\end_inset
で追加情報が明示的に与えられているときでも、LyXがこのレイアウト用に生成する既定CSS情報を出力するか否か。これを
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
1
\end_layout
\end_inset
にすると、生成されたCSSを完全に上書きする代わりに、変更したり追加したりすることができます。既定値は
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
0
\end_layout
\end_inset
です。
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
HTMLItem
\end_layout
\end_inset
[
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
文字列
\end_layout
\end_inset
] 環境の段落に使用されるタグ。上記各例の
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
itemtag
\end_layout
\end_inset
を置き換えます。既定値は
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
div
\end_layout
\end_inset
です。
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
HTMLItemAttr
\end_layout
\end_inset
[
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
文字列
\end_layout
\end_inset
] itemタグの属性。既定値は
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
class=`レイアウト名_item'
\end_layout
\end_inset
です。
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
HTMLLabel
\end_layout
\end_inset
[
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
文字列
\end_layout
\end_inset
] 段落と項目ラベルに使用されるタグ。上記各例の
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
labeltag
\end_layout
\end_inset
を置き換えます。既定値は
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
span
\end_layout
\end_inset
です。
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
HTMLLabelAttr
\end_layout
\end_inset
[
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
文字列
\end_layout
\end_inset
] labelタグの属性。既定値は
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
class=`レイアウト名_label'
\end_layout
\end_inset
です。
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
HTMLLabelFirst
\end_layout
\end_inset
[
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
\emph on
0
\emph default
,1
\end_layout
\end_inset
] このタグは、リスト関係環境でのみ意味を持ち、labelタグが、itemタグの前に出力されるか、中に出力されるかを制御します。これは、たとえば、descrip
tion環境の中で、
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
`<dt>\SpecialChar \ldots{}
</dt><dd>\SpecialChar \ldots{}
</dd>
\end_layout
\end_inset
という形を得るために使用されます。既定値は
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
0
\end_layout
\end_inset
で、labelタグはitemタグの中に出力されます。
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
HTMLPreamble
\end_layout
\end_inset
この様式が使用されたときに、
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
<head>
\end_layout
\end_inset
セクションに出力される情報。これは、たとえば、
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
onclick
\end_layout
\end_inset
ハンドラを定義するために
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
<script>
\end_layout
\end_inset
ブロックをインクルードするのに使用することができます。
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
HTMLStyle
\end_layout
\end_inset
 この様式が使用されたときに、インクルードするCSSスタイル情報。これは、レイアウトが生成する
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
<style>
\end_layout
\end_inset
ブロックで自動的に包まれますので、CSS自体をインクルードするだけで大丈夫です。
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
HTMLTag
\end_layout
\end_inset
[
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
文字列
\end_layout
\end_inset
] 主幹ラベルに使用されるタグ。上記各例の
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
tag
\end_layout
\end_inset
を置き換えます。既定値は
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
div
\end_layout
\end_inset
です。
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
HTMLTitle
\end_layout
\end_inset
[
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
\emph on
0
\emph default
,1
\end_layout
\end_inset
] この様式が、XHTMLファイルの
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
<title>
\end_layout
\end_inset
タグを生成するのに使用する様式であるという印をつけます。既定値は偽です。
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
stdtitle.inc
\end_layout
\end_inset
ファイルでは、
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
title
\end_layout
\end_inset
環境のこの項目を真に設定しています。
\end_layout
\begin_layout Subsection
差込枠レイアウトXHTML
\end_layout
\begin_layout Standard
差込枠のXHTML出力も、レイアウトファイル内の情報によって制御することができます
\begin_inset Foot
status collapsed
\begin_layout Plain Layout
現在のところ、これは「テキスト」差込枠(中に書き込みができる差込枠)にのみ有効で、「コマンド」差込枠(ダイアログボックスに関連付けられた差込枠)には適用されませ
ん。
\end_layout
\end_inset
。ここでも、LyXは適切な既定値を提供しようと試み、既定のCSS様式を構成します。しかし、すべてカスタマイズ可能です。
\end_layout
\begin_layout Standard
LyXが差込枠用に出力するXHTMLは、以下の形を取ります。
\end_layout
\begin_layout LyX-Code
<tag attr=
\begin_inset Quotes erd
\end_inset
value
\begin_inset Quotes erd
\end_inset
>
\end_layout
\begin_layout LyX-Code
<labeltag>ラベル</labeltag>
\end_layout
\begin_layout LyX-Code
<innertag attr=
\begin_inset Quotes erd
\end_inset
value
\begin_inset Quotes erd
\end_inset
>差込枠の内容。</innertag>
\end_layout
\begin_layout LyX-Code
</tag>
\end_layout
\begin_layout Standard
差込枠が多段落を許可している---つまり
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
MultiPar
\end_layout
\end_inset
が真---ならば、差込枠の内容は、それ自身段落として出力され、それらの段落に用いられる様式(標準、引用など)を用いて整形されます。もちろん、段落にラベルがなけれ
ば、labelタグは省略され、ラベルがあれば、現在のところ、つねに
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
span
\end_layout
\end_inset
が用いられます。innerタグは非必須であり、既定では出力されません。各差込枠用に出力される特定のタグや属性は、以下のレイアウトタグによって制御することができま
す。
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
HTMLAttr
\end_layout
\end_inset
[
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
文字列
\end_layout
\end_inset
] 主幹タグと共に出力される属性情報を指定します。たとえば、「
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
class=`mydiv'
\end_layout
\end_inset
」のようなものです。既定においては、LyXは「
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
class=`レイアウト名'
\end_layout
\end_inset
」と出力します。ここで
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
レイアウト名
\end_layout
\end_inset
は、レイアウトのLyX名であり、chapterのように小文字で記述します。
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
HTMLForceCSS
\end_layout
\end_inset
[
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
\emph on
0
\emph default
,1
\end_layout
\end_inset
] 
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
HTMLStyle
\end_layout
\end_inset
で追加情報が明示的に与えられているときでも、LyXがこのレイアウト用に生成する既定CSS情報を出力するか否か。これを
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
1
\end_layout
\end_inset
にすると、生成されたCSSを完全に上書きする代わりに、変更したり追加したりすることができます。既定値は
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
0
\end_layout
\end_inset
です。
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
HTMLInnerAttr
\end_layout
\end_inset
[
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
文字列
\end_layout
\end_inset
] innerタグの属性。既定値は
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
class=`差込枠名_inner'
\end_layout
\end_inset
です。
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
HTMLInnerTag
\end_layout
\end_inset
[
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
文字列
\end_layout
\end_inset
] innerタグです。上記各例の
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
innertag
\end_layout
\end_inset
を置き換えます。既定値はなしです。
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
HTMLIsBlock
\end_layout
\end_inset
[
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
0,
\emph on
1
\end_layout
\end_inset
] この差込枠が脚注のように独立した文字列ブロックを表すのか、それとも、派生枝のように周囲の文字列の中に取り込まれる素材を表すのか。既定値は1です。
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
HTMLLabel
\end_layout
\end_inset
[
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
文字列
\end_layout
\end_inset
] 場合によっては、カウンタへの参照を含む、この差込枠のラベル。たとえば、脚注用には
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
\backslash
arabic{footnote}
\end_layout
\end_inset
など。これは非必須であり、既定値はありません。
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
HTMLPreamble
\end_layout
\end_inset
この様式が使用されたときに、
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
<head>
\end_layout
\end_inset
セクションに出力される情報。これは、たとえば、
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
onclick
\end_layout
\end_inset
ハンドラを定義するために
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
<script>
\end_layout
\end_inset
ブロックをインクルードするのに使用することができます。
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
HTMLStyle
\end_layout
\end_inset
 この様式が使用されたときに、インクルードするCSSスタイル情報。これは、レイアウトが生成する
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
<style>
\end_layout
\end_inset
ブロックで自動的に包まれますので、CSS自体をインクルードするだけで大丈夫です。
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
HTMLTag
\end_layout
\end_inset
[
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
文字列
\end_layout
\end_inset
] 主幹ラベルに使用されるタグ。上記各例の
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
tag
\end_layout
\end_inset
を置き換えます。既定値は
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
MultiPar
\end_layout
\end_inset
の設定に依存し、
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
MultiPar
\end_layout
\end_inset
が真ならば
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
div
\end_layout
\end_inset
、偽ならば
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
span
\end_layout
\end_inset
です。
\end_layout
\begin_layout Subsection
フロートXHTML
\end_layout
\begin_layout Standard
フロートのXHTML出力も、レイアウトファイル内の情報によって制御することができます。出力は、以下の形を取ります。
\end_layout
\begin_layout LyX-Code
<tag attr=
\begin_inset Quotes erd
\end_inset
value
\begin_inset Quotes erd
\end_inset
>
\end_layout
\begin_layout LyX-Code
フロートの内容。
\end_layout
\begin_layout LyX-Code
</tag>
\end_layout
\begin_layout Standard
キャプションは、存在している場合には、独立した差込枠となり、そのような形で出力されます。その外観は、キャプション差込枠のInsetLayoutで制御することがで
きます。
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
HTMLAttr
\end_layout
\end_inset
[
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
文字列
\end_layout
\end_inset
] 主幹タグと共に出力される属性情報を指定します。たとえば、「
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
class=`myfloat' onclick=`\SpecialChar \ldots{}
'
\end_layout
\end_inset
」のようなものです。既定においては、LyXは「
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
class=`float float-フロート型'
\end_layout
\end_inset
」と出力します。ここで
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
フロート型
\end_layout
\end_inset
は、フロート宣言で定義された(
\begin_inset CommandInset ref
LatexCommand ref
reference "sub:フロート"
\end_inset
参照、この型のフロートのLyX名です。ただし、小文字に変換され、アルファベットや数字でない文字はアンダースコアに変換されます。例float-table。
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
HTMLStyle
\end_layout
\end_inset
 このフロートが使用されたときに、インクルードするCSSスタイル情報。これは、レイアウトが生成する
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
<style>
\end_layout
\end_inset
ブロックで自動的に包まれますので、CSS自体をインクルードするだけで大丈夫です。
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
HTMLTag
\end_layout
\end_inset
[
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
文字列
\end_layout
\end_inset
] このフロートに使用されるタグ。上記各例の
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
tag
\end_layout
\end_inset
を置き換えます。既定値は
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
div
\end_layout
\end_inset
であり、ほとんどの場合変更する必要はありません。
\end_layout
\begin_layout Subsection
書誌情報の整形
\end_layout
\begin_layout Standard
書誌情報は、
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
CiteFormat
\end_layout
\end_inset
ブロックを使用して整形することができます。詳細については、第
\begin_inset CommandInset ref
LatexCommand ref
reference "sub:引用書式指定"
\end_inset
節を参照してください。
\end_layout
\begin_layout Subsection
LyXが生成したCSS
\end_layout
\begin_layout Standard
LyXは、提供されている他のレイアウト情報に基づいて、差込枠と段落様式の両方の既定CSS様式ルールを生成ということすることを、これまでに何度か触れました。この節
では、LyXがどのレイアウト情報を、どのように使うのか、ひとこと述べておきたいと思います。
\end_layout
\begin_layout Standard
LyXは、現在のところ、
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
Font
\end_layout
\end_inset
宣言で指定されている
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
Family
\end_layout
\end_inset
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
Series
\end_layout
\end_inset
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
Shape
\end_layout
\end_inset
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
Size
\end_layout
\end_inset
を利用して、フォント情報についてのみCSSを自動生成します
\begin_inset CommandInset ref
LatexCommand ref
reference "sub:フォント指定"
\end_inset
節を参照)。この変換は、きわめて分かりやすく自明です。たとえば、「
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
Family Sans
\end_layout
\end_inset
」は「
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
font-family: sans-serif
\end_layout
\end_inset
」になります。LyXの寸法とCSSの寸法のあいだの対応は、少し複雑ですが、それでも直感的に分かります。詳細については、
\begin_inset Flex URL
status collapsed
\begin_layout Plain Layout
src/FontInfo.cpp
\end_layout
\end_inset
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
getSizeCSS()
\end_layout
\end_inset
関数をご覧ください。
\end_layout
\begin_layout Chapter
外部素材を取り込む
\end_layout
\begin_layout Standard
\begin_inset Box Shadowbox
position "t"
hor_pos "c"
has_inner_box 1
inner_pos "t"
use_parbox 0
use_makebox 0
width "100col%"
special "none"
height "1in"
height_special "totalheight"
status open
\begin_layout Plain Layout
【警告】本説明書のこの部分は、しばらく更新されていません。もちろんまだ正確であることを期待していますが、保証の限りではありません。
\end_layout
\end_inset
\end_layout
\begin_layout Standard
LyX外部のソースから素材を使用する方法は、取扱説明書
\emph on
埋込オブジェクト篇
\emph default
で詳細にカバーされています。本章は、新種の素材を取り込む際に、舞台裏で何をする必要があるかをカバーします。
\end_layout
\begin_layout Section
どのように機能するのか
\end_layout
\begin_layout Standard
外部素材の機能は、ひな型の概念に基づいています。ひな型は、LyXがある型の素材とどのように橋渡しをするべきかを指定するものです。同梱物として、LyXは、Xfig
の図や、様々なラスター形式画像、チェス棋譜、LilyPond楽譜用のひな型を事前に定義されたものとして含んでいます。実際に何が入っているかは、
\begin_inset Flex MenuItem
status collapsed
\begin_layout Plain Layout
挿入\SpecialChar \menuseparator
ファイル\SpecialChar \menuseparator
外部素材
\end_layout
\end_inset
メニューで見ることができます。さらに、特定の型の素材をサポートするのに、自分自身のひな型を作成することも可能です。後でどのようなことをすればいいか詳細に説明しま
すが、できればあなたが作ったすべてのひな型を投稿して、我々がLyXの後の版に取り込むことができるようにしてくださることを希望します。
\end_layout
\begin_layout Standard
外部素材の機能におけるもう一つの基本的な発想は、最終素材の元となるオリジナルファイルと、書き出された文書や印刷された文書に取り込むための生成ファイルとを区別して
いることです。たとえば、
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
Xfig
\end_layout
\end_inset
で作成した図の場合を考えてみましょう。Xfigアプリケーション自体は、
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
.fig
\end_layout
\end_inset
拡張子を持つオリジナルファイルを操作します。Xfigで図を作成したり変更したりして、作業が終われば
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
fig
\end_layout
\end_inset
ファイルに保存します。この図をお使いの文書に取り込みたいときには、LaTeXファイルにそのままインクルードできるように、
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
transfig
\end_layout
\end_inset
を呼び出してPostScriptファイルを生成します。この場合には、
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
.fig
\end_layout
\end_inset
ファイルがオリジナルファイルであり、PostScriptファイルが生成ファイルになります。
\end_layout
\begin_layout Standard
この区別は、文書を執筆している最中に、素材を更新することができるようにするために重要です。さらに、これによって、複数の書き出し書式をサポートするために必要な柔軟
性が提供されます。たとえば、平文テキストファイルの場合には、図を生のPostScriptファイルとして取り込むのは、とても褒められた発想とはいえません。むしろ、
その図への参照だけを含めるか、最終出力が実際の画像に近いものとなるように画像からASCIIへの変換子を呼び出したいと考えることでしょう。LyXの外部素材マネジメ
ントは、LyXがサポートする各書き出し書式別に仕分けしているので、ユーザがこれを行うことが可能となっています。
\end_layout
\begin_layout Standard
LyXの外部素材マネジメントは、書き出し書式によって異なる生成物をサポートすることの他に、編集・閲覧アプリケーションを緊密に統合することもサポートします。Xfi
gの図の場合には、LyXの外部素材ダイアログからシングルクリックでオリジナルファイルをXfigで開くことができ、ダブルクリックすることで生成されたPostScr
iptファイルをGhostviewで閲覧することができます。もうコマンドラインをもてあそんだり、オリジナルファイルや生成ファイルがどこにあるか探したり変更を加え
るためにファイルブラウザをいじくり回す必要はないのです。このようにして、文書を執筆する際に必要となる多くのアプリケーションを最大限に利用し、最終的により生産性を
上げることができるようになるのです。
\end_layout
\begin_layout Section
外用ひな型設定ファイル
\end_layout
\begin_layout Standard
LyXに自製の外用ひな型を付け加えるのは、比較的簡単です。しかしながら、これを不用心に行ってしまうと、たいていの場合、簡単に濫用されてしまうようなセキュリティホ
ールを作ってしまいがちであることを心に留めておいてください。したがって、これを実行に移す前に、第
\begin_inset CommandInset ref
LatexCommand ref
reference "sec:セキュリティに関する論点"
\end_inset
節のセキュリティに関する議論を読んでおいてください。
\end_layout
\begin_layout Standard
このことに言及した上で、あなたが作成した面白いひな型は、ぜひ投稿してください。
\end_layout
\begin_layout Standard
外用ひな型は、
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
LyXDir/lib/external_templates
\end_layout
\end_inset
ファイルで定義されています。自分用の版を
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
UserDir/external_templates
\end_layout
\end_inset
に置くこともできます。
\end_layout
\begin_layout Standard
典型的なひな型は以下のようになります。
\end_layout
\begin_layout LyX-Code
Template XFig
\end_layout
\begin_layout LyX-Code
GuiName "XFig: $$AbsOrRelPathParent$$Basename"
\end_layout
\begin_layout LyX-Code
HelpText
\end_layout
\begin_layout LyX-Code
An XFig figure.
\end_layout
\begin_layout LyX-Code
HelpTextEnd
\end_layout
\begin_layout LyX-Code
InputFormat fig
\end_layout
\begin_layout LyX-Code
FileFilter "*.fig"
\end_layout
\begin_layout LyX-Code
AutomaticProduction true
\end_layout
\begin_layout LyX-Code
Transform Rotate
\end_layout
\begin_layout LyX-Code
Transform Resize
\end_layout
\begin_layout LyX-Code
Format LaT
\begin_inset ERT
status collapsed
\begin_layout Plain Layout
{}
\end_layout
\end_inset
eX
\end_layout
\begin_layout LyX-Code
TransformCommand Rotate RotationLatexCommand
\end_layout
\begin_layout LyX-Code
TransformCommand Resize ResizeLatexCommand
\end_layout
\begin_layout LyX-Code
Product "$$RotateFront$$ResizeFront
\end_layout
\begin_layout LyX-Code
\backslash
\backslash
input{$$AbsOrRelPathMaster$$Basename.pstex_t}
\end_layout
\begin_layout LyX-Code
$$ResizeBack$$RotateBack"
\end_layout
\begin_layout LyX-Code
UpdateFormat pstex
\end_layout
\begin_layout LyX-Code
UpdateResult "$$AbsPath$$Basename.pstex_t"
\end_layout
\begin_layout LyX-Code
Requirement "graphicx"
\end_layout
\begin_layout LyX-Code
ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pstex_t"
\end_layout
\begin_layout LyX-Code
ReferencedFile latex "$$AbsPath$$Basename.eps"
\end_layout
\begin_layout LyX-Code
ReferencedFile dvi "$$AbsPath$$Basename.eps"
\end_layout
\begin_layout LyX-Code
FormatEnd
\end_layout
\begin_layout LyX-Code
Format PDFLaT
\begin_inset ERT
status collapsed
\begin_layout Plain Layout
{}
\end_layout
\end_inset
eX
\end_layout
\begin_layout LyX-Code
TransformCommand Rotate RotationLatexCommand
\end_layout
\begin_layout LyX-Code
TransformCommand Resize ResizeLatexCommand
\end_layout
\begin_layout LyX-Code
Product "$$RotateFront$$ResizeFront
\end_layout
\begin_layout LyX-Code
\backslash
\backslash
input{$$AbsOrRelPathMaster$$Basename.pdftex_t}
\end_layout
\begin_layout LyX-Code
$$ResizeBack$$RotateBack"
\end_layout
\begin_layout LyX-Code
UpdateFormat pdftex
\end_layout
\begin_layout LyX-Code
UpdateResult "$$AbsPath$$Basename.pdftex_t"
\end_layout
\begin_layout LyX-Code
Requirement "graphicx"
\end_layout
\begin_layout LyX-Code
ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pdftex_t"
\end_layout
\begin_layout LyX-Code
ReferencedFile latex "$$AbsPath$$Basename.pdf"
\end_layout
\begin_layout LyX-Code
FormatEnd
\end_layout
\begin_layout LyX-Code
Format Ascii
\end_layout
\begin_layout LyX-Code
Product "$$Contents(
\backslash
"$$AbsPath$$Basename.asc
\backslash
")"
\end_layout
\begin_layout LyX-Code
UpdateFormat asciixfig
\end_layout
\begin_layout LyX-Code
UpdateResult "$$AbsPath$$Basename.asc"
\end_layout
\begin_layout LyX-Code
FormatEnd
\end_layout
\begin_layout LyX-Code
Format DocBook
\end_layout
\begin_layout LyX-Code
Product "<graphic fileref=
\backslash
"$$AbsOrRelPathMaster$$Basename.eps
\backslash
">
\end_layout
\begin_layout LyX-Code
</graphic>"
\end_layout
\begin_layout LyX-Code
UpdateFormat eps
\end_layout
\begin_layout LyX-Code
UpdateResult "$$AbsPath$$Basename.eps"
\end_layout
\begin_layout LyX-Code
ReferencedFile docbook "$$AbsPath$$Basename.eps"
\end_layout
\begin_layout LyX-Code
ReferencedFile docbook-xml "$$AbsPath$$Basename.eps"
\end_layout
\begin_layout LyX-Code
FormatEnd
\end_layout
\begin_layout LyX-Code
Product "[XFig: $$FName]"
\end_layout
\begin_layout LyX-Code
FormatEnd
\end_layout
\begin_layout LyX-Code
TemplateEnd
\end_layout
\begin_layout Standard
ご覧の通り、ひな型は
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
Template
\end_layout
\end_inset
\SpecialChar \ldots{}
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
TemplateEnd
\end_layout
\end_inset
で閉じられます。ひな型には、一般的な設定を行うヘッダ部と、サポートされている主要な文書ファイル書式の設定を行う
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
Format
\end_layout
\end_inset
\SpecialChar \ldots{}
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
FormatEnd
\end_layout
\end_inset
部があります。
\end_layout
\begin_layout Subsection
ひな型のヘッダ
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
AutomaticProduction
\begin_inset space ~
\end_inset
true|false
\end_layout
\end_inset
このひな型で扱うファイルをLyXが生成しなくてはならないか否か。このコマンドは、一度だけ必ず現れなくてはなりません。
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
FileFilter
\begin_inset space ~
\end_inset
<パターン>
\end_layout
\end_inset
望むファイル群を表示するために、ファイルダイアログで使用するフィルタ用globパターン。2つ以上のファイル拡張子があり得る場合たとえば、tgifには
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
.obj
\end_layout
\end_inset
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
.tgo
\end_layout
\end_inset
があります)、「
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
*.{obj,tgo}
\end_layout
\end_inset
」の様なパターンを使用してください。このコマンドは、一度だけ必ず現れなくてはなりません。
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
GuiName
\begin_inset space ~
\end_inset
<GUI名>
\end_layout
\end_inset
この文字列はボタン上に表示されます。このコマンドは、一度だけ必ず現れなくてはなりません。
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
HelpText
\begin_inset space ~
\end_inset
<文章>
\begin_inset space ~
\end_inset
HelpTextEnd
\end_layout
\end_inset
外部素材ダイアログで使用されるヘルプ文。このひな型がユーザに何を提供できるのか、ユーザに説明するのに十分な情報を盛り込んでください。このコマンドは、一度だけ必
ず現れなくてはなりません。
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
InputFormat
\begin_inset space ~
\end_inset
<書式>
\end_layout
\end_inset
オリジナルファイルのファイル書式。これは、LyXが知っている書式名でなくてはなりません
\begin_inset CommandInset ref
LatexCommand ref
reference "sec:書式"
\end_inset
章参照。このひな型が、2つ以上の書式のオリジナルファイルを取り扱える場合は、「
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
*
\end_layout
\end_inset
」を使用してください。この場合、LyXはファイル書式を推定するために、ファイル自体に詮索を試みます。このコマンドは、一度だけ必ず現れなくてはなりません。
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
Template
\begin_inset space ~
\end_inset
<ID>
\end_layout
\end_inset
このひな型の(他と重複しない)名称。代入マクロを含めてはなりません(下記参照)。
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
Transform
\begin_inset space ~
\end_inset
Rotate|Resize|Clip|Extra
\end_layout
\end_inset
このコマンドは、このひな型がどのような変換をサポートしているかを指定します。これは全く登場しなくても1回以上現れても構いません。このコマンドは、外部素材ダイア
ログ中の対応するタブを使用可能にします。
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
Transform
\end_layout
\end_inset
コマンド一つずつに応じて、
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
Format
\end_layout
\end_inset
部に、対応する
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
TransformCommand
\end_layout
\end_inset
コマンドか
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
TransformOption
\end_layout
\end_inset
コマンドを置かなくてはなりません。これを行わないと、この書式での変換はサポートされません。
\end_layout
\begin_layout Subsection
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
Format
\end_layout
\end_inset
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
Format
\begin_inset space ~
\end_inset
LaT
\begin_inset ERT
status collapsed
\begin_layout Plain Layout
{}
\end_layout
\end_inset
eX|PDFLaT
\begin_inset ERT
status collapsed
\begin_layout Plain Layout
{}
\end_layout
\end_inset
eX|PlainText|DocBook
\end_layout
\end_inset
この書式定義が定める主要な文書ファイル書式。すべてのひな型が、全文書ファイル書式に対して意味のある表示ができるわけではありません。それでも、全書式に対して
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
Format
\end_layout
\end_inset
部を定義してください。表示する方法がないときは、ダミーテキストを使用してください。これによって、書き出した文書内で、少なくとも外部素材への参照を見ることができる
ようになります。
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
Option
\begin_inset space ~
\end_inset
<名称>
\begin_inset space ~
\end_inset
<値>
\end_layout
\end_inset
このコマンドは、
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
Product
\end_layout
\end_inset
での代入に使うマクロ
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
$$<名称>
\end_layout
\end_inset
を新たに定義します。
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
<値>
\end_layout
\end_inset
自体にも代入マクロを使うことができます。
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
Product
\end_layout
\end_inset
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
<値>
\end_layout
\end_inset
を直接使用するよりも優れた点は、
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
$$<名称>
\end_layout
\end_inset
に代入された値が、その文書書式で有効な非必須引数となるように健全化されることです。このコマンドは全く登場しなくても1回以上現れても構いません。
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
Product
\begin_inset space ~
\end_inset
<文>
\end_layout
\end_inset
書き出された文書に挿入される文。実のところ、これが最も重要なコマンドであり、とても複雑になることがあります。このコマンドは、一度だけ必ず現れなくてはなりません
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
Preamble
\begin_inset space ~
\end_inset
<名称>
\end_layout
\end_inset
このコマンドは、LaTeXプリアンブルに入れるプリアンブル片を指定します。これは
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
PreambleDef
\end_layout
\end_inset
\SpecialChar \ldots{}
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
PreambleDefEnd
\end_layout
\end_inset
を使用して定義しなくてはなりません。このコマンドは全く登場しなくても1回以上現れても構いません。
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
ReferencedFile
\begin_inset space ~
\end_inset
<書式>
\begin_inset space ~
\end_inset
<ファイル名>
\end_layout
\end_inset
このコマンドは、変換過程で生成され、特定の書き出し書式に必要とされるファイルを示します。ファイル名が相対パスである場合には、親文書に対する相対パスとして解釈さ
れます。このコマンドは全く登場しなくても1回以上現れても構いません。
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
Requirement
\begin_inset space ~
\end_inset
<package>
\end_layout
\end_inset
必要とされるLaTeXパッケージ名。パッケージは、LaTeXプリアンブル中で
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
\backslash
usepackage{}
\end_layout
\end_inset
を使って取り込まれます。このコマンドは全く登場しなくても1回以上現れても構いません。
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
TransformCommand
\begin_inset space ~
\end_inset
Rotate
\begin_inset space ~
\end_inset
RotationLatexCommand
\end_layout
\end_inset
このコマンドは、回転用に、組み込みのLaTeXコマンドを使用するように指定します。このコマンドは、1回現れても全く現れなくても構いません。
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
TransformCommand
\begin_inset space ~
\end_inset
Resize
\begin_inset space ~
\end_inset
ResizeLatexCommand
\end_layout
\end_inset
このコマンドは、伸縮用に、組み込みのLaTeXコマンドを使用するように指定します。このコマンドは、1回現れても全く現れなくても構いません。
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
TransformOption
\begin_inset space ~
\end_inset
Rotate
\begin_inset space ~
\end_inset
RotationLatexOption
\end_layout
\end_inset
このコマンドは、回転が非必須引数を通じて行われるように指定します。このコマンドは、1回現れても全く現れなくても構いません。
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
TransformOption
\begin_inset space ~
\end_inset
Resize
\begin_inset space ~
\end_inset
ResizeLatexOption
\end_layout
\end_inset
このコマンドは、伸縮が非必須引数を通じて行われるように指定します。このコマンドは、1回現れても全く現れなくても構いません。
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
TransformOption
\begin_inset space ~
\end_inset
Clip
\begin_inset space ~
\end_inset
ClipLatexOption
\end_layout
\end_inset
このコマンドは、切り抜きが非必須引数を通じて行われるように指定します。このコマンドは、1回現れても全く現れなくても構いません。
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
TransformOption
\begin_inset space ~
\end_inset
Extra
\begin_inset space ~
\end_inset
ExtraLatexOption
\end_layout
\end_inset
このコマンドは、追加の非必須引数を使用することを指定します。このコマンドは、1回現れても全く現れなくても構いません。
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
UpdateFormat
\begin_inset space ~
\end_inset
<書式>
\end_layout
\end_inset
変換されたファイルのファイル書式。これは、LyXが知っている書式名でなくてはなりません
\begin_inset Flex MenuItem
status collapsed
\begin_layout Plain Layout
ツール\SpecialChar \menuseparator
設定:変換子
\end_layout
\end_inset
ダイアログを参照)。このコマンドは、一度だけ必ず現れなくてはなりません。
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
UpdateResult
\begin_inset space ~
\end_inset
<ファイル名>
\end_layout
\end_inset
変換されたファイルのファイル名。ファイル名は絶対パスでなくてはなりません。このコマンドは、一度だけ必ず現れなくてはなりません。
\end_layout
\begin_layout Subsection
プリアンブルの定義
\end_layout
\begin_layout Standard
外用ひな型設定ファイルには、
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
PreambleDef
\end_layout
\end_inset
\SpecialChar \ldots{}
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
PreambleDefEnd
\end_layout
\end_inset
で囲んだプリアンブル定義を追加することができます。これらの定義は、ひな型の
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
Format
\end_layout
\end_inset
部で使用することができます。
\end_layout
\begin_layout Section
代入機構
\end_layout
\begin_layout Standard
外部素材機構が外部プログラムを呼び出すときには、ひな型設定ファイルで定義されたコマンドにしたがって行われます。これらのコマンドには、実行前に展開されるマクロをい
ろいろ入れることができます。実行は、つねに元の文書があるディレクトリで行われます。
\end_layout
\begin_layout Standard
また、外部素材が表示されるときにはいつでも、その名称は代入機構によって組み立てられ、ひな型定義中の他のほとんどのコマンドも代入をサポートしています。
\end_layout
\begin_layout Standard
使用できるマクロは以下の通りです。
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
$$AbsOrRelPathMaster
\end_layout
\end_inset
LyX親文書への絶対ファイルパスないしは相対ファイルパス
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
$$AbsOrRelPathParent
\end_layout
\end_inset
LyX文書への絶対ファイルパスないしは相対ファイルパス
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
$$AbsPath
\end_layout
\end_inset
絶対ファイルパス
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
$$Basename
\end_layout
\end_inset
パスおよび拡張子を除いたファイル名
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
$$Contents(
\begin_inset Quotes eld
\end_inset
filename.ext
\begin_inset Quotes erd
\end_inset
)
\end_layout
\end_inset
このマクロは、
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
filename.ext
\end_layout
\end_inset
と云う名のファイルの中身を展開します。
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
$$Extension
\end_layout
\end_inset
ファイル拡張子(点を含む)
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
$$FName
\end_layout
\end_inset
外部素材ダイアログで指定されたファイルのファイル名。これはLyX文書への絶対パスでも良いですし、相対パスでも構いません。
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
$$FPath
\end_layout
\end_inset
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
$$FName
\end_layout
\end_inset
のパス部分LyX文書への絶対パス名か相対パス名
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
$$RelPathMaster
\end_layout
\end_inset
LyX親文書への相対ファイルパス
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
$$RelPathParent
\end_layout
\end_inset
LyX文書への相対ファイルパス
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
$$Sysdir
\end_layout
\end_inset
このマクロは、システムディレクトリの絶対パスを展開します。これは、典型的には、LyXに同梱されているヘルパースクリプト群を示したりするのに使用されます。
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
$$Tempname
\end_layout
\end_inset
元の文書が閉じられたり、挿入されていた外部素材が削除されたりすると自動的に削除される一時ファイルのフルパスとファイル名。
\end_layout
\begin_layout Standard
パスを示すマクロはすべて最後のディレクトリ区切りも含んでいますので、たとえば絶対パスのファイル名を
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
$$AbsPath$$Basename$$Extension
\end_layout
\end_inset
のようにして作ることができます。
\end_layout
\begin_layout Standard
上記マクロは、特記しない限りはすべてのコマンドで代入が行われます。
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
Transform
\end_layout
\end_inset
コマンドと
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
TransformCommand
\end_layout
\end_inset
コマンドが有効にされている場合、
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
Product
\end_layout
\end_inset
コマンドは、これらに加えて以下の代入もサポートします。
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
$$ResizeFront
\end_layout
\end_inset
伸縮コマンドの前置部。
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
$$ResizeBack
\end_layout
\end_inset
伸縮コマンドの後置部。
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
$$RotateFront
\end_layout
\end_inset
回転コマンドの前置部。
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
$$RotateBack
\end_layout
\end_inset
回転コマンドの後置部。
\end_layout
\begin_layout Standard
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
Option
\end_layout
\end_inset
コマンドの値に入れる文字列では、
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
Transform
\end_layout
\end_inset
コマンドと
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
TransformOption
\end_layout
\end_inset
コマンドが有効にされていれば、以下の代入もサポートされます。
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
$$Clip
\end_layout
\end_inset
切り抜きオプション。
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
$$Extra
\end_layout
\end_inset
追加オプション。
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
$$Resize
\end_layout
\end_inset
伸縮オプション。
\end_layout
\begin_layout Description
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
$$Rotate
\end_layout
\end_inset
回転オプション。
\end_layout
\begin_layout Standard
どうしてこんなに多くのパス関連マクロがあるのか不思議に思われるかもしれません。主に以下の二つの理由があります。
\end_layout
\begin_layout Enumerate
相対ファイル名と絶対ファイル名は、それぞれ相対的あるいは絶対的なままで維持されなくてはなりません。ユーザにはどちらかの形を好む理由があるのかもしれません。たとえ
ば相対名は、いろいろなマシンで作業をする持ち運び用の文書で役立ちます。絶対名は、プログラムによっては必要とされることがあり得ます。
\end_layout
\begin_layout Enumerate
LaTeXは、相対ファイル名に関して、LyXや入れ子にした取り込みファイル中の他のプログラムとは異なった取り扱いを行います。LyXにとって相対ファイル名とは、常
にこのファイル名が書かれている文書に対して相対的なものになります。LaTeXにとっての相対ファイル名は、常に親文書に対するものになります。これら二つの定義は、一
つの文書しかないときには同じですが、部分文書を含む親文書があるときには異なったものとなってきます。つまり、相対ファイル名は、LaTeXに提示されるときに変換され
なくてはならないのです。幸い、正しいマクロを選びさえすれば、これはLyXが自動的に行ってくれます。
\end_layout
\begin_layout Standard
すると、新しく作ったひな型定義では、どのパス関連マクロを使うべきでしょうか。このルールは難しくありません。つまり、
\end_layout
\begin_layout Itemize
絶対パスが必要とされるときには
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
$$AbsPath
\end_layout
\end_inset
を使う。
\end_layout
\begin_layout Itemize
代入された文字列が、LaTeXインプットの一種である場合には、
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
$$AbsOrRelPathMaster
\end_layout
\end_inset
を使う。
\end_layout
\begin_layout Itemize
それ以外ならば、ユーザの選択を尊重するために
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
$$AbsOrRelPathParent
\end_layout
\end_inset
を使う。
\end_layout
\begin_layout Standard
このルールが機能せずに、たとえば相対名が必要となる特殊な場合もありますが、通常、上記でうまく動作します。特殊例の例としては、上述のXFigひな型での
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
ReferencedFile latex "$$AbsOrRelPathMaster$$Basename.pstex_t"
\end_layout
\end_inset
というコマンドがあります。この場合、
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
.pstex_t
\end_layout
\end_inset
ファイルの複写子は、ファイル内容を書き換えるのに相対名を必要とするために、絶対名を使用することができないのです。
\end_layout
\begin_layout Section
セキュリティに関する論点
\begin_inset CommandInset label
LatexCommand label
name "sec:セキュリティに関する論点"
\end_inset
\end_layout
\begin_layout Standard
外部素材機能は、多くの外部プログラムとの橋渡しをし、しかもそれを自動的に行うので、そのセキュリティ面での帰結を考慮しなくてはなりません。特に、ユーザは好きなファ
イル名やパラメータ文字列を含めることが許されていて、しかもそれらがコマンドに展開されるので、ユーザが文書を閲覧したり印刷したりしたときに、任意のコマンドを実行す
ることができるような悪意ある文書を作成することが可能となりましょう。これは、我々がぜひとも避けたいことなのです。
\end_layout
\begin_layout Standard
しかしながら、外部プログラムコマンドはひな型設定ファイルでのみ指定されているので、LyXが安全なひな型でのみ適切に設定されているならば、セキュリティ上の問題は発
生しません。これは、外部プログラムが
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
system
\end_layout
\end_inset
システムコールではなく、
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
execvp
\end_layout
\end_inset
システムコールで呼び出されているため、ファイル名やパラメータ部からシェル経由で任意のコマンドを実行することはできないためです。
\end_layout
\begin_layout Standard
これは、外部素材ひな型でどのようなコマンド文字列を使用することのできるかについて、制限があることを意味します。特に、パイプやリダイレクトはそのまま使用することは
できません。これは、LyXの安全性を維持するためにそうしなくてはならないのです。もしシェル機能の一部を使用したいとすると、これを完全に統御の下においたまま行う安
全なスクリプトを書いた上で、このスクリプトをコマンド文字列から呼び出すようにしなくてはなりません。
\end_layout
\begin_layout Standard
シェルと直接やりとりするひな型を設計することは可能ではありますが、悪意のあるユーザが狡猾なファイル名やパラメータを書くことによって、任意のコマンドを実行できるよ
うになるため、一般的には、統御下に置いた状態で
\begin_inset Flex Code
status collapsed
\begin_layout Plain Layout
execvp
\end_layout
\end_inset
システムコールを使用する安全なスクリプトのみを使用することをお勧めします。確かに、管理された環境下で使用する分には、通常のシェルスクリプトを使用する方に流れる誘
惑はあります。そうした場合には、お使いのシステムに簡単に濫用することのできるセキュリティホールを、
\emph on
間違いなく
\emph default
導入することを理解しておいてください。オープンソースの伝統に従って、私たちは人々に新しいひな型を投稿してくれるよう促していますが、そのような安全でないひな型はL
yXの標準頒布版には取り入れるべきでないとすることには当然の正当性があります。公式の頒布チャンネルから出荷されているLyXには、安全でないひな型は決して入ってい
ません。
\end_layout
\begin_layout Standard
外部素材を含めることで強力な力を手に入れることができますが、この力とともにセキュリティ上の危険を導入してしまわないように気をつける必要があります。無防備なスクリ
プトのたった一行に入り込んだ、ちょっとしたエラーが、巨大なセキュリティ上の問題に扉を開きうるのです。したがって、もしこの問題を完全に理解していないならば、特定の
ひな型が安全であるかどうか疑問がある際には、知識豊富なセキュリティの専門家か、LyX開発チームに相談してみてください。そしてこの相談は、管理されていない環境下で
これを使用する前に、行うようにしてください。
\end_layout
\end_body
\end_document