Re: [MiKTeX] Nameref and non-english (in particular: german)
MiKTeX source code moved to GitHub
Brought to you by:
csc
From: <moh...@st...> - 2004-07-05 16:16:39
|
On Mon, 05 Jul 2004 16:51:51 +0200, Volker Sch=F6ch [lists] =20 <sch...@gm...> wrote: > Sounds very good, thank you! Some questions remain: > > - I only knew the "\newcommand{\command}[1]{....}" syntax. What > is "\newcommand*"? Using the starred version of \newcommand means that the arguments of = the =20 defined command cannot contain a blank line or \par. This makes it a = lot =20 easier to spot runaway arguments. Let's consider the input Some text in English. See \vNameref{sec:2. Some text in English. Some text in English. Some text in English. Some text in English. Some text in English. Some text in English. Some text in English. Some text in English. Some text in English. Some text in English. Some text in English. Some text in English. Some text in English. Some text in English. Some text in English. Some text in English. Some text in English. Some text in English. Some text in English. With the non-starred version of \newcommand we get an error like this= : %%%%%%%%% Runaway argument? {sec:2. Some text in English. Some text in English. Some text in Engl= \ETC. ! File ended while scanning use of \vNameref. <inserted text> \par <*> varioref.tex ? H I suspect you have forgotten a `}', causing me to read past where you wanted me to stop. I'll try to recover; but if the error is serious, you'd better type `E' or `X' now and fix your file. %%%%%%%%%% With the starred version we instead get this (useful) message: %%%%%%%%% Runaway argument? {sec:2. Some text in English. Some text in English. Some text in Engl= \ETC. ! Paragraph ended before \vNameref was complete. <to be read again> \par l.25 ? H I suspect you've forgotten a `}', causing me to apply this control sequence to too much text. How can we recover? My plan is to forget the whole thing and hope for the best. %%%%%%%%%% So we can actually pinpoint the place where it goes wrong. the drawba= ck is =20 of course that you can't have arguments that span multiple paragraphs= , bow =20 how often does one have that kind of arguments, where they couldn't b= e =20 more sensibly put inside an environment? > - When I copy-paste the above line, it doesn't compile (undefined > control sequence). My guess is that there's something wrong > with the various apostrophes, but I'm not knowledgable enough > to tell which would be correct. Could you please verify the > code once again? Here's an example file: \documentclass{article} \usepackage[english,german]{babel,varioref} \usepackage{hyperref} \newcommand*\vNameref[1]{`\nameref{#1}'\ \vpageref{#1}} \begin{document} \tableofcontents \section{Erste}\label{sec:1} Hier ist etwas auf Deutsch. \clearpage Siehe \vNameref{sec:1}. \selectlanguage{english} \section{Second}\label{sec:2} Some text in English. See \vNameref{sec:2}. \end{document} > - What's the meaning of the "'\" sequence in the middle of the > string? I don't understand that. The "\ " is a space. In my LaTeX programming environment spaces are = =20 ignored unless you specify them manually, so that what I do. In regul= ar =20 LaTeX definitions it is also good practice becuase then you're never = in =20 doubt whether it is a wanted space or a spurious space. --=20 Morten H=F8gholm |