Index in KoMa-Layers does not workHow to make “This page intentionally left blank.” in KOMA scriptHow to make an indexed word reference another indexed word in LyX?Removing spurious pagebreak in index?Index does not printIndexing does not work with index packageKOMA book: correct hyperlink to the index?Collecting index entries after printindexHow to use luacode* to eliminate need to escape “”?allowbreak does not work in indexDoes numbers=autoenddot work in KOMA Script?Redeclaresectioncommand does not work for section - Koma Script Report - Lyx

What does "^L" mean in C?

Print last inputted byte

Do US professors/group leaders only get a salary, but no group budget?

How to define limit operations in general topological spaces? Are nets able to do this?

My friend is being a hypocrite

Violin - Can double stops be played when the strings are not next to each other?

What does "Four-F." mean?

Calculate the frequency of characters in a string

Why Choose Less Effective Armour Types?

Hausdorff dimension of the boundary of fibres of Lipschitz maps

I got the following comment from a reputed math journal. What does it mean?

Asserting that Atheism and Theism are both faith based positions

Help rendering a complicated sum/product formula

Why does the degree of dissociation change when we dilute a weak acid even though the equilibrium constant K is constant?

Knife as defense against stray dogs

How could an airship be repaired midflight?

Is a party consisting of only a bard, a cleric, and a warlock functional long-term?

Can other pieces capture a threatening piece and prevent a checkmate?

How can an organ that provides biological immortality be unable to regenerate?

How do hiring committees for research positions view getting "scooped"?

How is the partial sum of a geometric sequence calculated?

How are passwords stolen from companies if they only store hashes?

Is honey really a supersaturated solution? Does heating to un-crystalize redissolve it or melt it?

Constant Current LED Circuit



Index in KoMa-Layers does not work


How to make “This page intentionally left blank.” in KOMA scriptHow to make an indexed word reference another indexed word in LyX?Removing spurious pagebreak in index?Index does not printIndexing does not work with index packageKOMA book: correct hyperlink to the index?Collecting index entries after printindexHow to use luacode* to eliminate need to escape “”?allowbreak does not work in indexDoes numbers=autoenddot work in KOMA Script?Redeclaresectioncommand does not work for section - Koma Script Report - Lyx













5















Background.
I would like to replace the intentionally blank pages or vacat pages in scrbook with a page which shows a new quote on every new blank page. Thanks to scrbook and LuaTeX this is not that difficult to write.



Here is my problem.
Unfortunately, the index on these pages does not work. The entry does not show up in the .idx-file.



Remarks.



  • Choosing a different engine than LuaTeX is not an option.

  • The code which accesses the quote from Lua-tables is not shown here to avoid a bloated MWE and a separated .lua-file.

  • Choosing a different class than scrbook is not an option.

  • The same problem occurs in the header and footer.

  • The indexes index does work here A and index does work here B work fine.

My MWE.



documentclass[paper=a4,twoside]scrbook

usepackagefontspec,polyglossia
setdefaultlanguage[variant=usmax]english

usepackagehyperref,makeidx

usepackagescrlayer,scrlayer-scrpage
DeclareNewLayer[
foreground,
align=l,
area=.25paperwidth.37paperheight.5paperwidth.5paperheight,
contents=A quote which is accessed by Lua. But not in the MWE. But the textbfindexindexindex does not work here does not work here!
Just some Lua code: directluatex.sprint(math.exp(-1)).
]intentionallyBlankLayer
DeclareNewPageStyleByLayersintentionallyBlankintentionallyBlankLayer
KOMAoptionscleardoublepage=intentionallyBlank

ihead[bar indexbar head index does not work]foo indexfoo head index does not work
ifoot[bar indexbar foot index does not work]foo indexfoo foot index does not work

makeindex
begindocument

chapterLorem foo
Some text with a working indexindexindex does work here A.
chapterLorem bar
Some other text with a working indexindexindex does work here B.

printindex
enddocument









share|improve this question
























  • Great MWE. Your example works well. In my idx file I get indexentryindex does work here A1 Fixing the page number is the only issue I see.

    – Marco Daniel
    Mar 25 '17 at 9:42






  • 1





    @MarcoDaniel: I don't get it, and page 1 is the wrong page anyway.

    – Ulrike Fischer
    Mar 25 '17 at 10:19











  • @Maco Daniel: The index I do not get is index does not work here.

    – CampanIgnis
    Mar 25 '17 at 11:23












  • @Ulrike Fischer: Observing my PDF, page 1 is correct.

    – CampanIgnis
    Mar 25 '17 at 11:26











  • @CampanIgnis: I was referring to Marco's comment, imho he looked at the wrong entry.

    – Ulrike Fischer
    Mar 25 '17 at 11:34















