样式文件“myoptions1.sty”如下所示:
\setlength{\textwidth}{5.6in}
\setlength{\textheight}{7.1in}
\setlength{\headsep}{0.25in}
\setlength{\abovedisplayskip}{0.2ex plus 0.1ex minus 0.1ex}
\setlength{\abovedisplayshortskip}{0.2ex plus 0.1ex minus 0.1ex}
\setlength{\belowdisplayskip}{0.2ex plus 0.1ex minus 0.1ex}
\setlength{\topsep}{0.5ex plus 0.2ex minus 0.1ex}
\setlength{\itemsep}{2pt}
\newcounter{example}
\newcounter{exercise}
\newcounter{mytheorem}
\newcounter{defin}
\newenvironment{example}{\vspace{10pt}\begin{sloppypar}\stepcounter{example}\noindent{\bf Example \Roman{chapter}.\arabic{section}.\arabic{example}. }%
\nopagebreak \setlength{\parindent}{0pt}}{\hfill\end{sloppypar}\setlength{\parskip}{12pt} }
\newenvironment{exercise}{\vspace{10pt}\begin{sloppypar}\stepcounter{exercise}\noindent{\bf Exercise \Roman{chapter}.\arabic{section}.\arabic{exercise}. } \nopagebreak}{\hfill\unboldmath\end{sloppypar}\setlength{\parskip}{12pt} }
\newenvironment{mytheorem}{\begin{sloppypar}\ \hfill\break\stepcounter{mytheorem}\noindent{\bf Theorem \Roman{chapter}.\arabic{section}.\arabic{mytheorem}. } \nopagebreak}{\hfill\unboldmath\end{sloppypar}}
\newenvironment{defin}{\begin{sloppypar}\ \hfill\break\stepcounter{defin}\noindent{\bf Definition
\Roman{chapter}.\arabic{section}.\arabic{defin}. } \nopagebreak}{\hfill\unboldmath\end{sloppypar}}
\newcommand{\reset}{\setcounter{example}{0}\setcounter{exercise}{0}\setcounter{equation}{0}\setcounter{mytheorem}{0}\setcounter{defin}{0}}
\newcommand{\reseteq}{\setcounter{equation}{0}}
\newenvironment{appendixexample}{\begin{sloppypar}\ \hfill\break\stepcounter{example}\begin{quote}\noindent\bf Example \Alph{section}.\arabic{subsection}-\arabic{example} \normalfont\sffamily\small}{\hfill\(\clubsuit\)\end{quote}\end{sloppypar}}
\newenvironment{appendixexercise}{\begin{sloppypar}\ \hfill\break\stepcounter{exercise}\noindent\bf Exercise \Alph{section}.\arabic{subsection}-\arabic{exercise}\normalfont\small}{\hfill\(\spadesuit\)\end{sloppypar}}
\newcommand{\be}{\begin{exercise}}
\newcommand{\ee}{\end{exercise}}
\newcommand{\bn}{\begin{equation}}
\newcommand{\en}{\end{equation}}
\newcommand{\bna}{\begin{eqnarray}}
\newcommand{\ena}{\end{eqnarray}}
\newcommand{\bnb}{\begin{eqnarray*}}
\newcommand{\enb}{\end{eqnarray*}}
\newcommand{\bt}{\begin{mytheorem}}
\newcommand{\et}{\end{mytheorem}}
\newcommand{\bp}{\begin{example}}
\newcommand{\ep}{\end{example}}
\newcommand{\bd}{\begin{defin}}
\newcommand{\ed}{\end{defin}}
\newcommand{\D}{\displaystyle}
\newcommand{\os}{\bigcirc\!\!\!\!\!\!{ s }\;\;}
\providecommand{\bm}{\boldmath}
\providecommand{\ubm}{\boldmath}
\renewcommand{\bm}{\boldmath}
\renewcommand{\ubm}{\unboldmath}
\allowdisplaybreaks
\renewcommand{\thechapter}{\Roman{chapter}}
\renewcommand{\thesection}{\Roman{chapter}.\arabic{section}}
\newcommand{\bap}{\begin{appendixexample}}
\newcommand{\eap}{\end{appendixexample}}
\newcommand{\bae}{\begin{appendixexercise}}
\newcommand{\eae}{\end{appendixexercise}}
\renewcommand\chapter{\@startsection{chapter}{0}{\z@}%
{24pt}%
{36pt}% {2.5ex \@plus.2ex}%
{\reset \normalfont\itshape\bfseries\huge\raggedleft\noindent}}
\renewcommand\section{\@startsection{section}{1}{\z@}%
{12pt}%
{12pt}%
{\reseteq \noindent\normalfont\large\bfseries }}
\renewcommand\subsection{\@startsection{subsection}{2}{\z@}%
{12pt}%
{12pt}%
{\noindent\normalfont\large\itshape\bfseries }}
\renewcommand\subsubsection{\@startsection{subsubsection}{3}{\z@}%
{-2ex\@plus -1ex \@minus -.2ex}%
{1.5ex \@plus .2ex}%
{\normalfont\normalsize\bfseries}}
\renewcommand\subparagraph{\@startsection{subparagraph}{5}{\parindent}%
{2ex \@plus1ex \@minus .2ex}%
{-1em}%
{\normalfont\normalsize\scshape}}
\newcommand\sectionname{}
%--------- Appendix ----------------------------------------------------------
%
\renewcommand\appendix{\par
\setcounter{section}{0}%
\setcounter{subsection}{0}%
\renewcommand\thesection{\@Alph\c@section}%
\renewcommand\sectionname{\appendixname~}
}
\newcommand{\ch}[3]{\ensuremath{\left\{ #1 \atop #2\ #3 \right\}}}
\newcommand{\bch}[3]{\ensuremath\overline{{\left\{ #1 \atop #2\ #3 \right\}}}}
再次给出 LaTeX 文件,如下所示:
\documentclass[12pt,twoside,english]{book}
\usepackage[T1]{fontenc}
\usepackage[latin1]{inputenc}
\pagestyle{myheadings}
\usepackage{amsmath,amstext}
\usepackage{imakeidx}
\makeindex%[intoc]
\usepackage[dvips]{graphics}
\usepackage[]{graphicx, caption}
\usepackage{epsfig}
\usepackage{floatflt}
\makeindex
\usepackage{chngpage}
\usepackage{amssymb}
\usepackage{ae,aecompl}
\usepackage{mathrsfs}
\makeatletter
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% LyX specific LaTeX commands.
\date{today}
\newtheorem{theo}{Theorem}[section]
\newtheorem{defi}{Definition}[section]
\newtheorem{lem}{Lemma}[section]
\newtheorem{cor}{Corollary}[section]
\newtheorem{pr}{Proposition}[section]
\newtheorem{rem}{Remark}[section]
\newcommand{\noun}[1]{\textsc{#1}}
\newcommand{\bq}{\begin{equation}}
\newcommand{\eq}{\end{equation}}
\newcommand{\bqa}{\begin{eqnarray}}
\newcommand{\eqa}{\end{eqnarray}}
\newcommand{\bqb}{\begin{eqnarray*}}
\newcommand{\eqb}{\end{eqnarray*}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands.
\usepackage{myoptions1}
\usepackage{tocloft}
\addtolength{\cftsecnumwidth}{10pt}
\usepackage{babel}
\makeatother
\begin{document}
\chapter{First Chapter}
\section{First Section}
\begin{example}\label{ex1}
This is an example.
\end{example}
\begin{example}\label{ex2}
This is another example.
\end{example}
\vspace{1em}
In the Example \ref{ex1} and Example \ref{ex2}, we have seen....
\end{document}
我的问题:我正在打电话示例 I.1.1和示例 I.1.2使用代码 \ref{ex1} 和 \ref{ex2}。
但产出却仅仅变成了“一.1“ 代替 ”I.1.1“ 和 ”I.1.2“。
我确实需要帮助来纠正它。