4

LyX (v2.03) uses refstyle for cross references. By default if you use the GUI to create a reference it produces source that looks like:

\tabref{label1}
\figref{label2}

which produces an output like "figure 1.1 and table 1.1".

What I want is the capitalised equivalent:

\Tabref{label1}
\Figref{label2}

Which will give "Figure 1.1 and Table 1.1".

Is there a switch or something to pass to the refstyle package to always do uppercase? Or do I have to manually enter the \Tabref each time?

1

refstyle uses a config file refstyle.cfg. You can make a copy in your local texmf tree or in your working directory. Edit the contents of you local refstyle.cfg file. Depending on the language you are using (default is english) change the spesific \RS<language> command. For example \RSenglish

%%-- ENGLISH ------------------------------------
\newcommand\RSenglish{%
    \def\RSrngtxt{\space to~}%........... Range:     figures 5 to 6
    \def\RSlsttwotxt{\space and~}%....... List two:  figures 5 and 6
    \def\RSlsttxt{, and~}%............... List more: figures 5, 6, and 7
    \def\RSparttxt{Part~}%............... Part     lowercase singular
    \def\RSpartstxt{Parts~}%.............          lowercase plural
    \def\RSParttxt{Part~}%...............          uppercase singular (sentence start)
    \def\RSPartstxt{Parts~}%.............          uppercase plural   (sentence start)
    \def\RSappendixname{appendix~}%...... Appendix lowercase singular
    \def\RSappendicesname{appendices~}%..          lowercase plural
    \def\RSAppendixname{Appendix~}%......          uppercase singular (sentence start)
    \def\RSAppendicesname{Appendices~}%..          uppercase plural   (sentence start)
    \def\RSchaptername{chapter~}%........ Chapter  lowercase singular
    \def\RSchaptersname{chapters~}%......          lowercase plural
    \def\RSChaptername{Chapter~}%........          uppercase singular (sentence start)
    \def\RSChaptersname{Chapters~}%......          uppercase plural   (sentence start)
    \def\RSsectxt{section~}%............. Section  lowercase singular
    \def\RSsecstxt{sections~}%...........          lowercase plural
    \def\RSSectxt{Section~}%.............          uppercase singular (sentence start)
    \def\RSSecstxt{Sections~}%...........          uppercase plural   (sentence start)
    \def\RSeqtxt{equation~}%............. Equation lowercase singular
    \def\RSeqstxt{equations~}%...........          lowercase plural
    \def\RSEqtxt{Equation~}%.............          uppercase singular (sentence start)
    \def\RSEqstxt{Equations~}%...........          uppercase plural   (sentence start)
    \def\RSfigtxt{figure~}%.............. Figure   lowercase singular
    \def\RSfigstxt{figures~}%............          lowercase plural
    \def\RSFigtxt{Figure~}%..............          uppercase singular (sentence start)
    \def\RSFigstxt{Figures~}%............          uppercase plural   (sentence start)
    \def\RStabtxt{table~}%............... Table    lowercase singular
    \def\RStabstxt{tables~}%.............          lowercase plural
    \def\RSTabtxt{Table~}%...............          uppercase singular (sentence start)
    \def\RSTabstxt{Tables~}%.............          uppercase plural   (sentence start)
    \def\RSfootntxt{footnote~}%.......... Footnote lowercase singular
    \def\RSfootnstxt{footnotes~}%........          lowercase plural
    \def\RSFootntxt{Footnote~}%..........          uppercase singular (sentence start)
    \def\RSFootnstxt{Footnotes~}%........          uppercase plural   (sentence start)
}
2

Add the following code to the document preamble:

\renewcommand{\tabref}{\Tabref}
\renewcommand{\figref}{\Figref}

This might break \tabref and \figref if you want lowercase but it should capitalize all table and figure cross references.

0

Belated supplement to @Danie Els's reply (from his own package documentation)

When the package is loaded, it first searchers for a local user defined configuration file refstyle.def .

I.e. you have to rename your edited file. (Should have posted this as a comment but still <50 rep.)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.