希腊文 utf8 文档中的英文 minitoc 条目

希腊文 utf8 文档中的英文 minitoc 条目

在问题中显示的文档设置中希腊文 PDF 书签,有趣的部分是:

\documentclass[greek,english]{scrbook}
\usepackage[LGRx,T1]{fontenc} % define LGR and T1 encodings
\usepackage[utf8]{inputenc} % standard UTF-8 input encoding
\usepackage[greek,english]{babel}
\usepackage[unicode]{hyperref}

米尼托克该包用于按章节呈现迷你目录。

\usepackage[k-loose]{minitoc} % Mini-ToCs with loose line spacing
\mtcsettitle{minitoc}{} % for empty title
\mtcsetrules{minitoc}{off} % turn off rules before and after the minitoc's
\mtcsetpagenumbers{minitoc}{off} % turn off page numbering in minitoc's

除一个部分外,其余部分标题均为希腊文。唯一的英文部分名为拇指食指并且正确(?)用英语定义\selectlanguage{english},在 mini-ToC 中以希腊字母显示为Τηυμβ-ινδεξ

笔记该章节标题正确显示在(正常)目录中!

应该如何米尼托克指示尊重语言设置?

答案1

示例文档中有很多方面需要纠正:

\documentclass[10pt,english,greek,BCOR=20mm, footnoterule,
  lists=totoc, index=totoc, captions=bottombeside, open=any,
  iso-8859-7,latin9,utf8]{scrbook}

\usepackage[LGRx,T1,LGR]{fontenc} % define LGR and T1 encodings
\usepackage[utf8]{inputenc} % standard UTF-8 input encoding
\usepackage[english,greek]{babel}

\usepackage[a4paper]{geometry}
\geometry{tmargin=20mm,bmargin=30mm,lmargin=30mm,rmargin=30mm}

\usepackage{color}

\usepackage{units}
\usepackage[normalem]{ulem}

\usepackage[k-loose]{minitoc} % loose line spaced minitoc
\mtcsettitle{minitoc}{} % for empty title
\mtcsetrules{minitoc}{off} % turn off rules before and after the minitoc's
\mtcsetpagenumbers{minitoc}{off} % turn off page numbering in minitoc's

\usepackage[unicode=true,bookmarks=true,bookmarksnumbered=true,
  bookmarksopen=true,bookmarksopenlevel=1,breaklinks=true,
  pdfborder={0 0 0},backref=page,colorlinks=true]{hyperref}
\usepackage{bookmark} % pdf bookmarks

\hypersetup{pdftitle={Αναφορά...},
 pdfauthor={Νίκος Αλεξανδρής},
 pdfsubject={Υλοποίηση...},
 pdfkeywords={minitoc, greek, english, babel, unicode, LaTeX},
 linkcolor=blue, anchorcolor=red, pdfstartview={FitH}, 
 hyperfootnotes=false, unicode=true}

\usepackage{kerkis} % fonts
\usepackage[final,expansion=true,protrusion=true]{microtype} % kerning/margin

