Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

7 May, 2024: fms is rebuilding. Don't expect much in that section for quite a few days, maybe longer.


computers / comp.text.tex / Re: Error with sidecap and twoside document on new MiKTeX

SubjectAuthor
* Error with sidecap and twoside document on new MiKTeXHolger Schieferdecker
`* Re: Error with sidecap and twoside document on new MiKTeXUlrike Fischer
 `* Re: Error with sidecap and twoside document on new MiKTeXHolger Schieferdecker
  `* Re: Error with sidecap and twoside document on new MiKTeXHolger Schieferdecker
   `* Re: Error with sidecap and twoside document on new MiKTeXUlrike Fischer
    `* Re: Error with sidecap and twoside document on new MiKTeXHolger Schieferdecker
     `- Re: Error with sidecap and twoside document on new MiKTeXRolf Niepraschk

1
Error with sidecap and twoside document on new MiKTeX

<tq383iU58q4L1@news.in-ulm.de>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=5987&group=comp.text.tex#5987

  copy link   Newsgroups: comp.text.tex
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!news1.tnib.de!feed.news.tnib.de!news.tnib.de!newsfeed.in-ulm.de!not-for-mail
From: spamless@gmx.de (Holger Schieferdecker)
Newsgroups: comp.text.tex
Subject: Error with sidecap and twoside document on new MiKTeX
Date: Mon, 16 Jan 2023 11:15:14 +0100
Organization: [ posted via ] IN-Ulm
Lines: 78
Message-ID: <tq383iU58q4L1@news.in-ulm.de>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.in-ulm.de 07E84812C27C40D18E18241D7A5CEC70
X-Mozilla-News-Host: news://news.in-ulm.de:119
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101
Thunderbird/52.9.1
 by: Holger Schieferdecke - Mon, 16 Jan 2023 10:15 UTC

Hello,

A colleague of mine got a new PC with a new installation of MiKTeX. Now
he has a problem with a two-sided document using the sidecap package.
The error message is (but the document looks ok):

! Undefined control sequence.
<argument> \SC@pageref
{\SC@IDENT }
l.19 \end{SCfigure}

I created a minimal example:

%%%%%%%%%%%%%%%%%%%%%%%%%
\listfiles

\documentclass[twoside]{article}
\usepackage{lmodern}
\usepackage[T1]{fontenc}
\usepackage[ukenglish]{babel}
\usepackage{graphicx}
\usepackage[outercaption]{sidecap}
%\usepackage{hyperref}

\begin{document}

Here is some dummy text.

\begin{SCfigure}
\includegraphics[width=0.45\textwidth]{example-image-a}
\caption{This is the caption.}
\label{fig:a}
\end{SCfigure}

\end{document}
%%%%%%%%%%%%%%%%%%%%%%%%%%

There are some methods to compile the document without error.

1. Removing class option twoside
2. Not loading babel
3. Loading hyperref.

Besides that compiling the document on a PC with an older installation
of MiKTeX works fine as well.

Looking at sidecap.sty all these solutions lead to a different
definition of \SC@pageref.

Without the option twoside \SC@pageref is not needed:

