X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=lib%2Fsyntax.default;h=f18ea74b795e729d59a251bd5704881c1a5b9f5f;hb=4436678c97d94b64e3254aa53026c0404cbb8f8a;hp=0ddbfe2a017d998eaf06d662173c1a785c335a93;hpb=a76050219a44c07922914ad876f4ba6c1e61c107;p=lyx.git diff --git a/lib/syntax.default b/lib/syntax.default index 0ddbfe2a01..f18ea74b79 100644 --- a/lib/syntax.default +++ b/lib/syntax.default @@ -1,8 +1,8 @@ % This is the default list of commands for tex conversion programs to read % It tells how many arguments each command takes, and which of them % (if any) are optional. -% It is taken from the list of commands written by John Weiss 970311 for reLyX -% plus the math commands from math_hash.C +% It is taken from the list of commands originally written by John Weiss +% 1997-03-11 for reLyX plus the math commands from math_hash.C % % Also had to add textrm etc. commands and many size commands (like \small) % @@ -55,9 +55,9 @@ $$ \`{} \~{} \b{} -% \begin{}[] %reLyX will get confused if \begin is found in this file! +%\begin{}[] %tex2lyx will get confused if \begin is found in this file! %\begin{}[]{} % All of these show the different variations of \begin (jpw) -%\begin{}{} % reLyX can only handle \begin{} +%\begin{}{} %\begin{}{}{} %\begin{}[][][]{} %\begin{}(,) @@ -118,7 +118,7 @@ $$ \documentstyle[]{} \em \emph{} -% \end{} %reLyX will get confused if \end is found in this file! +%\end{} %tex2lyx will get confused if \end is found in this file! \epsf{} \epsfbox{} \epsffile{} @@ -263,8 +263,6 @@ $$ % arguments] and those that insert lists, since a list isn't a single % object. % -% I had to remove things that TeX.pm doesn't recognize as a token, and hardcode -% those into reLyX. This included !' ?' -- --- and maybe some other things \ % A "\" followed by a space. \, @@ -360,8 +358,21 @@ $$ % % Arguments whose text is "translate" will have regular LaTeX in them (as % opposed to commands with special syntax) which should be translated by -% reLyX like regular LaTeX. \mbox{} is an obvious example. LyX doesn't +% tex2lyx like regular LaTeX. \mbox{} is an obvious example. LyX doesn't % support it, but only the "\mbox{" and the "}" need to be in TeX mode. +% "translate" should be specified for as many arguments aspossible. +% Besides the better on-screen display of the contents (a math inset looks +% better than a formula in ERT), it enables LyX to apply some fixes to LaTeX +% limitations: For example, footnotes in section headings do not work in +% LaTeX, but LyX produces preamble code to fix that. Of course this works only +% for footnote insets and not for footnotes in ERT. Example: +% \section{title \texorpdfstring{\footnote{foo}}{bar}} +% is some code that may occur in a .tex file created by LyX. The re-import +% works only because the first argument of \texorpdfstring is specified as +% translatable in this file. +% If a command puts the contents of an argument inside an own group, use +% "group" instead of "translate". Otherwise things like font changes would +% survive the end of the group in LyX (bug 3036). \abstractname \Acrobatmenu{}{} % from the hyperref package @@ -389,6 +400,8 @@ $$ \bottomfraction \caption[]{} \cc{} +\ce{} +\cf{} \ccname \centering \centerline{translate} @@ -396,27 +409,35 @@ $$ \chapter*{} \chaptername \check{} +\CheckCommand{}[][]{} +\CheckCommand*{}[][]{} +\CheckCommandx{}[][]{} % xargs.sty +\CheckCommandx*{}[][]{} % xargs.sty %\circle{} % picture environment (JMarc) %\circle*{} \cleardoublepage \clearpage \closing{} \color[]{,,} % Two variants of this command and the next (jpw) -% \color{} % This variant doesn't matter to reLyX (adk) +%\color{} \colorspec[]{,,}{} -%\colorspec{}{} % This variant doesn't matter to reLyX (adk) +%\colorspec{}{} %\contentsline{}{\numberline{} }{} % Appears only in .toc file (JMarc) \contentsname -% \dashbox{}(,)[]{} %picture +%\dashbox{}(,)[]{} %picture \date{} \dblfigrule \dblfloatpagefraction \dbltopfraction +\DeclareRobustCommand{}[][]{} +\DeclareRobustCommand*{}[][]{} +\DeclareRobustCommandx{}[][]{} % xargs.sty +\DeclareRobustCommandx*{}[][]{} % xargs.sty \def{}{} \definecolor{}{}{,,} +\DeleteShortVerb{} % from doc.sty, argument must be verbatim \DescribeMacro{} \discretionary{}{}{} -\email[]{} \encl{} \enclname \enlargethispage{} @@ -425,7 +446,7 @@ $$ \extracolsep{} \fbox{translate} \fcolorbox[]{,,}{,,}{} % Two variants of this command -%\fcolorbox{}{}{} % This variant doesn't matter to reLyX (adk) +%\fcolorbox{}{}{} \figurename \floatpagefraction \flushbottom @@ -448,7 +469,6 @@ $$ \glossaryentry{}{} %only in .glo file (JMarc) % \graphpaper[](,)(,) %picture \headtoname -\homepage[]{} \href{}{translate} % from the hyperref package \hspace{} \hspace*{} @@ -461,7 +481,7 @@ $$ \ifthenelse \includegraphics*[,][,]{} % LyX 1.0 doesn't support clipping figures \indent -\index{} +\index{translate} \indexentry{}{} % only in .idx files (JMarc) \indexname \indexspace @@ -481,7 +501,7 @@ $$ \labelitemiv \language{} % We need this because the arguments must not be interpreted -\let{}{} +\let{item}{item} % \line(,){} %picture \linebreak[] \linethickness{} @@ -499,8 +519,9 @@ $$ \makelabel{translate} \makelabels \maketitle -\markboth{}{translate} -\markright{translate} +\MakeShortVerb{} % from doc.sty, argument must be verbatim +\markboth{group}{group} +\markright{group} \mathversion{} \mbox{translate} \mddefault @@ -509,11 +530,13 @@ $$ \newboolean{} \newcommand{}[][]{} \newcommand*{}[][]{} -%\newcommand{}[]{} % reLyX doesn't care about missing optarg +\newcommandx{}[][]{} % xargs.sty +\newcommandx∗{}[][]{} % xargs.sty \newcounter{}[] \newenvironment{}[][]{}{} \newenvironment*{}[][]{}{} -% \newenvironment{}[]{}{} % reLyX doesn't care about missing optarg +\newenvironmentx{}[][]{}{} % xargs.sty +\newenvironmentx*{}[][]{}{} % xargs.sty \newfont{}{ scaled } \newlength{} \newpage @@ -536,7 +559,7 @@ $$ % \oval(,)[] %picture \pagebreak[] \pagecolor[]{,,} -% \pagecolor{} % reLyX doesn't care about this version +% \pagecolor{} % tex2lyx can first care about this when fileformat 351 is supported \pagename \pagenumbering{} \par @@ -551,10 +574,12 @@ $$ \pdfstringdef{}{} % from the hyperref package \poptabs \prefacename -\printindex +\printindex[]{} \protect \providecommand{}[][]{} \providecommand*{}[][]{} +\providecommandx{}[][]{} % xargs.sty +\providecommandx*{}[][]{} % xargs.sty \ps \psfrag{}[][][][]{translate} \psfrag*{}[][][][]{translate} @@ -572,10 +597,13 @@ $$ \refstepcounter{} \renewcommand{}[][]{} \renewcommand*{}[][]{} -% \renewcommand{}[]{} %reLyX doesn't care about variants +\renewcommandx{}[][]{} % xargs.sty +\renewcommandx∗{}[][]{} % xargs.sty \renewenvironment{}[][]{}{} \renewenvironment*{}[][]{}{} -% \renewenvironment{}[]{}{} +%\renewenvironment{}[]{}{} +\renewenvironmentx{}[][]{}{} % xargs.sty +\renewenvironmentx*{}[][]{}{} % xargs.sty \resizebox{}{}{translate} \resizebox*{}{}{translate} \reversemarginpar @@ -607,6 +635,7 @@ $$ \shortstack[]{translate} \showhyphens{} \signature{} +\sindex[]{translate} %splitidx.sty \sldefault \sloppy \stepcounter{} @@ -627,11 +656,20 @@ $$ \tableofcontents \tabularnewline[] \telephone{translate} -\texorpdfstring{}{} % from the hyperref package +\texorpdfstring{translate}{translate} % from the hyperref package \textcircled{translate} \textcolor[]{,,}{translate} -%\textcolor{}{} % reLyX doesn't care about this version -\textnormal{translate} +%\textcolor{}{} +\textbf{translate} % hardcoded, but needed nevertheless for \let\xyz\textbf +\textnormal{translate} % hardcoded, but needed nevertheless for \let\xyz\textnormal +\textmd{translate} % hardcoded, but needed nevertheless for \let\xyz\textmd +\textit{translate} % hardcoded, but needed nevertheless for \let\xyz\textit +\textrm{translate} % hardcoded, but needed nevertheless for \let\xyz\textrm +\textsc{translate} % hardcoded, but needed nevertheless for \let\xyz\textsc +\textsf{translate} % hardcoded, but needed nevertheless for \let\xyz\textsf +\textsl{translate} % hardcoded, but needed nevertheless for \let\xyz\textsl +\texttt{translate} % hardcoded, but needed nevertheless for \let\xyz\texttt +\textup{translate} % hardcoded, but needed nevertheless for \let\xyz\textup \textfraction \thanks{translate} \thicklines @@ -650,45 +688,14 @@ $$ \usepackage[]{}[] \value{} % \vector(,){} %picture -% \verb|| % reLyX needs \verb to be hardcoded +% \verb|| % tex2lyx fails on \verb, see http://www.lyx.org/trac/ticket/4468 and http://www.lyx.org/trac/ticket/5408 % \verb*|| \visible \vline \vspace{} \vspace*{} \whiledo{}{} - - -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% There are some environments which reLyX doesn't have an equivalent for. -% However, *within* that environment, simple translatable LaTeX appears. -% (E.g., this doesn't include something like "picture" because the TeX -% parser can't (yet?) understand the parentheses as being delimiters of -% coordinates rather than plain text.) -% The environment names are placed in a "reLyXre" environment. -% There aren't very many of these; the idea is that the user can add -% user-defined environments in personal syntax files - -\begin{reLyXre} -% filecontents can only appear before \documentclass command, so not worth it -fussypar -sloppypar -% slide only appears in the slides class, but if we don't put this in, then -% the whole document will be copied in TeX mode! -slide -titlepage -\end{reLyXre} - -%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -% Keep bugging André until he adds 'support' for these in mathed, -% meaning that they can be removed from here. - -\begin{reLyXmt} -\sb {_} -\sp {^} -\ensuremath {} % If it's in math mode, \ensuremath is unnec. -\end{reLyXmt} - +\xymatrix{} % this is basically an array => the contents would be parsed badly (bug 8396) % LaTeX environments. % They have always one extra "argument": @@ -697,35 +704,36 @@ titlepage \begin{environments} bibunit[]{translate} psmatrix[]{} +theorem[]{translate} % from amsthm.sty and probably others thebibliography{} \end{environments} % Environments that start math mode. % $...$, $$...$$, \(...\) and \[...\] are hardcoded in tex2lyx. -% The arguments are currently ignored. +% The arguments are currently ignored (apart from displaymath). \begin{mathenvironments} -equation -equation* -eqnarray -eqnarray* -align -align* -gather -gather* -multline -multline* -math -displaymath -flalign -flalign +equation{displaymath} +equation*{displaymath} +eqnarray{displaymath} +eqnarray*{displaymath} +align{displaymath} +align*{displaymath} +gather{displaymath} +gather*{displaymath} +multline{displaymath} +multline*{displaymath} +math{} +displaymath{displaymath} +flalign{displaymath} +flalign{displaymath} % These require extra args -alignat -alignat* -xalignat -xalignat* -xxalignat +alignat{}{displaymath} +alignat*{displaymath} +xalignat{}{displaymath} +xalignat*{}{displaymath} +xxalignat{}{displaymath} % These are not known by LyX but work nevertheless: -empheq +empheq[]{}{displaymath} \end{mathenvironments} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%