我一直在使用 MacOS,但最近我决定从 MacOS 跳转到运行 Fedora 40 的 Linux。LaTeX
安装在 Fedora 上,我texmaker
在两个操作系统上都使用它来编辑文档。
今天,我尝试在 Fedora 上运行与之前在 MacOS 上运行的完全相同的文件texmaker
。与之前不同,它无法编译。
请参阅此处的代码:
%% start of file `template.tex'.
%% Copyright 2006-2015 Xavier Danaux ([email protected]).
%
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License version 1.3c,
% available at http://www.latex-project.org/lppl/.
\documentclass[11pt,a4paper,roman]{moderncv} % possible options include font size ('10pt', '11pt' and '12pt'), paper size ('a4paper', 'letterpaper', 'a5paper', 'legalpaper', 'executivepaper' and 'landscape') and font family ('sans' and 'roman')
\usepackage[
backend=biber,
style=apa,
sorting=nty
]{biblatex}
\addbibresource{bibliography.bib} % needed for quick compiling using fn+F1
% moderncv themes
\moderncvstyle{banking} % style options are 'casual' (default), 'classic', 'banking', 'oldstyle' and 'fancy'
\moderncvcolor{blue} % color options 'black', 'blue' (default), 'burgundy', 'green', 'grey', 'orange', 'purple' and 'red'
%\renewcommand{\familydefault}{\sfdefault} % to set the default font; use '\sfdefault' for the default sans serif font, '\rmdefault' for the default roman one, or any tex font name
%\nopagenumbers{} % uncomment to suppress automatic page numbering for CVs longer than one page
%\usepackage[sfdefault]{ClearSans} % specifies font
\renewcommand\rmdefault{cmr}
\renewcommand\sfdefault{cmss}
\renewcommand\ttdefault{cmtt}
\usepackage[T1]{fontenc} % needed for character encryption, instead of \usepackage[utf8]{inputenc} used
% character encoding
% usepackage[utf8]{inputenc} % if you are not using xelatex ou lualatex, replace by the encoding you are using
% adjust the page margins
\usepackage[scale=0.8, bottom=2cm]{geometry}
%\setlength{\hintscolumnwidth}{3cm} % if you want to change the width of the column with the dates
%\setlength{\makecvtitlenamewidth}{10cm} % for the 'classic' style, if you want to force the width allocated to your name and avoid line breaks. be careful though, the length is normally calculated to avoid any overlap with your personal info; use this at your own typographical risks...
\usepackage{fancyhdr} % needed for page numbers
\usepackage{lastpage} % needed for page numbers
\usepackage{xcolor} % needed for additional colors
\usepackage{lipsum}
\usepackage[]{fontawesome5} % needed for adjusted symbols at phone number and email
\usepackage{stringstrings}
\usepackage{ragged2e} % needed for justification of text (Blocksatz instead of raggedright or so)
%%%%%%%%%%%%%% DEFINE COLORS %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\definecolor{white}{RGB}{255,255,255} % needed for \icon command
\definecolor{gray}{HTML}{4D4D4D}
\definecolor{black}{HTML}{000000}
\definecolor{sidecolor}{HTML}{E7E7E7}
\definecolor{mainblue}{HTML}{0E5484} % needed for \icon command
\definecolor{maingray}{HTML}{B9B9B9}
\definecolor{frontColor}{rgb}{0.22,0.45,0.70}% light blue
\definecolor{backColor}{RGB}{200,200,200}% grey
\colorlet{color1}{mainblue} % assign mainblue to color 1 for the correct color of name in title
%%%%%%%%%%%%%%%% ALIGN ADDRESS SYMBOL WITH PHONE SYMBOL %%%%%%%%%%%%
\makeatletter
% internal command to flush the makehead
\@initializecommand{\flushmakeheaddetails}{%
\ifnum\makeheaddetailsboxwidth>0%
\strut\usebox{\makeheaddetailsbox}%
\savebox{\makeheaddetailsbox}{}%
\savebox{\makeheaddetailstempbox}{}%
\setlength{\makeheaddetailsboxwidth}{0pt}\fi}
\@initializecommand{\makehead}{%
\setlength{\makeheaddetailswidth}{0.8\textwidth}%
\hfil%
\parbox{\makeheaddetailswidth}{%
\centering%
% name and title
\vspace{-2cm} % CHANGED: adjust to specify height of name and contact details on page
\namestyle{\@firstname~\@lastname}%
\ifthenelse{\equal{\@title}{}}{}{\titlestyle{~|~\@title}}% \isundefined doesn't work on \@title, as LaTeX itself defines \@title (before it possibly gets redefined by \title)
% optional detailed information
\vspace{0.4cm} % CHANGED: adjust the vertical space between name and contact details
\if@details{%
\\%
% \raggedright % CHANGED: left-align address block :: Uncomment for address first and aligned with phone symbol
% \hspace{1.08cm} % CHANGED: adjust the horizontal space manually such that the address and phone symbol are aligned :: Uncomment for address first and aligned with phone symbol
% \addressfont\color{color2}% :: Uncomment for address first and aligned with phone symbol
% \ifthenelse{\isundefined{\@addressstreet}}{}{\addtomakeheaddetails{\addresssymbol\href{https://osm.org/go/0JrItkpzc--?m=&way=383042322}{\@addressstreet}}% % CHANGED: insert link which points to address on a map! :: Uncomment for address first and aligned with phone symbol
% \ifthenelse{\equal{\@addresscity}{}}{}{\addtomakeheaddetails[~--~]{\@addresscity}}% if \addresstreet is defined, \addresscity and \addresscountry will always be defined but could be empty :: Uncomment for address first and aligned with phone symbol
% \ifthenelse{\equal{\@addresscountry}{}}{}{\addtomakeheaddetails[~--~]{\@addresscountry}}% :: Uncomment for address first and aligned with phone symbol
% \flushmakeheaddetails\@firstmakeheaddetailselementtrue\\}% :: Uncomment for address first and aligned with phone symbol
% \ifthenelse{\isundefined{\@born}}{}{\addtomakeheaddetails{\bornsymbol\@born}}% :: Uncomment for address first and aligned with phone symbol
% \vspace{0.2cm} %CHANGED: introduce some vertical space between address and rest of additional information :: Uncomment for address first and aligned with phone symbol
\centering % CHANGED: center the rest of the additional information
\collectionloop{phones}{% the key holds the phone type (=symbol command prefix), the item holds the number
\ifthenelse{\isundefined{\@addressstreet}}{}{\addtomakeheaddetails{\addresssymbol\href{https://osm.org/go/0JrDODV-?relation=109166}{\@addressstreet}}} % delete this (the address) ifthenelse for having the address above phone and email and aligned with phone symbol
\addtomakeheaddetails{\csname\collectionloopkey phonesymbol\endcsname\collectionloopitem}}%
\ifthenelse{\isundefined{\@email}}{}{\addtomakeheaddetails{\emailsymbol\emaillink{\@email}}}%
\ifthenelse{\isundefined{\@homepage}}{}{\addtomakeheaddetails{\homepagesymbol\httpslink{\@homepage}}}%
\collectionloop{socials}{% the key holds the social type (=symbol command prefix), the item holds the link
\addtomakeheaddetails{\csname\collectionloopkey socialsymbol\endcsname\collectionloopitem}}%
\ifthenelse{\isundefined{\@extrainfo}}{}{\addtomakeheaddetails{\@extrainfo}}%
\flushmakeheaddetails}\fi}\\[2.5em]}% need to force a \par after this to avoid weird spacing bug at the first section if no blank line is left after \makehead
\makeatother
%%%%%%%%%%%%% ADJUSTMENT OF ICONS FOR PHONE AND EMAIL %%%%%%%%%%%%%%%%
% IMPORTANT NOTE: originally, the fontawesome5 package is loaded without the parameter "fixed". To get same size icons I added the parameter. In more detail, the file can be found here /usr/local/texlive/2022/texmf-dist/tex/latex/moderncv/moderncviconsawesome.sty and "[fixed]" was added where the package is loaded.
\patchcmd{\makeheaddetailssymbol} % deletes the dot between phone and email but keeps the spacing
{\textbullet}% to search
{}% replacement
{}{}% success failure
\newcommand*\icon[1]{\tikz[baseline=(char.base)]{\node[shape=circle,draw,inner sep=1pt, fill=mainblue,mainblue,text=white] (char) {#1};}} % command needed to create blue circle with following phone and email symbols in it
\renewcommand*{\mobilephonesymbol} {{\textsc{\icon{\faPhone}}}~} % change standard phone symbol to current blue and white one
\renewcommand*{\emailsymbol} {{\textsc{\icon{\faAt}}}~} % change standard email symbol to current blue and white one
%\newcommand{\addresssymbol}{\icon{\faMapMarker}~}
\renewcommand*{\addresssymbol} {{\textsc{\icon{\faMapMarker}}}~} % change standard address symbol to current blue and white one
%%%%%%%%%%%%%%% CHANGE FONT OF TITLE OR NAME %%%%%%%%%%%%%%%%%%%%
% IMPORTANT NOTE: Other style changes of the header can be done in two ways. 1) go to file /usr/local/texlive/2022/texmf-dist/tex/latex/moderncv/moderncvheadiii.sty (REMEMBER: Banking = iii) and edit directly this file. 2) Copy the respective command into this file and \renewcommand{•}{•} here.
\renewcommand*{\namefont}{\fontsize{25}{40}\bfseries\upshape} % set the name font equal to title font
\renewcommand*{\titlefont}{\fontsize{25}{40}\bfseries\upshape} % to change the title font
%%%%%%%%%%%%%%%%%% CHANGE NAME AND CLOSING NAME %%%%%%%%%%%%%%%%%%
\newcommand{\firstcap}[1]{\caselower[e]{#1}\capitalize{\thestring}} % new command to convert a capital lastname such as ZEROBIN to Zerobin for the name in the signature
\makeatletter
\renewcommand*{\makeletterclosing}{
\@closing\\[1em] % 1em is spacing below 'closing{}' command
{\@firstname~\firstcap{\@lastname}}
\ifthenelse{\isundefined{\@enclosure}}{}{%
\\%
\vspace{1cm} % spacing between signature and 'enclosure{}'
{\color{color2}\itshape\enclname: \@enclosure}}}
\makeatother
%%%%%%%%%%%%%%%%%%%%%% ADJUST RECIPIENT NAME ADDRESS STRUCTURE %%%%%%%%%%%%%%%%%%%%
\makeatletter
\renewcommand*{\makeletterhead}{%
% recompute lengths (in case we are switching from letter to resume, or vice versa)
\recomputeletterlengths%
% sender block
\makehead%
\par%
\vspace{-0.2cm} % CHANGE THIS VALUE TO ADJUST VSPACE BETWEEN PERSONAL INFORMATION AND RECIPIENT INFORMATION
% recipient block
\begin{minipage}[t]{.8\textwidth}
\raggedright%
\addressfont%
{\bfseries\upshape\@recipientname}\\%
\@recipientaddress%
\end{minipage}
% date
\hfill% US style
% \\[1em]% UK style
\@date\\[2em]% US informal style: "January 1, 1900"; UK formal style: "01/01/1900"
% opening
\raggedright
\@opening\\[1.5em]%
% ensure no extra spacing after \makelettertitle due to a possible blank line
% \ignorespacesafterend% not working
\hspace{0pt}\par\vspace{-\baselineskip}\vspace{-\parskip}}
\makeatother
%%%%%%%%%%%%% PAGE NUMBERING %%%%%%%%%%%%%%%%%%%%
\pagestyle{fancy} % set page style
\fancyfoot[R]{Page \thepage{} of \pageref{LastPage}} % define page numbering in right footer
%%%%%%%%%%%%%%%%% PERSONAL INFORMATION %%%%%%%%%%%%%%%%%%%%
% CHANGE LINE 81 TO ALIGN ADDRESS AND PHONE SYMBOL MANUALLY
\name{FirstNAME}{LastNAME}
\title{Cover Letter} % \vspace{} introduced for some spacing between title and address block
\address{XYXYXYXY}% optional, remove / comment the line if not wanted; the "postcode city" and "country" arguments can be omitted or provided empty
% See above to insert link which points to address on a map!
\phone[mobile]{+00 1234 56789} % optional, remove / comment the line if not wanted; the optional "type" of the phone can be "mobile" (default), "fixed" or "fax"
%\phone[fixed]{+2~(345)~678~901}
%\phone[fax]{+3~(456)~789~012}
\email{[email protected]} % optional, remove / comment the line if not wanted
%\homepage{www.johndoe.com} % optional, remove / comment the line if not wanted
%\social[linkedin]{john.doe} % optional, remove / comment the line if not wanted
%\social[twitter]{jdoe} % optional, remove / comment the line if not wanted
%\social[github]{jdoe} % optional, remove / comment the line if not wanted
%\extrainfo{additional information} % optional, remove / comment the line if not wanted
%\photo[64pt][0.4pt]{picture} % optional, remove / comment the line if not wanted; '64pt' is the height the picture must be resized to, 0.4pt is the thickness of the frame around it (put it to 0pt for no frame) and 'picture' is the name of the picture file
%\quote{Some quote} % optional, remove / comment the line if not wanted
% bibliography adjustements (only useful if you make citations in your resume, or print a list of publications using BibTeX)
% to show numerical labels in the bibliography (default is to show no labels)
%\makeatletter\renewcommand*{\bibliographyitemlabel}{\@biblabel{\arabic{enumiv}}}\makeatother
% to redefine the bibliography heading string ("Publications")
%\renewcommand{\refname}{Articles}
% bibliography with mutiple entries
%\usepackage{multibib}
%\newcites{book,misc}{{Books},{Others}}
%----------------------------------------------------------------------------------
% content
%----------------------------------------------------------------------------------
\begin{document}
\hypersetup{allbordercolors=red, pdfborder = 0 0 1}
%----- letter ---------------------------------------------------------
% recipient data
\recipient{Recepient Name}{
Street and Number, \\
District City, \\
Country}
\date{\today}
\opening{%\textbf{Application for the vacant Pre-Doc position} \\ [0.6cm]
To whom it may concern, \vspace{-0.4cm}}
\closing{Sincerely,}
%\enclosure[Attached]{CV} % use an optional argument to use a string other than "Enclosure", or redefine \enclname
\makelettertitle
\justify % justify (Blocksatz) text instead of raggedright
%%%%%%%%%%%%%%%% Intro %%%%%%%%%%%%%%
\lipsum[1-2]
\makeletterclosing % automatically inserts the 'closing{}', 'name{}{}' and 'enclosure{}' at the end of the letter including some spacing
\end{document}
%% end of file `template.tex'.
每当我按下F1
以快速编译它时,输出是:Error : could not start the command : biber "test"
其中“test”是文件名。
当然,我已验证设置biber %
中是否写明。Bib(la)tex
我刚刚再次尝试在 MacOS 机器上编译它,它运行没有任何问题。所以,任何帮助都将不胜感激,因为我不知道如何继续。