5















Background.
I would like to replace the intentionally blank pages or vacat pages in scrbook with a page which shows a new quote on every new blank page. Thanks to scrbook and LuaTeX this is not that difficult to write.



Here is my problem.
Unfortunately, the index on these pages does not work. The entry does not show up in the .idx-file.



Remarks.



  • Choosing a different engine than LuaTeX is not an option.

  • The code which accesses the quote from Lua-tables is not shown here to avoid a bloated MWE and a separated .lua-file.

  • Choosing a different class than scrbook is not an option.

  • The same problem occurs in the header and footer.

  • The indexes index does work here A and index does work here B work fine.

My MWE.



documentclass[paper=a4,twoside]scrbook

usepackagefontspec,polyglossia
setdefaultlanguage[variant=usmax]english

usepackagehyperref,makeidx

usepackagescrlayer,scrlayer-scrpage
DeclareNewLayer[
foreground,
align=l,
area=.25paperwidth.37paperheight.5paperwidth.5paperheight,
contents=A quote which is accessed by Lua. But not in the MWE. But the textbfindexindexindex does not work here does not work here!
Just some Lua code: directluatex.sprint(math.exp(-1)).
]intentionallyBlankLayer
DeclareNewPageStyleByLayersintentionallyBlankintentionallyBlankLayer
KOMAoptionscleardoublepage=intentionallyBlank

ihead[bar indexbar head index does not work]foo indexfoo head index does not work
ifoot[bar indexbar foot index does not work]foo indexfoo foot index does not work

makeindex
begindocument

chapterLorem foo
Some text with a working indexindexindex does work here A.
chapterLorem bar
Some other text with a working indexindexindex does work here B.

printindex
enddocument









share|improve this question
























  • Great MWE. Your example works well. In my idx file I get indexentryindex does work here A1 Fixing the page number is the only issue I see.

    – Marco Daniel
    Mar 25 '17 at 9:42






  • 1





    @MarcoDaniel: I don't get it, and page 1 is the wrong page anyway.

    – Ulrike Fischer
    Mar 25 '17 at 10:19











  • @Maco Daniel: The index I do not get is index does not work here.

    – CampanIgnis
    Mar 25 '17 at 11:23












  • @Ulrike Fischer: Observing my PDF, page 1 is correct.

    – CampanIgnis
    Mar 25 '17 at 11:26











  • @CampanIgnis: I was referring to Marco's comment, imho he looked at the wrong entry.

    – Ulrike Fischer
    Mar 25 '17 at 11:34













5












5








5


1






Background.
I would like to replace the intentionally blank pages or vacat pages in scrbook with a page which shows a new quote on every new blank page. Thanks to scrbook and LuaTeX this is not that difficult to write.



Here is my problem.
Unfortunately, the index on these pages does not work. The entry does not show up in the .idx-file.



Remarks.



  • Choosing a different engine than LuaTeX is not an option.

  • The code which accesses the quote from Lua-tables is not shown here to avoid a bloated MWE and a separated .lua-file.

  • Choosing a different class than scrbook is not an option.

  • The same problem occurs in the header and footer.

  • The indexes index does work here A and index does work here B work fine.

My MWE.



documentclass[paper=a4,twoside]scrbook

usepackagefontspec,polyglossia
setdefaultlanguage[variant=usmax]english

usepackagehyperref,makeidx

usepackagescrlayer,scrlayer-scrpage
DeclareNewLayer[
foreground,
align=l,
area=.25paperwidth.37paperheight.5paperwidth.5paperheight,
contents=A quote which is accessed by Lua. But not in the MWE. But the textbfindexindexindex does not work here does not work here!
Just some Lua code: directluatex.sprint(math.exp(-1)).
]intentionallyBlankLayer
DeclareNewPageStyleByLayersintentionallyBlankintentionallyBlankLayer
KOMAoptionscleardoublepage=intentionallyBlank

ihead[bar indexbar head index does not work]foo indexfoo head index does not work
ifoot[bar indexbar foot index does not work]foo indexfoo foot index does not work

makeindex
begindocument

chapterLorem foo
Some text with a working indexindexindex does work here A.
chapterLorem bar
Some other text with a working indexindexindex does work here B.

printindex
enddocument









share|improve this question
















Background.
I would like to replace the intentionally blank pages or vacat pages in scrbook with a page which shows a new quote on every new blank page. Thanks to scrbook and LuaTeX this is not that difficult to write.



Here is my problem.
Unfortunately, the index on these pages does not work. The entry does not show up in the .idx-file.



Remarks.



  • Choosing a different engine than LuaTeX is not an option.

  • The code which accesses the quote from Lua-tables is not shown here to avoid a bloated MWE and a separated .lua-file.

  • Choosing a different class than scrbook is not an option.

  • The same problem occurs in the header and footer.

  • The indexes index does work here A and index does work here B work fine.

My MWE.



documentclass[paper=a4,twoside]scrbook

usepackagefontspec,polyglossia
setdefaultlanguage[variant=usmax]english

usepackagehyperref,makeidx

usepackagescrlayer,scrlayer-scrpage
DeclareNewLayer[
foreground,
align=l,
area=.25paperwidth.37paperheight.5paperwidth.5paperheight,
contents=A quote which is accessed by Lua. But not in the MWE. But the textbfindexindexindex does not work here does not work here!
Just some Lua code: directluatex.sprint(math.exp(-1)).
]intentionallyBlankLayer
DeclareNewPageStyleByLayersintentionallyBlankintentionallyBlankLayer
KOMAoptionscleardoublepage=intentionallyBlank

ihead[bar indexbar head index does not work]foo indexfoo head index does not work
ifoot[bar indexbar foot index does not work]foo indexfoo foot index does not work

makeindex
begindocument

chapterLorem foo
Some text with a working indexindexindex does work here A.
chapterLorem bar
Some other text with a working indexindexindex does work here B.

printindex
enddocument






luatex koma-script indexing blank-page scrlayer-scrpage






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited 5 mins ago







CampanIgnis

















asked Mar 24 '17 at 21:14









CampanIgnisCampanIgnis

2,8542932




2,8542932












  • Great MWE. Your example works well. In my idx file I get indexentryindex does work here A1 Fixing the page number is the only issue I see.

    – Marco Daniel
    Mar 25 '17 at 9:42






  • 1





    @MarcoDaniel: I don't get it, and page 1 is the wrong page anyway.

    – Ulrike Fischer
    Mar 25 '17 at 10:19











  • @Maco Daniel: The index I do not get is index does not work here.

    – CampanIgnis
    Mar 25 '17 at 11:23












  • @Ulrike Fischer: Observing my PDF, page 1 is correct.

    – CampanIgnis
    Mar 25 '17 at 11:26











  • @CampanIgnis: I was referring to Marco's comment, imho he looked at the wrong entry.

    – Ulrike Fischer
    Mar 25 '17 at 11:34

















  • Great MWE. Your example works well. In my idx file I get indexentryindex does work here A1 Fixing the page number is the only issue I see.

    – Marco Daniel
    Mar 25 '17 at 9:42






  • 1





    @MarcoDaniel: I don't get it, and page 1 is the wrong page anyway.

    – Ulrike Fischer
    Mar 25 '17 at 10:19











  • @Maco Daniel: The index I do not get is index does not work here.

    – CampanIgnis
    Mar 25 '17 at 11:23












  • @Ulrike Fischer: Observing my PDF, page 1 is correct.

    – CampanIgnis
    Mar 25 '17 at 11:26











  • @CampanIgnis: I was referring to Marco's comment, imho he looked at the wrong entry.

    – Ulrike Fischer
    Mar 25 '17 at 11:34
















Great MWE. Your example works well. In my idx file I get indexentryindex does work here A1 Fixing the page number is the only issue I see.

– Marco Daniel
Mar 25 '17 at 9:42





Great MWE. Your example works well. In my idx file I get indexentryindex does work here A1 Fixing the page number is the only issue I see.

– Marco Daniel
Mar 25 '17 at 9:42




1




1





@MarcoDaniel: I don't get it, and page 1 is the wrong page anyway.

– Ulrike Fischer
Mar 25 '17 at 10:19





@MarcoDaniel: I don't get it, and page 1 is the wrong page anyway.

– Ulrike Fischer
Mar 25 '17 at 10:19













@Maco Daniel: The index I do not get is index does not work here.

– CampanIgnis
Mar 25 '17 at 11:23






@Maco Daniel: The index I do not get is index does not work here.

– CampanIgnis
Mar 25 '17 at 11:23














@Ulrike Fischer: Observing my PDF, page 1 is correct.

– CampanIgnis
Mar 25 '17 at 11:26





@Ulrike Fischer: Observing my PDF, page 1 is correct.

– CampanIgnis
Mar 25 '17 at 11:26













@CampanIgnis: I was referring to Marco's comment, imho he looked at the wrong entry.

– Ulrike Fischer
Mar 25 '17 at 11:34





@CampanIgnis: I was referring to Marco's comment, imho he looked at the wrong entry.

– Ulrike Fischer
Mar 25 '17 at 11:34










2 Answers
2






active

oldest

votes


















3














The page style is used during the output routine and there index is redefined to do nothing. You can try to write the index entry with low level commands, but then you don't get links from hyperref. You could also move the index code to the onselect-hook of the page style. But as pagestyles can be selected in various places without being used at the end you could end with too many index entries. The onevenpage-option looks more logical but doesn't work.



RequirePackageluatex85
documentclass[paper=a4,twoside]scrbook
makeatletter

usepackagefontspec,polyglossia
setdefaultlanguage[variant=usmax]english

usepackagehyperref
usepackagemakeidx

usepackagescrlayer,scrlayer-scrpage

makeatletter
DeclareNewLayer[
foreground,
align=l,
area=.25paperwidth.37paperheight.5paperwidth.5paperheight,
contents=some content with an index entry without link:
protected@write@indexfile%
stringindexentryindex entry in contentthepage,
]intentionallyBlankLayer
DeclareNewPageStyleByLayers[
onselect =
ifnumoddvaluepageindexindex quote in onselect]intentionallyBlankintentionallyBlankLayer
KOMAoptionscleardoublepage=intentionallyBlank

makeindex
begindocument
chapterLorem foo
Some text with a working indexindexindex does work here A.
chapterLorem bar
Some other text with a working indexindexindex does work here B.

printindex
enddocument





share|improve this answer

























  • "index is redefined to do nothing" I thought of something similar, but what is the reason for this definition? Why did you include http://www.ctan.org/pkg/xfp?

    – CampanIgnis
    Mar 25 '17 at 11:59







  • 1





    You can try contents=some content with an index entry without link: protected@write@indexfile% stringindexentryindex entry in contentthepage, to get a link.

    – Marco Daniel
    Mar 25 '17 at 12:16






  • 2





    Well when the pagestyle is used you are in the middle of the output routine and normally you don't want some commands to interfere. Imho trying to inject an index entry and a quote through a page style is a bit dubious. It would be better to define your own cleardoublepage-command or to ask the KOMA-maintainer to add a hook for text content in this pages (if it doesn't exist yet). Or you could hook in the chapter command. After all you are trying something similar to a epigraph.

    – Ulrike Fischer
    Mar 25 '17 at 12:25


















0














Ulrike Fischer describes a different solution in her comment Index in KoMa-Layers does not work with a redefinition of cleardoublpage. I hoped for an elegant solution which is not based on overriding something. The following code is based on https://tex.stackexchange.com/a/205536/128553.



documentclass[paper=a4,twoside]scrbook

usepackagefontspec,polyglossia
setdefaultlanguage[variant=usmax]english

usepackagehyperref,makeidx

usepackagescrlayer,scrlayer-scrpage
newcommand*blankpage%
parvspace*fill%
A quote which is accessed by Lua. But not in the MWE. But the textbfindexindexindex does now work here does not work here!
Just some Lua code: directluatex.sprint(math.exp(-1)).
vspacefill%

makeatletter
renewcommand*cleardoubleoddstandardpage%
clearpage
if@twoside
ifoddc@page
else
blankpage
thispagestyleempty%
newpage
if@twocolumnhboxnewpagefi
fi
fi

makeatother

makeindex
begindocument

chapterLorem foo
Some text with a working indexindexindex does work here A.
chapterLorem bar
Some other text with a working indexindexindex does work here B.

printindex
enddocument


Remark. This answer was part of the question and is now posted as an answer to honor the conventions of this site. The answer https://tex.stackexchange.com/a/360327/128553 is accepted for giving two solutions, this one is a just a realisation of her second suggestion.






share|improve this answer






















    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%2f360272%2findex-in-koma-layers-does-not-work%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    3














    The page style is used during the output routine and there index is redefined to do nothing. You can try to write the index entry with low level commands, but then you don't get links from hyperref. You could also move the index code to the onselect-hook of the page style. But as pagestyles can be selected in various places without being used at the end you could end with too many index entries. The onevenpage-option looks more logical but doesn't work.



    RequirePackageluatex85
    documentclass[paper=a4,twoside]scrbook
    makeatletter

    usepackagefontspec,polyglossia
    setdefaultlanguage[variant=usmax]english

    usepackagehyperref
    usepackagemakeidx

    usepackagescrlayer,scrlayer-scrpage

    makeatletter
    DeclareNewLayer[
    foreground,
    align=l,
    area=.25paperwidth.37paperheight.5paperwidth.5paperheight,
    contents=some content with an index entry without link:
    protected@write@indexfile%
    stringindexentryindex entry in contentthepage,
    ]intentionallyBlankLayer
    DeclareNewPageStyleByLayers[
    onselect =
    ifnumoddvaluepageindexindex quote in onselect]intentionallyBlankintentionallyBlankLayer
    KOMAoptionscleardoublepage=intentionallyBlank

    makeindex
    begindocument
    chapterLorem foo
    Some text with a working indexindexindex does work here A.
    chapterLorem bar
    Some other text with a working indexindexindex does work here B.

    printindex
    enddocument





    share|improve this answer

























    • "index is redefined to do nothing" I thought of something similar, but what is the reason for this definition? Why did you include http://www.ctan.org/pkg/xfp?

      – CampanIgnis
      Mar 25 '17 at 11:59







    • 1





      You can try contents=some content with an index entry without link: protected@write@indexfile% stringindexentryindex entry in contentthepage, to get a link.

      – Marco Daniel
      Mar 25 '17 at 12:16






    • 2





      Well when the pagestyle is used you are in the middle of the output routine and normally you don't want some commands to interfere. Imho trying to inject an index entry and a quote through a page style is a bit dubious. It would be better to define your own cleardoublepage-command or to ask the KOMA-maintainer to add a hook for text content in this pages (if it doesn't exist yet). Or you could hook in the chapter command. After all you are trying something similar to a epigraph.

      – Ulrike Fischer
      Mar 25 '17 at 12:25















    3














    The page style is used during the output routine and there index is redefined to do nothing. You can try to write the index entry with low level commands, but then you don't get links from hyperref. You could also move the index code to the onselect-hook of the page style. But as pagestyles can be selected in various places without being used at the end you could end with too many index entries. The onevenpage-option looks more logical but doesn't work.



    RequirePackageluatex85
    documentclass[paper=a4,twoside]scrbook
    makeatletter

    usepackagefontspec,polyglossia
    setdefaultlanguage[variant=usmax]english

    usepackagehyperref
    usepackagemakeidx

    usepackagescrlayer,scrlayer-scrpage

    makeatletter
    DeclareNewLayer[
    foreground,
    align=l,
    area=.25paperwidth.37paperheight.5paperwidth.5paperheight,
    contents=some content with an index entry without link:
    protected@write@indexfile%
    stringindexentryindex entry in contentthepage,
    ]intentionallyBlankLayer
    DeclareNewPageStyleByLayers[
    onselect =
    ifnumoddvaluepageindexindex quote in onselect]intentionallyBlankintentionallyBlankLayer
    KOMAoptionscleardoublepage=intentionallyBlank

    makeindex
    begindocument
    chapterLorem foo
    Some text with a working indexindexindex does work here A.
    chapterLorem bar
    Some other text with a working indexindexindex does work here B.

    printindex
    enddocument





    share|improve this answer

























    • "index is redefined to do nothing" I thought of something similar, but what is the reason for this definition? Why did you include http://www.ctan.org/pkg/xfp?

      – CampanIgnis
      Mar 25 '17 at 11:59







    • 1





      You can try contents=some content with an index entry without link: protected@write@indexfile% stringindexentryindex entry in contentthepage, to get a link.

      – Marco Daniel
      Mar 25 '17 at 12:16






    • 2





      Well when the pagestyle is used you are in the middle of the output routine and normally you don't want some commands to interfere. Imho trying to inject an index entry and a quote through a page style is a bit dubious. It would be better to define your own cleardoublepage-command or to ask the KOMA-maintainer to add a hook for text content in this pages (if it doesn't exist yet). Or you could hook in the chapter command. After all you are trying something similar to a epigraph.

      – Ulrike Fischer
      Mar 25 '17 at 12:25













    3












    3








    3







    The page style is used during the output routine and there index is redefined to do nothing. You can try to write the index entry with low level commands, but then you don't get links from hyperref. You could also move the index code to the onselect-hook of the page style. But as pagestyles can be selected in various places without being used at the end you could end with too many index entries. The onevenpage-option looks more logical but doesn't work.



    RequirePackageluatex85
    documentclass[paper=a4,twoside]scrbook
    makeatletter

    usepackagefontspec,polyglossia
    setdefaultlanguage[variant=usmax]english

    usepackagehyperref
    usepackagemakeidx

    usepackagescrlayer,scrlayer-scrpage

    makeatletter
    DeclareNewLayer[
    foreground,
    align=l,
    area=.25paperwidth.37paperheight.5paperwidth.5paperheight,
    contents=some content with an index entry without link:
    protected@write@indexfile%
    stringindexentryindex entry in contentthepage,
    ]intentionallyBlankLayer
    DeclareNewPageStyleByLayers[
    onselect =
    ifnumoddvaluepageindexindex quote in onselect]intentionallyBlankintentionallyBlankLayer
    KOMAoptionscleardoublepage=intentionallyBlank

    makeindex
    begindocument
    chapterLorem foo
    Some text with a working indexindexindex does work here A.
    chapterLorem bar
    Some other text with a working indexindexindex does work here B.

    printindex
    enddocument





    share|improve this answer















    The page style is used during the output routine and there index is redefined to do nothing. You can try to write the index entry with low level commands, but then you don't get links from hyperref. You could also move the index code to the onselect-hook of the page style. But as pagestyles can be selected in various places without being used at the end you could end with too many index entries. The onevenpage-option looks more logical but doesn't work.



    RequirePackageluatex85
    documentclass[paper=a4,twoside]scrbook
    makeatletter

    usepackagefontspec,polyglossia
    setdefaultlanguage[variant=usmax]english

    usepackagehyperref
    usepackagemakeidx

    usepackagescrlayer,scrlayer-scrpage

    makeatletter
    DeclareNewLayer[
    foreground,
    align=l,
    area=.25paperwidth.37paperheight.5paperwidth.5paperheight,
    contents=some content with an index entry without link:
    protected@write@indexfile%
    stringindexentryindex entry in contentthepage,
    ]intentionallyBlankLayer
    DeclareNewPageStyleByLayers[
    onselect =
    ifnumoddvaluepageindexindex quote in onselect]intentionallyBlankintentionallyBlankLayer
    KOMAoptionscleardoublepage=intentionallyBlank

    makeindex
    begindocument
    chapterLorem foo
    Some text with a working indexindexindex does work here A.
    chapterLorem bar
    Some other text with a working indexindexindex does work here B.

    printindex
    enddocument






    share|improve this answer














    share|improve this answer



    share|improve this answer








    edited Mar 26 '17 at 21:32









    Martin Schröder

    12.9k640125




    12.9k640125










    answered Mar 25 '17 at 11:52









    Ulrike FischerUlrike Fischer

    196k8302689




    196k8302689












    • "index is redefined to do nothing" I thought of something similar, but what is the reason for this definition? Why did you include http://www.ctan.org/pkg/xfp?

      – CampanIgnis
      Mar 25 '17 at 11:59







    • 1





      You can try contents=some content with an index entry without link: protected@write@indexfile% stringindexentryindex entry in contentthepage, to get a link.

      – Marco Daniel
      Mar 25 '17 at 12:16






    • 2





      Well when the pagestyle is used you are in the middle of the output routine and normally you don't want some commands to interfere. Imho trying to inject an index entry and a quote through a page style is a bit dubious. It would be better to define your own cleardoublepage-command or to ask the KOMA-maintainer to add a hook for text content in this pages (if it doesn't exist yet). Or you could hook in the chapter command. After all you are trying something similar to a epigraph.

      – Ulrike Fischer
      Mar 25 '17 at 12:25

















    • "index is redefined to do nothing" I thought of something similar, but what is the reason for this definition? Why did you include http://www.ctan.org/pkg/xfp?

      – CampanIgnis
      Mar 25 '17 at 11:59







    • 1





      You can try contents=some content with an index entry without link: protected@write@indexfile% stringindexentryindex entry in contentthepage, to get a link.

      – Marco Daniel
      Mar 25 '17 at 12:16






    • 2





      Well when the pagestyle is used you are in the middle of the output routine and normally you don't want some commands to interfere. Imho trying to inject an index entry and a quote through a page style is a bit dubious. It would be better to define your own cleardoublepage-command or to ask the KOMA-maintainer to add a hook for text content in this pages (if it doesn't exist yet). Or you could hook in the chapter command. After all you are trying something similar to a epigraph.

      – Ulrike Fischer
      Mar 25 '17 at 12:25
















    "index is redefined to do nothing" I thought of something similar, but what is the reason for this definition? Why did you include http://www.ctan.org/pkg/xfp?

    – CampanIgnis
    Mar 25 '17 at 11:59






    "index is redefined to do nothing" I thought of something similar, but what is the reason for this definition? Why did you include http://www.ctan.org/pkg/xfp?

    – CampanIgnis
    Mar 25 '17 at 11:59





    1




    1





    You can try contents=some content with an index entry without link: protected@write@indexfile% stringindexentryindex entry in contentthepage, to get a link.

    – Marco Daniel
    Mar 25 '17 at 12:16





    You can try contents=some content with an index entry without link: protected@write@indexfile% stringindexentryindex entry in contentthepage, to get a link.

    – Marco Daniel
    Mar 25 '17 at 12:16




    2




    2





    Well when the pagestyle is used you are in the middle of the output routine and normally you don't want some commands to interfere. Imho trying to inject an index entry and a quote through a page style is a bit dubious. It would be better to define your own cleardoublepage-command or to ask the KOMA-maintainer to add a hook for text content in this pages (if it doesn't exist yet). Or you could hook in the chapter command. After all you are trying something similar to a epigraph.

    – Ulrike Fischer
    Mar 25 '17 at 12:25





    Well when the pagestyle is used you are in the middle of the output routine and normally you don't want some commands to interfere. Imho trying to inject an index entry and a quote through a page style is a bit dubious. It would be better to define your own cleardoublepage-command or to ask the KOMA-maintainer to add a hook for text content in this pages (if it doesn't exist yet). Or you could hook in the chapter command. After all you are trying something similar to a epigraph.

    – Ulrike Fischer
    Mar 25 '17 at 12:25











    0














    Ulrike Fischer describes a different solution in her comment Index in KoMa-Layers does not work with a redefinition of cleardoublpage. I hoped for an elegant solution which is not based on overriding something. The following code is based on https://tex.stackexchange.com/a/205536/128553.



    documentclass[paper=a4,twoside]scrbook

    usepackagefontspec,polyglossia
    setdefaultlanguage[variant=usmax]english

    usepackagehyperref,makeidx

    usepackagescrlayer,scrlayer-scrpage
    newcommand*blankpage%
    parvspace*fill%
    A quote which is accessed by Lua. But not in the MWE. But the textbfindexindexindex does now work here does not work here!
    Just some Lua code: directluatex.sprint(math.exp(-1)).
    vspacefill%

    makeatletter
    renewcommand*cleardoubleoddstandardpage%
    clearpage
    if@twoside
    ifoddc@page
    else
    blankpage
    thispagestyleempty%
    newpage
    if@twocolumnhboxnewpagefi
    fi
    fi

    makeatother

    makeindex
    begindocument

    chapterLorem foo
    Some text with a working indexindexindex does work here A.
    chapterLorem bar
    Some other text with a working indexindexindex does work here B.

    printindex
    enddocument


    Remark. This answer was part of the question and is now posted as an answer to honor the conventions of this site. The answer https://tex.stackexchange.com/a/360327/128553 is accepted for giving two solutions, this one is a just a realisation of her second suggestion.






    share|improve this answer



























      0














      Ulrike Fischer describes a different solution in her comment Index in KoMa-Layers does not work with a redefinition of cleardoublpage. I hoped for an elegant solution which is not based on overriding something. The following code is based on https://tex.stackexchange.com/a/205536/128553.



      documentclass[paper=a4,twoside]scrbook

      usepackagefontspec,polyglossia
      setdefaultlanguage[variant=usmax]english

      usepackagehyperref,makeidx

      usepackagescrlayer,scrlayer-scrpage
      newcommand*blankpage%
      parvspace*fill%
      A quote which is accessed by Lua. But not in the MWE. But the textbfindexindexindex does now work here does not work here!
      Just some Lua code: directluatex.sprint(math.exp(-1)).
      vspacefill%

      makeatletter
      renewcommand*cleardoubleoddstandardpage%
      clearpage
      if@twoside
      ifoddc@page
      else
      blankpage
      thispagestyleempty%
      newpage
      if@twocolumnhboxnewpagefi
      fi
      fi

      makeatother

      makeindex
      begindocument

      chapterLorem foo
      Some text with a working indexindexindex does work here A.
      chapterLorem bar
      Some other text with a working indexindexindex does work here B.

      printindex
      enddocument


      Remark. This answer was part of the question and is now posted as an answer to honor the conventions of this site. The answer https://tex.stackexchange.com/a/360327/128553 is accepted for giving two solutions, this one is a just a realisation of her second suggestion.






      share|improve this answer

























        0












        0








        0







        Ulrike Fischer describes a different solution in her comment Index in KoMa-Layers does not work with a redefinition of cleardoublpage. I hoped for an elegant solution which is not based on overriding something. The following code is based on https://tex.stackexchange.com/a/205536/128553.



        documentclass[paper=a4,twoside]scrbook

        usepackagefontspec,polyglossia
        setdefaultlanguage[variant=usmax]english

        usepackagehyperref,makeidx

        usepackagescrlayer,scrlayer-scrpage
        newcommand*blankpage%
        parvspace*fill%
        A quote which is accessed by Lua. But not in the MWE. But the textbfindexindexindex does now work here does not work here!
        Just some Lua code: directluatex.sprint(math.exp(-1)).
        vspacefill%

        makeatletter
        renewcommand*cleardoubleoddstandardpage%
        clearpage
        if@twoside
        ifoddc@page
        else
        blankpage
        thispagestyleempty%
        newpage
        if@twocolumnhboxnewpagefi
        fi
        fi

        makeatother

        makeindex
        begindocument

        chapterLorem foo
        Some text with a working indexindexindex does work here A.
        chapterLorem bar
        Some other text with a working indexindexindex does work here B.

        printindex
        enddocument


        Remark. This answer was part of the question and is now posted as an answer to honor the conventions of this site. The answer https://tex.stackexchange.com/a/360327/128553 is accepted for giving two solutions, this one is a just a realisation of her second suggestion.






        share|improve this answer













        Ulrike Fischer describes a different solution in her comment Index in KoMa-Layers does not work with a redefinition of cleardoublpage. I hoped for an elegant solution which is not based on overriding something. The following code is based on https://tex.stackexchange.com/a/205536/128553.



        documentclass[paper=a4,twoside]scrbook

        usepackagefontspec,polyglossia
        setdefaultlanguage[variant=usmax]english

        usepackagehyperref,makeidx

        usepackagescrlayer,scrlayer-scrpage
        newcommand*blankpage%
        parvspace*fill%
        A quote which is accessed by Lua. But not in the MWE. But the textbfindexindexindex does now work here does not work here!
        Just some Lua code: directluatex.sprint(math.exp(-1)).
        vspacefill%

        makeatletter
        renewcommand*cleardoubleoddstandardpage%
        clearpage
        if@twoside
        ifoddc@page
        else
        blankpage
        thispagestyleempty%
        newpage
        if@twocolumnhboxnewpagefi
        fi
        fi

        makeatother

        makeindex
        begindocument

        chapterLorem foo
        Some text with a working indexindexindex does work here A.
        chapterLorem bar
        Some other text with a working indexindexindex does work here B.

        printindex
        enddocument


        Remark. This answer was part of the question and is now posted as an answer to honor the conventions of this site. The answer https://tex.stackexchange.com/a/360327/128553 is accepted for giving two solutions, this one is a just a realisation of her second suggestion.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Feb 23 at 17:36









        CampanIgnisCampanIgnis

        2,8542932




        2,8542932



























            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.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2ftex.stackexchange.com%2fquestions%2f360272%2findex-in-koma-layers-does-not-work%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

            acmart: Multiple authors: all with same affiliation, one author an additional affiliationHow to Write Names of Multiple Authors with Shared Affiliation in ACM 2017 Template?Multiple authors with different primary affiliation, but same additional affiliationSame affiliation for all authors without extra packagesIOS-Book-Article.cls: one author with multiple affiliationacmart: Shared Author AffiliationMultiple authors with different primary affiliation, but same additional affiliationAuthor affiliation with only 1 authorAdding Multiple Authors with Different Affiliation in LaTeX ArticleLaTeX: Multiple authors stays on same lineHow to Label Multiple Authors with Same DescriptionHow to make two authors use the same affiliationTwo authors with same affiliation on finished front page

            How to write “ä” and other umlauts and accented letters in bibliography?Accents in BibTeXSorting references with special characters alphabeticallyUse ae ligature in bibliographyEastern European nameInverted circumflex in BibTexBibTex, non-ascii initials and nameptr fproblems with accent in LatexHow to add a Ø to my bibliography from Jabref?References without accentsTroubles when trying to cite St“omer-Verlet in ”title" field of a bib entryComprehensive list of accented charactersHow to type the letter “i” with two dots (diaeresis) in math mode?Problem with glossary text and accented lettersSpecial character in bibliographyAccented letters, Unicode and LaTeX accentsHow to stop natbib from modifying bibliography styleCitation of a paper with non-standard characters by BibtexWrite accented characters to file using writeHow to group the bibliography alphabetically, if some surnames start with “accented” characters?How can I automatically capitalize significant words in my bibliography?

            Problem using RevTeX4-1 with “! Undefined control sequence. @bibitemShut”