2

I am using this command to convert md file to tex

pandoc -s --bibliography teatar.bib --filter pandoc-citeproc 1.md -o cit2.tex

When I compile, I receive pdf file, but no italic and bold. However, in tex file there are proper \emph and \textbf marks.

My MWE:

% Options for packages loaded elsewhere
\PassOptionsToPackage{unicode}{hyperref}
\PassOptionsToPackage{hyphens}{url}
%
\documentclass[
]{article}
\usepackage{lmodern}
\usepackage{amssymb,amsmath}
\usepackage{ifxetex,ifluatex}
\ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0 % if pdftex
  \usepackage[T2A]{fontenc}
  \usepackage[utf8]{inputenc}
  \usepackage{textcomp} % provide euro and other symbols
\else % if luatex or xetex
  \usepackage{unicode-math}
  \defaultfontfeatures{Scale=MatchLowercase}
  \defaultfontfeatures[\rmfamily]{Ligatures=TeX,Scale=1}
\fi
% Use upquote if available, for straight quotes in verbatim environments
\IfFileExists{upquote.sty}{\usepackage{upquote}}{}
\IfFileExists{microtype.sty}{% use microtype if available
  \usepackage[]{microtype}
  \UseMicrotypeSet[protrusion]{basicmath} % disable protrusion for tt fonts
}{}
\makeatletter
\@ifundefined{KOMAClassName}{% if non-KOMA class
  \IfFileExists{parskip.sty}{%
    \usepackage{parskip}
  }{% else
    \setlength{\parindent}{0pt}
    \setlength{\parskip}{6pt plus 2pt minus 1pt}}
}{% if KOMA class
  \KOMAoptions{parskip=half}}
\makeatother
\usepackage{xcolor}
\IfFileExists{xurl.sty}{\usepackage{xurl}}{} % add URL line breaks if available
\IfFileExists{bookmark.sty}{\usepackage{bookmark}}{\usepackage{hyperref}}
\hypersetup{
  hidelinks,
  pdfcreator={LaTeX via pandoc}}
\urlstyle{same} % disable monospaced font for URLs
\setlength{\emergencystretch}{3em} % prevent overfull lines
\providecommand{\tightlist}{%
  \setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}}
\setcounter{secnumdepth}{-\maxdimen} % remove section numbering
\ifluatex
  \usepackage{selnolig}  % disable illegal ligatures
\fi
\newlength{\cslhangindent}
\setlength{\cslhangindent}{1.5em}
\newenvironment{cslreferences}%
  {\setlength{\parindent}{0pt}%
  \everypar{\setlength{\hangindent}{\cslhangindent}}\ignorespaces}%
  {\par}

\author{}
\date{}

\begin{document}

\hypertarget{ux43dux430ux441ux43bux43eux432-1-title-1}{%
\section{Наслов 1 Title
1}\label{ux43dux430ux441ux43bux43eux432-1-title-1}}

Некаков текст \emph{италик} и \textbf{болд} Some text \emph{italic} and
\textbf{bold} њитх референце (Alexander 2004, 1)

\hypertarget{ux43fux440ux438ux43aux430ux437ux43dux430ux442ux430-ux438-ux433ux43eux440ux430ux43d-ux441ux43cux435ux43dux438-ux43fux43eux441ux43bux435}{%
\section{Title Наслов}\label{ux43fux440ux438ux43aux430ux437ux43dux430ux442ux430-ux438-ux433ux43eux440ux430ux43d-ux441ux43cux435ux43dux438-ux43fux43eux441ux43bux435}}

Некаков текст \emph{италик} и \textbf{болд} Some text \emph{italic} and
\textbf{bold} with footnote.\footnote{footnote text текст на фуснота.}

\hypertarget{references}{%
\section*{References}\label{references}}
\addcontentsline{toc}{section}{References}

\hypertarget{refs}{}
\begin{cslreferences}
\leavevmode\hypertarget{ref-Alexander.2004}{}%
Alexander, Jeffrey C. 2004. ``Preface.'' In \emph{Cultural trauma and
collective identity}, edited by Jeffrey C. Alexander, vii--ix. Berkeley,
Calif.; London: University of California Press.
\end{cslreferences}

\end{document}

Any help, please?

EDIT: My markdown source

# Наслов 1 Title 1
Некаков текст *италик* и **болд**
Some text *italic* and **bold** њитх референце [@Alexander.2004,1]

# Title Наслов

Некаков текст *италик* и **болд**
Some text *italic* and **bold** with footnote.[^1] 




[^1]: footnote text текст на фуснота. 

# References

2
  • 1
    Please show the markdown source
    – DG'
    Commented Oct 6, 2020 at 15:47
  • 2
    The generated TeX document produces no bold or italic because these weights/shapes aren't available in the T2A encoding (which is for your Russian text). There is no automatic script switching in LaTeX, so if this were a LaTeX document you would ideally use babel with the appropriate languages and markup. How this can be done in .md I don't know although if you're only intending to produce PDF from .md you can include LaTeX markup in the .md document directly as needed.
    – Alan Munn
    Commented Oct 6, 2020 at 16:47

2 Answers 2

2

Following @Alan Munn advice, I add \usepackage[macedonian]{babel} and commented \usepackage{lmodern} Now I have bolds and italics. :-)

0

The following combination works for me.

Here is the markdown source:

---
lang: ru-RU
---

# Наслов 1 Title 1

Некаков текст *италик* и **болд**.
[Some text *italic* and **bold**]{lang=en-US} њитх референце.

# Title Наслов

Некаков текст *италик* и **болд**
[Some text *italic* and **bold** with footnote.]{lang=en-US}[^1]

[^1]: [footnote text]{lang=en-US} текст на фуснота.

# References

The Pandoc manual on p. 41:

lang identifies the main language of the document using IETF language tags (following the BCP 47 standard), such as en or en-GB. The Language subtag lookup tool can lookup or verify these tags. This affects most formats, and controls hyphenation in PDF output when using LaTeX (through babel and polyglossia) or ConTeXt.

Using Pandoc (v. 2.11), use the following command and then compile using pdfTeX:

pandoc -t latex -o output.tex source.md -s

You could also generate a PDF directly using the following command:

pandoc -t latex -o output.pdf source.md

Output:

Russian output

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .