![biblatex 打印不需要的星号 (*)](https://linux22.com/image/286132/biblatex%20%E6%89%93%E5%8D%B0%E4%B8%8D%E9%9C%80%E8%A6%81%E7%9A%84%E6%98%9F%E5%8F%B7%20(*).png)
我正在手动转换为简历的文档类biblatex
中使用。和已被重新定义。现在,如果我使用 或,我会在参考文献的左侧看到一个不想要的星号 (*)。article
\section
\subsection
bibtex
biblatex
此处已报告了类似的问题: 参考书目在第一行打印一个 *(星号)。
那里给出的解决方案仅适用于bibtex
。有人可以建议一个解决方案吗biblatex
?
将(期刊和会议)出版物清单放入简历中并不容易。
这是一个最小工作示例。
这是一个最小工作示例(MWE)。
\documentclass[10pt]{article}
\usepackage{hyperref}
% Redefine section
\renewcommand{\section}[2]%
{\pagebreak[2]\vspace{1.3\baselineskip}%
\phantomsection\addcontentsline{toc}{section}{#1}%
\hspace{0in}%
\marginpar{
\raggedright \scshape #1}#2}
% Redefine subsection
\renewcommand{\subsection}[2]%
{\pagebreak[2]\vspace{1.3\baselineskip}%
\phantomsection\addcontentsline{toc}{section}{#1}%
\hspace{0in}%
\marginpar{
\raggedright \scshape #1}#2}
%%%%%%%% biblatex
\usepackage[style=ieee, bibstyle=ieee, defernumbers=true, sorting=ydnt]{biblatex}
\begin{filecontents}{\jobname.bib}
@article{paper1,
author = {John G. Smith},
year = {2004},
title = {This is journal paper 1},
}
@article{papere2,
author = {John G. Smith},
year = {2006},
title = {This is journal paper 2},
}
@conference{C03,
author = {John G. Smith},
year = {2003},
title = {This is conference paper 1},
}
\end{filecontents}
\begin{document}
\section{Publications}
\begin{refsection}[\jobname.bib]
\nocite{*}
\printbibliography[heading=subbibliography,type=article, title={Journals}]
\end{refsection}
\begin{refsection}[\jobname.bib]
\nocite{*}
\printbibliography[heading=subbibliography, type=inproceedings, title={Conferences}]
\end{refsection}
\end{document}
要运行此示例,请将其保存为 mwe.tex 并输入:
- pdflatex mwe.tex
- bibtex mwe1-blx.aux
- bibtex mwe2-blx.aux
- pdflatex mwe.tex
- pdflatex mwe.tex
输出结果在右侧显示了 Publication 部分。在原始文件中,它位于左侧(我将其转换为 MWE,结果就是这样)。不过,您可以在右侧看到两个星号。这些是由 biblatex 打印的,可能是因为 \section* 尚未重新定义。
latex 的模板和这个一样模板。这个模板的问题在于,它没有为出版物列表提供适当的解决方案。我想使用 biblatex 来列出期刊和会议论文的两个部分,并分别进行枚举。
答案1
模仿链接的页面设计非常简单,sample_CV.tex
无需经过复杂的步骤。只需要geometry
和titlesec
。(我也会使用enumitem
来摆弄我的各种列表环境,但这不是重点。)在这种情况下,重要的是将边距设置为您喜欢的宽度,并确保有足够的空间放置您的部分标题。为了让这些设置显而易见且易于更改,我会使用以下内容:
\newlength\lmargwidth% <-- will set the width left of section headings
\newlength\sectionlen% <-- will set the space reserved for the section headings
\setlength{\lmargwidth}{1in}
\setlength{\sectionlen}{1in}
以这种方式设置长度的优点是,如果您决定要在其他地方使用相同的长度,则只需插入一个,例如\sectionlen
。然后,如果您想更改其长度(例如,2in
),一个更改将传播到文档中所有“正确”的位置。
此文件的唯一其他附加内容是\printmyname
命令,它基本上只是一个“可拉伸”宏,用于模仿名称的设置方式sample_CV.tex
。就我个人而言,我可能会做一些不同的事情来在我的简历中突出我的名字。(并不是说这个人的设置过于华丽......)
\documentclass[10pt]{article}
\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@article{paper1,
author = {John G. Smith},
year = {2004},
title = {This is journal paper 1},
}
@article{papere2,
author = {John G. Smith},
year = {2006},
title = {This is journal paper 2},
}
@conference{C03,
author = {John G. Smith},
year = {2003},
title = {This is conference paper 1},
}
\end{filecontents}
\usepackage[T1]{fontenc}
% These two lengths set the left margin and the space reserved on the
% left for the sectional titles, which are, by design *not* part of
% the text block. If you need to invade that space for a special
% section, you just need to decrease the left margin by a
% '-\sectionlen' (e.g., \hspace*{-\sectionlen})
\newlength\lmargwidth
\newlength\sectionlen
\setlength{\lmargwidth}{1.0in}%
\setlength{\sectionlen}{1.0in}%
\usepackage[paper=letterpaper,
%includefoot, % Uncomment to put page number above margin
lmargin={\dimexpr\lmargwidth +\sectionlen\relax}, % <-- changed
rmargin=1in,
vmargin=1in,
nomarginpar,
% showframe, % <-- for debugging...
]{geometry}
\usepackage{lipsum}
% Set up \section and \subsection format
\usepackage[nobottomtitles]{titlesec}
\setcounter{secnumdepth}{0}% <-- don't number sections or subsections
\titleformat{\section}[leftmargin]
{\normalfont\scshape\filright}
{\thesection}
{0.5em}
{}
\titlespacing*{\section}% <-- remove the * if you want indentation on the first line
{\sectionlen}{1.5ex plus .1ex minus .2ex}{0pc}
\titleformat{\subsection}[leftmargin]
{\normalfont\scshape\filright}
{\thesubsection}
{0.5em}
{}
\titlespacing*{\subsection}% <-- * == no indentation for 1st line
{\sectionlen}{1.5ex plus .1ex minus .2ex}{0pc}
%%%%%%%% biblatex
\usepackage[style=ieee, bibstyle=ieee, defernumbers=true, sorting=ydnt]{biblatex}
% Load hyperref after most packages...
\usepackage{hyperref}
% Format name: bold and 'large'
\newcommand{\nameformat}[1]{%
\textbf{\large #1}}
% Set and print name over a horizontal rule...
\newcommand{\printmyname}[1]{%
\begingroup
\parindent 0pt
\hspace*{-\sectionlen}%
\makebox[0pt][l]{\nameformat{#1}}\par
\hspace*{-\sectionlen}%
% \hrulefill% <-- normal line
\rule{\dimexpr\textwidth + \sectionlen\relax}{2mm}% <-- 2mm thick line
\endgroup}
\begin{document}
\printmyname{Some Gal with a Really Long Name}
\section{First}
\lipsum[1]
\begin{itemize}
\item one
\item two
\item three
\end{itemize}
\subsection{Second}
\lipsum[1-3]
\section*{First Starred}
\lipsum[2]
\subsection*{Second Starred}
\lipsum[2]
\section{Publications}
\begin{refsection}[\jobname.bib]
\nocite{*}
\printbibliography[heading=subbibliography,type=article, title={Journals}]
\end{refsection}
\begin{refsection}[\jobname.bib]
\nocite{*}
\printbibliography[heading=subbibliography, type=inproceedings, title={Conferences}]
\end{refsection}
\end{document}
原始答案。(旨在将章节标题与右边距对齐。)
我认为您只需使用以下非常简单的方法即可达到相同的效果titlesec
:
\usepackage{titlesec}
\setcounter{secnumdepth}{0}
\titleformat{\section}[block]
{\hfill\scshape}
{\thesection}
{0.5em}
{}[]
\titleformat{\subsection}[block]
{\hfill\scshape}
{\thesubsection}
{0.5em}
{}[]
完整的例子如下:
\documentclass[10pt]{article}
\usepackage[T1]{fontenc}
\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@article{paper1,
author = {John G. Smith},
year = {2004},
title = {This is journal paper 1},
}
@article{papere2,
author = {John G. Smith},
year = {2006},
title = {This is journal paper 2},
}
@conference{C03,
author = {John G. Smith},
year = {2003},
title = {This is conference paper 1},
}
\end{filecontents}
\usepackage{lipsum} % <-- used to help see the textblock
\usepackage{titlesec}
\setcounter{secnumdepth}{0}
\titleformat{\section}[block]
{\hfill\scshape}
{\thesection}
{0.5em}
{}[]
\titleformat{\subsection}[block]
{\hfill\scshape}
{\thesubsection}
{0.5em}
{}[]
% another titlesec option would be 'rightmargin' instead of 'block': but this puts the heading *in* the margin...
%%%%%%%% biblatex
\usepackage[style=ieee, bibstyle=ieee, defernumbers=true, sorting=ydnt]{biblatex}
\usepackage{hyperref}% load after most packages...
\begin{document}
\section{First}
\lipsum[1]
\subsection{Second}
\lipsum[1]
\section*{First Starred}
\subsection*{Second Starred}
\lipsum[1]
\section{Publications}
\begin{refsection}[\jobname.bib]
\nocite{*}
\printbibliography[heading=subbibliography,type=article, title={Journals}]
\end{refsection}
\begin{refsection}[\jobname.bib]
\nocite{*}
\printbibliography[heading=subbibliography, type=inproceedings, title={Conferences}]
\end{refsection}
\end{document}