정의된 섹션 제목을 올바르게 정렬

정의된 섹션 제목을 올바르게 정렬

이것은 대규모 프로젝트에서 정의하려는 섹션 제목의 MWE입니다.

\documentclass[a2,portrait]{a0poster}

\usepackage{tikz}

% Blue section, large, text on next line.
\def\Lsect#1{\noindent\hbox to \hsize{\large\color{blue} #1}\bigskip}

\begin{document}

\Lsect{This is a title}

Some text.

\end{document}

출력은 다음과 같습니다.

여기에 이미지 설명을 입력하세요

tikz문제를 재현하기 위해 LaTeX 파일에서 중요하지 않은 모든 줄을 제거했습니다(왜 거기에 있어야 하는지 잘 모르겠습니다 ).

제목을 왼쪽에 올바르게 정렬해야 하는데 어떻게 해야 할지 모르겠습니다. 제가 생각할 수 있는 정의에 맞게 모든 수정을 시도했습니다.

답변1

hbox를 특정 크기로 지정하면 TeX는 내용을 해당 크기에 맞추려고 시도합니다. 콘텐츠를 특정 방향으로 정렬하려면 다음 고무 길이 중 하나를 사용해 보십시오.

  • \hfil, \hfill또는\hfilll
  • \hss

\documentclass[a2,portrait]{a0poster}
\usepackage{tikz}
% Blue section, large, text on next line.
\def\Lsect#1{\noindent\hbox to \hsize{\large\color{blue} #1\hfil}\bigskip}
\begin{document}
\Lsect{This is a title}
Some text.
\end{document}

여기에 이미지 설명을 입력하세요

관련 정보