wtsnjp / llmk

Light LaTeX Make
https://ctan.org/pkg/llmk
MIT License
110 stars 5 forks source link

Bib2gls #13

Closed Martin-2019 closed 1 year ago

Martin-2019 commented 2 years ago

Dear Maintainer!

How to use bib2gls with the llmk program, with options, just like for the arara program (sequence), eg.:

% arara: lualatex: { shell: yes, synctex: yes } % arara: bib2gls: { group: on , recordcount: on , breakspace: on } % arara: lualatex: { shell: yes, synctex: yes } % arara: bib2gls: { group: on , recordcount: on , breakspace: on } % arara: lualatex: { shell: yes, synctex: yes } % arara: biber % arara: lualatex: { shell: yes, synctex: yes } % arara: lualatex: { shell: yes, synctex: yes }

Is this possible? If so, it might be worth adding to the manual - as an example.

Regards

M.

wtsnjp commented 2 years ago

You can configure several general features, including that specifies command-line options (opts), to treat any kind of program in the programs table. Please see Section 3.4 of the reference manual.

I'm not familiar with bib2gls. Is there anything special for the invocation of bib2gls? Maybe you need to run the latex program as its postprocess?

[programs.bib2gls]
command = "bib2gls"
target = "%B.aux"  # is this correct?
opts = ["<any option you want>"]
postprocess = "latex"

If there are standard (or recommended) options for general users, then I can add the setting to the default programs table and indeed write it down in the manual accordingly.

Martin-2019 commented 2 years ago

Dear Maintainer!

Unfortunately, it does not work.

M.

wtsnjp commented 2 years ago

What did you tried and what happened? Please provide more details.

Martin-2019 commented 2 years ago

I was working on attached files - the arara commands works, unfortunately.

file: sample

% This is an example LaTeX document for llmk. % Public domain.

% +++ % # This should be a comment % llmk_version = "1.1" % sequence = [ "latex", "bib2gls", "latex", "bib2gls", "latex" ] % max_repeat = 7 % % [programs.latex] % command = "lualatex" % args = "%T" %
% % [programs.bib2gls] % command = "bib2gls" % target = "%T" # is this correct? % opts = ["--group", "--break-space", "--cite-as-record"] % +++

% arara: pdflatex % arara: bib2gls: { options: [ --group, --break-space, --cite-as-record ] } % arara: pdflatex % arara: bib2gls: { options: [ --group, --break-space, --cite-as-record ] } % arara: pdflatex % arara: biber % arara: pdflatex % arara: pdflatex

% This file is public domain. See the "Examples" chapter % in the bib2gls user manual for a more detailed description % of this file.

% bib2gls must be run with the --cite-as-record switch

\documentclass[12pt,a4paper]{scrbook}

\usepackage[colorlinks]{hyperref}

\usepackage[record,% using bib2gls nomain,% don't define main glossary postdot,% full stop after descriptions nostyles,% don't load default styles % load glossary-tree and glossary-list and patch styles: stylemods={tree,list} ]{glossaries-extra}

\usepackage[refsegment=chapter, backend=biber, style=numeric-comp, hyperref, backref=true, indexing=cite,giveninits=true,sorting=none,citetracker=true,pagetracker=true,citecounter=true]{biblatex}

\addbibresource{citations.bib}

\newglossary{contributors}{Authors} \newglossary{titles}{Titles}

\newcommand{\bibglsnewbibtexentry}[4]{% \longnewglossaryentry*{#1}{name={#3},#2,type={titles}}{#4}% }

\GlsXtrLoadResources[ src={citations},% data in citations.bib entry-type-aliases={\GlsXtrBibTeXEntryAliases}, field-aliases={ title=name }, type={contributors}, category={same as original entry}, sort-field={category}, sort-suffix={name} ]

\glsxtrsetgrouptitle{article}{Articles} \glsxtrsetgrouptitle{book}{Books}

\newcommand{\contributorhandler}[1]{\par\glsentryname{#1} \cite{#1}}

\newcommand{\glsxtrpostdesccontributor}{% \glsxtrifhasfield{biblatexentry}{\glscurrententrylabel}% {% \glsxtrfieldforlistloop {\glscurrententrylabel}{biblatexentry}% {\contributorhandler}% }% {\par No titles.}% }

\newcommand{\glsxtrpostdescarticle}{\cite{\glscurrententrylabel}} \newcommand{\glsxtrpostdescbook}{\cite{\glscurrententrylabel}}

\begin{document} This is a sample document with some citations~\cite{duck2016,duck2018,macaw,parrot} and some more citations~\cite{duck2018,duck2016} and don't forget~\cite{ing,parrot2012} and lastly~\cite{quackalot}.

\printunsrtglossary[type=contributors,style=altlist] \printunsrtglossary*[type=titles,style=indexgroup] {% \renewcommand{\glsxtrgroupfield}{category}% \renewcommand{\glstreenamefmt}[1]{\emph{#1}}% \renewcommand{\glstreegroupheaderfmt}[1]{\textbf{#1}}% }

%\bibliographystyle{plain} %\bibliography{citations}

\printbibliography

\end{document}

and attached file citations:

% This file is public domain. See the "Examples" chapter % in the bib2gls user manual for a more detailed description % of this file.

% Encoding: UTF-8

@preamble{"\providecommand{\titlefmt}[1]{`#1'}"}

@article{duck2018, author = {Dickie Duck and Jos\'{e} Arara and Polly Parrot}, title = {Avian friendship}, journal = {Fowl Times}, year = 2018, volume = 7, number = 5, pages = "1032--5" }

@book{duck2016, author = {Dickie Duck}, title = {Feathered stunt doubles: \titlefmt{The Birds} and other films}, publisher = {Duck Duck Goose}, year = 2016 }

@book{macaw, author = {Prof Macaw}, title = {Annotated notes on the \titlefmt{Duck and Goose} chronicles}, publisher = {Duck Duck Goose}, year = 2012 }

@book{ing, author = {Bor Ing}, title = {\titlefmt{Duck and Goose}: an allegory for modern times?}, publisher = {Duck Duck Goose}, year = 2010 }

@article{parrot, author = {Polly Parrot and Dickie Duck}, title = {\titlefmt{Duck and Goose} Cheat Sheet for Students}, journal = {Fowl Times}, year = 2013, volume = 2, number = 10, pages = "15--23" }

@book{parrot2012, author = {A Parrot}, title = {My Friend is a Duck}, publisher = {Duck Duck Goose}, year = 2012 }

@book{quackalot, author = {Sir Quackalot}, title = {The Adventures of Duck and Goose}, publisher = {Duck Duck Goose}, year = 2011 }

%%%%

M.

wtsnjp commented 1 year ago

Sorry but only "the arara commands works" does not explain what you expect from our program. I will close this issue unless the reporter provides a more detailed and concrete request.

Martin-2019 commented 1 year ago

Thank you very much for your time and I apologise for the lack of communication, probably due to a lack of IT skills.

Yours sincerely