2

I would like to change one letter on small in my section

\documentclass[oneside,12pt,a4paper]{memoir}

\usepackage{polski}
\usepackage[utf8]{inputenc}
\usepackage[right=2.7cm,left=3.5cm, top=2.7cm, bottom=2.5cm,includehead]{geometry}

%section style
\renewcommand\section{\@startsection {section}{1}
                                                                     {\z@}%
                                   {-3.5ex \@plus -1ex \@minus -.2ex}%
                                   {2.3ex \@plus.2ex}%
                                   {\large\scshape}}%\bfseries}}
\renewcommand*{\thesection}{\arabic{chapter}.\arabic{section}}  
\setsecnumformat{\csname the#1\endcsname .\hspace{2.5mm}}

\begin{document}
\section{n-regular polygons}

\end{document}

This should generate N-REGULAR POLYGONS but I need n-REGULAR POLYGONS

2
  • (1) For me it's not clear what you are asking. (2) I think that your example code contains way too much stuff that is not needed at all to demonstrate your problem. (3) Please do not comment on this comment -- instead, update the question. (4) tex.stackexchange.com/questions/59726 sounds like your problem (again, I do not understand fully what you are asking). Commented Jun 22, 2017 at 19:52
  • Which letter do you want to change? Can you please make a compilable MWE? If I try to run your code I get the following error message ` ! You can't use \spacefactor' in vertical mode. Commented Jun 22, 2017 at 20:13

2 Answers 2

4

I borrowed the definition of section style form Rubens answers, as I cannot compile your MWE

\documentclass[oneside,12pt,a4paper]{memoir}

\newcommand*\lowercasecapitals[1]{\MakeLowercase{\large\scshape#1}}
\setsecheadstyle{\lowercasecapitals}

\begin{document}

\section{{\normalfont n}-regular polygons}

\end{document}

enter image description here

6

example

\documentclass[twocolumn]{memoir}
\usepackage{lipsum}
\newcommand*\lowercasecapitals[1]{\MakeLowercase{\large\scshape#1}}
\setsecheadstyle{\lowercasecapitals}

\begin{document}
\chapter{Polygons}
\section{$n$-regular Polygons}
\lipsum
\end{document}

You should simply use $...$ (which makes sense anyways). Moreover, you should restyle the section headings with \setsecheadstyle in memoir.

If you really need every first character in \normalfont you can automise like:

\documentclass[twocolumn]{memoir}
\usepackage{lipsum}

\makeatletter
\let\latex@section\section
\renewcommand*\section[2][]{%
  \if\relax\detokenize{#1}\relax
    \latex@section{\textnormal#2}
  \else
    \latex@section[#1]{\textnormal#2}
}
\makeatother

\newcommand*\lowercasecapitals[1]{\MakeLowercase{\large\scshape#1}}
\setsecheadstyle{\lowercasecapitals}

\begin{document}
\chapter{Polygons}
\section{n-regular Polygons}
\lipsum
\end{document}

Otherwise you should use the solution of @samcarter.

3
  • Nice, but "n" is math mode. I supose to change it, I should use \text{n}
    – user110944
    Commented Jun 22, 2017 at 20:31
  • @Blazej, added another solution (that does not use $...$)
    – Ruben
    Commented Jun 22, 2017 at 21:24
  • 2
    I also think that the n should be italic. But that's not related to Latex :) Commented Jun 22, 2017 at 21:40

You must log in to answer this question.

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