LyX 文件

LyX 文件

我试图得到这个:混合希伯来语和英语书目?但问题是我使用的是 LyX。所以我看这里:如何在 Lyx 中根据哈佛风格(作者年份、按来源类型字母顺序排列……)制作我的参考书目?
但我仍然无法工作(有很多很多问题.... :()

结果如下: 在此处输入图片描述

文件如下:

% Preview source code

%% 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[a4paper,english,hebrew]{article}
\usepackage{fontspec}
\usepackage{fancyhdr}
\pagestyle{fancy}
\setlength{\parindent}{0bp}
\usepackage[unicode=true,pdfusetitle,
 bookmarks=true,bookmarksnumbered=false,bookmarksopen=false,
 breaklinks=false,pdfborder={0 0 1},backref=false,colorlinks=false]
 {hyperref}

\makeatletter

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% LyX specific LaTeX commands.
\pdfpageheight\paperheight
\pdfpagewidth\paperwidth


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Textclass specific LaTeX commands.
\usepackage{theorem}
\theorembodyfont{\upshape}
\newtheorem{theorem}{\R{משפט}}[section]
\AtBeginDocument{\make@lr\thetheorem}

% The following chunk fixes export with XeTeX.
% It is needed because polyglossia is used by default
% and \make@lr is only defined by babel.
\@ifundefined{make@lr}
{\def\make@lr#1{\begingroup
    \toks@=\expandafter{#1}%
    \edef\x{\endgroup
  \def\noexpand#1{\noexpand\@number{\the\toks@}}}%
  \x}}{\relax}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands.
\newfontfamily\hebrewfont[Script=Hebrew]{David CLM}
\newfontfamily\hebrewfonttt[Script=Hebrew]{Miriam Mono CLM}
\newfontfamily\hebrewfontsf[Script=Hebrew]{Yehuda CLM}
\AtBeginDocument{
\renewcommand\footnoterule{%
  \kern -3pt
  \hbox to \textwidth{\hfill\vrule height 0.4pt width .4\textwidth}
  \kern 2.6pt
}}

\makeatother

\usepackage{polyglossia}
\setdefaultlanguage{hebrew}
\setotherlanguage{english}
\begin{document}
שלום\cite{sep-plato}

שלום\cite{מישהו1990}

\bibliographystyle{plain}
\bibliography{simplebib}

\end{document}

bib 文件如下:

% Encoding: UTF-8

@Book{מישהו1990,
  title     = {ספר},
  publisher = {הוצאה},
  year      = {1990},
  author    = {מישהו},
}

@InCollection{sep-plato,
  author       = {Kraut, Richard},
  title        = {Plato},
  booktitle    = {The Stanford Encyclopedia of Philosophy},
  publisher    = {Metaphysics Research Lab, Stanford University},
  year         = {2017},
  editor       = {Edward N. Zalta},
  edition      = {Fall 2017},
  howpublished = {\url{https://plato.stanford.edu/archives/fall2017/entries/plato/}},
}

@Comment{jabref-meta: databaseType:bibtex;}

我该怎么做才能使英语资源 [2] 按照正确的方向书写?(bibernatbib犯我的错误......)

PS 我正在使用JabRef软件。

答案1

更新:请参见下文 LyX 中的尝试。

babel这几乎肯定不是一个合适的答案,但确实展示了使用、lualatex和的可能前进方式biblatexbabel对于 RTL 语言来说仍然相当粗糙并且biblatex也不支持希伯来语,因此您需要做一些工作来设置字符串(但我认为可以做到)。

我的代码包含一些我认为不必要的解决方法,但为了让事情正常运转我必须这么做。

langid它的工作原理是在您的参考书目条目中指定一个字段,然后biblatex在此基础上更改参考书目中每个条目的语言(使用设置autolang=other*)。

\documentclass{article}

\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@Book{מישהו1990,
  title     = {ספר},
  publisher = {הוצאה},
  date      = {1990},
  author    = {מישהו},
  langid    = {hebrew}
}

@InCollection{sep-plato,
  author    = {Kraut, Richard},
  title     = {Plato},
  booktitle = {The Stanford Encyclopedia of Philosophy},
  publisher = {Metaphysics Research Lab, Stanford University},
  date      = {2017},
  editor    = {Edward N. Zalta},
  edition   = {Fall 2017},
  url       = {https://plato.stanford.edu/archives/fall2017/entries/plato/},
  langid    = {english}
}
\end{filecontents}

\usepackage[nil,bidi=basic-r,layout=lists]{babel}
\babelprovide[import=he,main]{hebrew}
\babelprovide[import=en]{english}
\babelfont{rm}[
  Ligatures=TeX,
  Extension=.ttf,
  UprightFont=*-Medium,
  ItalicFont=*-MediumOblique,
  BoldFont=*-Bold,
  BoldItalicFont=*-BoldOblique
]{TaameyDavidCLM}
\babelfont[american]{rm}[
  Ligatures=TeX,
  SmallCapsFont={Latin Modern Roman Caps}
]{Latin Modern Roman}
\babelfont{tt}[Ligatures=TeX]{Latin Modern Mono}

\usepackage[autolang=other*]{biblatex}
\addbibresource{\jobname.bib}

% set labels left to right, otherwise brackets are wrong. Why is this??
\DeclareFieldFormat{labelnumberwidth}{\textdir TLT \mkbibbrackets{#1}}

% slight tweak to bibliography environment
\defbibenvironment{bibliography}
  {\list
     {\printtext[labelnumberwidth]{%
        \printfield{labelprefix}%
        \printfield{labelnumber}}}
     {\setlength{\labelwidth}{\labelnumberwidth}%
      \setlength{\leftmargin}{\labelwidth}%
      \setlength{\labelsep}{\biblabelsep}%
      \addtolength{\leftmargin}{\labelsep}%
      \setlength{\itemsep}{\bibitemsep}%
      \setlength{\parsep}{\bibparsep}}%
      \renewcommand*{\makelabel}[1]{\hss##1}}
  {\endlist}
  {\item \leavevmode}% add \leavevmode to work around babel quirk

\begin{document}

שלום \autocite{sep-plato}.

שלום \autocite{מישהו1990}.

\printbibliography[title=מקורות]
\end{document}

在此处输入图片描述


LyX 文件

实际上在 LyX 中可以做到这一点。但这有点麻烦。而且我不确定它有多强大。您必须在序言中进行语言和 biblatex 设置。这是我的尝试:

#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 article
\begin_preamble
\usepackage[nil,bidi=basic-r,layout=lists]{babel}
\babelprovide[import=he,main]{hebrew}
\babelprovide[import=en]{english}
\babelfont{rm}[
  Ligatures=TeX,
  Extension=.ttf,
  UprightFont=*-Medium,
  ItalicFont=*-MediumOblique,
  BoldFont=*-Bold,
  BoldItalicFont=*-BoldOblique
]{TaameyDavidCLM}
\babelfont[english]{rm}[
  Ligatures=TeX,
  SmallCapsFont={Latin Modern Roman Caps}
]{Latin Modern Roman}
\babelfont{tt}[Ligatures=TeX]{Latin Modern Mono}

\usepackage[style=numeric,autolang=other*]{biblatex}

% set labels left to right, otherwise brackets are wrong. Why is this??
\DeclareFieldFormat{labelnumberwidth}{\textdir TLT \mkbibbrackets{#1}}

% slight tweak to bibliography environment
\defbibenvironment{bibliography}
  {\list
     {\printtext[labelnumberwidth]{%
        \printfield{labelprefix}%
        \printfield{labelnumber}}}
     {\setlength{\labelwidth}{\labelnumberwidth}%
      \setlength{\leftmargin}{\labelwidth}%
      \setlength{\labelsep}{\biblabelsep}%
      \addtolength{\leftmargin}{\labelsep}%
      \setlength{\itemsep}{\bibitemsep}%
      \setlength{\parsep}{\bibparsep}}%
      \renewcommand*{\makelabel}[1]{\hss##1}}
  {\endlist}
  {\item \leavevmode}% add \leavevmode to work around babel quirk

% set references string, since biblatex falls back to english
\DefineBibliographyStrings{english}{
  references = {מקורות}
}
\end_preamble
\use_default_options true
\maintain_unincluded_children false
\language english
\language_package none
\inputencoding default
\fontencoding global
\font_roman "default" "default"
\font_sans "default" "default"
\font_typewriter "default" "default"
\font_math "auto" "auto"
\font_default_family default
\use_non_tex_fonts true
\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 pdf5
\output_sync 0
\bibtex_command biber
\index_command default
\paperfontsize default
\spacing single
\use_hyperref false
\papersize default
\use_geometry false
\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 biblatex
\cite_engine_type numerical
\biblio_style plain
\biblio_options autolang=other*
\biblatex_bibstyle numeric
\biblatex_citestyle numeric
\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 3
\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 Standard

\lang hebrew
שלום 
\begin_inset CommandInset citation
LatexCommand autocite
key "sep-plato"
literal "false"

\end_inset

.
\end_layout

\begin_layout Standard

\lang hebrew
שלום 
\begin_inset CommandInset citation
LatexCommand autocite
key "מישהו1990"
literal "false"

\end_inset

.
\end_layout

\begin_layout Standard
This is in English.
\end_layout

\begin_layout Standard

\lang hebrew
\begin_inset CommandInset bibtex
LatexCommand bibtex
btprint "btPrintCited"
bibfiles "simplebib"

\end_inset


\end_layout

\end_body
\end_document

simplebib.bib

@Book{מישהו1990,
  title     = {ספר},
  publisher = {הוצאה},
  date      = {1990},
  author    = {מישהו},
  langid    = {hebrew}
}

@InCollection{sep-plato,
  author    = {Kraut, Richard},
  title     = {Plato},
  booktitle = {The Stanford Encyclopedia of Philosophy},
  publisher = {Metaphysics Research Lab, Stanford University},
  date      = {2017},
  editor    = {Edward N. Zalta},
  edition   = {Fall 2017},
  url       = {https://plato.stanford.edu/archives/fall2017/entries/plato/},
  langid    = {english}
}

输出基本与上面相同。(除了还添加了英文段落。)

相关内容