[博士论文模板求助] 每章最后的成果,如何跟随盲审模式自动mask掉关键信息? #471
-
发生了什么?目前成果清单页的文献可以随着盲审模式正确输出信息,但是现在每一章最后的相关成果采用相同的 \printbibliography 命令时,作者信息不会跟着盲审模式被masked掉。请问可否通过设置模板文件实现? 你期望的结果No response 问题复现的步骤(或者截图)操作系统或平台None LaTeX 发行版以及发行年份No response BIThesis 模板No response 日志信息(可选)No response |
Beta Was this translation helpful? Give feedback.
Replies: 16 comments
-
能否提供 另:如果着急,建议 |
Beta Was this translation helpful? Give feedback.
-
pub.bib里都是这样写的 @article{eg,
title = {example},
journal = {nc},
volume = {1},
pages = {1},
year = {2022},
issn = {1111-1111},
author = {A and B and C and D and E},
annotation = {第一作者,SCI源刊,IF=1.0,中科院一区, top},
author+an = {1:myself="\Author"},
keywords = {sci, ch5}
} 可否把盲审模式的作用范围扩展到每一章? |
Beta Was this translation helpful? Give feedback.
-
尝试建立一个在章节里生效的新环境,如果盲审模式这个参数能传到chapter里,应该就可以生效了 \newenvironment {pubsec}
{
% 同时设置 omit 以及 blindPeerReview 才能跳过此章节生成。
\begin{blindPeerReview}[\l__bithesis_publications_omit_bool]
% % 将此章节视为特殊的附录页,关闭附录编号,重定义 section 编号。
% % 不知为何,需要手动重置 section 计数器。
% \setcounter{section}{0}
% \ctexset{
% appendix/numbering = false,
% section/number = \arabic{section},
% subsection/number = \arabic{section}. \arabic{subsection},
% subsubsection/number = \arabic{section}. \arabic{subsection}. \arabic{subsubsection},
% }
% 设置参考文献字号为 5 号
\renewcommand*{\bibfont}{\zihao{5}}
% 设置参考文献各个项目之间的垂直距离为 0
\setlength{\bibitemsep}{0ex}
\setlength{\bibnamesep}{0ex}
\setlength{\bibinitsep}{0ex}
% 设置参考文献顺序标签 `[1]` 与文献内容 `作者. 文献标题...` 的间距
\setlength{\biblabelsep}{1.7mm}
\bool_if:NF \l__bithesis_style_bibliography_indent_bool {
% 设置参考文献后文缩进为 0(与 Word 模板保持一致)
% See: https://github.com/hushidong/biblatex-gb7714-2015
% 如何修参考文献表的缩进?
\cs_set:Npn \itemcmd {
\settowidth{\lengthid}{\mkgbnumlabel{\printfield{labelnumber}}}
%%这里是所做的调整,以下两句通过调整\lengthid来调整缩进
\setlength{\lengthid}{0pt}
\addtolength{\lengthid}{-\biblabelsep}
\setlength{\lengthlw}{\textwidth}
\addtolength{\lengthlw}{-\lengthid}
\addvspace{\bibitemsep}%恢复\bibitemsep的作用
\hangindent\lengthid
\leavevmode\mkgbnumlabel{\printfield{labelnumber}}%
\hspace{\biblabelsep}
}
}
% If in blindPeerReview mode, omit delimiters in author field.
\bool_if:NT \g__bithesis_blind_mode_bool {
% 如果有多个作者,不修改此项的话,作者与标题之间会有逗号。
\DeclareDelimFormat[bib,biblist]{finalnamedelim}{}
% 如果自己不是第一个作者,不修改此项的话,会在最开始有逗号。
\DeclareDelimFormat{multinamedelim}{}
% 如果覆盖的是英文作者,不修改此项的话,会在最开始有空格。
\DeclareDelimFormat{bibnamedelimd}{}
% 如果作者太多而被截断,不修改的话,会多余逗号、“等”云云。
% 被截断的充要条件:作者数量大于通过`\BITSetup`设置的`publications/maxbibnames`。
% 故设置标点来去掉逗号,
\DeclareDelimFormat[bib,biblist]{andothersdelim}{}
% 并设置本地化字符串来去掉“等”。
\setlocalbibstring{andothers}{}
\setlocalbibstring{andotherscn}{}
% 另外注意,我们仍尊重`maxbibnames`和`minbibnames`,保证若开盲审时显示作者,则关盲审时也正常。
}
% ===== 上方定义与「参考文献」部分相同
% 中文姓名下,此部分不参与输出。
\cs_set:Npn \mkbibnamegiven ##1 {
\haspartannotation{myself}{
\bool_if:NTF \g__bithesis_blind_mode_bool {
% 盲审模式,不输出内容
} {
% 普通模式
\textbf{##1}
}
}{
\bool_if:NTF \g__bithesis_blind_mode_bool {
% 盲审模式,不输出内容
} {
% 普通模式
##1
}
}
}
\cs_set:Npn \mkbibnamefamily ##1 {
\haspartannotation{myself}{
% 作者为自己
\bool_if:NTF \g__bithesis_blind_mode_bool {
% 盲审模式
\getpartannotation{myself}
} {
% 普通模式
\textbf{##1}
}
}{
% 作者不是自己
\bool_if:NTF \g__bithesis_blind_mode_bool {
% 盲审模式,不输出
} {
% 普通模式
##1
}
}
}
\if_cs_exist:N \c@pub {
% 重置计数器
\setcounter{pub}{0}
} \else: {
% 设置计数器
\newcounter{pub}
} \fi:
% 设置参考文献的排序
\bool_if:NTF \l__bithesis_publications_sorting_bool {
% Sorting by year, name, type.
\newrefcontext[sorting=ynt]
} {
% Do not sort.
\newrefcontext
}
% 根据 maxbibnames 的设置,覆盖 \blx@maxbibnames 选项,保证所有作者都能显示。
\cs_set:Npn \blx@maxbibnames {
\l__bithesis_publications_maxbibnames_int
}
% 根据 minbibnames 的设置,覆盖 \blx@minbibnames 选项,保证所有作者都能显示。
\cs_set:Npn \blx@minbibnames {
\l__bithesis_publications_minbibnames_int
}
\end{blindPeerReview}
}
{} |
Beta Was this translation helpful? Give feedback.
-
大概有解决方案,不过有另外一个问题。此处的参考文献的字号是五号(默认参考文献字号)还是小四(正文)? |
Beta Was this translation helpful? Give feedback.
-
确实,既然位置是在每个章节的最后,那应该和正文字体设置一致,应该把字号那一行也注释掉 |
Beta Was this translation helpful? Give feedback.
-
请问最后还有单独一页清单吗? 如果没有,也许直接用 |
Beta Was this translation helpful? Give feedback.
-
@YDX-2147483647 |
Beta Was this translation helpful? Give feedback.
-
这个我不是很理解:如果你已经自定义了新的环境,盲审模式下应该也是生效的。 |
Beta Was this translation helpful? Give feedback.
-
@YoungZnBIT 请问你现在是加到 |
Beta Was this translation helpful? Give feedback.
-
我试了一下,可能给原来的 \begin{publications}[这是个可选参数,不填时按原来效果,填了就会省略一部分;只要填了,无论填什么效果都一样]
\addpubs{eg}
\printbibliography[heading=none,type=article,category=mypub,keyword=ch5,resetnumbers=true]{}
\end{publications} 修改 % \begin{environment}{publications}
% 生成攻读学位期间发表论文与研究成果清单。
% \begin{macrocode}
-\NewDocumentEnvironment {publications} {+b}
+\NewDocumentEnvironment {publications} {o +b}
{
% 同时设置 omit 以及 blindPeerReview 才能跳过此章节生成。
\begin{blindPeerReview}[\l_@@_publications_omit_bool]
+ \IfNoValueT {#1} {
% 将此章节视为特殊的附录页,关闭附录编号,重定义 section 编号。
% 不知为何,需要手动重置 section 计数器。
\setcounter{section}{0}
…
% 设置参考文献字号为 5 号
\renewcommand*{\bibfont}{\zihao{5}}
+ }
% 设置参考文献各个项目之间的垂直距离为 0
\setlength{\bibitemsep}{0ex}
\setlength{\bibnamesep}{0ex}
…
\l_@@_publications_minbibnames_int
}
+ \IfNoValueT {#1} {
\chapter{\@@_get_const:N {publications}}
+ }
- #1
+ #2
\end{blindPeerReview}
}
{} |
Beta Was this translation helpful? Give feedback.
-
我也是想给出类似的方案,只不过是用 s 参数,更合适一点 |
Beta Was this translation helpful? Give feedback.
-
然后字号的配置要提取出来,因为其他同学可能会需要其他字号大小。 |
Beta Was this translation helpful? Give feedback.
-
@YDX-2147483647 |
Beta Was this translation helpful? Give feedback.
-
确实…… 给最后大清单套个 % 个人成果
+\begin{refsection}
\input{./misc/4_pub.tex}
+\end{refsection} 它能同时满足以下要求。
|
Beta Was this translation helpful? Give feedback.
-
大佬牛逼 |
Beta Was this translation helpful? Give feedback.
-
hold / solved,感谢大佬们周末还在看代码 |
Beta Was this translation helpful? Give feedback.
我试了一下,可能给原来的
publications
环境加个参数更简单。修改
bithesis.cls
/bithesis.dtx
,加个 optional (o)(原来的 body (+b) 从#1
顺延到#2
),用\IfNoValueT {#1} {…}
包裹要删掉的部分: