0

This is a follow up to this, and is also based off of this.

Current code:

\documentclass[12pt]{article}
\usepackage{float}
\usepackage[american,siunitx]{circuitikz}
\usepackage[margin=1in]{geometry} 
\begin{document} 
    \makeatletter
    \let\small\@undefined
    \let\footnotesize\@undefined
    \let\scriptsize\@undefined
    \let\tiny\@undefined
    \let\large\@undefined
    \let\Large\@undefined
    \let\LARGE\@undefined
    \let\huge\@undefined
    \let\Huge\@undefined
    \input{size10.clo}\makeatother
    \restoregeometry
    \section*{Hello}
    Hello HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH
    \begin{figure}[H]
        \centering
        \begin{circuitikz}
            \draw(0, 0) to [V, v_= $v_g\left(t\right)$] ++(0, -3) ;
            \draw(0, 0) to [R, l^= $R$] ++(3,0) to [C, l^=$C$] ++(0, -3) -- ++(-3,0);
        \end{circuitikz}
        \caption{A simple low-pass filter.}
        \label{RCFilter}
    \end{figure}
    \noindent
    IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII
\end{document}

Current output: enter image description here

Here's what I am trying to achieve:

Desired output: enter image description here

Code that makes the desired output:

\documentclass[10pt]{article}
\usepackage{float}
\usepackage[american,siunitx]{circuitikz}
\usepackage[margin=1in]{geometry} 
\begin{document} 
    \section*{Hello}
    Hello HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH
    \begin{figure}[H]
        \centering
        \begin{circuitikz}
            \draw(0, 0) to [V, v_= $v_g\left(t\right)$] ++(0, -3) ;
            \draw(0, 0) to [R, l^= $R$] ++(3,0) to [C, l^=$C$] ++(0, -3) -- ++(-3,0);
        \end{circuitikz}
        \caption{A simple low-pass filter.}
        \label{RCFilter}
    \end{figure}
    \noindent
    IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII
\end{document}

What I am trying to do is that for some article files, I want a few pages that follow \documentclass[12pt]{article} followed by another that follow \documentclass[10pt]{article} (i.e. changing the settings of the article class). I thought that the answers in this link (i.e. my answer) and that link would change the article class's parameters besides the font (10pt), but it only changes the font size of all text, which includes the text in the figures. If the solution in this link does not work, then what is the solution? Any help would be appreciated.

Superman
  • 1,615

1 Answers1

2

In the following example, the font size settings are changed and restored by reloading the size configuration file size10.clo and size12.clo. The example prints the same test contents three times, first in 10pt, then in 12pt (highlighted by gray color), at last in 10pt.

\documentclass{article}
\usepackage{xcolor}

\def\dummytext{[Dummy text] Nunc sed pede. Praesent vitae lectus. Praesent neque justo,
  vehicula eget, interdum id, facilisis et, nibh.}
\def\test{
  \dummytext
  \begin{enumerate}
    \item 
    \item
  \end{enumerate}
  \dummytext
  \[ a^2 + b^2 = c^2 \]
  \dummytext
  \[ a^2 + b^2 = c^2 \]
  \par        % always end the paragraph before changing size
}

\begin{document}
\test         % 10pt is used

\makeatletter % change to 12pt settings
\input{size12.clo}
\makeatother

\color{gray}  % for highlighting
\test         % 12pt is used
\normalcolor  % for highlighting

\makeatletter % restore to 10pt settings
\input{size10.clo}
\makeatother

\test         % 10pt is used
\end{document}

enter image description here

muzimuzhi Z
  • 26,474
  • 1
    A very direct approach. One thing that stands out is that the transition from 10 to 12pt has less intervening space than the transition from 12 to 10pt. Is the application of gray relevant, or is there some difference in the two .clo files involved? – barbara beeton Jun 07 '20 at 22:02
  • @barbarabeeton Fixed by appending a \par to \test. With the help of \scrollmode\loggingoutput, it shows there is an extra \baselineskip at the transition from 12pt to 10pt. I guess it is an empty line caused by the change of TeX's internal states. – muzimuzhi Z Jun 07 '20 at 22:22