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:


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

  • 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.) – ShreevatsaR May 25 '17 at 20:57

\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

   \abovedisplayskip 10\p@ \@plus2\p@ \@minus5\p@
   \abovedisplayshortskip \z@ \@plus3\p@
   \belowdisplayshortskip 6\p@ \@plus3\p@ \@minus3\p@
   \belowdisplayskip \abovedisplayskip

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

  • Thanks David, but when I added the command you posted, it resulted in an error. I'm not saying the provided suggestion is bad, but in the system in question - I'm new to it and thus not 100% sure of how it works, or if it works correctly at all. – Adam T May 25 '17 at 20:39
  • @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} – David Carlisle May 25 '17 at 20:44
  • 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 '17 at 20:48
  • why can't you use \large (which gives 12pt if the default is 10pt, you should almost never need to give numeric values. If you do use numeric values syntax is \fontsize{12pt}{14pt}\selectfont for 12pt font on a 14pt baseline. You are certainly approaching this the wrong way but it is hard to say what you should do as you haven't given any description of the top level requirement just shown code that will stop latex working. – David Carlisle May 25 '17 at 20:56
  • 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 '17 at 21:13

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.