dot2texi 包和输出目录

dot2texi 包和输出目录

我正在使用dot2texi包在我的演示文稿上绘制一些图形beamer,但我不知道如何使它与该outputdir选项一起工作。

这是我的目录结构:

├── biblio.bib
├── build
├── img
│   └── logo.eps
└── main.tex

我正在使用latexmk,这是我的配置文件:

$pdf_mode = 1;
$recorder = 1;
$pdf_previewer = 'evince';
$pdf_update_method = 0;
$pdflatex = 'xelatex -interaction=nonstopmode -shell-escape -output-directory=build';
@default_files = ("main");
$out_dir = './build';
$biber = 'biber --output-safechars';
$bibtex_use = 1;
$cleanup_mode = 2;
$clean_ext = ('%R.tdo %R.bbl');
$latex_silent_switch = "-interaction=batchmode -c-style-errors";
$silent = 1;

这是我的文件main.tex

% warns when you accidentally use deprecated LaTeX constructs from l2tabu
\RequirePackage[l2tabu,orthodox]{nag}
\documentclass[final, 11pt, aspectratio=1610, xcolor=table, hyperref={bookmarks,hidelinks}]{beamer}
\usetheme[block=fill,progressbar=foot]{metropolis}
%\usetheme{sthlm}
%\usecolortheme{sthlmv42}
\usepackage{ifxetex}

\ifxetex
    % XeLaTeX
    \usepackage{polyglossia}
    \setmainlanguage{brazil}
    \usepackage{fontspec}
%    \setmainfont{⟨font name⟩}[⟨font features⟩] % This is the normal font used in most of the document
%    \setsansfont{⟨font name⟩}[⟨font features⟩] % The elements that require a sans font
%    \setmonofont{⟨font name⟩}[⟨font features⟩] % Everithing that must be formatted with a Typewritter font in your document
%    \setmathrm{⟨font name⟩}[⟨font features⟩]
%    \setmathsf{⟨font name⟩}[⟨font features⟩]
%    \setmathtt{⟨font name⟩}[⟨font features⟩]
%    \setboldmathrm{⟨font name⟩}[⟨font features⟩]
%    \setmainfont{Cardo}
%    \setsansfont{Linux Libertine}
%    \setmonofont{Fira Code}
%    \setmathrm{XITS Math}
    %\usepackage{unicode-math}
\else
    % default: pdfLaTeX
    \usepackage[brazilian]{babel} % language of the document, activate the appropriate hyphenation rules
    \usepackage[utf8]{inputenc} % input character encoding
    \usepackage[T1]{fontenc} % output character encoding: accented characters, hypernations
    \usepackage{lmodern} % latin modern font
    %\usepackage[sfdefault,semibold]{FiraSans}
    %\usepackage{FiraMono}
\fi

% Conctrols shrinking and stretching of the fonts and with the extent to which text protrudes into the margins in a way that yields results that look better, that have fewer instances of hyphenation, and fewer overfull hboxes.
\usepackage[stretch=10]{microtype}
\usepackage{relsize} % Set the font size relative to the current font size
% references
\usepackage[
backend=biber,
style=numeric,
citestyle=numeric-comp
]{biblatex}
% layout
\usepackage{parskip} % helo find best places for page breaks and skip between lists
\usepackage{lscape} % long tables and landscape pictures
\usepackage{setspace} % space between lines
\usepackage{float} % Graphics, tables placement
\usepackage{adjustbox} % adjust boxed content (tables)
\usepackage{geometry}
% graphics
\usepackage{graphicx} % manage pictures
\usepackage{tikz}
\usetikzlibrary {positioning,arrows,shapes,shadows}
\usepackage{moreverb}
\usepackage{xkeyval}
\usepackage[autosize,outputdir={build/},debug]{dot2texi}
% math
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{amsthm}
\usepackage{calrsfs} % Copperplate calligraphic letters
\usepackage{amsfonts} % ex­tended set of fonts for use in math­e­mat­ics
\usepackage{bbm} % double-striked left side and normal right side fonts
% pseudocode
\usepackage{algorithm}
\usepackage[noend]{algpseudocode}
% code
\usepackage[outputdir=\detokenize{./build}]{minted}
% tables
\usepackage{booktabs}
\usepackage{array}
% misc
\usepackage[small]{caption} % customize caption in float environments
\usepackage[subrefformat=parens,labelformat=parens]{subcaption} % caption for subfigures
\usepackage{color}
% \usepackage{xkeyval}
\usepackage[portuguese,colorinlistoftodos]{todonotes}
\usepackage[inline, shortlabels]{enumitem} % inline enumerate
\usepackage{csquotes} % quotations
\usepackage{appendixnumberbeamer} % appendix on beamer
\usepackage{url}
\usepackage{multicol}
% cross-refs
\usepackage{hypcap} % anchors links to the beginning of floats
%\usepackage{cleveref}