\if@twoside
\newcommand*{\isSC@ODD}[2]{%
\ifthenelse{\isodd{\SC@pageref{\SC@IDENT}}}{#1}{#2}}
\else
\newcommand*{\isSC@ODD}[2]{#1}%
\fi

Concerning 2. and 3. see the following code of sidecap.sty:

\@ifpackageloaded{hyperref}%
{\let\SC@pageref=\hypergetpageref}%
{%
\@ifpackageloaded{babel}%
{\let\SC@pageref=\org@pageref}%
{\let\SC@pageref=\pageref}%
}

If hyperref is not loaded and babel is loaded then \SC@pageref is
defined as \org@pageref. Now I assume that some internals of babel
changend in a way other that sidecap is expecting it. But maybe I'm
completely wrong here. Babel is too complex for me to understand the code.

Now I'm not sure how to solve the problem. Is that something that
sidecap should handle, or should I file a bug report against babel? Or
is my analysis wrong and something else is causing the error?

Holger

Re: Error with sidecap and twoside document on new MiKTeX

<9x6hjjuxf4sd.dlg@nililand.de>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=5989&group=comp.text.tex#5989

  copy link   Newsgroups: comp.text.tex
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!news.szaf.org!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: news3@nililand.de (Ulrike Fischer)
Newsgroups: comp.text.tex
Subject: Re: Error with sidecap and twoside document on new MiKTeX
Date: Mon, 16 Jan 2023 12:58:11 +0100
Lines: 47
Message-ID: <9x6hjjuxf4sd.dlg@nililand.de>
References: <tq383iU58q4L1@news.in-ulm.de>
Reply-To: news3@nililand.de
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
X-Trace: individual.net Fo/7KyylqCqQ8ZbVW97YHwcqPM62qc709ETageeDta6hFdo1FY
Cancel-Lock: sha1:j1ECpVlCxyYdk9aNb8zPN6+mToY=
User-Agent: 40tude_Dialog/2.0.15.41de
 by: Ulrike Fischer - Mon, 16 Jan 2023 11:58 UTC

Am Mon, 16 Jan 2023 11:15:14 +0100 schrieb Holger Schieferdecker:

> Hello,
>
> A colleague of mine got a new PC with a new installation of MiKTeX. Now
> he has a problem with a two-sided document using the sidecap package.
> The error message is (but the document looks ok):
>
> ! Undefined control sequence.
> <argument> \SC@pageref
> {\SC@IDENT }
> l.19 \end{SCfigure}
>

> Now I'm not sure how to solve the problem. Is that something that
> sidecap should handle, or should I file a bug report against babel? Or
> is my analysis wrong and something else is causing the error?

sidecap. It copies a command (\org@pageref) that is in current
system undefined as no longer needed.

sidecap can drop this

\@ifpackageloaded{hyperref}%
{\let\SC@pageref=\hypergetpageref}%
{%
\@ifpackageloaded{babel}%
{\let\SC@pageref=\org@pageref}%
{\let\SC@pageref=\pageref}%
}

and simply use \NewCommandCopy\SC@pageref\pageref as the kernel
\pageref and the ifthen package has been adapted to work correctly
with hyperref (and babel has been adapted and no longer patches
ifthenelse).

As a work around you can use in the document

\makeatletter
\AtBeginDocument{\NewCommandCopy\SC@pageref\pageref}
\makeatother

--
Ulrike Fischer
http://www.troubleshooting-tex.de/

Re: Error with sidecap and twoside document on new MiKTeX

<tq63c5U9ucnL1@news.in-ulm.de>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=5996&group=comp.text.tex#5996

  copy link   Newsgroups: comp.text.tex
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!news.bawue.net!newsfeed.in-ulm.de!not-for-mail
From: spamless@gmx.de (Holger Schieferdecker)
Newsgroups: comp.text.tex
Subject: Re: Error with sidecap and twoside document on new MiKTeX
Date: Tue, 17 Jan 2023 13:12:54 +0100
Organization: [ posted via ] IN-Ulm
Lines: 92
Message-ID: <tq63c5U9ucnL1@news.in-ulm.de>
References: <tq383iU58q4L1@news.in-ulm.de> <9x6hjjuxf4sd.dlg@nililand.de>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.in-ulm.de B5E0B22A446E861CE11B2C5EB73DF126
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101
Thunderbird/52.9.1
In-Reply-To: <9x6hjjuxf4sd.dlg@nililand.de>
 by: Holger Schieferdecke - Tue, 17 Jan 2023 12:12 UTC

Am 16.01.2023 um 12:58 schrieb Ulrike Fischer:
> Am Mon, 16 Jan 2023 11:15:14 +0100 schrieb Holger Schieferdecker:
>
>> Hello,
>>
>> A colleague of mine got a new PC with a new installation of MiKTeX. Now
>> he has a problem with a two-sided document using the sidecap package.
>> The error message is (but the document looks ok):
>>
>> ! Undefined control sequence.
>> <argument> \SC@pageref
>> {\SC@IDENT }
>> l.19 \end{SCfigure}
>
>> Now I'm not sure how to solve the problem. Is that something that
>> sidecap should handle, or should I file a bug report against babel? Or
>> is my analysis wrong and something else is causing the error?
>
> sidecap. It copies a command (\org@pageref) that is in current
> system undefined as no longer needed.
>
> sidecap can drop this
>
> \@ifpackageloaded{hyperref}%
> {\let\SC@pageref=\hypergetpageref}%
> {%
> \@ifpackageloaded{babel}%
> {\let\SC@pageref=\org@pageref}%
> {\let\SC@pageref=\pageref}%
> }
>
> and simply use \NewCommandCopy\SC@pageref\pageref as the kernel
> \pageref and the ifthen package has been adapted to work correctly
> with hyperref (and babel has been adapted and no longer patches
> ifthenelse).

Thank you for the explanation!

> As a work around you can use in the document
>
> \makeatletter
> \AtBeginDocument{\NewCommandCopy\SC@pageref\pageref}
> \makeatother

Ok, thanks, this makes the document compile without errors. But the
outercaption option of sidecap is not recognized anymore. All captions
are on the left side regardless if it's an odd or even page.

As I don't have permanent access to the PC of my colleague I tried to
reproduce that with my PC and the older installation of MiKTeX (dating
of July 2021). But there were other issues. NewCommandCopy complained
that \SC@pageref was already defined. Using \let instead worked, and the
captions were on the correct side. Unfortunately that solution doesn't
help on the newer MiKTeX.

It seems there is no easy solution working for both older and new
installations of LaTeX.

Holger

%%% This example creates the desired output on older LaTeX only %%%
\documentclass[twoside]{article}
\usepackage{lmodern}
\usepackage[T1]{fontenc}
\usepackage[ukenglish]{babel}
\usepackage{graphicx}
\usepackage[outercaption]{sidecap}

\makeatletter
%\AtBeginDocument{\NewCommandCopy{\SC@pageref}{\pageref}}
%\AtBeginDocument{\let\SC@pageref=\pageref}
\let\SC@pageref=\pageref
\makeatother

\begin{document}

\begin{SCfigure}
\includegraphics[width=0.45\textwidth]{example-image-a}
\caption{This is the caption on the right side.}
\label{fig:a}
\end{SCfigure}

\clearpage

\begin{SCfigure}
\includegraphics[width=0.45\textwidth]{example-image-b}
\caption{This is the caption on the left side.}
\label{fig:b}
\end{SCfigure}

\end{document}

Re: Error with sidecap and twoside document on new MiKTeX

<tq6fn7UaifkL1@news.in-ulm.de>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=5997&group=comp.text.tex#5997

  copy link   Newsgroups: comp.text.tex
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!news.bawue.net!newsfeed.in-ulm.de!not-for-mail
From: spamless@gmx.de (Holger Schieferdecker)
Newsgroups: comp.text.tex
Subject: Re: Error with sidecap and twoside document on new MiKTeX
Date: Tue, 17 Jan 2023 16:43:37 +0100
Organization: [ posted via ] IN-Ulm
Lines: 88
Message-ID: <tq6fn7UaifkL1@news.in-ulm.de>
References: <tq383iU58q4L1@news.in-ulm.de> <9x6hjjuxf4sd.dlg@nililand.de>
<tq63c5U9ucnL1@news.in-ulm.de>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.in-ulm.de A8DCD6784DBD7BE23F82CBCF7EFBFAEA
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101
Thunderbird/52.9.1
In-Reply-To: <tq63c5U9ucnL1@news.in-ulm.de>
 by: Holger Schieferdecke - Tue, 17 Jan 2023 15:43 UTC

Am 17.01.2023 um 13:12 schrieb Holger Schieferdecker:
> Ok, thanks, this makes the document compile without errors. But the
> outercaption option of sidecap is not recognized anymore. All captions
> are on the left side regardless if it's an odd or even page.

Now I installed texlive portable on my PC parallel to MiKTeX and
investigated a bit further.

Even without loading babel (therefore no need for the workaround)
sidecap doesn't recocnize odd pages. Internally sidecap does the following:

\newcommand*\SC@pageref{}
% some code

\AtBeginDocument{%
% some code
\@ifpackageloaded{hyperref}%
{\let\SC@pageref=\hypergetpageref}%
{%
\@ifpackageloaded{babel}%
{\let\SC@pageref=\org@pageref}%
{\let\SC@pageref=\pageref}%
}
}

Looking at that I would assume that \SC@pageref is the same as \pageref.
And looking at it seems to confirm that:

\makeatletter
\meaning\SC@pageref

\meaning\pageref
\makeatother

But there seems to be a difference as the example below gives a
different result for both macros. On page 1 the output is "1 odd even".
Can anybody explain what's happening here?

Holger

%%%%%%%%%%%%
\documentclass[twoside]{article}
\usepackage{lmodern}
\usepackage[T1]{fontenc}
%\usepackage[ukenglish]{babel}
\usepackage{graphicx}
\usepackage[outercaption]{sidecap}

\makeatletter
%\AtBeginDocument{\NewCommandCopy{\SC@pageref}{\pageref}}
\makeatother

\begin{document}

\makeatletter
\meaning\SC@pageref

\meaning\pageref
\makeatother

\begin{SCfigure}
\includegraphics[width=0.45\textwidth]{example-image-a}
\caption{This is the caption on the right side.}
\label{fig:a}
\end{SCfigure}

\pageref{fig:a}
\ifthenelse{\isodd{\pageref{fig:a}}}{odd}{even}
\makeatletter
\ifthenelse{\isodd{\SC@pageref{fig:a}}}{odd}{even}
\makeatother

\clearpage

\begin{SCfigure}
\includegraphics[width=0.45\textwidth]{example-image-b}
\caption{This is the caption on the left side.}
\label{fig:b}
\end{SCfigure}

\pageref{fig:a}
\ifthenelse{\isodd{\pageref{fig:b}}}{odd}{even}
\makeatletter
\ifthenelse{\isodd{\SC@pageref{fig:b}}}{odd}{even}
\makeatother

\end{document}

Re: Error with sidecap and twoside document on new MiKTeX

<1qif0hs7te6qp$.dlg@nililand.de>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=5998&group=comp.text.tex#5998

  copy link   Newsgroups: comp.text.tex
Path: i2pn2.org!rocksolid2!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: news3@nililand.de (Ulrike Fischer)
Newsgroups: comp.text.tex
Subject: Re: Error with sidecap and twoside document on new MiKTeX
Date: Tue, 17 Jan 2023 17:55:01 +0100
Lines: 26
Message-ID: <1qif0hs7te6qp$.dlg@nililand.de>
References: <tq383iU58q4L1@news.in-ulm.de> <9x6hjjuxf4sd.dlg@nililand.de> <tq63c5U9ucnL1@news.in-ulm.de> <tq6fn7UaifkL1@news.in-ulm.de>
Reply-To: news3@nililand.de
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
X-Trace: individual.net sTjmhEonj7vZLMqqVDVBAQZI7makrXHkh+xAGYQ0hXn4yO1fjG
Cancel-Lock: sha1:2uuVanzjdAF7w/ZIafs8RPBroFU=
User-Agent: 40tude_Dialog/2.0.15.41de
 by: Ulrike Fischer - Tue, 17 Jan 2023 16:55 UTC

Am Tue, 17 Jan 2023 16:43:37 +0100 schrieb Holger Schieferdecker:

> Am 17.01.2023 um 13:12 schrieb Holger Schieferdecker:
>> Ok, thanks, this makes the document compile without errors. But the
>> outercaption option of sidecap is not recognized anymore. All captions
>> are on the left side regardless if it's an odd or even page.
>
> Now I installed texlive portable on my PC parallel to MiKTeX and
> investigated a bit further.
>
> Even without loading babel (therefore no need for the workaround)
> sidecap doesn't recocnize odd pages. Internally sidecap does the following:

hm, right making a copy is not the right fix, as ifthenelse can't
change it locally. Try

\makeatletter
\AtBeginDocument{\renewcommand\SC@pageref{\pageref}}
\makeatother

--
Ulrike Fischer
http://www.troubleshooting-tex.de/

Re: Error with sidecap and twoside document on new MiKTeX

<tq8d97UdlhaL1@news.in-ulm.de>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=6007&group=comp.text.tex#6007

  copy link   Newsgroups: comp.text.tex
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!news.bawue.net!newsfeed.in-ulm.de!not-for-mail
From: spamless@gmx.de (Holger Schieferdecker)
Newsgroups: comp.text.tex
Subject: Re: Error with sidecap and twoside document on new MiKTeX
Date: Wed, 18 Jan 2023 10:13:55 +0100
Organization: [ posted via ] IN-Ulm
Lines: 36
Message-ID: <tq8d97UdlhaL1@news.in-ulm.de>
References: <tq383iU58q4L1@news.in-ulm.de> <9x6hjjuxf4sd.dlg@nililand.de>
<tq63c5U9ucnL1@news.in-ulm.de> <tq6fn7UaifkL1@news.in-ulm.de>
<1qif0hs7te6qp$.dlg@nililand.de>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.in-ulm.de 781390E14E33D044D24588A77D8099F5
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101
Thunderbird/52.9.1
In-Reply-To: <1qif0hs7te6qp$.dlg@nililand.de>
 by: Holger Schieferdecke - Wed, 18 Jan 2023 09:13 UTC

Am 17.01.2023 um 17:55 schrieb Ulrike Fischer:
> Am Tue, 17 Jan 2023 16:43:37 +0100 schrieb Holger Schieferdecker:
>
>> Am 17.01.2023 um 13:12 schrieb Holger Schieferdecker:
>>> Ok, thanks, this makes the document compile without errors. But the
>>> outercaption option of sidecap is not recognized anymore. All captions
>>> are on the left side regardless if it's an odd or even page.
>>
>> Now I installed texlive portable on my PC parallel to MiKTeX and
>> investigated a bit further.
>>
>> Even without loading babel (therefore no need for the workaround)
>> sidecap doesn't recocnize odd pages. Internally sidecap does the following:
>
> hm, right making a copy is not the right fix, as ifthenelse can't
> change it locally. Try
>
> \makeatletter
> \AtBeginDocument{\renewcommand\SC@pageref{\pageref}}
> \makeatother

Have you tried that with my example? I got the error

Command \SC@pageref undefined.
....
l.21 \begin{document}

But the following works (with the new texlive and the older MiKTeX):

\makeatletter
\AtBeginDocument{\providecommand\SC@pageref{}\renewcommand\SC@pageref{\pageref}}
\makeatother

Thank you very much!

Holger

Re: Error with sidecap and twoside document on new MiKTeX

<k3a3q8F4lbfU1@mid.individual.net>

  copy mid

https://www.rocksolidbbs.com/computers/article-flat.php?id=6033&group=comp.text.tex#6033

  copy link   Newsgroups: comp.text.tex
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: Rolf.Niepraschk@gmx.de (Rolf Niepraschk)
Newsgroups: comp.text.tex
Subject: Re: Error with sidecap and twoside document on new MiKTeX
Date: Tue, 24 Jan 2023 14:12:40 +0100
Lines: 8
Message-ID: <k3a3q8F4lbfU1@mid.individual.net>
References: <tq383iU58q4L1@news.in-ulm.de> <9x6hjjuxf4sd.dlg@nililand.de>
<tq63c5U9ucnL1@news.in-ulm.de> <tq6fn7UaifkL1@news.in-ulm.de>
<1qif0hs7te6qp$.dlg@nililand.de> <tq8d97UdlhaL1@news.in-ulm.de>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: individual.net OqnGtrygm1qlUthI8EKcGwdcJ3NeC8J46efhW+CU+NliiXk4YV
Cancel-Lock: sha1:FFAewdY5zHEIm7s3W5Y4wKpsQm8=
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101
Thunderbird/102.6.1
Content-Language: de-DE
In-Reply-To: <tq8d97UdlhaL1@news.in-ulm.de>
 by: Rolf Niepraschk - Tue, 24 Jan 2023 13:12 UTC

I've released a new version correcting the bug on GitHub:

https://github.com/rolfn/sidecap

It will also appear on CTAN shortly.

....Rolf

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor