Reaproveitando uma definição de ambiente personalizada com pacote floats e comando newenvironment: preso na definição de nome de legenda

Reaproveitando uma definição de ambiente personalizada com pacote floats e comando newenvironment: preso na definição de nome de legenda

Estou no processo de criar um float personalizado para abrigar longas listas de palavras e definições que eu poderia organizar em \multicols{n}vez de um tableou tabular(ou qualquer derivação delas) para que flua bem pelas páginas, dependendo do número de definições e do número de colunas. No entanto, como acontece com outros ambientes flutuantes, se forem muito grandes, eles se recusam a fluir por várias páginas, enquanto o que eu quero é que a lista comece onde quer que eu a coloque no documento e continue até terminar, quantas páginas houver. .

Durante minha pesquisa no Google, encontrei esta pergunta:Tag de algoritmo e quebra de página, onde uma resposta inclui a definição de um ambiente personalizado, breakablealgorithmque permite que eles se espalhem por várias páginas.

Peguei esse código e o ajustei em meu documento e até agora consegui que tudo funcionasse praticamente do jeito que eu queria, exceto que não consigo descobrir como quebrar o link do código original para oAlgoritmonome que aparece na legenda e conecte-o ao meu novo nome:Orðalisti(lista de palavras). Acho que sei qual linha é a culpada (veja MWE), mas não consegui descobrir como modificá-la para chamar o nome do meu novo ambiente (OrðalistiPara \begin{bigwordlist}e \endbigwordlist).

MWE:

\documentclass[12pt]{book}


\usepackage[LY1,T1]{fontenc} 
\usepackage[icelandic]{babel}
\usepackage{lmodern}

\usepackage{multicol}
\usepackage{float}
\usepackage{algorithm} % if I delete this it breaks at \caption

\floatstyle{plain}
\newfloat{wordlist}{tbhp}{lol}[chapter]
\floatname{wordlist}{Orðalisti}

\makeatletter
\newenvironment{bigwordlist}
  {
     \refstepcounter{wordlist}
     \renewcommand{\caption}[2][\relax]{
       {\center{\ALG@name~\thewordlist}{:} ##2\par}% problematic line
       \ifx\relax##1\relax 
         \addcontentsline{lol}{wordlist}{\protect\numberline{\thewordlist}##2} 
       \else
         \addcontentsline{lol}{wordlist}{\protect\numberline{\thewordlist}##1} 
       \fi
     }
  }{
  }
\makeatother


\begin{document}

\chapter{List chapter}

This is a short list:

\begin{wordlist}
\sffamily
    Master cleanse edison \\  bulb bicycle rights ad \\  affogato ethical \\  Truffaut mustache fugiat \\ skateboard shaman man braid \\ 
\rmfamily
\label{listi:short}
\caption{this is a short list}
\end{wordlist}

This is a very long list that I have: 

\begin{bigwordlist}

\begin{footnotesize}
\begin{multicols}{2}
\sffamily
\noindent
Master cleanse edison \\  bulb bicycle rights ad \\  affogato ethical \\  Truffaut mustache fugiat \\ skateboard shaman man braid \\ 
tumeric irure sunt \\  enamel pin \\  in taiyaki \\  Tacos velit four\\  loko listicle health \\ goth narwhal \\ XOXO \\ esse mumblecore ea \\
bitters +1 \\ Organic sartorial authentic  \\ waistcoat officia \\ reprehenderit pork \\ belly helvetica mumblecore \\ Chillwave dreamcatcher marfa \\
ea artisan kickstarter \\ thundercats \\ lo-fi tofu \\ before they sold out \\  air plant \\ woke offal  \\ Typewriter truffaut quinoa \\ 
everyday carry  \\ ethical narwhal in \\ Selfies la croix \\ cray salvia subway tile \\ bitters vexillologist \\ enim tumeric anim \\ Craft beer \\ 
meh lorem \\ air plant \\ adaptogen stumptown \\ cold-pressed chartreuse\\ deserunt chicharrones forage \\ Lomo cupidatat  \\ subway tile \\
locavore ut \\ 90's keffiyeh ramps \\ consectetur truffaut \\ skateboard  \\ pour-over slow-carb \\ irony subway \\ tile adipisicing aliquip \\ 
Yuccie vinyl shoreditch \\ mumblecore \\ sriracha \\ tote bag \\ heirloom gluten-free wayfarers \\ letterpress glossier \\ Green juice taiyaki \\
chambray actually \\ letterpress \\ XOXO lyft \\ duis af sed \\ flannel \\ gentrify deep v. Dreamcatcher \\ cornhole flexitarian \\ mumblecore street art\\
raw denim \\ Live-edge \\ vegan portland \\ cray et yuccie \\ beard \\ shabby chic qui \\ selvage roof party \\ sunt \\ Pour-over yr \\ mollit raclette \\
beard brooklyn \\ hell of hexagon pork belly celiac \\ Succulents chambray\\  incididunt coloring book \\ disrupt flexitarian taiyaki sed \\ Before they sold out \\
edison bulb \\ prism \\ farm-to-table \\ do coloring book \\ Tattooed lorem \\ cred tacos \\ before they sold out \\ viral \\ man bun \\ cray enamel \\
pin wolf \\ Tofu wolf\\  semiotics id typewriter \\ XOXO \\ you probably haven't heard of them \\ tote bag \\ williamsburg \\ Asymmetrical heirloom \\ 
taxidermy cred \\ ea occaecat squid \\ fugiat labore \\ PBR\&B godard \\ the end
\rmfamily
\end{multicols}
\end{footnotesize}
    

\label{listi:long}
\caption{this is a long list}
\end{bigwordlist}

\listof{wordlist}{Orðalistaskrá}

\end{document}

Alguns comentários e respostas sobre a criação de novos tipos de ambientes flutuantes disseram que as pessoas deveriam preferir usar package newfloate not float, e tentei configurar o mesmo tipo de ambiente com ele. No entanto, eu ainda precisaria definir uma versão quebrável disso, já que também não conseguia ver se poderia implementar um recurso de quebra de página pronto para uso.

Responder1

Use \fname@wordlistem vez de \ALG@name. Então você também não precisa \usepackage{algorithm}mais.

insira a descrição da imagem aqui

insira a descrição da imagem aqui

\documentclass[12pt]{book}


\usepackage[LY1,T1]{fontenc} 
\usepackage[icelandic]{babel}
\usepackage{lmodern}

\usepackage{multicol}
\usepackage{float}

\floatstyle{plain}
\newfloat{wordlist}{tbhp}{lol}[chapter]
\floatname{wordlist}{Orðalisti}

\makeatletter
\newenvironment{bigwordlist}
  {
     \refstepcounter{wordlist}
     \renewcommand{\caption}[2][\relax]{
       {\center{\fname@wordlist~\thewordlist}{:} ##2\par}% problematic line
       \ifx\relax##1\relax 
         \addcontentsline{lol}{wordlist}{\protect\numberline{\thewordlist}##2} 
       \else
         \addcontentsline{lol}{wordlist}{\protect\numberline{\thewordlist}##1} 
       \fi
     }
  }{
  }
\makeatother


\begin{document}

\chapter{List chapter}

This is a short list:

\begin{wordlist}
\sffamily
    Master cleanse edison \\  bulb bicycle rights ad \\  affogato ethical \\  Truffaut mustache fugiat \\ skateboard shaman man braid \\ 
\rmfamily
\label{listi:short}
\caption{this is a short list}
\end{wordlist}

This is a very long list that I have: 

\begin{bigwordlist}

\begin{footnotesize}
\begin{multicols}{2}
\sffamily
\noindent
Master cleanse edison \\  bulb bicycle rights ad \\  affogato ethical \\  Truffaut mustache fugiat \\ skateboard shaman man braid \\ 
tumeric irure sunt \\  enamel pin \\  in taiyaki \\  Tacos velit four\\  loko listicle health \\ goth narwhal \\ XOXO \\ esse mumblecore ea \\
bitters +1 \\ Organic sartorial authentic  \\ waistcoat officia \\ reprehenderit pork \\ belly helvetica mumblecore \\ Chillwave dreamcatcher marfa \\
ea artisan kickstarter \\ thundercats \\ lo-fi tofu \\ before they sold out \\  air plant \\ woke offal  \\ Typewriter truffaut quinoa \\ 
everyday carry  \\ ethical narwhal in \\ Selfies la croix \\ cray salvia subway tile \\ bitters vexillologist \\ enim tumeric anim \\ Craft beer \\ 
meh lorem \\ air plant \\ adaptogen stumptown \\ cold-pressed chartreuse\\ deserunt chicharrones forage \\ Lomo cupidatat  \\ subway tile \\
locavore ut \\ 90's keffiyeh ramps \\ consectetur truffaut \\ skateboard  \\ pour-over slow-carb \\ irony subway \\ tile adipisicing aliquip \\ 
Yuccie vinyl shoreditch \\ mumblecore \\ sriracha \\ tote bag \\ heirloom gluten-free wayfarers \\ letterpress glossier \\ Green juice taiyaki \\
chambray actually \\ letterpress \\ XOXO lyft \\ duis af sed \\ flannel \\ gentrify deep v. Dreamcatcher \\ cornhole flexitarian \\ mumblecore street art\\
raw denim \\ Live-edge \\ vegan portland \\ cray et yuccie \\ beard \\ shabby chic qui \\ selvage roof party \\ sunt \\ Pour-over yr \\ mollit raclette \\
beard brooklyn \\ hell of hexagon pork belly celiac \\ Succulents chambray\\  incididunt coloring book \\ disrupt flexitarian taiyaki sed \\ Before they sold out \\
edison bulb \\ prism \\ farm-to-table \\ do coloring book \\ Tattooed lorem \\ cred tacos \\ before they sold out \\ viral \\ man bun \\ cray enamel \\
pin wolf \\ Tofu wolf\\  semiotics id typewriter \\ XOXO \\ you probably haven't heard of them \\ tote bag \\ williamsburg \\ Asymmetrical heirloom \\ 
taxidermy cred \\ ea occaecat squid \\ fugiat labore \\ PBR\&B godard \\ the end
\rmfamily
\end{multicols}
\end{footnotesize}
    

\label{listi:long}
\caption{this is a long list}
\end{bigwordlist}

\listof{wordlist}{Orðalistaskrá}

\end{document}

informação relacionada