\newcommand{\code}[1]{\texttt{#1}} % Textclass specific LaTeX commands

\definecolor{lightgray}{gray}{0.2} % define lightgray

%%% Important!
\addto\extrasenglish{\def\encodingdefault{T1}\fontencoding{T1}\selectfont}


\begin{document}
\dominitoc


\title{\foreignlanguage{english}{An english minitoc-entry in an LGRX encoded document}}
\subtitle{\foreignlanguage{english}{A (not exactly Minimal) Working Example!}}

\author{του Νίκου Αλεξανδρή%
\thanks{\foreignlanguage{english}{\protect\href{mailto:nik@}{nik@}}}}

\maketitle

\tableofcontents

\chapter{Σχεδιασμός~και υλοποίηση}
\minitoc

\section{Δομή εγγράφου\label{sec:a}}

\section{Δομή σελίδας\label{sec:b}}
\begin{otherlanguage*}{english}
\begin{itemize}

\item \foreignlanguage{greek}{(ύψος κειμένου)}
$textheight:\,\unit[438]{pt}*\unit[0.3515]{mm}=\unit[153.957]{mm}$

\item \foreignlanguage{greek}{(πλάτος κειμένου)}
$textwidth:\,\unit[746]{pt}*\unit[0.3515]{mm}=\unit[262.219]{mm}$

\item
$\nicefrac{textwidth}{2}:\,\nicefrac{\unit[746]{pt}*\unit[0.3515]{mm}}{2}=\unit[131.1095]{mm}$
\end{itemize}
\end{otherlanguage*}

\subsection{Κεφαλίδες~και Υποσέλιδες~σημειώςεις}
\begin{otherlanguage*}{english}
\begin{itemize}
\item \sout{use }\emph{\sout{scrpage2}}\sout{ instead of }\emph{\sout{fancyheader}} (see also:
\href{http://tex.stackexchange.com/questions/11220/replacing-fancyhdr-with-scrpage2}%
  {tex.stackexchange.com/questions/11220/replacing-fancyhdr-with-scrpage2})
\end{itemize}
\end{otherlanguage*}

\subsection{Δομή πλάγιων σελίδων}

(=\foreignlanguage{english}{landscape})
\begin{otherlanguage*}{english}
\begin{itemize}
\item balance up with respect to page width!
\item in each landscape page: 2x 48\% column width(ed) boxes
\item inside column-boxes: vertically stacked, and centered, 2x photos sized
49\% of text height
\end{itemize}
\end{otherlanguage*}

\section{\texorpdfstring{\foreignlanguage{english}{Thumb index}}{Thumb
index}}
\label{Section: Thumb - Index}
\begin{otherlanguage*}{english}
\begin{itemize}
\item using \code{chapterthumbs.sty}
by Markus Kohm (e.g., among other places also to be found at
\href{file:http://www.tex.ac.uk/tex-archive/info/examples/KOMA-Script-3/Anhang-B/source/chapterthumb.sty}%
  {http://www.tex.ac.uk/tex-archive/info/examples/KOMA-Script-3/Anhang-B/source/chapterthumb.sty})
\end{itemize}
\end{otherlanguage*}

\end{document}

很少需要明确使用\selectlanguage。你给出的定义\textgreek是无用的,因为希腊语是默认语言。相反,对于英语文本,也需要类似的技巧。

直接输入σς显然是可能的。

答案2

你是如何定义英语部分的?

下列

\section{\texorpdfstring{\selectlanguage{english}Thumb index}{Thumb index}}

似乎在这里工作。

答案3

遵循 Stephan Lehmke 的建议后得到一个(虽然成功但并不完全是最小的)工作示例:

\documentclass[10pt,english,greek,BCOR=20mm, footnoterule, lists=totoc, index=totoc, captions=bottombeside, open=any, iso-8859-7,latin9,utf8,english,greem]{scrbook}

\usepackage[LGRx,T1]{fontenc} % define LGR and T1 encodings
\usepackage[utf8]{inputenc} % standard UTF-8 input encoding
\usepackage[english,greek]{babel}

\usepackage[a4paper]{geometry}
\geometry{verbose,tmargin=20mm,bmargin=30mm,lmargin=30mm,rmargin=30mm}
\setlength{\parskip}{\medskipamount}
\setlength{\parindent}{0pt}

\usepackage{units}
\PassOptionsToPackage{normalem}{ulem}
\usepackage{ulem}

\usepackage[unicode=true,
 bookmarks=true,bookmarksnumbered=true,bookmarksopen=true,bookmarksopenlevel=1,
 breaklinks=true,pdfborder={0 0 0},backref=page,colorlinks=true]
 {hyperref}
\hypersetup{pdftitle={Αναφορά...},
 pdfauthor={Νίκος Αλεξανδρής},
 pdfsubject={Υλοποίηση...},
 pdfkeywords={minitoc, greek, english, babel, unicode, LaTeX},
 linkcolor=blue, anchorcolor=red, pdfstartview={FitH}, hyperfootnotes=false, unicode=true}

\makeatletter


\DeclareRobustCommand{\greektext}{%
  \fontencoding{LGR}\selectfont\def\encodingdefault{LGR}}
\DeclareRobustCommand{\textgreek}[1]{\leavevmode{\greektext #1}}
\DeclareFontEncoding{LGR}{}{}
\DeclareTextSymbol{\~}{LGR}{126}

\newcommand{\code}[1]{\texttt{#1}} % Textclass specific LaTeX commands

\usepackage{bookmark} % pdf bookmarks
\usepackage{breakurl} % breakurl's
\usepackage{kerkis} % fonts
\usepackage[final,expansion=true,protrusion=true]{microtype} % kerning/margin

\usepackage{color}
\definecolor{lightgray}{gray}{0.2} % define lightgray

\usepackage[k-loose]{minitoc} % loose line spaced minitoc
\mtcsettitle{minitoc}{} % for empty title
\mtcsetrules{minitoc}{off} % turn off rules before and after the minitoc's
\mtcsetpagenumbers{minitoc}{off} % turn off page numbering in minitoc's


\begin{document}


\title{\selectlanguage{english}An english minitoc-entry in an LGRX encoded document}
\subtitle{\selectlanguage{english}A (not exactly Minimal) Working Example!}

\author{του Νίκου Αλεξανδρή%
\thanks{\selectlanguage{english}%
\protect\href{mailto:nik@}{nik@}\selectlanguage{greek}
%
}}

\maketitle

\selectlanguage{english}%
\dominitoc
\mtcprepare
\tableofcontents{}

\selectlanguage{greek}%
\chapter{Σχεδια\textsigmaμό\textvarsigma~και υλοποίη\textsigmaη}
\minitoc

\section{Δομή εγγράφου\label{sec:=000394=0003BF=0003BC=0003AE-=0003B5=0003B3=0003B3=0003C1=0003AC=0003C6=0003BF=0003C5}}

\section{Δομή \textsigmaελίδα\textvarsigma\label{sec:=000394=0003BF=0003BC=0003AE-=0003C3=0003B5=0003BB=0003AF=0003B4=0003B1=0003C2}}
\begin{itemize}
\item (ύψο\textgreek{c} κειμένου) \foreignlanguage{english}{$textheight:\,\unit[438]{pt}*\unit[0.3515]{mm}=\unit[153.957]{mm}$}
\item (πλάτο\textgreek{c} κειμένου) \foreignlanguage{english}{$textwidth:\,\unit[746]{pt}*\unit[0.3515]{mm}=\unit[262.219]{mm}$}
\selectlanguage{english}%
\item $\nicefrac{textwidth}{2}:\,\nicefrac{\unit[746]{pt}*\unit[0.3515]{mm}}{2}=\unit[131.1095]{mm}$
\end{itemize}

\subsection{Κεφαλίδε\textvarsigma~και Υπο\textsigmaέλιδε\textvarsigma~\textsigmaημειώ\textgreek{svει}\textvarsigma}
\selectlanguage{english}%
\begin{itemize}
\item \sout{use }\emph{\sout{scrpage2}}\sout{ instead of }\emph{\sout{fancyheader}}
\foreignlanguage{greek}{(}see also:\foreignlanguage{greek}{ }\href{http://tex.stackexchange.com/questions/11220/replacing-fancyhdr-with-scrpage2}{tex.stackexchange.com/questions/11220/replacing-fancyhdr-with-scrpage2}\foreignlanguage{greek}{)}
\end{itemize}
\selectlanguage{greek}%

\subsection{Δομή πλάγιων \textsigmaελίδων}

(=\foreignlanguage{english}{landscape})
\selectlanguage{english}%
\begin{itemize}
\item balance up with respect to page width!
\item in each landscape page: 2x 48\% column width(ed) boxes
\item inside column-boxes: vertically stacked, and centered, 2x photos sized
49\% of text height
\end{itemize}
\selectlanguage{greek}%

\section{\texorpdfstring{\selectlanguage{english}Thumb index}{Thumb index}}\foreignlanguage{english}{\label{Section: Thumb - Index}}
\selectlanguage{english}%
\begin{itemize}
\item using \code{chapterthumbs.sty}
by Markus Kohm (e.g., among other places also to be found at \href{file:http://www.tex.ac.uk/tex-archive/info/examples/KOMA-Script-3/Anhang-B/source/chapterthumb.sty}{http://www.tex.ac.uk/tex-archive/info/examples/KOMA-Script-3/Anhang-B/source/chapterthumb.sty})
\end{itemize}

\end{document}

相关内容