Whether bookmarks duplicates or not is dependent on engine and `caption` package












1














Backgroud



This answer of question Bookmark tables and figures says




[usage of bookmark ready to be inserted]



Next issue: caption often sets its argument twice, because it wants to check, whether the caption fits in one line. This can be turned off with singlelinecheck=false. But this affects the formatting of single line captions.



[first solution, using DeclareCaptionTextFormat to define a new caption text format in which an bookmark is inserted]




Question



I am curious about what happens when "caption sets its argument twice", so I use a simplified example and come with the following table:



| Engine + format | is `caption` loaded | is bookmark duplicate             |
| --------------- | ------------------- | --------------------------------- |
| xelatex | no | no |
| xelatex | yes | no |
| pdflatex | no | only multiline captions duplicate |
| pdflatex | yes | yes |


Here "duplicate" means there are two adjacent bookmarks, both having the same content and destination, in the PDF file.




  • no duplicate: no duplicate

  • partly duplicate: partly duplicate

  • fully duplicate: fully duplicate


Hence my question is




  1. Why the output is engine dependent?

    I guess this may come from the different bookmark driver files, but currently I am not able to read through or understand them.

    From another perspective, if every usage of caption sets its argument twice (for example, inside @makecaption provided by standard classes), bookmarks will always be duplicate, independent of engines.

  2. For pdflatex, why the output is pacakge caption dependent? Which part of the source code of this package causes this?


version info




  • macOS 12.14.2 with TeX Live 2018

  • XeTeX, 3.14159265-2.6-0.99999

  • pdfTeX, 3.14159265-2.6-1.40.19

  • LaTeX2e, 2018-12-01


output of listfiles with caption loaded and xelatex



 *File List*
article.cls 2018/09/03 v1.4i Standard LaTeX document class
size10.clo 2018/09/03 v1.4i Standard LaTeX file (size option)
caption.sty 2018/10/06 v3.3-154 Customizing captions (AR)
caption3.sty 2018/09/12 v1.8c caption3 kernel (AR)
keyval.sty 2014/10/28 v1.15 key=value parser (DPC)
bookmark.sty 2016/05/17 v1.26 PDF bookmarks (HO)
pdfescape.sty 2016/05/16 v1.14 Implements pdfTeX's escape features (HO)
ltxcmds.sty 2016/05/16 v1.23 LaTeX kernel commands for general use (HO)
pdftexcmds.sty 2018/09/10 v0.29 Utility functions of pdfTeX for LuaTeX (HO)
infwarerr.sty 2016/05/16 v1.4 Providing info/warning/error messages (HO)
ifluatex.sty 2016/05/16 v1.4 Provides the ifluatex switch (HO)
ifpdf.sty 2018/09/07 v3.3 Provides the ifpdf switch
ifxetex.sty 2010/09/12 v0.6 Provides ifxetex conditional
ifvtex.sty 2016/05/16 v1.6 Detect VTeX and its facilities (HO)
hyperref.sty 2018/11/30 v6.88e Hypertext links for LaTeX
hobsub-hyperref.sty 2016/05/16 v1.14 Bundle oberdiek, subset hyperref (HO)
hobsub-generic.sty 2016/05/16 v1.14 Bundle oberdiek, subset generic (HO)
hobsub.sty 2016/05/16 v1.14 Construct package bundles (HO)
intcalc.sty 2016/05/16 v1.2 Expandable calculations with integers (HO)
etexcmds.sty 2016/05/16 v1.6 Avoid name clashes with e-TeX commands (HO)
kvsetkeys.sty 2016/05/16 v1.17 Key value parser (HO)
kvdefinekeys.sty 2016/05/16 v1.4 Define keys (HO)
bigintcalc.sty 2016/05/16 v1.4 Expandable calculations on big integers (HO)
bitset.sty 2016/05/16 v1.2 Handle bit-vector datatype (HO)
uniquecounter.sty 2016/05/16 v1.3 Provide unlimited unique counter (HO)
letltxmacro.sty 2016/05/16 v1.5 Let assignment for LaTeX macros (HO)
hopatch.sty 2016/05/16 v1.3 Wrapper for package hooks (HO)
xcolor-patch.sty 2016/05/16 xcolor patch
atveryend.sty 2016/05/16 v1.9 Hooks at the very end of document (HO)
atbegshi.sty 2016/06/09 v1.18 At begin shipout hook (HO)
refcount.sty 2016/05/16 v3.5 Data extraction from label references (HO)
hycolor.sty 2016/05/16 v1.8 Color options for hyperref/bookmark (HO)
auxhook.sty 2016/05/16 v1.4 Hooks for auxiliary files (HO)
kvoptions.sty 2016/05/16 v3.12 Key value format for package options (HO)
pd1enc.def 2018/11/30 v6.88e Hyperref: PDFDocEncoding definition (HO)
hyperref.cfg 2002/06/06 v1.2 hyperref configuration of TeXLive
url.sty 2013/09/16 ver 3.4 Verb mode for urls, etc.
hxetex.def 2018/11/30 v6.88e Hyperref driver for XeTeX
puenc.def 2018/11/30 v6.88e Hyperref: PDF Unicode definition (HO)
stringenc.sty 2016/05/16 v1.11 Convert strings between diff. encodings (HO)
rerunfilecheck.sty 2016/05/16 v1.8 Rerun checks for auxiliary files (HO)
bkm-dvipdfm.def 2016/05/17 v1.26 bookmark driver for dvipdfm (HO)
nameref.sty 2016/05/21 v2.44 Cross-referencing by name of section
gettitlestring.sty 2016/05/16 v1.5 Cleanup title references (HO)
se-ascii-print.def 2016/05/16 v1.11 stringenc: Printable ASCII characters
***********


