Code Monkey home page Code Monkey logo

apxproof's Introduction

apxproof's People

Contributors

a3nm avatar kbauer avatar komorin95 avatar kostrykin avatar pierresenellart avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

apxproof's Issues

apxproof breaks fancyvrb macros

Currently, the apxproof package redefines the VerbatimOut environment in a manner, that breaks it for any use other than in apxproof. This seems quite likely to produce severe conflicts with other packages.

How to reproduce

The following file will compile as expected.
But if apxproof is imported, it fails.

\documentclass[a5paper,12pt]{article}

\usepackage{fancyvrb}

\begin{document}

Before VerbatimOut.

\begin{VerbatimOut}{\jobname.x}
First line.
Second line.
\end{VerbatimOut}

After VerbatimOut, before VerbatimInput.

\VerbatimInput{\jobname.x}

After VerbatimInput.

\end{document}

Possible solutions

  1. Defining a package-local version axp@VerbatimOut, instead of redefining the global VerbatimOut environment.
  2. Using an entirely different mechanism for accumulating appendix contents; On modern hardware, an accumulation form \appto{\axp@appendixcontents}{CONTENTS} (or \eappto with \expandonce{\BODY} when using \NewEnviron) should work too.

Incompatibility with tocbibind

Hi Pierre,

Some people use the tocbibind package to ensure that the "References" section created by Bibtex shows up in the table of contents. See for instance https://tex.stackexchange.com/a/8459.

However, this causes a cryptic compilation error together with apxproof unless using bibliography=common. Here is a MWE:

\documentclass{article}

\usepackage{tocbibind}
\usepackage{apxproof}

\begin{document}

\bibliographystyle{plain}
\bibliography{biblio}

\end{document}

