I use pandoc, so I'm a bit limited in the tex hacks I can apply. However, here is an example: I have this document, test.md, in pandoc Markdown:
---
listings: true # see also https://stackoverflow.com/q/67106641
title: "Some title here"
author: John Doe
date: \today
header-includes: |
\lstset{% for listings
basicstyle=\scriptsize\ttfamily,
breaklines=true,
}
---
Introduction
Here is some code output, obtained with the devcon.exe command line tool:
PCI\VEN_8086&DEV_A295&SUBSYS_36E217AA&REV_F0\3&11583659&0&E0
Name: Intel(R) 200 Series Chipset Family PCI Express Root Port #6 - A295
Driver is running.
PCI\VEN_8086&DEV_5912&SUBSYS_36E217AA&REV_04\3&11583659&0&10
Name: Intel(R) HD Graphics 630
Driver is running.
ACPI\ACPI000C\2&DABA3FF&1
Name: ACPI Processor Aggregator
Driver is running.
ACPI\GENUINEINTEL_-_INTEL64_FAMILY_6_MODEL_158_-_INTEL(R)_CORE(TM)_I7-7700T_CPU_@_2.90GHZ\_1
Name: Intel(R) Core(TM) i7-7700T CPU @ 2.90GHz
Driver is running.
So ...
Convert to Latex using pandoc test.md --listings -s -o test.tex, I get:
% Options for packages loaded elsewhere
\PassOptionsToPackage{unicode}{hyperref}
\PassOptionsToPackage{hyphens}{url}
%
\documentclass[
]{article}
\usepackage{amsmath,amssymb}
\usepackage{lmodern}
\usepackage{ifxetex,ifluatex}
\ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0 % if pdftex
\usepackage[T1]{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{
pdftitle={Some title here},
pdfauthor={John Doe},
hidelinks,
pdfcreator={LaTeX via pandoc}}
\urlstyle{same} % disable monospaced font for URLs
\usepackage{listings}
\newcommand{\passthrough}[1]{#1}
\lstset{defaultdialect=[5.3]Lua}
\lstset{defaultdialect=[x86masm]Assembler}
\setlength{\emergencystretch}{3em} % prevent overfull lines
\providecommand{\tightlist}{%
\setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}}
\setcounter{secnumdepth}{-\maxdimen} % remove section numbering
\lstset{% for listings
basicstyle=\scriptsize\ttfamily,
breaklines=true,
}
\ifluatex
\usepackage{selnolig} % disable illegal ligatures
\fi
\title{Some title here}
\author{John Doe}
\date{\today}
\begin{document}
\maketitle
\hypertarget{introduction}{%
\section{Introduction}\label{introduction}}
Here is some code output, obtained with the
\passthrough{\lstinline!devcon.exe!} command line tool:
\begin{lstlisting}
PCI\VEN_8086&DEV_A295&SUBSYS_36E217AA&REV_F0\3&11583659&0&E0
Name: Intel(R) 200 Series Chipset Family PCI Express Root Port #6 - A295
Driver is running.
PCI\VEN_8086&DEV_5912&SUBSYS_36E217AA&REV_04\3&11583659&0&10
Name: Intel(R) HD Graphics 630
Driver is running.
ACPI\ACPI000C\2&DABA3FF&1
Name: ACPI Processor Aggregator
Driver is running.
ACPI\GENUINEINTEL_-INTEL64_FAMILY_6_MODEL_158-INTEL(R)_CORE(TM)_I7-7700T_CPU@_2.90GHZ_1
Name: Intel(R) Core(TM) i7-7700T CPU @ 2.90GHz
Driver is running.
\end{lstlisting}
So \ldots{}
\end{document}
And finally, the PDF output, obtained with pandoc test.md --listings -o test.pdf, looks like this:
So, got my main listing in small \scriptsize font size, which is what I wanted - however, now pandoc uses \lstinline for the inline teletype/code as well, and so the inline code is also small font size, which I do not want.
Instead, I would like the \lstinline style to keep the normal size teletype font, and the {lstlisting} environment with small (script) size teletype font by default.
Is there any way I can achieve this, solely by setting options in the Latex preamble (as that is pretty much the only option I have with pandoc, using the header-includes directive in the YAML preamble)?

