diff --git a/src/io/fileexporter.cpp b/src/io/fileexporter.cpp index 9cc3052f..a74b3374 100644 --- a/src/io/fileexporter.cpp +++ b/src/io/fileexporter.cpp @@ -1,69 +1,67 @@ /*************************************************************************** * Copyright (C) 2004-2018 by Thomas Fischer * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, see . * ***************************************************************************/ #include "fileexporter.h" #include #include const QString FileExporter::keyPaperSize = QStringLiteral("paperSize"); const QString FileExporter::defaultPaperSize = QStringLiteral("a4"); -const QString FileExporter::keyFont = QStringLiteral("Font"); -const QString FileExporter::defaultFont = QString(); FileExporter::FileExporter(QObject *parent) : QObject(parent) { /// nothing } FileExporter::~FileExporter() { /// nothing } QString FileExporter::toString(const QSharedPointer element, const File *bibtexfile, QStringList *errorLog) { QBuffer buffer; buffer.open(QBuffer::WriteOnly); if (save(&buffer, element, bibtexfile, errorLog)) { buffer.close(); if (buffer.open(QBuffer::ReadOnly)) { QTextStream ts(&buffer); ts.setCodec("UTF-8"); return ts.readAll(); } } return QString(); } QString FileExporter::toString(const File *bibtexfile, QStringList *errorLog) { QBuffer buffer; buffer.open(QBuffer::WriteOnly); if (save(&buffer, bibtexfile, errorLog)) { buffer.close(); if (buffer.open(QBuffer::ReadOnly)) { QTextStream ts(&buffer); ts.setCodec("utf-8"); return ts.readAll(); } } return QString(); } diff --git a/src/io/fileexporter.h b/src/io/fileexporter.h index c09bdad8..99064a70 100644 --- a/src/io/fileexporter.h +++ b/src/io/fileexporter.h @@ -1,64 +1,61 @@ /*************************************************************************** * Copyright (C) 2004-2017 by Thomas Fischer * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, see . * ***************************************************************************/ #ifndef KBIBTEX_IO_FILEEXPORTER_H #define KBIBTEX_IO_FILEEXPORTER_H #include #include "kbibtexio_export.h" #include "file.h" class QIODevice; class File; class Element; /** * @author Thomas Fischer */ class KBIBTEXIO_EXPORT FileExporter : public QObject { Q_OBJECT public: static const QString keyPaperSize; static const QString defaultPaperSize; - static const QString keyFont; - static const QString defaultFont; - explicit FileExporter(QObject *parent); ~FileExporter() override; QString toString(const QSharedPointer element, const File *bibtexfile, QStringList *errorLog = nullptr); QString toString(const File *bibtexfile, QStringList *errorLog = nullptr); virtual bool save(QIODevice *iodevice, const File *bibtexfile, QStringList *errorLog = nullptr) = 0; virtual bool save(QIODevice *iodevice, const QSharedPointer element, const File *bibtexfile, QStringList *errorLog = nullptr) = 0; signals: void progress(int current, int total); public slots: virtual void cancel() { // nothing } }; #endif // KBIBTEX_IO_FILEEXPORTER_H diff --git a/src/io/fileexporterpdf.cpp b/src/io/fileexporterpdf.cpp index f18c23c7..113f6c26 100644 --- a/src/io/fileexporterpdf.cpp +++ b/src/io/fileexporterpdf.cpp @@ -1,219 +1,216 @@ /*************************************************************************** * Copyright (C) 2004-2018 by Thomas Fischer * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, see . * ***************************************************************************/ #include "fileexporterpdf.h" #include #include #include #include #include #include #include #include "fileinfo.h" #include "element.h" #include "entry.h" #include "fileexporterbibtex.h" #include "kbibtex.h" #include "logging_io.h" FileExporterPDF::FileExporterPDF(QObject *parent) : FileExporterToolchain(parent) { m_fileBasename = QStringLiteral("bibtex-to-pdf"); m_fileStem = tempDir.path() + QDir::separator() + m_fileBasename; setFileEmbedding(FileExporterPDF::EmbedBibTeXFileAndReferences); reloadConfig(); } FileExporterPDF::~FileExporterPDF() { /// nothing } void FileExporterPDF::reloadConfig() { KSharedConfigPtr config = KSharedConfig::openConfig(QStringLiteral("kbibtexrc")); KConfigGroup configGroup(config, QStringLiteral("FileExporterPDFPS")); m_babelLanguage = configGroup.readEntry(keyBabelLanguage, defaultBabelLanguage); m_bibliographyStyle = configGroup.readEntry(keyBibliographyStyle, defaultBibliographyStyle); KConfigGroup configGroupGeneral(config, QStringLiteral("General")); m_paperSize = configGroupGeneral.readEntry(keyPaperSize, defaultPaperSize); - m_font = configGroupGeneral.readEntry(keyFont, defaultFont); } bool FileExporterPDF::save(QIODevice *iodevice, const File *bibtexfile, QStringList *errorLog) { if (!iodevice->isWritable() && !iodevice->open(QIODevice::WriteOnly)) { qCWarning(LOG_KBIBTEX_IO) << "Output device not writable"; return false; } bool result = false; m_embeddedFileList.clear(); if (m_fileEmbedding & EmbedBibTeXFile) m_embeddedFileList.append(QString(QStringLiteral("%1|%2|%3")).arg(QStringLiteral("BibTeX source"), m_fileStem + KBibTeX::extensionBibTeX, m_fileBasename + KBibTeX::extensionBibTeX)); if (m_fileEmbedding & EmbedReferences) fillEmbeddedFileList(bibtexfile); QFile output(m_fileStem + KBibTeX::extensionBibTeX); if (output.open(QIODevice::WriteOnly)) { FileExporterBibTeX bibtexExporter(this); bibtexExporter.setEncoding(QStringLiteral("latex")); result = bibtexExporter.save(&output, bibtexfile, errorLog); output.close(); } if (result) result = generatePDF(iodevice, errorLog); if (errorLog != nullptr) qCDebug(LOG_KBIBTEX_IO) << "errorLog" << errorLog->join(QStringLiteral(";")); iodevice->close(); return result; } bool FileExporterPDF::save(QIODevice *iodevice, const QSharedPointer element, const File *bibtexfile, QStringList *errorLog) { if (!iodevice->isWritable() && !iodevice->open(QIODevice::WriteOnly)) { qCWarning(LOG_KBIBTEX_IO) << "Output device not writable"; return false; } bool result = false; m_embeddedFileList.clear(); //if (m_fileEmbedding & EmbedReferences) // FIXME need File object fillEmbeddedFileList(element); QFile output(m_fileStem + KBibTeX::extensionBibTeX); if (output.open(QIODevice::WriteOnly)) { FileExporterBibTeX bibtexExporter(this); bibtexExporter.setEncoding(QStringLiteral("latex")); result = bibtexExporter.save(&output, element, bibtexfile, errorLog); output.close(); } if (result) result = generatePDF(iodevice, errorLog); iodevice->close(); return result; } void FileExporterPDF::setDocumentSearchPaths(const QStringList &searchPaths) { m_searchPaths = searchPaths; } void FileExporterPDF::setFileEmbedding(FileEmbedding fileEmbedding) { /// If there is not embedfile.sty file, disable embedding /// irrespective of user's wishes if (!kpsewhich(QStringLiteral("embedfile.sty"))) m_fileEmbedding = NoFileEmbedding; else m_fileEmbedding = fileEmbedding; } bool FileExporterPDF::generatePDF(QIODevice *iodevice, QStringList *errorLog) { QStringList cmdLines {QStringLiteral("pdflatex -halt-on-error ") + m_fileStem + KBibTeX::extensionTeX, QStringLiteral("bibtex ") + m_fileStem + KBibTeX::extensionAux, QStringLiteral("pdflatex -halt-on-error ") + m_fileStem + KBibTeX::extensionTeX, QStringLiteral("pdflatex -halt-on-error ") + m_fileStem + KBibTeX::extensionTeX}; return writeLatexFile(m_fileStem + KBibTeX::extensionTeX) && runProcesses(cmdLines, errorLog) && writeFileToIODevice(m_fileStem + KBibTeX::extensionPDF, iodevice, errorLog); } bool FileExporterPDF::writeLatexFile(const QString &filename) { QFile latexFile(filename); if (latexFile.open(QIODevice::WriteOnly)) { QTextStream ts(&latexFile); ts.setCodec("UTF-8"); ts << "\\documentclass{article}" << endl; ts << "\\usepackage[T1]{fontenc}" << endl; ts << "\\usepackage[utf8]{inputenc}" << endl; if (kpsewhich(QStringLiteral("babel.sty"))) ts << "\\usepackage[" << m_babelLanguage << "]{babel}" << endl; if (kpsewhich(QStringLiteral("hyperref.sty"))) ts << "\\usepackage[pdfborder={0 0 0},pdfproducer={KBibTeX: https://userbase.kde.org/KBibTeX},pdftex]{hyperref}" << endl; else if (kpsewhich(QStringLiteral("url.sty"))) ts << "\\usepackage{url}" << endl; if (m_bibliographyStyle.startsWith(QStringLiteral("apacite")) && kpsewhich(QStringLiteral("apacite.sty"))) ts << "\\usepackage[bibnewpage]{apacite}" << endl; if ((m_bibliographyStyle == QStringLiteral("agsm") || m_bibliographyStyle == QStringLiteral("dcu") || m_bibliographyStyle == QStringLiteral("jmr") || m_bibliographyStyle == QStringLiteral("jphysicsB") || m_bibliographyStyle == QStringLiteral("kluwer") || m_bibliographyStyle == QStringLiteral("nederlands") || m_bibliographyStyle == QStringLiteral("dcu") || m_bibliographyStyle == QStringLiteral("dcu")) && kpsewhich(QStringLiteral("harvard.sty")) && kpsewhich(QStringLiteral("html.sty"))) ts << "\\usepackage{html}" << endl << "\\usepackage[dcucite]{harvard}" << endl << "\\renewcommand{\\harvardurl}{URL: \\url}" << endl; if (kpsewhich(QStringLiteral("embedfile.sty"))) ts << "\\usepackage{embedfile}" << endl; if (kpsewhich(QStringLiteral("geometry.sty"))) ts << "\\usepackage[paper=" << m_paperSize << (m_paperSize.length() <= 2 ? "paper" : "") << "]{geometry}" << endl; - if (!m_font.isEmpty() && kpsewhich(m_font + QStringLiteral(".sty"))) - ts << "\\usepackage{" << m_font << "}" << endl; ts << "\\bibliographystyle{" << m_bibliographyStyle << "}" << endl; ts << "\\begin{document}" << endl; if (!m_embeddedFileList.isEmpty()) for (const QString &embeddedFile : const_cast(m_embeddedFileList)) { const QStringList param = embeddedFile.split(QStringLiteral("|")); QFile file(param[1]); if (file.exists()) ts << "\\embedfile[desc={" << param[0] << "}"; ts << ",filespec={" << param[2] << "}"; if (param[2].endsWith(KBibTeX::extensionBibTeX)) ts << ",mimetype={text/x-bibtex}"; else if (param[2].endsWith(KBibTeX::extensionPDF)) ts << ",mimetype={application/pdf}"; ts << "]{" << param[1] << "}" << endl; } ts << "\\nocite{*}" << endl; ts << QStringLiteral("\\bibliography{") << m_fileBasename << QStringLiteral("}") << endl; ts << "\\end{document}" << endl; latexFile.close(); return true; } else return false; } void FileExporterPDF::fillEmbeddedFileList(const File *bibtexfile) { for (const auto &element : const_cast(*bibtexfile)) fillEmbeddedFileList(element, bibtexfile); } void FileExporterPDF::fillEmbeddedFileList(const QSharedPointer element, const File *bibtexfile) { if (bibtexfile == nullptr || !bibtexfile->hasProperty(File::Url)) { /// If no valid File was provided or File is not saved, do not append files return; } const QSharedPointer entry = element.dynamicCast(); if (!entry.isNull()) { const QString title = PlainTextValue::text(entry->value(Entry::ftTitle)); const auto urlList = FileInfo::entryUrls(entry, bibtexfile->property(File::Url).toUrl(), FileInfo::TestExistenceYes); for (const QUrl &url : urlList) { if (!url.isLocalFile()) continue; const QString filename = url.toLocalFile(); const QString basename = QFileInfo(filename).fileName(); m_embeddedFileList.append(QString(QStringLiteral("%1|%2|%3")).arg(title, filename, basename)); } } } diff --git a/src/io/fileexporterpdf.h b/src/io/fileexporterpdf.h index 14922886..9ead36e1 100644 --- a/src/io/fileexporterpdf.h +++ b/src/io/fileexporterpdf.h @@ -1,61 +1,60 @@ /*************************************************************************** * Copyright (C) 2004-2017 by Thomas Fischer * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, see . * ***************************************************************************/ #ifndef BIBTEXFILEEXPORTERPDF_H #define BIBTEXFILEEXPORTERPDF_H #include #include "fileexportertoolchain.h" /** @author Thomas Fischer */ class KBIBTEXIO_EXPORT FileExporterPDF : public FileExporterToolchain { Q_OBJECT public: enum FileEmbedding { NoFileEmbedding = 0, EmbedBibTeXFile = 1, EmbedReferences = 2, EmbedBibTeXFileAndReferences = EmbedBibTeXFile | EmbedReferences}; explicit FileExporterPDF(QObject *parent); ~FileExporterPDF() override; void reloadConfig() override; bool save(QIODevice *iodevice, const File *bibtexfile, QStringList *errorLog = nullptr) override; bool save(QIODevice *iodevice, const QSharedPointer element, const File *bibtexfile, QStringList *errorLog = nullptr) override; void setDocumentSearchPaths(const QStringList &searchPaths); void setFileEmbedding(FileEmbedding fileEmbedding); private: QString m_fileBasename; QString m_fileStem; QString m_babelLanguage; QString m_paperSize; - QString m_font; QString m_bibliographyStyle; FileEmbedding m_fileEmbedding; QStringList m_embeddedFileList; QStringList m_searchPaths; bool generatePDF(QIODevice *iodevice, QStringList *errorLog); bool writeLatexFile(const QString &filename); void fillEmbeddedFileList(const File *bibtexfile); void fillEmbeddedFileList(const QSharedPointer element, const File *bibtexfile); }; #endif diff --git a/src/io/fileexporterps.cpp b/src/io/fileexporterps.cpp index be5940b9..91d59aaa 100644 --- a/src/io/fileexporterps.cpp +++ b/src/io/fileexporterps.cpp @@ -1,175 +1,172 @@ /*************************************************************************** * Copyright (C) 2004-2018 by Thomas Fischer * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, see . * ***************************************************************************/ #include "fileexporterps.h" #include #include #include #include #include #include #include "element.h" #include "fileexporterbibtex.h" #include "kbibtex.h" #include "logging_io.h" FileExporterPS::FileExporterPS(QObject *parent) : FileExporterToolchain(parent) { m_fileBasename = QStringLiteral("bibtex-to-ps"); m_fileStem = tempDir.path() + QDir::separator() + m_fileBasename; reloadConfig(); } FileExporterPS::~FileExporterPS() { /// nothing } void FileExporterPS::reloadConfig() { KSharedConfigPtr config = KSharedConfig::openConfig(QStringLiteral("kbibtexrc")); KConfigGroup configGroup(config, QStringLiteral("FileExporterPDFPS")); m_babelLanguage = configGroup.readEntry(keyBabelLanguage, defaultBabelLanguage); m_bibliographyStyle = configGroup.readEntry(keyBibliographyStyle, defaultBibliographyStyle); KConfigGroup configGroupGeneral(config, QStringLiteral("General")); m_paperSize = configGroupGeneral.readEntry(keyPaperSize, defaultPaperSize); - m_font = configGroupGeneral.readEntry(keyFont, defaultFont); } bool FileExporterPS::save(QIODevice *iodevice, const File *bibtexfile, QStringList *errorLog) { if (!iodevice->isWritable() && !iodevice->open(QIODevice::WriteOnly)) { qCWarning(LOG_KBIBTEX_IO) << "Output device not writable"; return false; } bool result = false; QFile output(m_fileStem + KBibTeX::extensionBibTeX); if (output.open(QIODevice::WriteOnly)) { FileExporterBibTeX bibtexExporter(this); bibtexExporter.setEncoding(QStringLiteral("latex")); result = bibtexExporter.save(&output, bibtexfile, errorLog); output.close(); } if (result) result = generatePS(iodevice, errorLog); iodevice->close(); return result; } bool FileExporterPS::save(QIODevice *iodevice, const QSharedPointer element, const File *bibtexfile, QStringList *errorLog) { if (!iodevice->isWritable() && !iodevice->open(QIODevice::WriteOnly)) { qCWarning(LOG_KBIBTEX_IO) << "Output device not writable"; return false; } bool result = false; QFile output(m_fileStem + KBibTeX::extensionBibTeX); if (output.open(QIODevice::WriteOnly)) { FileExporterBibTeX bibtexExporter(this); bibtexExporter.setEncoding(QStringLiteral("latex")); result = bibtexExporter.save(&output, element, bibtexfile, errorLog); output.close(); } if (result) result = generatePS(iodevice, errorLog); iodevice->close(); return result; } bool FileExporterPS::generatePS(QIODevice *iodevice, QStringList *errorLog) { QStringList cmdLines {QStringLiteral("latex -halt-on-error bibtex-to-ps.tex"), QStringLiteral("bibtex bibtex-to-ps"), QStringLiteral("latex -halt-on-error bibtex-to-ps.tex"), QStringLiteral("latex -halt-on-error bibtex-to-ps.tex"), QStringLiteral("dvips -R2 -o bibtex-to-ps.ps bibtex-to-ps.dvi")}; return writeLatexFile(m_fileStem + KBibTeX::extensionTeX) && runProcesses(cmdLines, errorLog) && beautifyPostscriptFile(m_fileStem + KBibTeX::extensionPostScript, QStringLiteral("Exported Bibliography")) && writeFileToIODevice(m_fileStem + KBibTeX::extensionPostScript, iodevice, errorLog); } bool FileExporterPS::writeLatexFile(const QString &filename) { QFile latexFile(filename); if (latexFile.open(QIODevice::WriteOnly)) { QTextStream ts(&latexFile); ts.setCodec("UTF-8"); ts << "\\documentclass{article}" << endl; ts << "\\usepackage[T1]{fontenc}" << endl; ts << "\\usepackage[utf8]{inputenc}" << endl; if (kpsewhich(QStringLiteral("babel.sty"))) ts << "\\usepackage[" << m_babelLanguage << "]{babel}" << endl; if (kpsewhich(QStringLiteral("url.sty"))) ts << "\\usepackage{url}" << endl; if (m_bibliographyStyle.startsWith(QStringLiteral("apacite")) && kpsewhich(QStringLiteral("apacite.sty"))) ts << "\\usepackage[bibnewpage]{apacite}" << endl; if ((m_bibliographyStyle == QStringLiteral("agsm") || m_bibliographyStyle == QStringLiteral("dcu") || m_bibliographyStyle == QStringLiteral("jmr") || m_bibliographyStyle == QStringLiteral("jphysicsB") || m_bibliographyStyle == QStringLiteral("kluwer") || m_bibliographyStyle == QStringLiteral("nederlands") || m_bibliographyStyle == QStringLiteral("dcu") || m_bibliographyStyle == QStringLiteral("dcu")) && kpsewhich(QStringLiteral("harvard.sty")) && kpsewhich(QStringLiteral("html.sty"))) ts << "\\usepackage{html}" << endl << "\\usepackage[dcucite]{harvard}" << endl << "\\renewcommand{\\harvardurl}{URL: \\url}" << endl; if (kpsewhich(QStringLiteral("geometry.sty"))) ts << "\\usepackage[paper=" << m_paperSize << (m_paperSize.length() <= 2 ? "paper" : "") << "]{geometry}" << endl; - if (!m_font.isEmpty() && kpsewhich(m_font + QStringLiteral(".sty"))) - ts << "\\usepackage{" << m_font << "}" << endl; ts << "\\bibliographystyle{" << m_bibliographyStyle << "}" << endl; ts << "\\begin{document}" << endl; ts << "\\nocite{*}" << endl; ts << "\\bibliography{bibtex-to-ps}" << endl; ts << "\\end{document}" << endl; latexFile.close(); return true; } else return false; } bool FileExporterPS::beautifyPostscriptFile(const QString &filename, const QString &title) { QFile postscriptFile(filename); if (postscriptFile.open(QFile::ReadOnly)) { QTextStream ts(&postscriptFile); QStringList lines; QString line; int i = 0; while (!(line = ts.readLine()).isNull()) { if (i < 32 && line.startsWith(QStringLiteral("%%Title:"))) line = "%%Title: " + title; else if (i < 32 && line.startsWith(QStringLiteral("%%Creator:"))) line += QStringLiteral("; exported from within KBibTeX: https://userbase.kde.org/KBibTeX"); lines += line; ++i; } postscriptFile.close(); if (postscriptFile.open(QFile::WriteOnly)) { QTextStream ts(&postscriptFile); for (const QString &line : const_cast(lines)) ts << line << endl; postscriptFile.close(); } else return false; } else return false; return true; } diff --git a/src/io/fileexporterps.h b/src/io/fileexporterps.h index 1e9b6fe7..3857422a 100644 --- a/src/io/fileexporterps.h +++ b/src/io/fileexporterps.h @@ -1,54 +1,53 @@ /*************************************************************************** * Copyright (C) 2004-2017 by Thomas Fischer * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, see . * ***************************************************************************/ #ifndef BIBTEXFILEEXPORTERPS_H #define BIBTEXFILEEXPORTERPS_H #include "fileexportertoolchain.h" class QStringList; /** @author Thomas Fischer */ class KBIBTEXIO_EXPORT FileExporterPS : public FileExporterToolchain { Q_OBJECT public: explicit FileExporterPS(QObject *parent); ~FileExporterPS() override; void reloadConfig() override; bool save(QIODevice *iodevice, const File *bibtexfile, QStringList *errorLog = nullptr) override; bool save(QIODevice *iodevice, const QSharedPointer element, const File *bibtexfile, QStringList *errorLog = nullptr) override; private: QString m_fileBasename; QString m_fileStem; QString m_babelLanguage; QString m_paperSize; - QString m_font; QString m_bibliographyStyle; bool generatePS(QIODevice *iodevice, QStringList *errorLog); bool writeLatexFile(const QString &filename); bool beautifyPostscriptFile(const QString &filename, const QString &title); }; #endif