我在 Windows 上使用 LyX 2.3.0 尝试编写 beamer 演示文稿,但引用显示不正确。对于某些设置,它会显示“作者?”,而对于其他设置,它会显示类似“king_matrix_2014”的内容。无论如何,它都不会像应该的那样显示“King (2014)”。当我选择“数字”样式而不是“作者”时,我总是得到“?”。
日志取决于我选择的样式。
.bib 文件:
@article{king_matrix_2014,
title = {Matrix method for comparing system and individual energy return ratios when considering an energy transition},
volume = {72},
issn = {0360-5442},
url = {http://www.sciencedirect.com/science/article/pii/S0360544214005817},
doi = {10.1016/j.energy.2014.05.032},
abstract = {ERRs (Energy return ratios) are valuable metrics for understanding and comparing the contributions of individual energy technologies. It is also important to calculate ERRs in the context of a system, or economy, using a mix of energy technologies. In this paper I demonstrate a framework to simultaneously consider individual energy technology and system-wide ERRs using a process-based input{\textendash}output model approach. I demonstrate the approach via an example calculating grid electricity ERRs assuming constant technology with only a shift in dominance from fossil to renewable technology. The framework also enables interpretation of changes in individual ERRs due to a shift from one technology to another, with implications for energy scenario analyses. Another finding of this paper is that the ERR GER (gross energy ratio, often assumed equal to EROImm (energy return on energy invested at the {\textquoteleft}mine mouth{\textquoteright})), is only well-defined for primary energy extraction and not energy carriers such as gasoline and electricity. NER (Net energy ratio) and NEER (net external energy ratio), also known as EPR (energy payback ratio), are the most appropriate metrics for describing energy carriers sold to consumers.},
urldate = {2018-03-29},
journal = {Energy},
author = {King, Carey W.},
month = aug,
year = {2014},
note = {00011},
keywords = {excellent, EROI, Net energy, Energy, system, Life cycle assessment, Energy economics, Input{\textendash}output},
pages = {254--265},
file = {King 2014 home:U\:\\Zotero\\storage\\D7F3PPBD\\King 2011 home.pdf:application/pdf;ScienceDirect Full Text PDF:U\:\\Zotero\\storage\\VDAXI9WZ\\King - 2014 - Matrix method for comparing system and individual .pdf:application/pdf}
}
.lyx 文件:
#LyX 2.3 created this file. For more info see http://www.lyx.org/
\lyxformat 544
\begin_document
\begin_header
\save_transient_properties true
\origin unavailable
\textclass beamer
\begin_preamble
\usepackage{url}
%\usepackage{hyperref}
\usepackage{indentfirst}
\usepackage{tabularx}
%\usepackage[super,sort&compress]{natbib}
\usetheme{Warsaw}
\usepackage{dsfont}
%\usepackage[table]{xcolor}
%\usepackage{dcolumn}
\addtobeamertemplate{footline}{\insertframenumber/\inserttotalframenumber}
\end_preamble
\use_default_options true
\maintain_unincluded_children false
\language english
\language_package auto
\inputencoding auto
\fontencoding global
\font_roman "default" "default"
\font_sans "default" "default"
\font_typewriter "default" "default"
\font_math "libertine-ntxm" "auto"
\font_default_family default
\use_non_tex_fonts false
\font_sc false
\font_osf false
\font_sf_scale 100 100
\font_tt_scale 100 100
\use_microtype false
\use_dash_ligatures true
\graphics default
\default_output_format default
\output_sync 0
\bibtex_command default
\index_command default
\paperfontsize default
\spacing single
\use_hyperref false
\papersize default
\use_geometry true
\use_package amsmath 1
\use_package amssymb 1
\use_package cancel 1
\use_package esint 1
\use_package mathdots 1
\use_package mathtools 1
\use_package mhchem 1
\use_package stackrel 1
\use_package stmaryrd 1
\use_package undertilde 1
\cite_engine natbib
\cite_engine_type authoryear
\biblio_style plainnat
\use_bibtopic false
\use_indices false
\paperorientation portrait
\suppress_date false
\justification true
\use_refstyle 1
\use_minted 0
\index Index
\shortcut idx
\color #008000
\end_index
\secnumdepth 3
\tocdepth 1
\paragraph_separation indent
\paragraph_indentation default
\is_math_indent 0
\math_numbering_side default
\quotes_style english
\dynamic_quotes 0
\papercolumns 1
\papersides 1
\paperpagestyle default
\tracking_changes false
\output_changes false
\html_math_output 0
\html_css_as_file 0
\html_be_strict false
\end_header
\begin_body
\begin_layout Title (Plain Frame)
Bibliography not working
\end_layout
\begin_layout Frame
\begin_inset Argument 4
status open
\begin_layout Plain Layout
\end_layout
\end_inset
\begin_inset Separator latexpar
\end_inset
\end_layout
\begin_deeper
\begin_layout Standard
\begin_inset CommandInset citation
LatexCommand citet
key "king_matrix_2014"
literal "false"
\end_inset
\end_layout
\end_deeper
\begin_layout Standard
\begin_inset CommandInset bibtex
LatexCommand bibtex
btprint "btPrintCited"
bibfiles "C:/Users/a.fabre/Google Drive/Economie/Articles/Environment"
options "plain"
\end_inset
\end_layout
\end_body
\end_document
.tex 文件:
%% LyX 2.3.0 created this file. For more info, see http://www.lyx.org/.
%% Do not edit unless you really know what you are doing.
\documentclass[english]{beamer}
\usepackage[libertine]{newtxmath}
\usepackage[T1]{fontenc}
\usepackage[latin9]{inputenc}
\setcounter{secnumdepth}{3}
\setcounter{tocdepth}{1}
\usepackage[authoryear]{natbib}
\makeatletter
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Textclass specific LaTeX commands.
% this default might be overridden by plain title style
\newcommand\makebeamertitle{\frame{\maketitle}}%
% (ERT) argument for the TOC
\AtBeginDocument{%
\let\origtableofcontents=\tableofcontents
\def\tableofcontents{\@ifnextchar[{\origtableofcontents}{\gobbletableofcontents}}
\def\gobbletableofcontents#1{\origtableofcontents}
}
% plain title style, override default
\renewcommand\makebeamertitle{\frame[plain]{\maketitle}}%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands.
\usepackage{url}
%\usepackage{hyperref}
\usepackage{indentfirst}
\usepackage{tabularx}
%\usepackage[super,sort&compress]{natbib}
\usetheme{Warsaw}
\usepackage{dsfont}
%\usepackage[table]{xcolor}
%\usepackage{dcolumn}
\addtobeamertemplate{footline}{\insertframenumber/\inserttotalframenumber}
\makeatother
\usepackage{babel}
\begin{document}
\title{Bibliography not working}
\makebeamertitle
\begin{frame}{}
\citet{king_matrix_2014}
\end{frame}
\bibliographystyle{plain}
\bibliography{\string"C:/Users/a.fabre/Google Drive/Economie/Articles/Environment\string"}
\end{document}
[编辑] 包括\usepackage{dsfont}
帮助在最后显示参考书目(之前它甚至没有出现)。
答案1
当您使用 时,您会遇到问题\citet
,这是 natbib 特定的命令。要使用,请采用与 natbib 兼容的样式,例如替换plain
样式with
plainnat`。
其他一些评论:
latin9
是如今非常不常见的编码。检查这是否确实是您的文件保存的编码周围应该有一个框架
\bibliographystyle{plainnat}\bibliography{test}
。否则对齐会被破坏,并且其他功能(例如自动框架中断)将无法使用与 beamer 一起使用
\usepackage{indentfirst}
没有多大意义\addtobeamertemplate{footline}{\insertframenumber/\inserttotalframenumber}
会导致丑陋的白色盒子,我会使用\setbeamertemplate{page number in head/foot}[totalframenumber]
%% LyX 2.3.0 created this file. For more info, see http://www.lyx.org/.
%% Do not edit unless you really know what you are doing.
\documentclass[english]{beamer}
\usepackage[libertine]{newtxmath}
\usepackage[T1]{fontenc}
\usepackage[latin9]{inputenc}
\setcounter{secnumdepth}{3}
\setcounter{tocdepth}{1}
\usepackage[authoryear]{natbib}
\makeatletter
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Textclass specific LaTeX commands.
% this default might be overridden by plain title style
\newcommand\makebeamertitle{\frame{\maketitle}}%
% (ERT) argument for the TOC
\AtBeginDocument{%
\let\origtableofcontents=\tableofcontents
\def\tableofcontents{\@ifnextchar[{\origtableofcontents}{\gobbletableofcontents}}
\def\gobbletableofcontents#1{\origtableofcontents}
}
% plain title style, override default
\renewcommand\makebeamertitle{\frame[plain]{\maketitle}}%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands.
\usepackage{url}
%\usepackage{hyperref}
\usepackage{indentfirst}
\usepackage{tabularx}
%\usepackage[super,sort&compress]{natbib}
\usetheme{Warsaw}
\usepackage{dsfont}
%\usepackage[table]{xcolor}
%\usepackage{dcolumn}
\addtobeamertemplate{footline}{\insertframenumber/\inserttotalframenumber}
\makeatother
\usepackage{babel}
\begin{document}
\title{Bibliography not working}
\makebeamertitle
\begin{frame}{}
\citet{king_matrix_2014}
\end{frame}
\begin{frame}
\bibliographystyle{plainnat}
\bibliography{test}
\end{frame}
\end{document}