我正在用芬兰语写我的学士论文。我们提供了模板可以使用,我要开始使用它了。这是我第一次使用 LaTeX,基本上模板所做的所有复杂的事情对我来说都是神奇的。
我遇到的问题是urldate
参考书目语法不正确。
请看以下示例:
@online{test,
author = {An Author},
title = {This is the title},
url = {https://www.url.com/},
year = {2023},
urldate = {2023-04-15}
}
我使用模板提供的 APA 样式,因此参考书目显示为:
Author, A. (2023). This is the title. Haettu huhtikuuta 15, 2023, osoitteesta https://www.url.com/
但是,Haettu huhtikuuta 15, 2023
语法不正确,应该是Haettu 15. huhtikuuta, 2023
。或者甚至更可取的是Haettu 15.4.2023
。
我可以做些什么来修复这个语法错误?对我来说,这些翻译/格式似乎只是来自tauthesis.cls
文件。是否需要在某个上游位置进行修复?
编辑:
根据@CarLaTeX的评论,目前问题已经得到解决,参考书目文本非常接近语法正确。现在只,
需要删除urldate后面的逗号():
下面是我正在使用的“最小”示例(抱歉,不是那么最小,我不知道在不破坏模板的情况下我可以从模板中删除什么) :
https://www.overleaf.com/read/thvfdcfwgkxh
答案1
您已tauthesis.cls
修改\ExecuteOptions{finnish,numeric}
为\ExecuteOptions{finnish,apa}
。
您还可以urldate=short
在需要 BiBLaTeX 时添加:
\RequirePackage
[backend=biber,
autolang=other,
urldate=short,
citestyle=\@citationstyle,
bibstyle=\@citationstyle]{biblatex}
完成后,你的引用将以这种方式出现:
\begin{filecontents}[overwrite]{references.bib}
@online{test,
author = {An Author},
title = {This is the title},
url = {https://www.url.com/},
year = {2023},
urldate = {2023-04-15}
}
\end{filecontents}
\pdfminorversion=6
\documentclass{tauthesis}
\usepackage{amsmath, amssymb, amsthm}
\newcommand{\verbcommand}[1]{\texttt{\textbackslash #1}}
\makeglossaries
\addbibresource{references.bib}
\begin{document}
Test citation \cite{test}.
\printbibliography[heading=bibintoc]
\end{document}
编辑:
重新定义urldate
:
\begin{filecontents*}[overwrite]{references.bib}
@online{test,
author = {An Author},
title = {This is the title of some cool site},
url = {https://www.url.com/},
year = {2023},
urldate = {2023-04-15}
}
@online{test2,
author = {An Authorr},
title = {Why doesn't this also wrap incorrectly},
subtitle = {so weird, I cant replicate},
url = {https://www.url.com/this-a-long-url-yeah-yeah-yeah-yeah.html},
year = {2023},
urldate = {2023-04-15}
}
@online{SOAPvsREST,
author = {Alyssa Walker},
title = {SOAP vs REST API},
subtitle = {Difference Between Web Services},
url = {https://www.guru99.com/comparison-between-web-services.html},
year = {2023},
urldate = {2023-04-10}
}
\end{filecontents*}
\begin{filecontents*}[overwrite]{\jobname.xmpdata}
\Title{test}
\Author{test}
\Language{fi}
\end{filecontents*}
\pdfminorversion=6
\documentclass{tauthesis}
\usepackage{amsmath, amssymb, amsthm}
\usepackage{hyperref}
\hypersetup{hidelinks}
% float placement
\usepackage{float}
% svg support
\usepackage{svg}
% landscape support
\usepackage{lscape}
% long table support
\usepackage{longtable}
% checkmark and x mark support from pifont's dingbats
\usepackage{pifont}
\newcommand{\cmark}{\ding{51}}%
\newcommand{\xmark}{\ding{55}}%
%%%%% Your commands.
% added:
\usepackage{microtype}
% Print verbatim LaTeX commands
\newcommand{\verbcommand}[1]{\texttt{\textbackslash #1}}
\makeglossaries
% added:
\DefineBibliographyStrings{finnish}{%
urlseen = {Haettu\addspace},%
urlfrom = {osoitteesta\addspace},%
}
% added (thanks to moewe):
\DeclareFieldFormat{urldate}{\bibstring{urlseen}~#1\space\bibstring{urlfrom}}
\renewbibmacro*{url+urldate}{%
\usebibmacro{urldate}%
\setunit{\addspace}%
\usebibmacro{url}%
}
\DefineBibliographyExtras{finnish}{%
% d-m-y format for short dates
\protected\def\mkbibdateshort#1#2#3{%
\iffieldundef{#3}
{}
{\thefield{#3}%
\iffieldundef{#2}{}{.}}%
\iffieldundef{#2}
{}
{\thefield{#2}%
\iffieldundef{#1}{}{.}}%
\iffieldbibstring{#1}{\bibstring{\thefield{#1}}}{\mkyearzeros{\thefield{#1}}}}%
}
% added:
\renewcommand*{\finentrypunct}{}
\addbibresource{references.bib}
\begin{document}
\chapter{test}
\cite{test}
\cite{test2}
\cite{SOAPvsREST}
\printbibliography[heading=bibintoc]
\end{document}
对于超出边距的文本,可以加载microtype
包。
要删除末尾的点,可以使用:
\renewcommand*{\finentrypunct}{}
但它会删除所有条目的最后一个点。