如何将 bibitem 标签作为侧边注?

如何将 bibitem 标签作为侧边注?

灵感源自美丽模板我正在使用 Manuel Kühner 的软件包marginnote结合来scrbook注释我的主要文本,效果很好。

包含文本和注释的两页示例

不幸的是,在我看来,这会给我的参考书目带来不好的副作用,因为我不会使用额外的空间来做旁注。

两页参考书目示例

我希望将 bibitem 的标识符放在边距内,并使用额外的空间(现在的标识符占用的空间,图中红色区域)来作为参考。

我希望获得的两个页面的示例

不幸的是,我不知道从哪里开始。我的 B 计划是编写一个 .bbl 文件的解析脚本,但我认为必须有一个仅基于 LaTeX 的解决方案。

任何帮助都将受到赞赏。


这是用于生成我从中拍摄图片的 pdf 的 MWE。

\documentclass[12pt, twoside]{scrbook}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{marginnote}
\usepackage{ragged2e}
\usepackage[english]{babel} % needed for blindtext
\usepackage{blindtext}
%\usepackage{showframe}

\newcommand{\myMarginnote}[1]{%
    \marginnote{% needs marginnote package
        \ifthispageodd{\RaggedRight}{\RaggedLeft}% needs ragged2e package
        \lineskiplimit=-\maxdimen% 
        \normalfont\sffamily\scriptsize%
        #1}
}

\usepackage{geometry}
\geometry{inner=20mm, outer=40mm, bottom=30mm, top=30mm,    marginparsep=3mm,   marginparwidth=30mm}
\usepackage{scrpage2}

% Define width of header
\setheadwidth[0pt]{textwithmarginpar}

% Define with of header line
\setheadsepline{0.4pt}

\ohead{\headmark}
\lefoot{\llap{\pagemark~}}
\rofoot{    \rlap{~\pagemark}}
\pagestyle{scrheadings}

\begin{document}
\markboth{left header}{right header}
\nocite{*}
~\newpage
\blindtext\myMarginnote{foobar}
\blindtext\myMarginnote{bar}
\blindtext\myMarginnote{foobar}
\blindtext\myMarginnote{bar}
\blindtext\myMarginnote{foobar foo foo foobar bar bar}
\blindtext\myMarginnote{bar}
\blindtext\myMarginnote{foobar}
\blindtext\myMarginnote{\blindtext}
\blindtext[4]

\bibliographystyle{alpha}
\bibliography{literatur}
\end{document}

这里的内容literatur.bib20 篇被引用次数最多的论文,由 google-scholar 拍摄):

@article{lowry1951protein,
  title={Protein measurement with the {Folin} phenol reagent},
  author={Lowry, Oliver H and Rosebrough, Nira J and Farr, A Lewis and Randall, Rose J and others},
  journal={J biol Chem},
  volume={193},
  number={1},
  pages={265--275},
  year={1951}
}

@article{laemmli1970cleavage,
  title={Cleavage of structural proteins during the assembly of the head of bacteriophage {T4}},
  author={Laemmli, Ulrich K and others},
  journal={nature},
  volume={227},
  number={5259},
  pages={680--685},
  year={1970},
  publisher={London}
}

@article{bradford1976rapid,
  title={A rapid and sensitive method for the quantitation of microgram quantities of protein utilizing the principle of protein-dye binding},
  author={Bradford, Marion M},
  journal={Analytical biochemistry},
  volume={72},
  number={1},
  pages={248--254},
  year={1976},
  publisher={Elsevier}
}

@article{sanger1977dna,
  title={{DNA} sequencing with chain-terminating inhibitors},
  author={Sanger, Frederick and Nicklen, Steven and Coulson, Alan R},
  journal={Proceedings of the National Academy of Sciences},
  volume={74},
  number={12},
  pages={5463--5467},
  year={1977},
  publisher={National Acad Sciences}
}

@article{chomczynski1987single,
  title={Single-step method of {RNA} isolation by acid guanidinium thiocyanate-phenol-chloroform extraction},
  author={Chomczynski, Piotr and Sacchi, Nicoletta},
  journal={Analytical biochemistry},
  volume={162},
  number={1},
  pages={156--159},
  year={1987},
  publisher={Elsevier}
}

@article{towbin1979electrophoretic,
  title={Electrophoretic transfer of proteins from polyacrylamide gels to nitrocellulose sheets: procedure and some applications},
  author={Towbin, Harry and Staehelin, Theophil and Gordon, Julian},
  journal={Proceedings of the National Academy of Sciences},
  volume={76},
  number={9},
  pages={4350--4354},
  year={1979},
  publisher={National Acad Sciences}
}

@article{lee1988development,
  title={Development of the Colle-Salvetti correlation-energy formula into a functional of the electron density},
  author={Lee, Chengteh and Yang, Weitao and Parr, Robert G},
  journal={Physical review B},
  volume={37},
  number={2},
  pages={785},
  year={1988},
  publisher={APS}
}

@article{becke1993density,
  title={Density-functional thermochemistry. III. The role of exact exchange},
  author={Becke, Axel D},
  journal={The Journal of chemical physics},
  volume={98},
  number={7},
  pages={5648--5652},
  year={1993},
  publisher={AIP Publishing}
}

@article{folch1957simple,
  title={A simple method for the isolation and purification of total lipids from animal tissues},
  author={Folch, Jordi and Lees, M\_ and Sloane-Stanley, GH and others},
  journal={J biol chem},
  volume={226},
  number={1},
  pages={497--509},
  year={1957}
}