Running latexmk -pdf gives the error:

) [1{/var/lib/texmf/fonts/map/pdftex/updmap/pdftex.map}] (./main.axp)
(./bu1.aux) (./bu1.bbl

! LaTeX Error: \begin{thebibliography} on input line 1 ended by \end{thebibitem
list}.

See the LaTeX manual or LaTeX Companion for explanation.
Type  H <return>  for immediate help.
 ...                                              
                                                  
l.3 \end{thebibliography}

This compiles fine without tocbibind or with bibliography=common.

Could this be fixed? I guess you would ideally want the effect of tocbibind without bibliography=common to add the "References for the appendix" section to the ToC, in the same way that the "References" section is.

Thanks!

Enhancement: Equation numbering in repeated environments?

Related to issue #16

It may be preferable, to have references point to the repeated version of an equation inside a foobarrep environment in the appendix.

This can be done by either:

  1. Repeating the number sequence, as seen in the main text. Would be doable, by resetting all relevant counters (equation, part, chapter, section, subsection, ...) at the beginning of the environment in the *.apx file.
  2. Redefine \label{NAME} and \label@in@display{NAME} to update \r@NAME instead of writing a \newlabel to the aux file, or doing nothing (current implementation, if bugfix from pull request #17 applied).
  3. Redefine Redefine \label{NAME} and \label@in@display{NAME} to produce a label NAME-apx or similar, that explicitly points to the appendix version; With [appendix=inline], this extra label would have to point to the main-text version.
    Downside: LaTeX editors would not be aware of the NAME-apx label.

Example:

\documentclass[12pt]{article}        %  Typeset as:
\usepackage{apxproof}                %
\newtheoremrep{thm}[section]{Theorem}%  Theorem 1. In theorens we
\def\appendixprelim{\par\hrulefill}  %  may need to use equations,
\begin{document}                     %  such as
                                     %
\begin{thmrep}                       %         E = mc²         (1)
  In theorems, we may need to        %
  use equations, such as             %  In main text, we will want
  \begin{equation}                   %  (1) to give (1), pointing    <-- After fixing #16,
    \label{eq:1}                     %  to  main-text version  of        points correctly
    E=mc^2                           %  the thmrep.                      to (1)
  \end{equation}                     %  --------------------------
\end{thmrep}                         %  Theorem 1. In theorems, we
In main text, we will want           %  may need to use equations,
(\ref{eq:1}) to give (1),            %  such as
pointing to the main-text            %
version of the \verb|thmrep|.        %         E = mc²         (2)
                                     %
\begin{appendixproof}
  In the proof we may want to        %  In the proof we may want to      Still points to (1),
  have (\ref{eq:1}) refer to the     %  have  (1)  refer  to  the    <-- even though (2) is
  repeated version, Eq.~(2).         %  repeated version, Eq. (2).       much closer.
\end{appendixproof}                  

                                     %
\end{document}                       %

Add other unrelated materials to the appendix

I can't seem to figure out how to add tables and etc. to my appendix while also using apxproof to add some proofs to the appendix. If I add an explicit \appendix to my .tex file, then the proofs that were automatically sent to the appendix will restart the appendix counter...

biblabel spacing hack for lipics should also apply to classes derived from lipics

In a document using lipics-v2016.cls, the spacing of labels in the appendix bibliography is broken. Presumably the problem is that the tweak on \@biblabel implemented near the end of apxproof.sty (namely, \def\@biblabel{\hspace*{-2em}\small\@oldbiblabel}%) should also be applied to this document even though it uses lipics-v2016.cls and not lipics.cls.

I would suggest changing the test \ifthenelse{\equal{\@currentclass}{lipics}}{ to a less restrictive condition, maybe testing if the class starts with "lipics" (e.g., with xstring's \IfBeginWith). Maybe there are better options, e.g., testing if a lipics-specific command is defined...

Error with nested optional arguments in theorem-like environment defined by \newtheoremrep

Hi Pierre and contributors,
Thank you for maintaining such a useful style file!
I've just realized that the following code doesn't compile (with v1.2.1):

\documentclass{article}
\usepackage{apxproof}
\newtheoremrep{theorem}{Theorem}
\begin{document}
\begin{theoremrep}[{\cite[pp.\,9--44]{leunen}}]
	Some good theorem holds.
\end{theoremrep}
\begin{proof}
	Some technical proof shows it.
\end{proof}
\bibliographystyle{plain}
\bibliography{refs}
\end{document}

Here, the content of refs.bib is:

@book{leunen,
author = "Mary-Claire van Leunen",
title = "A Handbook for Scholars",
year = 1978,}

(It is taken from this book in Japanese .)

Note that the following one compiles:

\documentclass{article}
\usepackage{apxproof}
\newtheoremrep{theorem}{Theorem}
\begin{document}
\begin{theorem}[{\cite[pp.\,9--44]{leunen}}]
	Some good theorem holds.
\end{theorem}
\begin{proof}
	Some technical proof shows it.
\end{proof}
\bibliographystyle{plain}
\bibliography{refs}
\end{document}

and so does the following one:

\documentclass{article}
\usepackage{apxproof}
\newtheoremrep{theorem}{Theorem}
\begin{document}
\begin{theoremrep}[\cite{leunen}]
	Some good theorem holds.
\end{theoremrep}
\begin{proof}
	Some technical proof shows it.
\end{proof}
\bibliographystyle{plain}
\bibliography{refs}
\end{document}

So I guess something is going wrong when theoremrep environment deals with an optional argument of a command in the optional argument of the theoremrep environment itself.
I'd appreciate it very much if this is resolved.
Thanks!

\section doesn't support optional argument with apxproof.

Normally, sectioning commands allow specifying a shorthand title as optional argument.

With apxproof, this isn't possible for \section, while remaining possible for all other sectioning commands.

The failure is silent, as apxproof's version of \section will gladly interpret \section[short]{long} as the section "[" starting with the text "short]title".

Example

\documentclass{article}
\usepackage{apxproof}

\begin{document}

\section[short title]{title}

\end{document}

Weird issue with parentheses in optional arguments to theorems

Trying to compile the file ecm.zip gives a weird error:

apxproof: Appendix material appended to the document
apxproof: Separate bibliography for appendix material) (./ecm.aux)

LaTeX Warning: Citation `a' on page 1 undefined on input line 10.

! Incomplete \iffalse; all text was ignored after line 10.
<inserted text> 
                \fi 
l.10 \end{theoremrep}
                     
? 

The presence of the opening parenthesis in the optional argument to the theoremrep appears to be important, as it works fine without it. Adding a closing parenthesis does not help. Any idea what can be going on?

Compatibility with claimproof (lipics)

LIPICS provide the fancy claimproof environement, allowing to have proofs inside a larger proof.
However, apxproof doesn't redefine it, and thus not putting the proof of a "claimrep" in the appendix.

MWE :

\documentclass[a4paper,UKenglish,cleveref]{lipics-v2021}
\usepackage{apxproof} 
\newtheoremrep{theorem}{Theorem}
\newtheoremrep{claim}[theorem]{Claim}

\begin{document}

\begin{claimrep}Claimrep with classical proof env : OK
\end{claimrep}
\begin{proof}
proof
\end{proof}

\begin{claimrep}Claimrep with claimproof env : KO
\end{claimrep}
\begin{claimproof}
proof
\end{claimproof}

\begin{claim}Classical Claim with claimproof. 
\end{claim}
\begin{claimproof}
proof
\end{claimproof}

\end{document}

Compatibility with natbib

It seems that apxproof doesn't work well with natbib. Here is an example.

\documentclass{article}

\usepackage[numbers]{natbib}
\usepackage{apxproof}

\begin{filecontents*}[overwrite]{refs.bib}
@article{thomas1998update,
  title={An update on the four-color theorem},
  author={Thomas, Robin},
  journal={Notices of the AMS},
  volume={45},
  number={7},
  pages={848--859},
  year={1998}
}

@article{robertson1986graph,
  title={Graph minors. II. Algorithmic aspects of tree-width},
  author={Robertson, Neil and Seymour, Paul D.},
  journal={Journal of algorithms},
  volume={7},
  number={3},
  pages={309--322},
  year={1986},
  publisher={Elsevier}
}

\end{filecontents*}


\begin{document}
  Here is a reference that is not in appendix \cite{thomas1998update}.

  \begin{toappendix}
    The same reference should be displayed here \cite{thomas1998update} since it's already been used.
    However, the following won't \cite{robertson1986graph}.
  \end{toappendix}


  \bibliographystyle{plainnat}
  \bibliography{refs}
\end{document}

Compatibility with biblatex

Since bibunits has a conflict error with biblatex, this package doesn't load when biblatex is loaded. Is it possible to not load bibunits? For instance, when using bibliography=common.

Apxproof makes \section brittle

Apparently apxproof makes the \section command brittle.

With apxproof, using anything other than plain text becomes dangerous, leading to failure of e.g.

\documentclass{article}
\usepackage{apxproof}

\begin{document}

\section{A \textit{B}}

\end{document}

The source of the issue seems to be the line

\def\@section#1{%
  \global\edef\axp@sectitle{#1}%    <-- This one.
  ...
}

Other things that broke for me with apxproof when used in \section commands:

  • \color{...}
  • Various math formattings (e.g. $\mathbf{P}$).

Put proofs in different subsections within a single section in appendix

I am wondering if the package can put proofs in different subsections within a single section in the appendix. For example:
instead of

A Proof of Section 3

B Proof of Section 4

I was hoping for

A Proofs

A.1 Proof of Section 3

A.2 Proof of Section 4

I realize \nosectionappendix can make the proofs appear in the same section and \renewcommand{\appendixsectionformat}[2]{Proofs} can customize the section title, but it will not create different subsections.

Disable single-column mode for appendix

In some circumstances (e.g., camera-ready submissions which include an appendix), it is useful to leave the appendix in two-column mode. Would it be possible to have an option to do this?

Fails with non-7-bit chars in appendix

Using non-7-bit characters in a toappendix environment (or in a proof environment that follows a repeated theorem) writes jobname.axp with an encoding different from the input document, which means it produces "! Package inputenc Error: Invalid UTF-8 byte sequence." when the appendix is generated. This means that proofs cannot be properly typeset in non-english.

Example document attached.
bork.txt

Reference only in the appendix

Hello,

I use \newtheoremrep and, in the proof, there is a citation to something only appearing in this proof.
With pdflatex/bibtex, it becomes a "?" and "Package natbib Warning: Citation DLS09journal on page 20 undefined", and there is no separate bibliography at the end. If I remove package natbib, I got
"LaTeX Warning: Citation DLS09journal on page 20 undefined on input line 16.
)
No file bu1.bbl."

Strangely enough, whit sharelatex, there is the new separate section, and the reference appears, but without any number (just []). (same log).

Do I miss something?
Best

Edit: it works with LIPICS style (although the numbering of lemma isn't then, but it's another issue)

Not compatible with \dump precompilation

LaTeX has a mechanism, where preambles can be precompiled for faster subsequent compilation, that can be summarized as

  • Create a separate file document_preamble.tex.
  • Compile it with pdflatex -ini "&pdflatex" "document_preamble" "\\dump" creating a document_preamble.fmt binary dump of several megabytes.
  • In document.tex, load this "format" file by starting the file with %&document_preamble. Otherwise it is compiled with pdflatex document as usual.

Expected behavior

  • During compilation of the preamble, no .axp file should be created.
  • When compiling document.tex, document.axp should be created.

Actual behavior

  • During compilation of the preamble, document_preamble.axp is created.
  • When compiling document.tex, no .axp file is created, leading to a "no such file" error when the appendix is typeset.

Cause

The axp file is created as \jobname.axp at the time, when the apxproof is loaded, i.e. when \usepackage{apxproof} is expanded. When working with precompiled preambles, at that time \jobname is document_preamble instead of document.

If nothing else prevents it, the obvious fix would be to defer the initialization of the .axp file with an \AtBeginDocument.

Equations inside repeated theorems override \labels from the main text.

The \label of equations is repeated in the appendix, if amsmath is loaded.
As a consequence, all \refs to equations in foobarrep environment incorrectly refer to the appendix.

Notes

  • The error doesn't become visible until the second compilation pass.
  • apxproof already redefines \label to \@gobble.
  • amsmath environments, including the redefined equation, redefines \label to \label@in@display,
    which invokes \ltx@label, which is defined as \let\ltx@label\label in amsmath.dtx.

Possible solution

  • Redefine \let\label@in@display\@gobble, same as with \label, in the repetitions.

Example

\documentclass{article}                        %
                                               %
\usepackage{apxproof}                          %
\usepackage{amsmath}                           % if amsmath is disabled,
\newtheoremrep{foobar}{FooBar}                 % the references are correct
                                               %
\begin{document}                               %
                                               %
\begin{foobar}                                 %
  \begin{equation}                             %
    References~to~this~equation~are~correct.   %
    \label{eq:correct}                         %
  \end{equation}                               %
\end{foobar}                                   %
                                               %
\begin{foobarrep}
  \begin{equation}
    References~here~are~broken.
    \label{eq:broken}
  \end{equation}
\end{foobarrep}

\begin{center}
  \begin{tabular}{lcc}
             & \texttt{eq:correct}    & \texttt{eq:broken} \\
    Expected & Eq.~(1)                & Eq.~(2) \\
    Obtained & Eq.~(\ref{eq:correct}) & Eq.~(\ref{eq:broken})
  \end{tabular}
\end{center}

\end{document}

image

Enhancement: Provide a hyperlink from the main-text theorem to the repeated theorem.

Currently, when using a \theoremrep environment with hyperref, a link from the repeated theorem in the appendix is created, that points to the theorem in the main text.

For navigation, it would be useful for the opposite to be true too. The most obvious place for such a link would be the numbering of the theorem (like the link from appendix to main text), allowing quickly switching between main text context and appendix.

Write in appendix: "Proof of Theorem~1" instead of just "Proof"

hi Pierre,

Thanks for your package! Below is an illustrative example. My question is whether it is possible to print "Proof of Theorem X" instead of just "Proof" in the appendix? Otherwise, it is unclear which proof refers to which theorem. I know we can use repeated theorems to achieve this clarity, or by using \begin[Proof of Theorem X]{proof} but I wonder if this can be done without those.

image

Appendix sectioning incompatibility with existing appendix

I'm using theoremrep to put my proofs in the appendix, but I have other things in the appendix as well. The two don't seem to get along: my own appendix sections start with A, B, C, ..., and so on, but then the proof appendix starts with A, B, C, ... and so on. That is, I have two appendix sections A, two appendix section B, etc.

Is there any way I can force the proof sectioning to not start over at A? Or alternatively to put my own appendix after the proof appendices?

Appendix breaks fancyhdr due to use of \axp@tmp in .axp file

The apxproof package is incompatible with \fancyhdr and \pagestyle{fancy}, causing an "Undefined command sequence" error upon typesetting the header.

The issue seems to be caused by the use of \axp@tmp in the .axp file, as by the time the header is typeset, including the section title, this macro may no longer be assigned.

Minimal working example

\documentclass[12pt]{article}

\usepackage{fancyhdr}
\usepackage{apxproof}

\newtheoremrep{thm}{Theorem}

\pagestyle{fancy}
\iftrue % -- Set to \iffalse to cause the error.
  \makeatletter
  \def\axp@tmp{\texttt{\string\axp@tmp=undefined}}
  \makeatother
\fi

\begin{document}

\section{First section.}

\begin{thmrep}
Hello world.
\end{thmrep}

\end{document}

Doesn't work with scrbook

This package does not work with \documentclass{scrbook}. The first problem is that \refname is \bibname in scrbook, but only changing that doesn't seem to be sufficient to make it work.

newenvironment not recognized inside a toappendix

Hi,

It seems that an environment defined by newenvironment is not recognized anymore when used inside a toappendix block.

Here is a MWE :

\documentclass[runningheads,envcountsame]{llncs}

\usepackage{amsmath,amssymb}
\usepackage{apxproof} 
\usepackage{xcolor}

\newtheoremrep{theorem}{Theorem}
\newtheoremrep{claim}[theorem]{Claim}

\newenvironment{claimproof}[1][\proofname]{
  \pushQED{\qed}%
  \normalfont 
  \trivlist
  \item[\hskip\labelsep
        \color{black}\sffamily
    #1{.}]\ignorespaces
}{%
  \renewcommand\qedsymbol{\textcolor{black}{\ensuremath{\vartriangleleft}}}
  \popQED\endtrivlist%\@endpefalse
  \renewcommand\qedsymbol{\textcolor{black}{\ensuremath{\blacktriangleleft}}}
}

\begin{document}

\begin{claim}
    ok claim in text
\end{claim}
\begin{claimproof}
    the proof
\end{claimproof}


\begin{toappendix}

\begin{claim}
    claim in appendix
\end{claim}
\begin{claimproof}
     LaTeX Error: Environment claimproof undefined.
\end{claimproof}

\end{toappendix}

\end{document}

It is solved if I copy paste the newenvironment definition inside the toappendix block (but ugly :)).

Use common bibliography in appendix and main text

Continuing on the (purely hypothetical) use case of camera-ready submissions which include an appendix, in this case it is a waste of space to have the same references both in the appendix and in the main bibliography.

Would it be possible to have a setting to use the main bibliography for both the main text and appendix?

Thanks!

Error with lipics-v2016.cls and \tableofcontents

Hi Pierre,

There seems to be an incompatibility between apxproof and \tableofcontents on lipics documents.

Here's a minimal counterexample, using lipics-2016.cls (cf lipics.tar.gz) and the latest apxproof.sty:

\documentclass[USenglish]{lipics-v2016}
\usepackage{apxproof}
\begin{document}
\tableofcontents
\end{document}

Here's the error (relevant part of the output of latexmk -pdf):

(./test.out) (./test.out)
! Illegal parameter number in definition of \axp@sectitle.
<to be read again> 
                   1
l.4 \tableofcontents
                    
? 

The document compiles fine if I remove \tableofcontents, or if I remove the \usepackage{apxproof}, or if I change the documentclass to scrartcl.

Disable the page break before appendix

It could be useful also if the \clearpage added before the appendix could be disabled. (I don't know whether having an option for this is reasonable, or whether there should be a more generic mechanism to configure what gets issued before the appendix starts.)

Appendix section number if using chapters

Hello,

I would like to use the apxproof package in a document which is sectioned with chapters (and possibly parts).

I would like all appendix sections generated by apxproof to be part of a chapter, let's say chapter "A", and then each section would be named "A.1 Proofs for Section ... ". What I'm obtaining instead is ".1 Proofs for Section ...".

Is there a workaround for this?

Here are pictures of the behaviour I'm obtaining as well as the code I'm using:
image
image
image

\documentclass{report}
\usepackage[utf8]{inputenc}

\usepackage[bibliography=common]{apxproof}

\BeforeBeginEnvironment{appendices}{\edef\TheChapter{\thechapter}}
\AtBeginEnvironment{appendices}{\renewcommand\thesection{\TheChapter.\Alph{section}}}

\renewcommand{\appendixprelim}{
    \clearpage\onecolumn
    \appendix\chapter{Proofs of the theorems in the main text}
    %\section{testsection}
}

\usepackage{amsthm}

\theoremstyle{plain}
    \newtheoremrep{theorem}{Theorem}[chapter]

\usepackage{hyperref}
    \hypersetup{
        bookmarksnumbered=true,
        colorlinks=true,
        linkcolor=blue
    }

\begin{document}

\tableofcontents

\chapter{the first chapter}

\section{the first section}
\begin{toappendix}
    \label{apx:the first section}
\end{toappendix}

\begin{theoremrep}
    This is a theorem.
\end{theoremrep}
\begin{inlineproof}
    See \ref{apx:the first section}.
\end{inlineproof}
\begin{proof}
    This is the actual proof of the theorem, which will show up in the appendix.
\end{proof}

\end{document}

Feature request: appendixtheorem

Is there any way to write a lemma that should only appear in the appendix?

I hacked something together that seems to get the job done:

  \NewEnviron{appendix#1}[2][]{%
    \refstepcounter{#1cnt}%
    \label{##2}
    \refstepcounter{axp@rpcounter}
    \label{axp@r\roman{axp@rpcounter}}
    \global\toggletrue{axp@seenreptheorem}%

    \global\expandafter\let\csname rplet\roman{axp@rpcounter}%
                            \endcsname
    \BODY
    \axp@writesection%
    \immediate\write\axp@proofsfile{%
      \noexpand\begin{axp@#1rp}
        [\noexpand\ref{axp@r\roman{axp@rpcounter}}%
          \@ifnotempty{##1}{\unexpanded{##1}}]%
        \noexpand\let\noexpand\label\noexpand\@gobble%
        \expandafter\noexpand\csname rplet\roman{axp@rpcounter}%
                              \endcsname
      \noexpand\end{axp@#1rp}
    }
  }

where the second argument is to specify a label for the environment, and #1cnt is the theoremlike counter , I couldn't figure a more slick way to do this.

Parent counters with newtheoremrep

To make it easier to migrate documents to apxproof, it would be nice if \newtheoremrep could support parent counters, the way it is done in amsthm. E.g., I'd like to be able to write:

\newtheoremrep{theorem}{Theorem}[section]
\newtheoremrep{lemma}[theorem]{Lemma}

and have theorems numbered like "Theorem i.j", where i is the section number and j is the theorem number, and likewise for Lemmas (with the same numbering).

Right now this doesn't work, and using \newtheoremrep{theorem}{Theorem}[section] does not number theorems following sections. I can cheat by using \newtheorem for some other environment, e.g., \newtheorem{definition}{Definition}[definition], and then use the definition counter in \newtheoremrep, but that's a bit ugly. Is it possible to fix this?

How to disable forward-linking?

I have hyperref loaded, but I don't want apxproof to create hyperlinks to repetitions of the theorems in the appendix.

How can we disable forward-linking?

Incompatibility between apxproof and \documentclass[autoref]{lipics-v2019}

The following MWE illustrates an incompatibility bug between apxproof and the use of the latest lipics document class with the autoref option.

\documentclass[autoref]{lipics-v2019}
\hideLIPIcs

\usepackage{apxproof}

\newtheoremrep{theorem}{Theorem}

\begin{document}

\maketitle

\begin{lemma}
  lemma
\end{lemma}

\end{document}

Forward linking of lemmas in llncs

Hello,
it seems that forward linking of lemmas (or anything but theorem) it's not working with llncs (backward linking is working tho).
It seems that it's just for llncs (at least, it's working for lipics).

Some mwe:

\documentclass{llncs}

\usepackage{hyperref}
\usepackage{apxproof}

\newtheoremrep{theorem}{Theorem}
\newtheoremrep{claim}[theorem]{Claim}
\newtheoremrep{lemma}[theorem]{Lemma}

\begin{document}

\begin{theoremrep}
  A great result rep.
\end{theoremrep}
\begin{proof}
  Proof of Theorem
\end{proof}

\begin{lemmarep}
  Some Lemma
\end{lemmarep}
\begin{proof}
  Proof of Lemma.
\end{proof}

\begin{theorem}
  Another great result.
\end{theorem}
\begin{proof}
  Proof of Theorem
  \begin{claimrep}
    claim !
  \end{claimrep}
  \begin{proof}
    proof
  \end{proof}
\end{proof}

\end{document}

or just adding in common.tex

\begin{lemmarep}
  A lemma.
\end{lemmarep}
\begin{proof}
  Proof of the lemma.
\end{proof}

Compatibility with llncs

I am using \ProvidesClass{llncs}[2018/03/10 v2.20 and there is a different theorem style used when using apxproof.
I tried to use

    \makeatletter
    \AtBeginDocument{%
    \def\thmhead#1#2#3{%
    \thmname{#1}\thmnumber{\@ifnotempty{#1}{ }\@upn{#2}}%
    \thmnote{ {\normalfont (#3)}}}%
    }
    \makeatother

but that did not help.
Here is the example (where brackets are removed by apxproof):

  \documentclass{llncs}

    \usepackage{apxproof}

    \begin{document}

    \begin{definition}[Some test title]
    Some other nonsense.
    \end{definition}

    \end{document}

Enhancement request: SyncTeX support

It would be desirable for appendix contents to have SyncTeX support, and for \newtheoremrep environments to have SyncTeX inverse search to point to the correct line rather than the final \end tag.

I spent some (too much time) trying to find a solution myself, so this might not actually be feasible. At least, it would require a significant rewrite of core mechanisms.

Feature request: references to appendix sections

It is sometimes useful, in the appendices of a paper, to write "we do as in Appendix X", where Appendix X is the appendix created by apxproof for some section of the paper (let's call it Foo). To do this, apparently, the current way is to add at the beginning of Section Foo the following:

\begin{toappendix}
\label{apx:foo}
\end{toappendix}

Then one can write \ref{apx:foo}.

It would be more elegant if apxproof could automatically generate label names for the sections that it creates, ideally following the label name(s) of the current section (assuming the section has a label, and apxproof has access to it). Specifically, if Section Foo has a label "foo", it would be nice if apxproof could create the label apx:foo for the appendix automatically. (Arguably, if Foo has label "sec:foobar", the label should be "apx:foobar" and not "apx:sec:foobar".)

What do you think?

Forward linking of lemmas in llncs

Hello,
it seems that forward linking of lemmas (or anything but theorem) it's not working with llncs (backward linking is working tho).
It seems that it's just for llncs (at least, it's working for lipics).

Some mwe:

\documentclass{llncs}

\usepackage{hyperref}
\usepackage{apxproof}

\newtheoremrep{theorem}{Theorem}
\newtheoremrep{claim}[theorem]{Claim}
\newtheoremrep{lemma}[theorem]{Lemma}

\begin{document}

\begin{theoremrep}
  A great result rep.
\end{theoremrep}
\begin{proof}
  Proof of Theorem
\end{proof}

\begin{lemmarep}
  Some Lemma
\end{lemmarep}
\begin{proof}
  Proof of Lemma.
\end{proof}

\begin{theorem}
  Another great result.
\end{theorem}
\begin{proof}
  Proof of Theorem
  \begin{claimrep}
    claim !
  \end{claimrep}
  \begin{proof}
    proof
  \end{proof}
\end{proof}

\end{document}

or just adding in common.tex

\begin{lemmarep}
  A not nested lemma.
\end{lemmarep}
\begin{proof}
  Proof of the other lemma.
\end{proof}

Error with a command with @ in xypic

I used apxproof.sty for a recent joint paper.
Thanks to this package, our time is saved a lot. I appreciate the developers.

During writing the paper, we have faced an unexpected compile error.
The following example cannot be compiled:

\documentclass{article}
\usepackage[all]{xy}
\usepackage{apxproof}
\begin{document}
\section{First Section}
\begin{toappendix}
\begin{displaymath}
  \xymatrix{A\ar@{.>}[r]_f & B}
\end{displaymath}
\end{toappendix}
\end{document}

Indeed, if I save this as bad.tex and try to compile it by
pdflatex -halt-on-error bad.tex
then I get the following error:

! Argument of \next@ has an extra }.
<inserted text> 
                \par 
l.5   \xymatrix{A\ar@{.>}[r]_f & B}
                                   
!  ==> Fatal error occurred, no output PDF file produced!

I'm using the latest apxproof.sty v1.20, pdfTeX Version 3.14159265-2.6-1.40.20 (TeX Live 2019), and Xy-pic version 3.8.9.

The use of \xymatrix should be correct, since the following example can be compiled successfully:

\documentclass{article}
\usepackage[all]{xy}
\usepackage{apxproof}
\begin{document}
\section{First Section}
\begin{displaymath}
  \xymatrix{A\ar@{.>}[r]_f & B}
\end{displaymath}
\end{document}

If there is no @, then the error is not caused.
The following example can be successfully compiled:

\documentclass{article}
\usepackage[all]{xy}
\usepackage{apxproof}
\begin{document}
\section{First Section}
\begin{toappendix}
\begin{displaymath}
  \xymatrix{A\ar[r]_f & B}
\end{displaymath}
\end{toappendix}
\end{document}

Actually, we have found a workaround of this.
Any @ inside an expanded macro does not seem to cause an error.
The following example can be successfully compiled:

\documentclass{article}
\usepackage[all]{xy}
\usepackage{apxproof}
\newcommand{\dottedarrowr}{\ar@{.>}[r]}
\begin{document}
\section{First Section}
\begin{toappendix}
\begin{displaymath}
  \xymatrix{A\dottedarrowr_f & B}
\end{displaymath}
\end{toappendix}
\end{document}

We used this in the recent paper, but it was a bit tiring to do.
Could you solve this?

A redundant proof section appears when the appendix is not inline

Hello, I seemed to bump into a bug. Here is a minimal working example:

\documentclass{article}
\usepackage{apxproof}
\newtheoremrep{theorem}{Theorem}
\newtheoremrep{proposition}{Proposition}
\author{Author}
\begin{document}
\title{Title}
\maketitle
\section{A Section}
\begin{propositionrep}
This is a proposition
\end{propositionrep}
\begin{proof}
This is a proof
\end{proof}
\section{Another Section}
This is a section without proofs
\begin{toappendix}
\section{Appendix Section}
\end{toappendix}
\end{document}

The above code works fine. But if I change \section{Appendix Section} to \include{appendix}, an empty section "B Proofs for Section 2 (Another Section)" will be created in the appendix even though Section 2 has no proofs. Cheers!

Constantly changing labels for amsart/acmart:

If I try to use apxproof with the amsart or acmart document classes, each time the file is compiled, a label is changed, causing LaTeX to issue the "Label(s) may have changed" warning. This is a problem, because some editors use this to determine whether they should run latex again, and will either infinitely loop, or exit with a "too many runs" error.

The issue seems to be the tocindent1 label, but I have no idea what this is or why it's changed.

MWE:

\documentclass{amsart}

\usepackage{apxproof}
\newtheoremrep{theorem}{Theorem}

% detect what changed, see https://tex.stackexchange.com/questions/154594/how-to-diagnose-a-permanent-labels-may-have-changed-warning
\makeatletter
\def\@testdef #1#2#3{%
\def\reserved@a{#3}\expandafter \ifx \csname #1@#2\endcsname
\reserved@a  \else
\typeout{^^Jlabel #2 changed:^^J%
\meaning\reserved@a^^J%
\expandafter\meaning\csname #1@#2\endcsname^^J}%
\@tempswatrue \fi}


\begin{document}

\section{One}
Content


\begin{theoremrep}[Some theorem]
  The  statement
\end{theoremrep}
\begin{proof}
  The proof
\end{proof}

\appendix

\end{document}
\endinput

Each run, this gives:

label tocindent1 changed:
macro:->4.185pt
macro:->6.25499pt
...
LaTeX Warning: Label(s) may have changed. Rerun to get cross-references right.

Cannot use `\ref` in appendix proofs with the `commandchars` argument of `\fvset` with IEEEtran

Hi,

I cannot compile the following document:

\documentclass{IEEEtran}
\usepackage{apxproof}
\fvset{commandchars=\\\{\}}
\newtheoremrep{theorem}{Theorem}[section]

\begin{document}

\section{Test}
\begin{theoremrep}
  X
\end{theoremrep}
 
\begin{proof}
  \ref{a}
\end{proof}
  
\end{document}

It produces the following error:

Runaway text?
  \protect \gdef \@refundefined {\protect \begingroup \def \MessageBreak \ETC.
! Forbidden control sequence found while scanning text of \write.
<inserted text> 
                }
l.14   \ref{a}

However, either commenting away the \fvset command or removing the \ref in the proof (and putting just text instead) compiles fine.

Thanks if you can help!

Customize the section title generated by apxproof

Hi @PierreSenellart,
Thanks for the great package!
I would like to know if it is possible to create something like the screenshot below, which has more fine-grained control over the titles auto-generated by apxproof package. You will notice that

  1. The proofs in the appendix have a shared "upper-level" section title `Deferred Proofs``.
  2. The title for each subsection in the appendix actually corresponds to the subsection title in the main text. For example, Proofs for Section 1.1: Analysis for Case I in the appendix versus Analysis for Case I in the main text.

image

However, using apxproof package, I can only now generate something like the screenshot below. Specifically,

  1. I don't know how to create the shared main title `Deferred Proofs``.
  2. I don't have fine-grained control over the generated title.

image

I tried to play around with \appendixsectionformat option; however, from the code it seems that the package only uses the title Information up to the section level instead of subsection or even subsubsection levels.

Thanks,
YD


The latex code (compiled on Overleaf for the desired output, i.e., the first screenshot) is attached below.

\documentclass{article}
\usepackage[appendix=append,forwardlinking=no]{apxproof}
\newtheoremrep{theorem}{Theorem}
\date{}
\title{apxproof: Flexible Title}


\begin{document}

\maketitle

\section{Analysis}
\subsection{Analysis for Case I}
\begin{theorem}\label{thm:1}
We assert that
$$
1+1 = 2
$$
\end{theorem}


\subsection{Analysis for Case II}
\begin{theorem}\label{thm:2}
We assert that
$$
2+2 = 4
$$
\end{theorem}

\appendix
\newpage
\section{Deferred Proofs}
\subsection{Proofs for  Section 1.1: Analysis for Case I}
\paragraph{Theorem~\ref{thm:1}
We assert that
$$
1+1 = 2
$$
}
\begin{proof}
This is trivial(1).
\end{proof}
\subsection{Proofs for  Section 1.2: Analysis for Case II}
\paragraph{Theorem~\ref{thm:2}
We assert that
$$
2+2 = 4
$$
}
\begin{proof}
This is trivial(2).
\end{proof}
\end{document}

The latex code for generating the second screenshot is also attached.

\documentclass{article}
\usepackage[appendix=append,forwardlinking=no]{apxproof}
\newtheoremrep{theorem}{Theorem}
\date{}
\title{apxproof test}


\begin{document}

\maketitle

\section{Analysis}
\subsection{Analysis for Case I}
\begin{theoremrep}
$$
1+1 = 2
$$
\end{theoremrep}
\begin{proof}
This is trivial(1).
\end{proof}

\subsection{Analysis for Case II}
\begin{theoremrep}
$$
2+2 = 4
$$
\end{theoremrep}
\begin{proof}
This is trivial(2).
\end{proof}


\end{document}

Lipics theorem formatting

The example produced for lipics-v2016 does not have the lipics formatting for statements of theorems, lemmas, etc. (For instance `Theorem n' should be boldface, and the statements of theorems should be italicised).

I assume this is because the \newtheoremrep command overrides the theorem environment definitions from the style file. I get the same behaviour in my own documents with \newtheoremrep and lipics-v2019.

Feature request: add a hook after the appendix

While submitting my thesis, I needed to add a CV after the appendix, and I had to modify apxproof to allow me to insert it after the generated appendix. It would be nice if such a hook was provided. What I did was add an \appendixpost similar to \appendixprelim, and then used it like this.

\renewcommand{\appendixpost}{
  \addtocontents{toc}{%
    \protect\contentsline{chapter}{Curriculum Vitae}{}{}{}}
  \includepdf[pages=-]{cv.pdf}
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.