% macros
\floatplacement{figure}{H}
\hypersetup{colorlinks=false}
% Resetting mathcal font to default
% https://tex.stackexchange.com/questions/67881/resetting-mathcal-font-to-default
\DeclareMathAlphabet{\mathcal}{OMS}{cmsy}{m}{n}

\setbeamertemplate{note page}[plain]
% http://tex.stackexchange.com/questions/124256/how-do-i-get-numbered-entries-in-a-beamer-bibliography
\setbeamertemplate{bibliography item}{\insertbiblabel}
% show notes
%\setbeameroption{show notes}
%\setbeameroption{show notes on second screen=right}
\presetkeys{todonotes}{fancyline,inline}{}

\newcommand{\fittable}[1]{\begin{adjustbox}{max width=\textwidth}#1\end{adjustbox}}

\setminted{linenos=true,autogobble=true,breakautoindent=true,breaklines=true}
% personalize line numbers
\renewcommand{\theFancyVerbLine}{\sffamily\textcolor[rgb]{0.5,0.5,1.0}{\scriptsize\oldstylenums{\arabic{FancyVerbLine}}}}

\addbibresource{biblio.bib}
\graphicspath{{./img/}}

\title{\textbf{Tile}}
\author{Authot}
\institute{Institute}
\titlegraphic{
    \tikz[overlay,remember picture]
    \node[at=(current page.south), anchor=south] {
        \includegraphics[scale=0.15]{logo}
    };
}
\date{\today}

\begin{document}

\maketitle

\begin{frame}
    \begin{dot2tex}[neato,mathmode]
    digraph G {
        node [shape="circle"];
        a_1 -> a_2 -> a_3 -> a_4 -> a_1;
    }
    \end{dot2tex}
\end{frame}

\end{document}

这是显示的错误latexmk

Latexmk: ====== There were problems writing to----- 'main-dot2tex-fig1.dot' in './build/build'.
----- But this is not the standard situation of
----- aux file to subdir of output directory, with
----- non-existent subdir

main.log部分:

! I can't write on file `build/main-dot2tex-fig1.dot'.
\dottotexverbatimwrite ...penout \verbatim@out #1 
                                                  \BeforeStream \let \do \@m...
l.2 \begin{dot2tex}[neato,mathmode]

(Press Enter to retry, or Control-D to exit; default file extension is `.tex')
Please type another output file name
! Emergency stop.
\dottotexverbatimwrite ...penout \verbatim@out #1 
                                                  \BeforeStream \let \do \@m...
l.2 \begin{dot2tex}[neato,mathmode]

*** (job aborted, file error in nonstop mode)

好像在路径中dot2texi附加了两次名称(错误输出),但我不知道为什么。buildlatexmk

有人能帮助我吗?

答案1

dot2texi.sty一种解决方法是通过添加选项来指定(隐式)输出/重新输入目录进行修补:

编辑:我制作了一个分支和一个修补版本那里

inputdir=./build/之后,使用选项(而不是outputdir)加载包应该就可以了。

如果你使用 LuaTeX,可以自动获取输出目录:参见这个问题


在第 100 行左右添加

\DeclareOptionX{inputdir}[]{\def\dtt@inputdir{#1}}
\def\dtt@inputdir{}

然后在第 275 行左右,替换

-o \[email protected] \dtt@options\space \[email protected]}

经过

-o \dtt@inputdir\[email protected] \dtt@options\space \dtt@inputdir\[email protected]}

相关内容