-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Incompatible with menukeys package #1
Comments
Thank you for reporting this. I have given a look at the It might not be a bad idea to ask the developer of the Could you please have a look at this? |
I couldn't replicate this. The hax file is never populated no matter whether it's I cleaned all the intermediate files including removing the Perhaps what you have discovered is that the ability to write to the I'm using the latest
|
This is not See the following MWE which also produces an empty \documentclass{article}
\RequirePackage{tikz}
\usepackage{hereapplies}
\begin{document}
\title{Some title}
\author{Some author}
\maketitle
This is concept one. To find this concept applied, please
see \whereapplies{conceptOne}.
This is concept two. To find this concept applied, please
see \whereapplies{conceptTwo}.\newpage
\hereapplies{conceptOne} This is page \thepage. As you can see,
``concept one'' applies here.\newpage
\hereapplies{conceptTwo} This is page \thepage. As you can see,
``concept two'' applies here.\newpage
\hereapplies{conceptOne, conceptTwo} This is page \thepage. As you
can see, both ``concept one'' and ``concept two'' apply here.\newpage
\hereapplies{conceptTwo} This is page \thepage. As you can see,
``concept two'' applies here.\newpage
\hereapplies[myref]{conceptOne} This is page \thepage. As you can
see, ``concept one'' applies here. This point in the document is
labeled \texttt{myref}.
\end{document} I'm not entirely sure why this happens, but an easy fix is putting the following in the preamble. \makeatletter
\AtEndDocument{%
\addtocontents{hax}{\@ha@commons@@haxcontent}%
}%
\makeatother |
Based on @Skillmon's finding I drilled down. It seems to be line 93 of \AtBeginDocument{\AtEndDocument{\clearpage\the\pgfutil@everybye}} I do not know enough about TeX/LaTeX to know why this line is causing the problem. Nor do I really understand why @Skillmon's fix works. Search methodIt is possible my investigation method is flawed, so here is what I did. Started with the example provided by @Skillmon and added Based on the file list produced, deduced it was not Substituted \input pgfutil-common.tex
\input pgfutil-latex.def
\input{pgfrcs.code.tex} Deduced that Started commenting out code in the local copy of Toggling line 93 as shown above seems to be the one that stops the Failed attempts at fixing the codeIn \AtEndDocument{% to
Keeping the original Mainly this proves I don't know enough about TeX hooks. |
Possible fixThis seems to work. \AtEndDocument{% to \AtEndEnvironment{document}{% Needs |
I'd argue that this is still wrong @alexSmercury. Imho, there is no good reason to only conditionally write the \documentclass{article}
\RequirePackage{tikz}
\usepackage{hereapplies}
\makeatletter
\gdef\@ha@newidentifier#1{%
% Was this identifier already initialized?
\ifcsname @ha@iter@@preamble@#1\endcsname\else%
% The identifier was never initialized
% Was a .hax file already exported during a previous run?
\ifcsname @ha@prop@@labels@#1\endcsname\else%
% This is the first run
% Set the output to "??" - to be updated by the .hax file
\expandafter\gdef\csname
@ha@prop@@doutput@#1\endcsname{\textbf{??}}%
% Set the starred output to "??" - to be updated by the .hax file
\expandafter\gdef\csname
@ha@prop@@soutput@#1\endcsname{\textbf{??}}%
% Set the list of labels to an empty value
\expandafter\gdef\csname @ha@prop@@labels@#1\endcsname{}%
\fi%
% Use "p." for the preamble when there is only one occurrence
\global\expandafter\let\csname @ha@iter@@preamble@#1\endcsname\hapage%
% Generate the output strings
\g@addto@macro\@ha@commons@@haxcontent{%
% Make sure that there are occurrences
\ifcsname @ha@iter@@labels@#1\endcsname%
% There are occurrences
% Generate the output strings
\protect\@ha@makeoutputstrings{#1}{\csname
@ha@iter@@preamble@#1\endcsname}{\csname
@ha@iter@@labels@#1\endcsname}%
\fi%
}%
\fi%
}
% Was the .hax input already initialized during this run?
\ifdefined\@ha@commons@@haxcontent\else%
% The .hax input was never initialized
% Previous versions created unwanted whitespaces; I am thankful to
% David Carlisle for suggesting `\endlinechar=\m@ne`
{\endlinechar=\m@ne\@starttoc{hax}}%
% Initialize the content to export to the .hax file
\gdef\@ha@commons@@haxcontent{}%
% Export the content when the document reaches the end
\AtEndDocument{%
\addtocontents{hax}{\@ha@commons@@haxcontent}%
}%
\fi%
\makeatother
\begin{document}
\title{Some title}
\author{Some author}
\maketitle
This is concept one. To find this concept applied, please
see \whereapplies{conceptOne}.
This is concept two. To find this concept applied, please
see \whereapplies{conceptTwo}.\newpage
\hereapplies{conceptOne} This is page \thepage. As you can see,
``concept one'' applies here.\newpage
\hereapplies{conceptTwo} This is page \thepage. As you can see,
``concept two'' applies here.\newpage
\hereapplies{conceptOne, conceptTwo} This is page \thepage. As you
can see, both ``concept one'' and ``concept two'' apply here.\newpage
\hereapplies{conceptTwo} This is page \thepage. As you can see,
``concept two'' applies here.\newpage
\hereapplies[myref]{conceptOne} This is page \thepage. As you can
see, ``concept one'' applies here. This point in the document is
labeled \texttt{myref}.
\end{document} |
Thank you both for finding and studying the problem!
Writing the --madmurphy |
@madmurphy You're welcome. I want to use I'm not good enough at LaTeX to know what's the best solution. But I agree with @Skillmon that prevention is better than cure.
@madmurphy There might be good reasons for someone including Unrelated: @Skillmon I just realized where I "know" you from. I've been using |
@alexSmercury Well, I'm also one of the |
Okay, this should fix the issue and still not create any Could you please give it a try? --madmurphy |
The patch works for me on my test files.
|
Alright then. I have updated the package on CTAN as well. Thank you for helping improve this package! --madmurphy |
Just from the looks of it I'd say looks fine, no need to run it as well I guess. |
Thank you too for your help. --madmurphy |
Loading the
menukeys
package meanshereapplies
does not store anything in the.hax
file. This then preventswhereapplies
from working.It does not matter whether
menukeys
is loaded before or afterhereapplies
.The text was updated successfully, but these errors were encountered: