Brug af authblk-pakke automatisk regne med affilkommando
On februar 10, 2021 by adminMin nuværende kodning er tilknytningslinknummer indsæt manuelt.
\title{Hormonal crosstalk for root development: a combined experimental and modeling perspective} \author[1]{Junli Liu} \author[2]{James Rowe} \author[3]{Keith Lindsey} \affil[1]{address one} \affil[2]{address two} \affil[3]{address three}
Men jeg ønsker, at tilknytningslinknummer skal indtastes automatisk som modkoncept. foreslå løsning
For eksempel:
\title{Hormonal crosstalk for root development: a combined experimental and modeling perspective} \author[1]{Junli Liu} \author[2]{James Rowe} \author[3]{Keith Lindsey} \affil{address one} \affil{address two} \affil{address three}
Kommentarer
- Du ' har fuldstændigt ændret spørgsmålet fra at anmode om ingen tilknytningstælling til automatisk nummerering. Mit forslag er at ikke gøre dette, da det gør eksisterende svar fuldstændigt ugyldige. I stedet for still et nyt opfølgningsspørgsmål .
Svar
Jeg er ikke sikker på, hvilken logik du forventer i \affil
.
Der er to former for brug af authblk
faciliteter.
Første form
\author{Name1} \affil{Affiliation1} \author{Name2a} \author{Name2b} \affil{Affiliation 2}
(et hvilket som helst antal forfattere kan gå foran en \affil
kommando, der henviser til den gruppe forfattere). Det er din sag:
\documentclass[twocolumn]{article} \usepackage[noblocks]{authblk} \begin{document} \title{Hormonal crosstalk for root development: a combined experimental and modeling perspective} \author{Junli Liu} \affil{Integrative Cell Biology Laboratory, School of Biological and Biomedical Sciences, The Bio physical Sciences Institute, Durham University, Durham, UK} \author{James Rowe} \author{Keith Lindsey} \affil{Some other laboratory, Elsewhere} \maketitle \end{document}
producerer
Anden form
Hvis tilknytninger ikke følger rækkefølgen af forfattere, skal man gå med den anden form, hvor det valgfri argument bliver nødvendigt:
\author[1]{Name1a} \author[2]{Name2} \author[1]{Name1b} \affil[1]{Affiliation1} \affil[2]{Affiliation2}
Så hvis Lindsey i dit tilfælde har samme tilknytning som Liu, skal du indtaste
\documentclass[twocolumn]{article} \usepackage[noblocks]{authblk} \begin{document} \title{Hormonal crosstalk for root development: a combined experimental and modeling perspective} \author[1]{Junli Liu} \author[2]{James Rowe} \author[1]{Keith Lindsey} \affil[1]{Integrative Cell Biology Laboratory, School of Biological and Biomedical Sciences, The Bio physical Sciences Institute, Durham University, Durham, UK} \affil[2]{Some other laboratory, Elsewhere} \maketitle
og du ” få
Alternativ måde
Hvis du har tilknytning til hver forfatter og ønsker automatisk nummerering, kan du gøre det ved at ændre, hvordan kommandoerne fungerer.
\documentclass[twocolumn]{article} \usepackage[noblocks]{authblk} \usepackage{letltxmacro,xpatch} \newcounter{affiliations} \LetLtxMacro{\authblkauthor}{\author} \LetLtxMacro{\authblkaffil}{\affil} \renewcommand{\author}[1]{% \authblkauthor[\theauthors]{#1}% } \renewcommand{\affil}[1]{% \stepcounter{affiliations}% \authblkaffil[\theaffiliations]{#1}% } \begin{document} \title{Hormonal crosstalk for root development: a combined experimental and modeling perspective} \author{Junli Liu} \author{James Rowe} \author{Keith Lindsey} \affil{Integrative Cell Biology Laboratory, School of Biological and Biomedical Sciences, The Bio physical Sciences Institute, Durham University, Durham, UK} \affil{Some other laboratory, Elsewhere} \affil{Another laboratory, Somewhere Else} \maketitle \end{document}
Du ville dog få nøjagtigt det samme resultat ved at bruge den første form, som efter min mening er klarere input.
\documentclass[twocolumn]{article} \usepackage[noblocks]{authblk} \begin{document} \title{Hormonal crosstalk for root development: a combined experimental and modeling perspective} \author{Junli Liu} \affil{Integrative Cell Biology Laboratory, School of Biological and Biomedical Sciences, The Bio physical Sciences Institute, Durham University, Durham, UK} \author{James Rowe} \affil{Some other laboratory, Elsewhere} \author{Keith Lindsey} \affil{Another laboratory, Somewhere Else} \maketitle \end{document}
En anden mulighed (her har du brug for det valgfri argument ud for \author
):
\documentclass[twocolumn]{article} \usepackage[noblocks]{authblk} \usepackage{letltxmacro,xpatch} \newcounter{affiliations} \LetLtxMacro{\authblkaffil}{\affil} \renewcommand{\affil}[1]{% \stepcounter{affiliations}% \authblkaffil[\theaffiliations]{#1}% } \begin{document} \title{Hormonal crosstalk for root development: a combined experimental and modeling perspective} \author[1]{Junli Liu} \author[2]{James Rowe} \author[3]{Keith Lindsey} \affil{Integrative Cell Biology Laboratory, School of Biological and Biomedical Sciences, The Bio physical Sciences Institute, Durham University, Durham, UK} \affil{Some other laboratory, Elsewhere} \affil{Another laboratory, Somewhere Else} \maketitle \end{document}
Kommentarer
- Jeg giver ingen valgfri argumenter som " \ affil [1] "
- Jeg giver ingen valgfri argumenter som " \ affil [1 ] " Jeg giver kun " \ affil {text her} ". Hvis den eneste affil er der, er tallet " 1 " vises ikke " adresse en ". Mere end en affil gives nummeret tælles automatisk som " 1 adresse en, 2 adresse to " .. Jeg vil gerne arbejde denne logiske automatiske optælling
- @SaravanakkhumarC Tilføj venligst nogle præciseringer (og eksempler) til dit spørgsmål.
- Jeg redigerer og gemmer min afklaring. Foreslå din løsning.
- @Vetri Jeg tilføjede koden, men for den applikation synes jeg den første formular er bedre, fordi på denne måde indtastes tilknytningen straks efter den relative forfatter.
Svar
Hvis en post ikke skal have et nummer, kan du bruge \affil[ ]{<stuff>}
:
\documentclass[twocolumn]{article} \usepackage[noblocks]{authblk} \begin{document} \title{Hormonal crosstalk for root development: a combined experimental and modeling perspective} \author[1]{Junli Liu} \author[2]{James Rowe} \author[2]{Keith Lindsey} \affil{Integrative Cell Biology Laboratory, School of Biological and Biomedical Sciences, The Bio physical Sciences Institute, Durham University, Durham, UK} \affil[$\relax$]{Integrative Cell Biology Laboratory, School of Biological and Biomedical Sciences, The Bio physical Sciences Institute, Durham University, Durham, UK} \maketitle \end{document}
Hvis du vil have alle \affil
for at være ugyldige for tal kan du tilføje følgende til din præambel:
\usepackage[noblocks]{authblk} \let\oldaffil\affil% Store a copy of \affil in \oldaffil \renewcommand{\affil}{\oldaffil[ ]}% Update \affil to *always* use \affil[ ]
Ovenstående ændring gør \affil
standard til \affil[ ]
så du behøver ikke at videregive et valgfrit argument længere.
\documentclass[twocolumn]{article} \usepackage[noblocks]{authblk} \let\oldaffil\affil \renewcommand{\affil}{\oldaffil[ ]} \begin{document} \title{Hormonal crosstalk for root development: a combined experimental and modeling perspective} \author[1]{Junli Liu} \author[2]{James Rowe} \author[2]{Keith Lindsey} \affil{Integrative Cell Biology Laboratory, School of Biological and Biomedical Sciences, The Bio physical Sciences Institute, Durham University, Durham, UK} \affil{Integrative Cell Biology Laboratory, School of Biological and Biomedical Sciences, The Bio physical Sciences Institute, Durham University, Durham, UK} \maketitle \end{document}
Kommentarer
-
$\null$
? Virkelig? 😉 - @egreg: Det ' s giver logisk mening at have ingen /
\null
tilknytning. At være\relax
ed om det er lige så godt. - Nej,
\relax
ville ikke ' fungerer ikke, fordi kommandoen\if\relax#1\relax
. Hverken\null
fungerer, fordi\if
sammenligner\relax
og\hbox
. Enklere:\affil[ ]
. Testen skal naturligvis være\ifx\hfuzz#1\hfuzz
(enhver primitiv, der ikke forventes i argumentet, ville også være god).
Skriv et svar