Skip to content
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

Conflict with pdfcomment #3

Open
callegar opened this issue Aug 10, 2024 · 6 comments
Open

Conflict with pdfcomment #3

callegar opened this issue Aug 10, 2024 · 6 comments

Comments

@callegar
Copy link

Looks like loading typog breaks the \pdfmarkupcomment command of package pdfcomment (at least when using lualatex). Is this expected. Is there any workaround?

@callegar
Copy link
Author

In fact, it is not just \pdfmarkupcomment. Also \pdfcomment and more get broken, leaving empty spaces in the text.

cspiel added a commit that referenced this issue Aug 11, 2024
…as loaded.

This attempt of a fix is related to issue #3.
@cspiel
Copy link
Owner

cspiel commented Aug 11, 2024

The problem is not limited to lualatex, it arises with pdflatex, too.
There are no errors or warnings but the output gets mangled really badly.

I could trace the issue to the macro \pdfstringdefDisableCommands.
However, I have not the slighest idea why it wreaks havoc. My "fix" is
not to use the macro if package pdfcomment was loaded.

Please pull the latest revision from the repository
and let my know how things work out on your system.

@callegar callegar changed the title Conflictt with pdfcomment Conflict with pdfcomment Aug 11, 2024
@callegar
Copy link
Author

callegar commented Aug 11, 2024

I have found documentation about the \pdfstringdefDisableCommands in https://texdoc.org/serve/paper.pdf/0. To the best of my understanding, this should be meant for setting up command substitutions for the \texorpdfstring macro, employed e.g. by hyperref to get rid of tex commands when producing PDF strings (e.g. for bookmarks). Apparently it is used quite often in typog. However, I thought this was mainly meant to disable commands, while in typog I see it often used to change a command into some other command. Out of curiosity, why is this needed so frequently? More interestingly, I wonder if calling \pdfstringdefDisableCommands is a problem in itself or if it is some specific command substitution to be problematic. I also wonder if avoiding it altogether could create other issues.

For the time being, I have split out in a mini-package the funtionalities of typog that I actually need (those related to sloppy), controlling other things I use (microtype and setspace) directly.

@cspiel
Copy link
Owner

cspiel commented Aug 11, 2024

Thanks for the reference! I wasn't aware of that document.

Package typog uses \pdfstringdefDisableCommands for the
same reasons as you exemplify in conjunction with package hyperref.
Many of typog's macros commonly occur in calls to sectioning macros (e.g. \section)
from where they get promoted to the PDF documents' bookmarks.
Without the substitutions installed by \pdfstringdefDisableCommands
the bookmarks look downright broken.

With respect to the usage of \pdfstringdefDisableCommands, Sec. 6.2
(bottom of page 14) of the document you quoted seems to confirm my
understanding that it replaces expansions for (textual parts of?) the
PDF-document.

Before you start forking parts of typog... Have you tried 04089e1?
It solves the issue on my system.

@callegar
Copy link
Author

Don't worry, not a public fork: it was just a private hack. I'll definitely try your patch.

@cspiel
Copy link
Owner

cspiel commented Aug 11, 2024

You can of course fork all or parts of typog.
That's why its license is permissive and its repo is on github.
I have no problems with that.

I just want you as an alpha-tester for my improvised fix,
so that other users who combine pdfcomment and
typog will benefit from it, too.

cspiel added a commit that referenced this issue Aug 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants