hyperref – valore non riconosciuto da pdfremotestartview

  • Creatore
    Topic
  • #109283
    Liverpool
    Partecipante
      Up
      0
      Down
      ::


      Sul manuale del pacchetto [tt]hyperref[/tt], nel capoverso a pag. 11 si legge:

      The following are possible values for the [tt]pdfview[/tt], [tt]pdfstartview[/tt] and [tt]pdfremotestartview[/tt] parameters.

      [tt]FitH[/tt] top Fits the width of the page to the window.

      Però se provo ad impostare il valore [tt]FitH[/tt] per la chiave [tt]pdfremotestartview[/tt] ottengo nel log:

      Package hyperref Warning: Invalid value `FitH’
      (hyperref) of `pdfremotestartview’
      (hyperref) is replaced by `Fit’ on input line 4362.

      come mostra il seguente mwe:
      `\documentclass{article}
      \usepackage[pdfremotestartview=FitH]{hyperref}
      \begin{document}
      Prova
      \end{document}`
      Dove sbaglio?
      So che in alternativa posso aggiungere [tt]#view=FitH[/tt] direttamente dopo il nome del file nel comando [tt]\href[/tt], ma avendo decine di documenti da collegare (e documenti in più lingue), preferirei evitare di farlo a mano.

      Grazie mille,
      Luigi

    Visualizzazione 7 filoni di risposte
    • Autore
      Risposte
      • #109284
        OldClaudio
        Partecipante
          Up
          0
          Down
          ::


          Luigi, ho eseguito il tuo EMC, ma non ottengo nessun errore.

          O meglio, ottengo un errore che sembra legato a pdflatex che avrebbe un piccolo bug.
          `pdfTeX warning: /Library/TeX/texbin/pdflatex: \pdfmatch: empty (sub)expression

          Package hyperref Warning: Internal error: Wrong pattern!
          (hyperref) –> ^(XYZ -?(null| *([0-9]+\.?[0-9]*|[0-9]*\.?[0-9]+)
          *) -?(null| *([0-9]+\.?[0-9]*|[0-9]*\.?[0-9]+) *) (null| *([0-9]+\.?[0-9]*|[0-
          9]*\.?[0-9]+) *)|Fit(|B|(H|V|BH|BV) (null| *([0-9]+\.?[0-9]*|[0-9]*\.?[0-9]+) *
          )|R *([0-9]+\.?[0-9]*|[0-9]*\.?[0-9]+) * *([0-9]+\.?[0-9]*|[0-9]*\.?[0-9]+) *
          *([0-9]+\.?[0-9]*|[0-9]*\.?[0-9]+) * *([0-9]+\.?[0-9]*|[0-9]*\.?[0-9]+) *))$
          <-- (hyperref) Pattern check ignored on input line 4362. ` Ma il concetto è che pdfremotestartview funziona, ma richede due compilazioni; dopo la prima c'è un messaggio che dice che un certo file .out è stato modificato, quaidni di ricompilare. La mia versione MacTeX è aggiornata a circa 5 giorni fa.

        • #109285
          Liverpool
          Partecipante
            Up
            0
            Down
            ::


            Per quante volte compili, ottengo sempre lo stesso warning. Io ho la versione 6.83q di hyperref.
            Per scrupolo, se compili questo documento e clicchi sul collegamento, l’altro documento si apre a larghezza intera?
            `\documentclass{article}
            \usepackage[pdfremotestartview=FitH]{hyperref}
            \begin{document}
            \href{pippo.pdf}{Il documento collegato si apre a larghezza intera?}
            \end{document}`

            Grazie
            [attachment=1825]pippo.pdf[/attachment]

            Attachments:
            You must be logged in to view attached files.
          • #109286
            OldClaudio
            Partecipante
              Up
              0
              Down
              ::


              No, e il file .out esiste ma è vuoto.

            • #109287
              Up
              0
              Down
              ::

              OldClaudio” post=109474Luigi, ho eseguito il tuo EMC, ma non ottengo nessun errore.

              O meglio, ottengo un errore che sembra legato a pdflatex che avrebbe un piccolo bug.
              `pdfTeX warning: /Library/TeX/texbin/pdflatex: \pdfmatch: empty (sub)expression

              Package hyperref Warning: Internal error: Wrong pattern!
              (hyperref) –> ^(XYZ -?(null| *([0-9]+\.?[0-9]*|[0-9]*\.?[0-9]+)
              *) -?(null| *([0-9]+\.?[0-9]*|[0-9]*\.?[0-9]+) *) (null| *([0-9]+\.?[0-9]*|[0-
              9]*\.?[0-9]+) *)|Fit(|B|(H|V|BH|BV) (null| *([0-9]+\.?[0-9]*|[0-9]*\.?[0-9]+) *
              )|R *([0-9]+\.?[0-9]*|[0-9]*\.?[0-9]+) * *([0-9]+\.?[0-9]*|[0-9]*\.?[0-9]+) *
              *([0-9]+\.?[0-9]*|[0-9]*\.?[0-9]+) * *([0-9]+\.?[0-9]*|[0-9]*\.?[0-9]+) *))$
              <-- (hyperref) Pattern check ignored on input line 4362. ` […] La mia versione MacTeX è aggiornata a circa 5 giorni fa.

              Mi sembra che il baco sia non in [tt]pdftex[/tt], ma nel pacchetto hyperref, il quale contiene effettivamente un «wrong pattern». Infatti, alle linee 4074–4103 di [tt]hyperref.sty[/tt] leggiamo:
              `
              \define@key{Hyp}{pdfremotestartview}{%
              \ifx\\#1\\%
              \def\@pdfremotestartview{/Fit}%
              \else
              \hypercalcbpdef\@pdfremotestartview{#1}%
              \edef\@pdfremotestartview{\@pdfremotestartview}%
              \Hy@Match\@pdfremotestartview{}{%
              ^(XYZ -?(null|\HyPat@NonNegativeReal/) %
              -?(null|\HyPat@NonNegativeReal/) %
              (null|\HyPat@NonNegativeReal/)|%
              Fit(|B|%
              (H|V|BH|BV) (null|\HyPat@NonNegativeReal/)|%
              R \HyPat@NonNegativeReal/ \HyPat@NonNegativeReal/ %
              \HyPat@NonNegativeReal/ \HyPat@NonNegativeReal/%
              ))$%
              }{}{%
              \Hy@Warning{%
              Invalid value `\@pdfremotestartview'\MessageBreak
              of `pdfremotestartview'\MessageBreak
              is replaced by `Fit'%
              }%
              \let\@pdfremotestartview\@empty
              }%
              \ifx\@pdfremotestartview\@empty
              \def\@pdfremotestartview{/Fit}%
              \else
              \edef\@pdfremotestartview{/\@pdfremotestartview}%
              \fi
              \fi
              }
              `
              Se comprendo correttamente la sintassi delle espressioni regolari usata dalla primitiva [tt]\pdfmatch[/tt], manca un [tt]null[/tt] prima di [tt]|B[/tt]: non [tt]Fit(|B|%[/tt] bensì [tt]Fit(null|B|%[/tt]. Se correggiamo il codice di [tt]hyperref.sty[/tt] in questo senso, cioè, ripeto
              `
              \define@key{Hyp}{pdfremotestartview}{%
              \ifx\\#1\\%
              \def\@pdfremotestartview{/Fit}%
              \else
              \hypercalcbpdef\@pdfremotestartview{#1}%
              \edef\@pdfremotestartview{\@pdfremotestartview}%
              \Hy@Match\@pdfremotestartview{}{%
              ^(XYZ -?(null|\HyPat@NonNegativeReal/) %
              -?(null|\HyPat@NonNegativeReal/) %
              (null|\HyPat@NonNegativeReal/)|%
              Fit(null|B|%
              (H|V|BH|BV) (null|\HyPat@NonNegativeReal/)|%
              R \HyPat@NonNegativeReal/ \HyPat@NonNegativeReal/ %
              \HyPat@NonNegativeReal/ \HyPat@NonNegativeReal/%
              ))$%
              }{}{%
              \Hy@Warning{%
              Invalid value `\@pdfremotestartview'\MessageBreak
              of `pdfremotestartview'\MessageBreak
              is replaced by `Fit'%
              }%
              \let\@pdfremotestartview\@empty
              }%
              \ifx\@pdfremotestartview\@empty
              \def\@pdfremotestartview{/Fit}%
              \else
              \edef\@pdfremotestartview{/\@pdfremotestartview}%
              \fi
              \fi
              }
              `
              otteniamo proprio il messaggio d’avvertimento riferito da @Liverpool, e il fatto che esso venga mostrato indica che [tt]\pdfmatch[/tt] ha restituito zero, cioè «corrispondenza non trovata»: ciò sembrerebbe voler dire che c’è ancora un errore nel pattern, ma io non riesco a vederlo.

              Comunque, direi che è praticamente certo che @Liverpool abbia scovato un baco in hyperref.

              Ciao.


              Gustavo

            • #109288
              Up
              0
              Down
              ::


              Allora, a quanto pare ho detto una sciocchezza: pensavo che [tt]null[/tt] fosse una parola riservata che indicasse una stringa vuota, ma dagli esperimenti che ho fatto risulterebbe che non è così. Ne approfitto per chiedere se qualcuno sa dove si possa trovare una specifica di riferimento per la sintassi delle espressioni regolari usata da [tt]\pdfmatch[/tt], o se la primitiva si conformi interamente alla sintassi specificata, per esempio, da [tt]re_format[/tt](7). Con la seguente correzione non si ottengono più avvertimenti:
              `
              \define@key{Hyp}{pdfremotestartview}{%
              \ifx\\#1\\%
              \def\@pdfremotestartview{/Fit}%
              \else
              \hypercalcbpdef\@pdfremotestartview{#1}%
              \edef\@pdfremotestartview{\@pdfremotestartview}%
              \Hy@Match\@pdfremotestartview{}{%
              ^(XYZ -?(()|\HyPat@NonNegativeReal/) %
              -?(()|\HyPat@NonNegativeReal/) %
              (()|\HyPat@NonNegativeReal/)|%
              Fit(()|B|%
              (H|V|BH|BV)(()| \HyPat@NonNegativeReal/)|%
              R \HyPat@NonNegativeReal/ \HyPat@NonNegativeReal/ %
              \HyPat@NonNegativeReal/ \HyPat@NonNegativeReal/%
              ))$%
              }{}{%
              \Hy@Warning{%
              Invalid value `\@pdfremotestartview'\MessageBreak
              of `pdfremotestartview'\MessageBreak
              is replaced by `Fit'%
              }%
              \let\@pdfremotestartview\@empty
              }%
              \ifx\@pdfremotestartview\@empty
              \def\@pdfremotestartview{/Fit}%
              \else
              \edef\@pdfremotestartview{/\@pdfremotestartview}%
              \fi
              \fi
              }
              `
              Notate lo spazio che da`(H|V|BH|BV) (()|\HyPat@NonNegativeReal/)|%`è stato spostato in` (H|V|BH|BV)(()| \HyPat@NonNegativeReal/)|%`(avete capito dov’è?): così com’era, lo spazio era obbligatorio dopo, per esempio, [tt]FitH[/tt].

              Ciao.


              Gustavo

            • #109289
              Liverpool
              Partecipante
                Up
                0
                Down
                ::


                Questo è il contenuto estratto dal file hyperref.sty presente sul mio pc (versione 6.83q):
                `\define@key{Hyp}{pdfremotestartview}{%
                \ifx\\#1\\%
                \def\@pdfremotestartview{/Fit}%
                \else
                \hypercalcbpdef\@pdfremotestartview{#1}%
                \edef\@pdfremotestartview{\@pdfremotestartview}%
                \Hy@Match\@pdfremotestartview{}{%
                ^(XYZ -?(null|\HyPat@NonNegativeReal/) %
                -?(null|\HyPat@NonNegativeReal/) %
                (null|\HyPat@NonNegativeReal/)|%
                Fit(|B|%
                (H|V|BH|BV) (null|\HyPat@NonNegativeReal/)|%
                R \HyPat@NonNegativeReal/ \HyPat@NonNegativeReal/ %
                \HyPat@NonNegativeReal/ \HyPat@NonNegativeReal/%
                ))$%
                }{}{%
                \Hy@Warning{%
                Invalid value `\@pdfremotestartview'\MessageBreak
                of `pdfremotestartview'\MessageBreak
                is replaced by `Fit'%
                }%
                \let\@pdfremotestartview\@empty
                }%
                \ifx\@pdfremotestartview\@empty
                \def\@pdfremotestartview{/Fit}%
                \else
                \edef\@pdfremotestartview{/\@pdfremotestartview}%
                \fi
                \fi
                }`
                In effetti c’è il [tt]null[/tt] ipotizzato da @letteracdp.
                Mi sembra di capire che voi abbiate una versione differente…
                Se sostituisco la riga incriminata con quella suggerita da @letteracdp, il problema si risolve.
                Ora che si fa? Penso che la cosa migliore sia contattare Oberdiek, ma secondo me dovrebbe farlo @letteracdp, dal momento che è stato lui a trovare la posizione del bug.

                Grazie a entrambi,
                Luigi

              • #109290
                Up
                0
                Down
                ::


                (Switched the discussion language to English because I intend to refer H.O. to this post.)

                Yeah, yesterday I’ve been quite silly, on one hand I hadn’t understand some things myself and, on the other, evidently I wasn’t able to explain the few ones I could make sense of. 😉

                So, [tt]null[/tt] is a reserved word of the PDF language (see PDF Reference, sixth edition, Version 1.7, subsection 3.2.8 ), not of the regex language! 😳 When writing [tt]null[/tt], Rahtz and Oberdiek actually meant that, after [tt]FitH[/tt], either a number, or a literal [tt]null[/tt] must follow: indeed, this is what the abovementioned manual prescribes in subsection 8.2.1. In other words, according to specifications, the value [tt]FitH[/tt] for the [tt]pdfremotestartview[/tt] option should be followed by an argument, and indicated as`\hypersetup{pdfremotestartview={FitH null}}`or, if you know what you are doing, with [tt]null[/tt] replaced by a numerical value (for explanations, see again subsection 8.2.1 of the cited manual).

                Now, subsection 8.2.1 isn’t very clear, but, by experiment, you can see that a “bare” [tt]FitH[/tt] value (that is, one without any following argument) is accepted as well in Acrobat Reader, and makes a link behave as expected when clicked. This means that we can allow such an argumentless version too.

                If we take into accoutn also the issue about the malformed pattern, caused by the fragment
                `
                Fit(|B|%
                (H|V|BH|BV) (null|\HyPat@NonNegativeReal/)|%
                `
                that indeed contains an empty alternative immediately after [tt]Fit([/tt], and which caused pdfTeX to report correctly an [tt]empty (sub)expression[/tt], we can dare to formulate the following proposal for amending the definition of the [tt]pdfremotestartview[/tt] key:
                `
                \define@key{Hyp}{pdfremotestartview}{%
                \ifx\\#1\\%
                \def\@pdfremotestartview{/Fit}%
                \else
                \hypercalcbpdef\@pdfremotestartview{#1}%
                \edef\@pdfremotestartview{\@pdfremotestartview}%
                \Hy@Match\@pdfremotestartview{}{%
                ^(XYZ(%
                ()| % add “+” after the space?
                (null|-?\HyPat@NonNegativeReal/) % add “+” after the space?
                (null|-?\HyPat@NonNegativeReal/) % add “+” after the space?
                (null|\HyPat@NonNegativeReal/)%
                )|% end of “XYZ”
                Fit(%
                ()|%
                B|%
                (H|V|BH|BV)(%
                ()| % add “+” after the space?
                (null|\HyPat@NonNegativeReal/)%
                )|%
                R % add “+” after the space?
                \HyPat@NonNegativeReal/ % add “+” after the space?
                \HyPat@NonNegativeReal/ % add “+” after the space?
                \HyPat@NonNegativeReal/ % add “+” after the space?
                \HyPat@NonNegativeReal/%
                )% end of “Fit”
                )$%
                }{}{%
                \Hy@Warning{%
                Invalid value `\@pdfremotestartview'\MessageBreak
                of `pdfremotestartview'\MessageBreak
                is replaced by `Fit'%
                }%
                \let\@pdfremotestartview\@empty
                }%
                \ifx\@pdfremotestartview\@empty
                \def\@pdfremotestartview{/Fit}%
                \else
                \edef\@pdfremotestartview{/\@pdfremotestartview}%
                \fi
                \fi
                }
                `
                Of course, there are still lots of things I don’t understand yet. For example, why is the syntax of [tt]pdfremotestartview[/tt] checked, but not, say, that of [tt]pdfstartview[/tt]?

                Ciao.


                Gustavo

              • #109291
                Up
                0
                Down
                ::


                Il baco è stato riportato a chi di dovere. Come potete vedere, questo filone di discussione è stato citato e collegato.

                Ciao.


                Gustavo

            Visualizzazione 7 filoni di risposte
            • Devi essere connesso per rispondere a questo topic.

            Go to top