string const name = p.verbatim_item();
string const body1 = p.verbatim_item();
string const body2 = p.verbatim_item();
- // store the in_lyx_preamble setting
- bool const was_in_lyx_preamble = in_lyx_preamble;
- if (name == "subref"
- || name == "thmref"
- || name == "lemref") {
- p.skip_spaces();
- in_lyx_preamble = true;
- }
// only non-lyxspecific stuff
- if (!in_lyx_preamble) {
+ if (in_lyx_preamble &&
+ (name == "subref" || name == "thmref" || name == "lemref"))
+ p.skip_spaces();
+ else {
ostringstream ss;
ss << '\\' << t.cs();
ss << '{' << name << '}'
<< '{' << body2 << '}';
h_preamble << ss.str();
}
- // restore the in_lyx_preamble setting
- in_lyx_preamble = was_in_lyx_preamble;
}
else if (t.cs() == "AtBeginDocument") {
string const name = p.verbatim_item();
- // store the in_lyx_preamble setting
- bool const was_in_lyx_preamble = in_lyx_preamble;
- if (name == "\\providecommand\\partref[1]{\\ref{part:#1}}"
+ // only non-lyxspecific stuff
+ if (in_lyx_preamble &&
+ (name == "\\providecommand\\partref[1]{\\ref{part:#1}}"
|| name == "\\providecommand\\chapref[1]{\\ref{chap:#1}}"
|| name == "\\providecommand\\secref[1]{\\ref{sec:#1}}"
|| name == "\\providecommand\\subref[1]{\\ref{sub:#1}}"
|| name == "\\providecommand\\lemref[1]{\\ref{lem:#1}}"
|| name == "\\providecommand\\thmref[1]{\\ref{thm:#1}}"
|| name == "\\providecommand\\corref[1]{\\ref{cor:#1}}"
- || name == "\\providecommand\\propref[1]{\\ref{prop:#1}}") {
+ || name == "\\providecommand\\propref[1]{\\ref{prop:#1}}"))
p.skip_spaces();
- in_lyx_preamble = true;
- }
- // only non-lyxspecific stuff
- if (!in_lyx_preamble) {
+ else {
ostringstream ss;
ss << '\\' << t.cs();
ss << '{' << name << '}';
h_preamble << ss.str();
}
- // restore the in_lyx_preamble setting
- in_lyx_preamble = was_in_lyx_preamble;
}
else if (t.cs() == "newcommand" || t.cs() == "newcommandx"
% Load refstyle before prettyref so that prettyref wins.
% The real refstyle tests are in test-refstyle-theorems.tex.
\usepackage{refstyle}
+\AtBeginDocument{\providecommand\secref[1]{\ref{sec:#1}}}
\def\mycommand{\textquestiondown}
\begin_header
\textclass book
\begin_preamble
-
-
-
-
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% LyX specific LaTeX commands.
-
-\floatstyle{ruled}
-\newfloat{algorithm}{tbp}{loa}[chapter]
-\providecommand{\algorithmname}{Algorithm}
-\floatname{algorithm}{\protect\algorithmname}
-
-
-
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Textclass specific LaTeX commands.
-\theoremstyle{plain}
-\newtheorem{thm}{}\theoremstyle{plain}
-\newtheorem{lem}[thm]{}\theoremstyle{plain}
-\newtheorem{cor}[thm]{}\theoremstyle{plain}
-\newtheorem{prop}[thm]{}\theoremstyle{plain}
-\newtheorem{conjecture}[thm]{}\theoremstyle{plain}
-\newtheorem{fact}[thm]{}\theoremstyle{definition}
-\newtheorem{defn}[thm]{}\theoremstyle{definition}
-\newtheorem{example}[thm]{}\theoremstyle{definition}
-\newtheorem{problem}[thm]{}\theoremstyle{definition}
-\newtheorem{xca}[thm]{}\theoremstyle{remark}
-\newtheorem{rem}[thm]{}\theoremstyle{remark}
-\newtheorem{claim}[thm]{}\ifx\proof\undefined
-\newenvironment{proof}[1][\protect\proofname]{\par
-\normalfont\topsep6\p@\@plus6\p@\relax
-\trivlist
-\itemindent\parindent
-\item[\hskip\labelsep\scshape #1]\ignorespaces
-}{%
-\endtrivlist\@endpefalse
-}
-\providecommand{\proofname}{Proof}
-\fi
-
-
-
\usepackage{babel}
-\providecommand{\claimname}{Claim}
-\providecommand{\conjecturename}{Conjecture}
-\providecommand{\corollaryname}{Corollary}
-\providecommand{\definitionname}{Definition}
-\providecommand{\examplename}{Example}
-\providecommand{\exercisename}{Exercise}
-\providecommand{\factname}{Fact}
-\providecommand{\lemmaname}{Lemma}
-\providecommand{\problemname}{Problem}
-\providecommand{\propositionname}{Proposition}
-\providecommand{\remarkname}{Remark}
-\providecommand{\theoremname}{Theorem}
-
\end_preamble
\use_default_options false
+%% LyX trick_preamble_code_into_believing_that_this_was_created_by_lyx created this file. For more info, see http://www.lyx.org/.
+%% Do not edit unless you really know what you are doing.
\documentclass[english]{book}
\usepackage[T1]{fontenc}
\usepackage[latin9]{inputenc}