Example document



documentclass{article}
usepackage{caption}
usepackage{bookmark}
listfiles
makeatletter
% simplified from https://tex.stackexchange.com/a/178548/79060
defaddBookmark#1{%
bookmark[dest=@currentHref]{Figure thefigure: #1}%
#1%
}
makeatother

begin{document}

dummy text
begin{figure}
centering
rule{6cm}{3cm}
caption{addBookmark{Figure caption text}}
end{figure}

begin{figure}
centering
rule{6cm}{3cm}
caption{addBookmark{Figure caption long long long long long long long long long long long long text}}
end{figure}

newpage % add a blank page to make it easier to see bookmark targets
dummy text

end{document}









share|improve this question





























    1














    Backgroud



    This answer of question Bookmark tables and figures says




    [usage of bookmark ready to be inserted]



    Next issue: caption often sets its argument twice, because it wants to check, whether the caption fits in one line. This can be turned off with singlelinecheck=false. But this affects the formatting of single line captions.



    [first solution, using DeclareCaptionTextFormat to define a new caption text format in which an bookmark is inserted]




    Question



    I am curious about what happens when "caption sets its argument twice", so I use a simplified example and come with the following table:



    | Engine + format | is `caption` loaded | is bookmark duplicate             |
    | --------------- | ------------------- | --------------------------------- |
    | xelatex | no | no |
    | xelatex | yes | no |
    | pdflatex | no | only multiline captions duplicate |
    | pdflatex | yes | yes |


    Here "duplicate" means there are two adjacent bookmarks, both having the same content and destination, in the PDF file.




    • no duplicate: no duplicate

    • partly duplicate: partly duplicate

    • fully duplicate: fully duplicate


    Hence my question is




    1. Why the output is engine dependent?

      I guess this may come from the different bookmark driver files, but currently I am not able to read through or understand them.

      From another perspective, if every usage of caption sets its argument twice (for example, inside @makecaption provided by standard classes), bookmarks will always be duplicate, independent of engines.

    2. For pdflatex, why the output is pacakge caption dependent? Which part of the source code of this package causes this?


    version info




    • macOS 12.14.2 with TeX Live 2018

    • XeTeX, 3.14159265-2.6-0.99999

    • pdfTeX, 3.14159265-2.6-1.40.19

    • LaTeX2e, 2018-12-01


    output of listfiles with caption loaded and xelatex



     *File List*
    article.cls 2018/09/03 v1.4i Standard LaTeX document class
    size10.clo 2018/09/03 v1.4i Standard LaTeX file (size option)
    caption.sty 2018/10/06 v3.3-154 Customizing captions (AR)
    caption3.sty 2018/09/12 v1.8c caption3 kernel (AR)
    keyval.sty 2014/10/28 v1.15 key=value parser (DPC)
    bookmark.sty 2016/05/17 v1.26 PDF bookmarks (HO)
    pdfescape.sty 2016/05/16 v1.14 Implements pdfTeX's escape features (HO)
    ltxcmds.sty 2016/05/16 v1.23 LaTeX kernel commands for general use (HO)
    pdftexcmds.sty 2018/09/10 v0.29 Utility functions of pdfTeX for LuaTeX (HO)
    infwarerr.sty 2016/05/16 v1.4 Providing info/warning/error messages (HO)
    ifluatex.sty 2016/05/16 v1.4 Provides the ifluatex switch (HO)
    ifpdf.sty 2018/09/07 v3.3 Provides the ifpdf switch
    ifxetex.sty 2010/09/12 v0.6 Provides ifxetex conditional
    ifvtex.sty 2016/05/16 v1.6 Detect VTeX and its facilities (HO)
    hyperref.sty 2018/11/30 v6.88e Hypertext links for LaTeX
    hobsub-hyperref.sty 2016/05/16 v1.14 Bundle oberdiek, subset hyperref (HO)
    hobsub-generic.sty 2016/05/16 v1.14 Bundle oberdiek, subset generic (HO)
    hobsub.sty 2016/05/16 v1.14 Construct package bundles (HO)
    intcalc.sty 2016/05/16 v1.2 Expandable calculations with integers (HO)
    etexcmds.sty 2016/05/16 v1.6 Avoid name clashes with e-TeX commands (HO)
    kvsetkeys.sty 2016/05/16 v1.17 Key value parser (HO)
    kvdefinekeys.sty 2016/05/16 v1.4 Define keys (HO)
    bigintcalc.sty 2016/05/16 v1.4 Expandable calculations on big integers (HO)
    bitset.sty 2016/05/16 v1.2 Handle bit-vector datatype (HO)
    uniquecounter.sty 2016/05/16 v1.3 Provide unlimited unique counter (HO)
    letltxmacro.sty 2016/05/16 v1.5 Let assignment for LaTeX macros (HO)
    hopatch.sty 2016/05/16 v1.3 Wrapper for package hooks (HO)
    xcolor-patch.sty 2016/05/16 xcolor patch
    atveryend.sty 2016/05/16 v1.9 Hooks at the very end of document (HO)
    atbegshi.sty 2016/06/09 v1.18 At begin shipout hook (HO)
    refcount.sty 2016/05/16 v3.5 Data extraction from label references (HO)
    hycolor.sty 2016/05/16 v1.8 Color options for hyperref/bookmark (HO)
    auxhook.sty 2016/05/16 v1.4 Hooks for auxiliary files (HO)
    kvoptions.sty 2016/05/16 v3.12 Key value format for package options (HO)
    pd1enc.def 2018/11/30 v6.88e Hyperref: PDFDocEncoding definition (HO)
    hyperref.cfg 2002/06/06 v1.2 hyperref configuration of TeXLive
    url.sty 2013/09/16 ver 3.4 Verb mode for urls, etc.
    hxetex.def 2018/11/30 v6.88e Hyperref driver for XeTeX
    puenc.def 2018/11/30 v6.88e Hyperref: PDF Unicode definition (HO)
    stringenc.sty 2016/05/16 v1.11 Convert strings between diff. encodings (HO)
    rerunfilecheck.sty 2016/05/16 v1.8 Rerun checks for auxiliary files (HO)
    bkm-dvipdfm.def 2016/05/17 v1.26 bookmark driver for dvipdfm (HO)
    nameref.sty 2016/05/21 v2.44 Cross-referencing by name of section
    gettitlestring.sty 2016/05/16 v1.5 Cleanup title references (HO)
    se-ascii-print.def 2016/05/16 v1.11 stringenc: Printable ASCII characters
    ***********


    Example document



    documentclass{article}
    usepackage{caption}
    usepackage{bookmark}
    listfiles
    makeatletter
    % simplified from https://tex.stackexchange.com/a/178548/79060
    defaddBookmark#1{%
    bookmark[dest=@currentHref]{Figure thefigure: #1}%
    #1%
    }
    makeatother

    begin{document}

    dummy text
    begin{figure}
    centering
    rule{6cm}{3cm}
    caption{addBookmark{Figure caption text}}
    end{figure}

    begin{figure}
    centering
    rule{6cm}{3cm}
    caption{addBookmark{Figure caption long long long long long long long long long long long long text}}
    end{figure}

    newpage % add a blank page to make it easier to see bookmark targets
    dummy text

    end{document}









    share|improve this question



























      1












      1








      1







      Backgroud



      This answer of question Bookmark tables and figures says




      [usage of bookmark ready to be inserted]



      Next issue: caption often sets its argument twice, because it wants to check, whether the caption fits in one line. This can be turned off with singlelinecheck=false. But this affects the formatting of single line captions.



      [first solution, using DeclareCaptionTextFormat to define a new caption text format in which an bookmark is inserted]




      Question



      I am curious about what happens when "caption sets its argument twice", so I use a simplified example and come with the following table:



      | Engine + format | is `caption` loaded | is bookmark duplicate             |
      | --------------- | ------------------- | --------------------------------- |
      | xelatex | no | no |
      | xelatex | yes | no |
      | pdflatex | no | only multiline captions duplicate |
      | pdflatex | yes | yes |


      Here "duplicate" means there are two adjacent bookmarks, both having the same content and destination, in the PDF file.




      • no duplicate: no duplicate

      • partly duplicate: partly duplicate

      • fully duplicate: fully duplicate


      Hence my question is




      1. Why the output is engine dependent?

        I guess this may come from the different bookmark driver files, but currently I am not able to read through or understand them.

        From another perspective, if every usage of caption sets its argument twice (for example, inside @makecaption provided by standard classes), bookmarks will always be duplicate, independent of engines.

      2. For pdflatex, why the output is pacakge caption dependent? Which part of the source code of this package causes this?


      version info




      • macOS 12.14.2 with TeX Live 2018

      • XeTeX, 3.14159265-2.6-0.99999

      • pdfTeX, 3.14159265-2.6-1.40.19

      • LaTeX2e, 2018-12-01


      output of listfiles with caption loaded and xelatex



       *File List*
      article.cls 2018/09/03 v1.4i Standard LaTeX document class
      size10.clo 2018/09/03 v1.4i Standard LaTeX file (size option)
      caption.sty 2018/10/06 v3.3-154 Customizing captions (AR)
      caption3.sty 2018/09/12 v1.8c caption3 kernel (AR)
      keyval.sty 2014/10/28 v1.15 key=value parser (DPC)
      bookmark.sty 2016/05/17 v1.26 PDF bookmarks (HO)
      pdfescape.sty 2016/05/16 v1.14 Implements pdfTeX's escape features (HO)
      ltxcmds.sty 2016/05/16 v1.23 LaTeX kernel commands for general use (HO)
      pdftexcmds.sty 2018/09/10 v0.29 Utility functions of pdfTeX for LuaTeX (HO)
      infwarerr.sty 2016/05/16 v1.4 Providing info/warning/error messages (HO)
      ifluatex.sty 2016/05/16 v1.4 Provides the ifluatex switch (HO)
      ifpdf.sty 2018/09/07 v3.3 Provides the ifpdf switch
      ifxetex.sty 2010/09/12 v0.6 Provides ifxetex conditional
      ifvtex.sty 2016/05/16 v1.6 Detect VTeX and its facilities (HO)
      hyperref.sty 2018/11/30 v6.88e Hypertext links for LaTeX
      hobsub-hyperref.sty 2016/05/16 v1.14 Bundle oberdiek, subset hyperref (HO)
      hobsub-generic.sty 2016/05/16 v1.14 Bundle oberdiek, subset generic (HO)
      hobsub.sty 2016/05/16 v1.14 Construct package bundles (HO)
      intcalc.sty 2016/05/16 v1.2 Expandable calculations with integers (HO)
      etexcmds.sty 2016/05/16 v1.6 Avoid name clashes with e-TeX commands (HO)
      kvsetkeys.sty 2016/05/16 v1.17 Key value parser (HO)
      kvdefinekeys.sty 2016/05/16 v1.4 Define keys (HO)
      bigintcalc.sty 2016/05/16 v1.4 Expandable calculations on big integers (HO)
      bitset.sty 2016/05/16 v1.2 Handle bit-vector datatype (HO)
      uniquecounter.sty 2016/05/16 v1.3 Provide unlimited unique counter (HO)
      letltxmacro.sty 2016/05/16 v1.5 Let assignment for LaTeX macros (HO)
      hopatch.sty 2016/05/16 v1.3 Wrapper for package hooks (HO)
      xcolor-patch.sty 2016/05/16 xcolor patch
      atveryend.sty 2016/05/16 v1.9 Hooks at the very end of document (HO)
      atbegshi.sty 2016/06/09 v1.18 At begin shipout hook (HO)
      refcount.sty 2016/05/16 v3.5 Data extraction from label references (HO)
      hycolor.sty 2016/05/16 v1.8 Color options for hyperref/bookmark (HO)
      auxhook.sty 2016/05/16 v1.4 Hooks for auxiliary files (HO)
      kvoptions.sty 2016/05/16 v3.12 Key value format for package options (HO)
      pd1enc.def 2018/11/30 v6.88e Hyperref: PDFDocEncoding definition (HO)
      hyperref.cfg 2002/06/06 v1.2 hyperref configuration of TeXLive
      url.sty 2013/09/16 ver 3.4 Verb mode for urls, etc.
      hxetex.def 2018/11/30 v6.88e Hyperref driver for XeTeX
      puenc.def 2018/11/30 v6.88e Hyperref: PDF Unicode definition (HO)
      stringenc.sty 2016/05/16 v1.11 Convert strings between diff. encodings (HO)
      rerunfilecheck.sty 2016/05/16 v1.8 Rerun checks for auxiliary files (HO)
      bkm-dvipdfm.def 2016/05/17 v1.26 bookmark driver for dvipdfm (HO)
      nameref.sty 2016/05/21 v2.44 Cross-referencing by name of section
      gettitlestring.sty 2016/05/16 v1.5 Cleanup title references (HO)
      se-ascii-print.def 2016/05/16 v1.11 stringenc: Printable ASCII characters
      ***********


      Example document



      documentclass{article}
      usepackage{caption}
      usepackage{bookmark}
      listfiles
      makeatletter
      % simplified from https://tex.stackexchange.com/a/178548/79060
      defaddBookmark#1{%
      bookmark[dest=@currentHref]{Figure thefigure: #1}%
      #1%
      }
      makeatother

      begin{document}

      dummy text
      begin{figure}
      centering
      rule{6cm}{3cm}
      caption{addBookmark{Figure caption text}}
      end{figure}

      begin{figure}
      centering
      rule{6cm}{3cm}
      caption{addBookmark{Figure caption long long long long long long long long long long long long text}}
      end{figure}

      newpage % add a blank page to make it easier to see bookmark targets
      dummy text

      end{document}









      share|improve this question















      Backgroud



      This answer of question Bookmark tables and figures says




      [usage of bookmark ready to be inserted]



      Next issue: caption often sets its argument twice, because it wants to check, whether the caption fits in one line. This can be turned off with singlelinecheck=false. But this affects the formatting of single line captions.



      [first solution, using DeclareCaptionTextFormat to define a new caption text format in which an bookmark is inserted]




      Question



      I am curious about what happens when "caption sets its argument twice", so I use a simplified example and come with the following table:



      | Engine + format | is `caption` loaded | is bookmark duplicate             |
      | --------------- | ------------------- | --------------------------------- |
      | xelatex | no | no |
      | xelatex | yes | no |
      | pdflatex | no | only multiline captions duplicate |
      | pdflatex | yes | yes |


      Here "duplicate" means there are two adjacent bookmarks, both having the same content and destination, in the PDF file.




      • no duplicate: no duplicate

      • partly duplicate: partly duplicate

      • fully duplicate: fully duplicate


      Hence my question is




      1. Why the output is engine dependent?

        I guess this may come from the different bookmark driver files, but currently I am not able to read through or understand them.

        From another perspective, if every usage of caption sets its argument twice (for example, inside @makecaption provided by standard classes), bookmarks will always be duplicate, independent of engines.

      2. For pdflatex, why the output is pacakge caption dependent? Which part of the source code of this package causes this?


      version info




      • macOS 12.14.2 with TeX Live 2018

      • XeTeX, 3.14159265-2.6-0.99999

      • pdfTeX, 3.14159265-2.6-1.40.19

      • LaTeX2e, 2018-12-01


      output of listfiles with caption loaded and xelatex



       *File List*
      article.cls 2018/09/03 v1.4i Standard LaTeX document class
      size10.clo 2018/09/03 v1.4i Standard LaTeX file (size option)
      caption.sty 2018/10/06 v3.3-154 Customizing captions (AR)
      caption3.sty 2018/09/12 v1.8c caption3 kernel (AR)
      keyval.sty 2014/10/28 v1.15 key=value parser (DPC)
      bookmark.sty 2016/05/17 v1.26 PDF bookmarks (HO)
      pdfescape.sty 2016/05/16 v1.14 Implements pdfTeX's escape features (HO)
      ltxcmds.sty 2016/05/16 v1.23 LaTeX kernel commands for general use (HO)
      pdftexcmds.sty 2018/09/10 v0.29 Utility functions of pdfTeX for LuaTeX (HO)
      infwarerr.sty 2016/05/16 v1.4 Providing info/warning/error messages (HO)
      ifluatex.sty 2016/05/16 v1.4 Provides the ifluatex switch (HO)
      ifpdf.sty 2018/09/07 v3.3 Provides the ifpdf switch
      ifxetex.sty 2010/09/12 v0.6 Provides ifxetex conditional
      ifvtex.sty 2016/05/16 v1.6 Detect VTeX and its facilities (HO)
      hyperref.sty 2018/11/30 v6.88e Hypertext links for LaTeX
      hobsub-hyperref.sty 2016/05/16 v1.14 Bundle oberdiek, subset hyperref (HO)
      hobsub-generic.sty 2016/05/16 v1.14 Bundle oberdiek, subset generic (HO)
      hobsub.sty 2016/05/16 v1.14 Construct package bundles (HO)
      intcalc.sty 2016/05/16 v1.2 Expandable calculations with integers (HO)
      etexcmds.sty 2016/05/16 v1.6 Avoid name clashes with e-TeX commands (HO)
      kvsetkeys.sty 2016/05/16 v1.17 Key value parser (HO)
      kvdefinekeys.sty 2016/05/16 v1.4 Define keys (HO)
      bigintcalc.sty 2016/05/16 v1.4 Expandable calculations on big integers (HO)
      bitset.sty 2016/05/16 v1.2 Handle bit-vector datatype (HO)
      uniquecounter.sty 2016/05/16 v1.3 Provide unlimited unique counter (HO)
      letltxmacro.sty 2016/05/16 v1.5 Let assignment for LaTeX macros (HO)
      hopatch.sty 2016/05/16 v1.3 Wrapper for package hooks (HO)
      xcolor-patch.sty 2016/05/16 xcolor patch
      atveryend.sty 2016/05/16 v1.9 Hooks at the very end of document (HO)
      atbegshi.sty 2016/06/09 v1.18 At begin shipout hook (HO)
      refcount.sty 2016/05/16 v3.5 Data extraction from label references (HO)
      hycolor.sty 2016/05/16 v1.8 Color options for hyperref/bookmark (HO)
      auxhook.sty 2016/05/16 v1.4 Hooks for auxiliary files (HO)
      kvoptions.sty 2016/05/16 v3.12 Key value format for package options (HO)
      pd1enc.def 2018/11/30 v6.88e Hyperref: PDFDocEncoding definition (HO)
      hyperref.cfg 2002/06/06 v1.2 hyperref configuration of TeXLive
      url.sty 2013/09/16 ver 3.4 Verb mode for urls, etc.
      hxetex.def 2018/11/30 v6.88e Hyperref driver for XeTeX
      puenc.def 2018/11/30 v6.88e Hyperref: PDF Unicode definition (HO)
      stringenc.sty 2016/05/16 v1.11 Convert strings between diff. encodings (HO)
      rerunfilecheck.sty 2016/05/16 v1.8 Rerun checks for auxiliary files (HO)
      bkm-dvipdfm.def 2016/05/17 v1.26 bookmark driver for dvipdfm (HO)
      nameref.sty 2016/05/21 v2.44 Cross-referencing by name of section
      gettitlestring.sty 2016/05/16 v1.5 Cleanup title references (HO)
      se-ascii-print.def 2016/05/16 v1.11 stringenc: Printable ASCII characters
      ***********


      Example document



      documentclass{article}
      usepackage{caption}
      usepackage{bookmark}
      listfiles
      makeatletter
      % simplified from https://tex.stackexchange.com/a/178548/79060
      defaddBookmark#1{%
      bookmark[dest=@currentHref]{Figure thefigure: #1}%
      #1%
      }
      makeatother

      begin{document}

      dummy text
      begin{figure}
      centering
      rule{6cm}{3cm}
      caption{addBookmark{Figure caption text}}
      end{figure}

      begin{figure}
      centering
      rule{6cm}{3cm}
      caption{addBookmark{Figure caption long long long long long long long long long long long long text}}
      end{figure}

      newpage % add a blank page to make it easier to see bookmark targets
      dummy text

      end{document}






      captions bookmarks engine






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited 3 hours ago







      Johannes Z

















      asked 4 hours ago









      Johannes ZJohannes Z

      1888




      1888






















          0






          active

          oldest

          votes











          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "85"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: false,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f469285%2fwhether-bookmarks-duplicates-or-not-is-dependent-on-engine-and-caption-package%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes
















          draft saved

          draft discarded




















































          Thanks for contributing an answer to TeX - LaTeX Stack Exchange!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.





          Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


          Please pay close attention to the following guidance:


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f469285%2fwhether-bookmarks-duplicates-or-not-is-dependent-on-engine-and-caption-package%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          A CLEAN and SIMPLE way to add appendices to Table of Contents and bookmarks

          Calculate evaluation metrics using cross_val_predict sklearn

          Insert data from modal to MySQL (multiple modal on website)