1

I tried to use a .tex file, which is referenced by many of our LaTeX documents, to globally reduce the font size of some markup that is an {item}.

I tried (in the .tex file) which serves as a preamble:

\renewcommand\fontsize{small}\selectfont 

and it had the desired effect of reducing the font size, however it came with a side effect of adding the text "small141.5" a few times before the markup of the actual {item}.

I also tried to use it as \newcommand but it had no effect.

The only thing that worked is when I inserted directly into the document, immediately before \item (the first line is below)..

\fontsize{12pt}\item Let $\displaystyle f(x) = \frac{3}{x^2}$. 

Then the .tex file in question does not reference "{item}" at all, so a few questions:

  • Is what I'm trying to do possible in a .tex file (so I won't have to a direct insert for possibly thousands of documents?
  • Can it be done and not introduce stray characters?

Thanks, Adam

1
  • What does the referenced .tex file contain? Is it simply text to be typeset, with no changes? (For example, if you typeset just that referenced .tex file and then pinned those printed pages into the hundreds/thousands of documents, would it work? Not suggesting doing this, just asking so that it's clear to everyone what your task is.) May 25, 2017 at 20:57

1 Answer 1

1

\fontsize is a core latex command which takes two arguments, a font size and a baselinespacing, if you redefine it you will break almost all latex font change commands.

You could redefine \normalsize which in article 10pt option is

\renewcommand\normalsize{%
   \@setfontsize\normalsize\@xpt\@xiipt
   \abovedisplayskip 10\p@ \@plus2\p@ \@minus5\p@
   \abovedisplayshortskip \z@ \@plus3\p@
   \belowdisplayshortskip 6\p@ \@plus3\p@ \@minus3\p@
   \belowdisplayskip \abovedisplayskip
   \let\@listi\@listI}

which sets the default font to be 10pt and also sets appropriate defaults for spacing around math and lists.

7
  • 1
    @AdamT the question is why are you needing to redefine core features of the system? Especially if you're a beginner (I've been doing this for 30 years and would think twice about redefining things at this level.) if you want a 12pt default just use \documentclass[12pt]{article} May 25, 2017 at 20:44
  • 1
    Hi David, the goal I'm trying for is not so much to redefine a core feature of a system, but to make an adjustment of font size that will take place without me having to hand edit hundreds (maybe thousands) of individual documents that "reference" the .tex file. I've searched in google for examples of how to use a .tex file, but there's not much info I've found. This .tex file is littered with things like \newcommand and \renewcommand
    – Adam T
    May 25, 2017 at 20:48
  • 1
    I don't think it's a matter of "why can't I do..." the question is "where". If you had 13,000 html pages and on all of them there was code div class="toppy", would it not be easier to adjust all of those references by using a cascading style sheet? Of course it would. Now I realize I'm comparing HTML/CSS to LaTex. I appreciate your time in trying to help.
    – Adam T
    May 25, 2017 at 21:13
  • 1
    @AdamT yes of course you should almost never need any explicit font commands in the document body the whole point of latex is to separate the main text markup from the document style. So once you have set up the fonts in the preamble you shouldn't need anything in the document body. May 25, 2017 at 21:15
  • 1
    Let us continue this discussion in chat.
    – Adam T
    May 25, 2017 at 21:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.