Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dot2texi and output directory #8

Open
nael8r opened this issue Nov 20, 2016 · 1 comment
Open

dot2texi and output directory #8

nael8r opened this issue Nov 20, 2016 · 1 comment

Comments

@nael8r
Copy link

nael8r commented Nov 20, 2016

I'm using the dot2texi package to draw some graphs on my beamer presentation, but I can't figure out how to make it work with the outputdir option.

Here is my directory structure:

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

I'm using latexmk and here is my configuration file:

$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;

And here is my document 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}
\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}

This is the error that latexmk shows:

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

Respective main.log section:

! 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)

Seems like the dot2texi is appending the build name twice in the path (latexmk error output), but I don't know why.

Anyone can help me?

ysalmon referenced this issue in ysalmon/dot2texisty Aug 26, 2017
As mentioned by https://github.com/kjellmf/dot2tex/issues/52, dot2tex fails when the tex document is compiled with a -outdir CLI switch because it is not informed that the .dot file was output in a different place, as dot2texi \writes will implicitly go there. This ugly hack allows to load dot2texi with a [inputdir=./build/] option that should be set to match the latex -outdir.
@kjellmf kjellmf transferred this issue from xyz2tex/dot2tex Mar 16, 2019
@christf
Copy link

christf commented Oct 5, 2020

this would be good to receive a proper fix as it breaks usage of a pdflatex command line option.
For people using -output-directory there is no indication that this is triggering the problem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants