X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Flyx_sty.C;h=9e7d56fdbf4e525438c5c87235af49276325491b;hb=9f871ade6515cd8b105d75d2201142adf329d2fa;hp=a0146ed0f175a5825ade5f4eee195a83e82e096c;hpb=27de1486ca34aaad446adb798d71a77d6f6304da;p=lyx.git diff --git a/src/lyx_sty.C b/src/lyx_sty.C index a0146ed0f1..9e7d56fdbf 100644 --- a/src/lyx_sty.C +++ b/src/lyx_sty.C @@ -1,94 +1,98 @@ -/* - This file is part of - ====================================================== - - LyX, The Document Processor - - Copyright (C) 1995 Matthias Ettrich - Copyright (C) 1995-1998 The LyX Team. - ====================================================== - */ +/** + * \file lyx_sty.C + * This file is part of LyX, the document processor. + * Licence details can be found in the file COPYING. + * + * \author Lars Gullik Bjønnes + * + * Full author contact details are available in file CREDITS. + */ #include #include "lyx_sty.h" + +namespace lyx { + +using std::string; + + //\NeedsTeXFormat{LaTeX2e} //\ProvidesPackage{lyx}[1996/01/11 LLE v0.2 (LyX LaTeX Extensions)] -//\message{LyX LaTeX Extensions (LLE v0.2) of 11-Jan-1996.} +//\message{LyX LaTeX Extensions (LLE v0.2) of 11-Jan-1996.} -// include this always -LString const lyx_def = +string const lyx_def = "\\providecommand{\\LyX}{L\\kern-.1667em\\lower.25em\\hbox{Y}\\kern-.125emX\\@}"; - -LString const lyxline_def = - "\\newcommand{\\lyxline}[1]{\n" - " {#1 \\vspace{1ex} \\hrule width \\columnwidth \\vspace{1ex}}\n" - "}"; -LString const noun_def = "\\newcommand{\\noun}[1]{\\textsc{#1}}"; +string const lyxline_def = + "\\newcommand{\\lyxline}[1][1pt]{%\n" + " \\par\\noindent%\n" + " \\rule[.5ex]{\\linewidth}{#1}\\par}"; + +string const noun_def = "\\newcommand{\\noun}[1]{\\textsc{#1}}"; -LString const lyxarrow_def = - "\\newcommand{\\lyxarrow}{\\leavevmode\\,$\\triangleright$\\,\\allowbreak}"; +string const lyxarrow_def = + "\\newcommand{\\lyxarrow}{\\leavevmode\\,$\\triangleright$\\,\\allowbreak}"; // for quotes without babel. This does not give perfect results, but // anybody serious about non-english quotes should use babel (JMarc). - - -LString const quotedblbase_def = +string const quotedblbase_def = "\\ProvideTextCommandDefault{\\quotedblbase}{%\n" " \\raisebox{-1.4ex}[1ex][.5ex]{\\textquotedblright}%\n" " \\penalty10000\\hskip0em\\relax%\n" "}"; -LString const quotesinglbase_def = +string const quotesinglbase_def = "\\ProvideTextCommandDefault{\\quotesinglbase}{%\n" " \\raisebox{-1.4ex}[1ex][.5ex]{\\textquoteright}%\n" " \\penalty10000\\hskip0em\\relax%\n" "}"; -LString const guillemotleft_def = - "\\ProvideTextCommandDefault{\\guillemotleft}{%\n" - " {\\usefont{U}{lasy}{m}{n}\\char'50\\kern-.15em\\char'50}%\n" - "\\penalty10000\\hskip0pt\\relax%\n" - "}"; - -LString const guillemotright_def = - "\\ProvideTextCommandDefault{\\guillemotright}{%\n" - " \\penalty10000\\hskip0pt%\n" - " {\\usefont{U}{lasy}{m}{n}\\char'51\\kern-.15em\\char'51}%\n" - "}"; - -LString const guilsinglleft_def = - "\\ProvideTextCommandDefault{\\guilsinglleft}{%\n" - " {\\usefont{U}{lasy}{m}{n}\\char'50}%\n" - " \\penalty10000\\hskip0pt\\relax%\n" - "}"; - -LString const guilsinglright_def = - "\\ProvideTextCommandDefault{\\guilsinglright}{%\n" - " \\penalty10000\\hskip0pt%\n" - " {\\usefont{U}{lasy}{m}{n}\\char'51}%\n" - "}"; - -LString const paragraphindent_def = - "\\newenvironment{LyXParagraphIndent}[1]%\n" +string const guillemotleft_def = + "\\ProvideTextCommandDefault{\\guillemotleft}{%\n" + " {\\usefont{U}{lasy}{m}{n}\\char'50\\kern-.15em\\char'50}%\n" + "\\penalty10000\\hskip0pt\\relax%\n" + "}"; + +string const guillemotright_def = + "\\ProvideTextCommandDefault{\\guillemotright}{%\n" + " \\penalty10000\\hskip0pt%\n" + " {\\usefont{U}{lasy}{m}{n}\\char'51\\kern-.15em\\char'51}%\n" + "}"; + +string const guilsinglleft_def = + "\\ProvideTextCommandDefault{\\guilsinglleft}{%\n" + " {\\usefont{U}{lasy}{m}{n}\\char'50}%\n" + " \\penalty10000\\hskip0pt\\relax%\n" + "}"; + +string const guilsinglright_def = + "\\ProvideTextCommandDefault{\\guilsinglright}{%\n" + " \\penalty10000\\hskip0pt%\n" + " {\\usefont{U}{lasy}{m}{n}\\char'51}%\n" + "}"; + +string const paragraphleftindent_def = + "\\newenvironment{LyXParagraphLeftIndent}[1]%\n" "{\n" " \\begin{list}{}{%\n" - " \\setlength\\topsep{0pt}%\n" + " \\setlength{\\topsep}{0pt}%\n" " \\addtolength{\\leftmargin}{#1}\n" -// "%% \\addtolength{\\leftmargin}{#1\\textwidth}\n" -// "%% \\setlength{\\textwidth}{#2\\textwidth}\n" -// "%% \\setlength\\listparindent\\parindent%\n" -// "%% \\setlength\\itemindent\\parindent%\n" - " \\setlength\\parsep{0pt plus 1pt}%\n" +// ho hum, yet more things commented out with no hint as to why they +// weren't just removed +// "%% \\addtolength{\\leftmargin}{#1\\textwidth}\n" +// "%% \\setlength{\\textwidth}{#2\\textwidth}\n" +// "%% \\setlength\\listparindent\\parindent%\n" +// "%% \\setlength\\itemindent\\parindent%\n" + " \\setlength{\\parsep}{0pt plus 1pt}%\n" " }\n" " \\item[]\n" "}\n" "{\\end{list}}\n"; -LString const floatingfootnote_def = +string const floatingfootnote_def = "%% Special footnote code from the package 'stblftnt.sty'\n" "%% Author: Robin Fairbairns -- Last revised Dec 13 1996\n" "\\let\\SF@@footnote\\footnote\n" @@ -106,16 +110,32 @@ LString const floatingfootnote_def = " \\expandafter\\noexpand\\csname SF@gobble@opt \\endcsname}\n" "\\def\\SF@gobble@twobracket[#1]#2{}\n"; -LString const minipageindent_def = - "%% This length is the backup for minipages of the \\parindent\n" - "\\newlength{\\LyXMinipageIndent}\n" - "\\setlength{\\LyXMinipageIndent}{\\parindent}\n"; - -LString const boldsymbol_def = +string const boldsymbol_def = "%% Bold symbol macro for standard LaTeX users\n" - "\\newcommand{\\boldsymbol}[1]{\\mbox{\\boldmath $#1$}}\n"; + "\\providecommand{\\boldsymbol}[1]{\\mbox{\\boldmath $#1$}}\n"; -LString const binom_def = +string const binom_def = "%% Binom macro for standard LaTeX users\n" "\\newcommand{\\binom}[2]{{#1 \\choose #2}}\n"; +string const mathcircumflex_def = + "%% For printing a cirumflex inside a formula\n" + "\\newcommand{\\mathcircumflex}[0]{\\mbox{\\^{}}}\n"; + +string const tabularnewline_def = + "%% Because html converters don't know tabularnewline\n" + "\\providecommand{\\tabularnewline}{\\\\}\n"; + +string const lyxgreyedout_def = + "%% The greyedout annotation environment\n" + "\\newenvironment{lyxgreyedout}{\\textcolor[gray]{0.8}\\bgroup}{\\egroup}\n"; + +// We want to omit the file extension for includegraphics, but this does not +// work when the filename contains other dots. +// Idea from http://www.tex.ac.uk/cgi-bin/texfaq2html?label=unkgrfextn +string const lyxdot_def = + "%% A simple dot to overcome graphicx limitations\n" + "\\newcommand{\\lyxdot}{.}\n"; + + +} // namespace lyx