# Simple text formatting in Latex

I'd like to do the following in latex (it's being fed to pandoc for conversion) I use the mainfont and mainfontoptions in pandoc

I have a piece of text on top that I'd like centered, and set to the the fonts specified in the command line.

The rest of the text, I'd like it to just be the default.

If I put in something like:

\centering Text


It centers fine, but also centers the rest of the document. It also doesn't use the font I want to use.

If I do

# Text


It uses the font (and makes it bold) but doesn't center. Ideally, I'd like to figure out some way to do a one-line \center and #.

• # used this way is definitely not LaTeX. Maybe you wanted to use {\centering\Huge Text\par}, or \begin{center}\Huge Text\end{center}. – frougon Apr 5 '20 at 22:08

\Huge\centerline{Text}\large

• I'm afraid this is not very good. 1) \large will affect whatever comes after it. 2) \centerline is from plain TeX, not LaTeX (sometimes, this can be acceptable, though). 3) The scope of \Huge is not limited here (though \large will override it). See my suggestions above—I hope they work in your system. – frougon Apr 5 '20 at 22:11
• It would be better to use \centerline{\Huge text}{\large other text}. – user30471 Apr 6 '20 at 2:41