Metadata-Version: 2.4
Name: pubmarq
Version: 0.1.0
Summary: Scientific articles and theses from markdown, set for a journal as PDF and DOCX
Author: Xaeian
License-Expression: MIT
Project-URL: Repository, https://github.com/Xaeian/PubMarQ
Keywords: journal,article,thesis,markdown,pdf,docx,ieee
Requires-Python: >=3.12
Description-Content-Type: text/markdown
License-File: license
Requires-Dist: docmarq[md]>=0.5.1
Requires-Dist: pdfmarq[md]>=0.7.1
Requires-Dist: markdown-it-py
Requires-Dist: Pillow
Requires-Dist: xaeian>=1.2.2
Requires-Dist: rlPyCairo
Provides-Extra: pages
Requires-Dist: xaeian[media]; extra == "pages"
Provides-Extra: all
Requires-Dist: xaeian[media]; extra == "all"
Dynamic: license-file

# PubMarQ

Scientific articles and theses from markdown, set as each journal or school wants them: PDF through [PDFMarQ](https://github.com/Xaeian/PDFMarQ), DOCX through [DocMarQ](https://github.com/Xaeian/DocMarQ).
Source says what the article is, its journal profile how it looks, so one markdown file goes to every journal pubmarq knows.

## Install

```sh
pip install pubmarq         # articles and theses
pip install pubmarq[pages]  # + PDF pages a dissertation sets in
```

## Use

```sh
py -m pubmarq build paper.md ijet          # paper.ijet.pdf and .docx
py -m pubmarq build paper.md ijet --blind  # + copies for blind review
py -m pubmarq check paper.md ijet          # preflight only
py -m pubmarq journals                     # known journals
```

`-j` answers in one JSON document.
Exit code: 0 with nothing to fix, 1 after errors, 2 for wrong arguments.

```py
from pubmarq import build
result = build("paper.md", "ijet", out_dir="out")
result.files, result.pages, result.issues
```

## Journals

| Key | Journal | Layout |
| --- | --- | --- |
| `ijet` | International Journal of Electronics and Telecommunications | IEEE, two columns, Times New Roman 10pt |
| `pe` | Przegląd Elektrotechniczny | Polish or English, two abstracts, Times New Roman 10.5pt, DOCX in Arial 9pt |
| `mdpi` | MDPI journals | one column, Palatino, general rules |
| `umg` | Gdynia Maritime University: diploma thesis | title page form, statement, both sides, Source Serif 4 and Sora |
| `umg-dr` | Gdynia Maritime University: doctoral dissertation | as `umg`, Rector's title page, articles set in |

Profiles are `Journal` dataclasses, so variants are one `replace` away:

```py
from dataclasses import replace
from pubmarq import JOURNALS, build
build("paper.md", replace(JOURNALS["ijet"], key="ijet-short", pages=(4, 6)))
```

## Article

```md
---
title: A Shared Register Specification as the Source of Complete Modbus RTU Device Support
short_title: Shared register specification  # running head
lang: en                                    # else the journal's
title_pl: Wspólna specyfikacja rejestrów    # second title PE prints
author:
  - Emilian Świtalski, 0000-0002-5437-381X, e.switalski@we.umg.edu.pl
entity: Gdynia Maritime University
address: Morska 81/87, 81-225 Gdynia, Poland
published: IJET 2027, 73(1), 245-250        # once accepted
doi: 10.24425/ijet.2027.123456
---

### Abstract

One paragraph.

**Keywords:** first, second, third

## Introduction

Text citing a work[^1], as Table 1 and Fig. 1 show.
```

- `### Abstract` or `### Streszczenie` opens abstracts, `**Keywords:**` their keywords.
- `##` and `###` are sections and subsections, numbered as each journal numbers them.
- Footnotes are references, set in each journal's style.
- `> **Table 1.** title` over tables and `> **Figure 1.** caption` under pictures, each pair in `<!-- group -->`, make captions; `<!-- group wide -->` spans both columns.
- `\label{x}` in `$$` formulas and `\eqref{x}` in text refer to them by number.
- Articles in two languages may keep each in its own file, `paper.PL.md` and `paper.EN.md`, each taking from the other what it lacks.
- Blind copies leave out authors, their places, funding and acknowledgment.

## Theses

```md
---
title: System monitorowania zużycia energii w instalacji okrętowej
title_en: Energy consumption monitoring in a ship installation
author: Jan Kowalski
album: 45678
degree: engineering                        # or master
faculty: Wydział Elektryczny
department: Katedra Elektroenergetyki Okrętowej
specialization: Elektroautomatyka okrętowa
supervisor: dr inż. Anna Nowak, prof. UMG
reviewer: dr hab. inż. Piotr Wiśniewski
date: 2027-01-15                           # of the statement
oecd: Nauki inżynieryjne i techniczne, Elektrotechnika, elektronika, inżynieria informatyczna
---
```

- `umg` sets the title page form with university emblem, statement, contents, each chapter on its own page and abstracts at the back.
- `## Wykaz rysunków` and `## Wykaz tabel` list captions with their pages.
- `umg-dr` sets dissertations: Rector's title page, abstracts before contents, parts as `## Część I. ...`, and `![](article.pdf)` setting articles in as published.
- DOCX files carry their faces, and Word fills their contents on opening.

## Preflight

Every build checks its article against the journal first, and `check` does only that: title, authors, abstracts and keywords, references and their DOIs, figures, tables and formulas never mentioned, raster figures under 300dpi, PDF page count, and what school forms need.

```text
ERR No title in en, which PE prints too
TIP Add it: title_en: in the frontmatter, or keep the article in en beside it, as paper.EN.md
WRN 8 keywords in pl, PE takes 4–6
ERR 1 error, 1 warning
```

## Fonts

Both formats set faces each journal names: Times New Roman and others from the system, else metric twins from a `--fonts` folder.
pubmarq carries open faces it needs, under SIL Open Font License: Open Sans, Tinos, Cascadia Code, Source Serif 4, Sora and IBM Plex Mono.
Palatino of MDPI has no open twin.

## Limits

- Word lays DOCX out on opening, so PDF page count is the guide.
- In DOCX, figures missing a column's rest leave gaps, and tables split between columns.
- MDPI profile follows general rules: check it against the journal's own.
- Dissertation DOCX names PDFs its PDF sets in, for pages to be added by hand.