@article{thompson1994clustal,
  title={{CLUSTAL W}: improving the sensitivity of progressive multiple sequence alignment through sequence weighting, position-specific gap penalties and weight matrix choice},
  author={Thompson, Julie D and Higgins, Desmond G and Gibson, Toby J},
  journal={Nucleic acids research},
  volume={22},
  number={22},
  pages={4673--4680},
  year={1994},
  publisher={Oxford Univ Press}
}

@article{kaplan1958nonparametric,
  title={Nonparametric estimation from incomplete observations},
  author={Kaplan, Edward L and Meier, Paul},
  journal={Journal of the American statistical association},
  volume={53},
  number={282},
  pages={457--481},
  year={1958},
  publisher={Taylor \& Francis}
}

@article{altschul1990basic,
  title={Basic local alignment search tool},
  author={Altschul, Stephen F and Gish, Warren and Miller, Webb and Myers, Eugene W and Lipman, David J},
  journal={Journal of molecular biology},
  volume={215},
  number={3},
  pages={403--410},
  year={1990},
  publisher={Elsevier}
}

@article{sheldrick2007short,
  title={A short history of {SHELX}},
  author={Sheldrick, George M},
  journal={Acta Crystallographica Section A: Foundations of Crystallography},
  volume={64},
  number={1},
  pages={112--122},
  year={2007},
  publisher={International Union of Crystallography}
}

@article{altschul1997gapped,
  title={Gapped BLAST and PSI-BLAST: a new generation of protein database search programs},
  author={Altschul, Stephen F and Madden, Thomas L and Sch{\"a}ffer, Alejandro A and Zhang, Jinghui and Zhang, Zheng and Miller, Webb and Lipman, David J},
  journal={Nucleic acids research},
  volume={25},
  number={17},
  pages={3389--3402},
  year={1997},
  publisher={Oxford Univ Press}
}

@article{murashige1962revised,
  title={A revised medium for rapid growth and bio assays with tobacco tissue cultures},
  author={Murashige, Toshio and Skoog, Folke},
  journal={Physiologia plantarum},
  volume={15},
  number={3},
  pages={473--497},
  year={1962},
  publisher={Wiley Online Library}
}

@article{perdew1996generalized,
  title={Generalized gradient approximation made simple},
  author={Perdew, John P and Burke, Kieron and Ernzerhof, Matthias},
  journal={Physical review letters},
  volume={77},
  number={18},
  pages={3865},
  year={1996},
  publisher={APS}
}

@article{folstein1975mini,
  title={“Mini-mental state”: a practical method for grading the cognitive state of patients for the clinician},
  author={Folstein, Marshal F and Folstein, Susan E and McHugh, Paul R},
  journal={Journal of psychiatric research},
  volume={12},
  number={3},
  pages={189--198},
  year={1975},
  publisher={Elsevier}
}

@article{bligh1959rapid,
  title={A rapid method of total lipid extraction and purification},
  author={Bligh, E Graham and Dyer, W Justin},
  journal={Canadian journal of biochemistry and physiology},
  volume={37},
  number={8},
  pages={911--917},
  year={1959},
  publisher={NRC Research Press}
}

@article{southern1975detection,
  title={Detection of specific sequences among DNA fragments separated by gel electrophoresis},
  author={Southern, Edwin Mellor},
  journal={Journal of molecular biology},
  volume={98},
  number={3},
  pages={503--517},
  year={1975},
  publisher={Elsevier}
}

@article{saitou1987neighbor,
  title={The neighbor-joining method: a new method for reconstructing phylogenetic trees.},
  author={Saitou, Naruya and Nei, Masatoshi},
  journal={Molecular biology and evolution},
  volume={4},
  number={4},
  pages={406--425},
  year={1987},
  publisher={SMBE}
}

答案1

我认为将书目标签放在右边距不是一个好主意:这会迫使读者去右边距找到标签,然后再往后翻整行。但如果你想……

\documentclass[12pt, twoside]{scrbook}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{marginnote}
\usepackage{ragged2e}
\usepackage[english]{babel} % needed for blindtext
\usepackage{blindtext}
%\usepackage{showframe}

\newcommand{\myMarginnote}[1]{%
    \marginnote{% needs marginnote package
        \ifthispageodd{\RaggedRight}{\RaggedLeft}% needs ragged2e package
        \lineskiplimit=-\maxdimen%
        \normalfont\sffamily\scriptsize%
        #1}%
}

\usepackage{geometry}
\geometry{inner=20mm, outer=40mm, bottom=30mm, top=30mm,    marginparsep=3mm,   marginparwidth=30mm}
\usepackage{scrpage2}

% Define width of header
\setheadwidth[0pt]{textwithmarginpar}

% Define with of header line
\setheadsepline{0.4pt}

\ohead{\headmark}
\lefoot{\llap{\pagemark~}}
\rofoot{    \rlap{~\pagemark}}
\pagestyle{scrheadings}

\begin{document}
\markboth{left header}{right header}
\nocite{*}

\makeatletter
\def\@lbibitem[#1]#2{\item[\hfill]\leavevmode\myMarginnote{\@biblabel{#1}}\if@filesw
      {\let\protect\noexpand
       \immediate
       \write\@auxout{\string\bibcite{#2}{#1}}}\fi\ignorespaces}
\renewcommand\@openbib@code{% change the list parameters
    \setlength\labelwidth{0pt}%
    \leftmargin\labelwidth
    \setlength\labelsep{0pt}%
    }

\renewcommand{\myMarginnote}[1]{%
    \marginnote{% needs marginnote package
        \ifthispageodd{\raggedright}{\raggedleft}%to avoid underfull messages
        \lineskiplimit=-\maxdimen%
        \normalfont\sffamily\scriptsize%
        #1}%
}    
\makeatother
\bibliographystyle{alpha}
\bibliography{literatur}
\end{document}

在此处输入图片描述

相关内容