Re: Memoir's pagenotes fail with Lyx
- From: Lars Madsen <daleif@xxxxxxxxx>
- Date: Tue, 07 Dec 2010 23:22:12 +0100
On 2010-12-07 20:28, stefano wrote:
On Dec 7, 9:56 am, Lars Madsen<dal...@xxxxxxxxxxxxxxxxxxxxxx> wrote:stefano wrote:On Dec 5, 10:22 am, Lars Madsen<dal...@xxxxxxxxx> wrote:On 2010-12-03 20:47, stefano wrote:
On Dec 3, 11:25 am, stefano<stefano.fran...@xxxxxxxxx> wrote:better solution: sanitize, but not %On Dec 3, 11:08 am, Lars Madsen<dal...@xxxxxxxxxxxxxxxxxxxxxx> wrote:I spoke too early. With the \@sanitize line commented out, \pagenoteLars Madsen wrote:Thanks Lars.stefano wrote:very interesting it is caused by \@sanitize which is used when we writeI think I have stumbled upon an incompatibility between memoir andhmm, that is interesting, I'll see what I can do
Lyx. Memoir uses the \pagenote command to produce endnotes. However,
pagenote fails when the text of the pagenote has a comment sign (i.e.
'%') before the closing brace. Which is exactly how Lyx produces
footnotes:
Minimal example:
\documentclass[a4paper,10pt]{memoir}
\usepackage[english]{babel}
\makepagenote
\begin{document}
1. This works\pagenote{This is a pagenote}
2 This fails\pagenote{This is a pagenote%
}
\printpagenotes
\end{document}
The second format is how Lyx exports to latex.
Any idea on how to solve the problem is welcome.
Cheers,
Stefano
the pagenote to file, so we end up with
\noteentry{2}{}{This is a pagenote% }{1}
which of course crashes everything when LaTeX attempts to run the .ent file.
Short term fix
\makeatletter
\renewcommand*{\makepagenote}{%
\newwrite\@notefile
\immediate\openout\@notefile=\jobname.ent
\mempagenotestrue
\def\pagenote{\@bsphack\begingroup
% \@sanitize
\m@m@wrpnote}%
\typeout{Writing note file \jobname.ent}%
\let\makepagenote\@empty}
\makeatother
\makepagenote
--
/daleif (remove RTFSIGNATURE from email address)
LaTeX FAQ: http://www.tex.ac.uk/faq
LaTeX book: http://www.imf.au.dk/system/latex/bog/(in Danish)
Remember to post minimal examples, see URL belowhttp://www.tex.ac.uk/cgi-bin/texfaq2html?label=minxamplhttp://www.min...
Problem solved for now, I guess.
Stefano
fails when there is an index command in the note's body. With the
\@sanitize line uncommented, the \index command works fine (but it
fails in Lyx, of course). A \protect command in front of the \index
command seems to work (although it may break something else. I am
never sure with LaTeX).
I confess I have no idea why it fails and why it works with protect.
Stefano
Example:
\documentclass[a4paper,10pt]{memoir}
\usepackage[english]{babel}
\makeatletter
\renewcommand*{\makepagenote}{%
\newwrite\@notefile
\immediate\openout\@notefile=\jobname.ent
\mempagenotestrue
\def\pagenote{\@bsphack\begingroup
% \@sanitize
\m@m@wrpnote}%
\typeout{Writing note file \jobname.ent}%
\let\makepagenote\@empty}
\makeatother
\makeindex
\makepagenote
\begin{document}
1. This note fails unless a protect command is placed in forn of the
index command \pagenote{This is a pagenote\index{instruments, logical}
%
}
\printpagenotes
\printindex
\end{document}
Error:
No file pagenote-test.aux.
! Use of \\m@m@wrpnote doesn't match its definition.
\@ifnextchar ... \reserved@d =#1\def \reserved@a {
#2}\def \reserved@b
{#3}\f...
l.20 }
\renewcommand*{\makepagenote}{%
\newwrite\@notefile
\immediate\openout\@notefile=\jobname.ent
\mempagenotestrue
\def\pagenote{\@bsphack\begingroup
\rem@special{\%}%<--- added
\@sanitize
\m@m@wrpnote}%
/daleif
Thanks Dale,
that works. I think I have stumbled upon a possibly related
problem, though.
While pagenote works fine if an unprotected \index command is in the
text of the note,
the combinaiton of \foottopagenote and \footnote does not work in the
same situation.
interesting
Something even more interesting
multiparagraph footnotes now fail.
:-(
\documentclass[a4paper,10pt]{memoir}
\usepackage[english]{babel}
\usepackage{lipsum}
%Fix to Lyx export problem, suggested by Lars Madsen on c.t.t. on
12/6/2010
\makeatletter
\renewcommand*{\makepagenote}{%
\newwrite\@notefile
\immediate\openout\@notefile=\jobname.ent
\mempagenotestrue
\def\pagenote{\@bsphack\begingroup
\rem@special{\%}%<--- added
\@sanitize
\m@m@wrpnote}%
\typeout{Writing note file \jobname.ent}%
\let\makepagenote\@empty}
\foottopagenote
\makeindex
\makepagenote
\begin{document}
1. This note works fine\pagenote{\index{word}\lipsum[1]%
}
2. This one fails unless I protect the index command\footnote{\protect
\index{word}\lipsum[2]%
\lipsum[3]}
\printpagenotes
\end{document}
output:
{\protect \index {word}\lipsum [2]
! Paragraph ended before \\footnote was complete.
<to be read again>
\par
l.25
that one is because \foottopagenote mistakenly does not redefine \footnote as \long, I'll fix that
still wondering about the \index stuff
.
- Follow-Ups:
- Re: Memoir's pagenotes fail with Lyx
- From: stefano
- Re: Memoir's pagenotes fail with Lyx
- References:
- Memoir's pagenotes fail with Lyx
- From: stefano
- Re: Memoir's pagenotes fail with Lyx
- From: Lars Madsen
- Re: Memoir's pagenotes fail with Lyx
- From: Lars Madsen
- Re: Memoir's pagenotes fail with Lyx
- From: stefano
- Re: Memoir's pagenotes fail with Lyx
- From: stefano
- Re: Memoir's pagenotes fail with Lyx
- From: Lars Madsen
- Re: Memoir's pagenotes fail with Lyx
- From: stefano
- Re: Memoir's pagenotes fail with Lyx
- From: Lars Madsen
- Re: Memoir's pagenotes fail with Lyx
- From: stefano
- Memoir's pagenotes fail with Lyx
- Prev by Date: Re: calc.sty scaling operations
- Next by Date: Re: How to use external programs with hyperref
- Previous by thread: Re: Memoir's pagenotes fail with Lyx
- Next by thread: Re: Memoir's pagenotes fail with Lyx
- Index(es):
Relevant Pages
|