0

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 fonts specified in the command line. The rest of the text I'd like 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 #.

2
  • 5
    # 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, 2020 at 22:08
  • (question bumped by Community) OP briefly mentioned pandoc. Question could have pandoc added however
    – user202729
    Dec 27, 2021 at 12:57

1 Answer 1

0

It appears that I can do:

\Huge\centerline{Text}\large

and get what I want

3
  • 1
    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, 2020 at 22:11
  • THe above works, but prevents the line from line-wrapping, whereas using \begin... /end wraps it up. I actually want the rest of the text large, anyway, so no big deal. Thx
    – Rory Toma
    Apr 6, 2020 at 2:28
  • 1
    It would be better to use \centerline{\Huge text}{\large other text}.
    – user30471
    Apr 6, 2020 at 2:41

You must log in to answer this question.

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