質問用フォーラムです。ご質問の前に質問のしかたをご覧ください。

changebar.sty とLualatex

- nori mori の投稿

よろしくお願いします。

下記のファイルでエラーになります。

-------------------------- ここから

\documentclass{jlreq}

\usepackage{changebar}

\begin{document}

test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test
\cbstart
change change change change change change change change change change change change change change 
\cbend
test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test

\end{document}

--------------------- ここまで

1行目が「\documentclass{jsarticle}」ならエラーは出ません。

emacs上のeshellで実行したときのエラーメッセージは以下のとおりです。

-------------------- ここから

~/tex-rensyu $ lualatex.exe changebar-lua.tex 

This is LuaHBTeX, Version 1.18.0 (TeX Live 2024) 
 restricted system commands enabled.
(./changebar-lua.tex
LaTeX2e <2024-06-01> patch level 2
L3 programming layer <2024-05-27>
 (c:/texlive/2024/texmf-dist/tex/latex/jlreq/jlreq.cls
Document Class: jlreq 2024/02/16 jlreq

  --- 略 ---

No file changebar-lua.aux.
(c:/texlive/2024/texmf-dist/tex/latex/base/ts1cmr.fd)
! Undefined control sequence.
\cb@defpoint ...ount }}\let \the =\z@ \pdfsavepos 
                                                  \edef \cb@temp {\write \@a...

l.9 c
   hange change change change change change change change change change chan...

---------------------- ここまで

changebarのバージョンは以下のとおりです。

  [2024/07/17 v3.7e Indicate changes with marginal bars]

ネットでpdfsaveposとsaveposの情報を散見するのですが、私には少しむつかしいです。

解決策をお教えいただければ感謝です。

論文を英文化したときの問題

- matushiro 97 の投稿

日本語の論文を英訳したいのですがいくつか解決できない問題が発生しました.
ファイルのサイズは大きく種類も多いのですが,一部を抜粋したときに問題が再現されないかもしれないので元のファイルをそのままアップします.
使用しているツールはTexWorksでLukaTexを使用しています.
解決策をご教示いただければ幸いです.

日本語論文.tex→日本語論文です.
英語論文.tex→英語論文です

preamble.tex→日本語論文.texで使用するプリアンブル部分."日本語論文.tex"の先頭の\input命令で読み込む.
preamble_E.tex→英語論文.texで使用するプリアンブル部分."英語論文.tex"の先頭の\input命令で読み込む.
preamble.texとpreamble_E.texの違いは二点です.
a.\newtheorem命令の表示がpreamble.texは日本語で,preamble_E.texは英語
b.preamble.texの\documentclassは"ltjsarticle"だけだが,preamble_E.texでは"ltjsarticle"と"larticle"の2つあり,1つをコメントアウトして選べるようになっている.

問題点:
1.日本語論文.texはコンパイルできてPDFファイルを出力します.これは問題ありません.
2.英語語論文.texはpreamble_E.texで"ltjsarticle"を選ぶとコンパイルできてPDFファイルを出力しますが,"larticle"を選ぶとコンパイルできません."ltjsarticle"のままでは,「目次」「概要」など組み込み済みの見出しが日本語なので,"larticle"(または適切な英論文のテンプレート)に変える必要があります.preamble_E.texや英語語論文.texの何を修正すればよいのでしょうか.
3.英語語論文.texはpreamble_E.texで"ltjsarticle"を選びコンパイルできた時でも,目次の"Appendix1"と"Deviation"の文字が重なって表示される.ちなみに,日本語論文の目次では「付論1 3次元技術面と1次元価値面の導出」のように適切に表示される.

4.本文中の見出しに脚注を付ける場合がありますが,そうすると目次にもこの脚注が再現されます.目次の脚注を表示させない方法はありますでしょうか.日本語論文,英語論文に共通の問題です.tocファイルを修正する方法ですとコンパイルするたびに上書きされるので,できれば避けたいです.tocの修正以外の解決策がなければ,\inhibitglue \footnotes@ve {…}を削除すればいいと思うのですが,削除したあとにコンパイルすると修正が上書きされるので,どうすればいいかわかりません.

よろしくお願いします.

image.png

タグ:

重複ラベルをリストアップする方法

- matushiro 97 の投稿

TeXworksを使っています.重複ラベルの一覧を取得する方法はありますでしょうか.

バージョンは以下とおりです.

よろしくお願いします.
image.png

[uplatex] marginpar + manyfoot

- 奥村 晴彦 の投稿
次のようなご質問をメールでいただきました。
わかるかた、おられますでしょうか?

I'm using uplatex for vertical typesetting, using manyfoot and marginpar together seems to cause some problem. Below is a minimal code that reproduce the problem:

\documentclass{utbook} % works if \documentclass{book} is used%
\usepackage[para*]{manyfoot}
\DeclareNewFootnote[para]{A}[default]

\begin{document}
Lorem ipsum dolor sit amet, consectetur adipiscing
elit.\FootnotetextA{abc} % works if no footnotes used
Aliquam gravida nec nulla sit amet
rutrum.

\marginpar[]{abc}%

\end{document}

The file compiles if I remove manyfoot.

ヘッダーと本文の間に隙間を空けたい

- 伊藤 直人 の投稿
昨日に続けて質問失礼します。 昨日、リンク先のような、質問をさせていただきました。 https://okumuralab.org/tex/mod/forum/discuss.php?d=3812 昨日は気づきませんでしたがヘッダーと本文の隙間が少し、狭いことに気づきました。そこでヘッダーと本文の間をたとえば、1文字開けるということをしたい場合、どうしたら良いでしょうか。 いろいろと試してみましたが自分では解決することでできず、ここにお知恵を拝借しにきた次第です。 ご教授いただけましたら幸いです。よろしくお願いいたします。

ヘッダーと本文の間に隙間を空けたい

- 伊藤 直人 の投稿
昨日に続けて質問失礼します。

昨日、リンク先のような、質問をさせていただきました。
https://okumuralab.org/tex/mod/forum/discuss.php?d=3812

昨日は気づきませんでしたがヘッダーと本文の隙間が少し、狭いことに気づきました。そこでヘッダーと本文の間をたとえば、1文字開けるということをしたい場合、どうしたら良いでしょうか。
いろいろと試してみましたが自分では解決することでできず、ここにお知恵を拝借しにきた次第です。

ご教授いただけましたら幸いです。よろしくお願いいたします。

jlreqのヘッダーで章見出し行の高さの半分と画像の高さの半分の位置が一致するようにしたい

- 伊藤 直人 の投稿
現在、添付しましたファイルのようにヘッダー部分の左側に章見出しを、右側に画像を配置するようにしています。
その際、章見出し行の高さの半分と画像の高さの半分の位置が一致するようにしたいと考えています。
現在、ソースだとある程度一致しているような感じがしますが画像はフォーラム投稿用に用意したもので実際に用いたい物とは異なるため、画像サイズが変わっても章見出し行と画像の上記の関係が保たれるものが良いと思い、いろいろと試してみましたが自分では解決することでできず、ここにお知恵を拝借しにきた次第です。

説明等至らぬ点があるかもしれませんがご教授いただけましたら幸いです。

natbib を使用して、ジャーナル名をシングルクォーテーションで囲むカスタムスタイルを設定するのに

- Sujeet Pradhan の投稿

natbib を使用して、ジャーナル名をシングルクォーテーションで囲むカスタムスタイルを設定するのに、どうすればよろしいでしょうか?教えていただけませんでしょうか?

よろしくお願いします。

% -*- coding: utf-8 -*-
\documentclass[dvipdfm,12pt]{book}

\usepackage{href-ul} % for doi href link 
% for mixing narrative and parenthesis style citation

\usepackage{natbib}
\setcitestyle{authoryear,open={(},close={)},aysep={,},yysep={;},maxcitenames=3}
\setlength\bibsep{0.5\baselineskip}
% Hanging Indentation for the references
\setlength{\bibhang}{0pt} 

% ジャーナル名をシングルクォーテーションで囲む設定


%%%%%%%%%%%%%%%%%%%%%%%%

\begin{document}

\citep{RN11}

\citet{RN10}

\end{document}

\bibliographystyle{apalike}

\bibliography{myreferences} %

tikz 矢印の上に斜線

- mathema の投稿
\documentclass{beamer} 
%\usepackage[utf8]{inputenc}
 
\newcommand{\maru}[1]{\ooalign{
\hfil\resizebox{.8\width}{\height}{#1}\hfil
\raise.1ex\hbox{\large$\bigcirc$}}}%encircle
\usepackage{fancybox}%about frame
%\usepackage{luatexja}%japanese
\usepackage{tikz}
\usetikzlibrary{positioning}
\usetikzlibrary{cd}%tikzcd
\usetikzlibrary{decorations.pathmorphing}
\usepackage{xcolor}
\usepackage{graphics}%reverse
\usepackage{graphicx}%about scalebox
\usepackage{amsmath,amsfonts,amsthm,amssymb,amscd,ascmac}%in order to  higher formula and mathfrak and so on.
\usepackage{latexsym, mathtools}%arrow
\usepackage{textcomp}%※
\usepackage{bussproofs}%prooftree
\usepackage{pifont}
\usepackage{subfigure}
\usepackage{lscape}%%revolve
\usepackage{stmaryrd}%bracket
\usepackage{cancel}%diagonal line on a letter
\usepackage{hyperref}%reference
\usepackage{setspace}%
\usepackage{soul}%下線
\usepackage{comment}
\usepackage{wrapfig}%回り込み
\usepackage{qrcode}
\usepackage{luatexja-otf}%ajRightBArrow等
\usepackage{multicol}%itemize並列版
\usepackage{enumerate}
\usepackage{tikz-cd}
\usetikzlibrary{arrows}
\usepackage{tasks}%itemize並列版
 
\definecolor{deepskyblue}{rgb}{0.0, 0.75, 1.0}
\definecolor{dodgerblue}{rgb}{0.12, 0.56, 1.0}
 
\setbeamercovered{transparent}
\setbeamertemplate{theorems}[numbered]
\setbeamertemplate{footline}[frame number]
\setbeamertemplate{navigation symbols}{}
 
\newcommand{\red}[1]{\textcolor{red}{#1}}
 
\renewcommand{\baselinestretch}{1.3}%Leave a space between lines
\renewcommand{\arraystretch}{1}%arrayの行間を変える
 
 
\parindent = 0pt%no indent
 
 
\usetheme{Madrid}%テーマは指定しなくともよい.
 
\usepackage[%
backend  = biber,
bibstyle = ieee,
]{biblatex}
%
%\nocite{*}
\addbibresource{bib_name.bib}
 
\begin{document} 

\begin{lemma}[Separations of logics]
    \begin{center}
        \begin{minipage}{.6\linewidth}
            \begin{figure}[H]
                \centering
                \begin{tikzpicture}[scale = 0.55, transform shape,auto,every node/.style={rectangle,rounded corners}]
                    \node[draw, align=center](LJN) at (4,12) {$\mathsf{LN}+(\mathsf{PE})+(\mathsf{An})$\\$\text{(Intuitionistic logic)}$};
                    \node[draw](LNPELP) at (0,10) {$\mathsf{LN+(PE)+(LP)}$};
                    \node[draw](LNAnDNPE) at (8,10.5) {$\mathsf{LN+(An)+(DNPE)}$};
                    \node[draw, align=center](LNAn) at (8,8.75) {$\mathsf{LN}+(\mathsf{An})$\\$\text{(Minimal logic)}$};
                    \node[draw, align=center](LNPE) at (0,8) {$\mathsf{LN+(PE)}$\\ 
                        $(\text{Co-minimal logic})$};
                    \node[draw](LNAn-LP) at (8,7) {$\mathsf{LN+(An}^-)+(\mathsf{LP})$};
                    \node[draw](LNAn-) at (4,6) {$\mathsf{LN+(An}^-)$};
                    \node[draw](LNCo) at (4,4) {$\mathsf{LN+(Co)}$};
                    \node[draw](LNPE-) at (0,4) {$\mathsf{LN+(PE}^-)$};
                    \node[draw](LNNeF) at (4,2) {$\mathsf{LN+(NeF)}$};
                    \node[draw](LN) at (4,0) {$\mathsf{LN}$};
                    \draw [right hook->](LJN) -- (LNPELP);
                    \draw[right hook->] (LJN)--(LNAnDNPE);
                    \draw [left hook->] (LNAnDNPE)--(LNAn)node[pos=0.4]{\Huge$/$};
                    \draw [left hook->] (LNPELP)--(LNPE);
                    \draw [left hook->] (LNPELP)--(LNAn-LP);
                    \draw [left hook->] (LNPE)--(LNAn-);
                    \draw [left hook->] (LNAn)--(LNAn-LP);
                    \draw [right hook->] (LNAn-LP)--(LNAn-);
                    \draw [left hook->] (LNAn-)--(LNCo);
                    \draw [left hook->] (LNCo)--(LNNeF);
                    \draw [left hook->] (LNNeF)--(LN);
                    \draw [left hook->] (LNPE)--(LNPE-);
                    \draw [left hook->] (LNPE-)--(LN);
                \end{tikzpicture}
                \label{fig6}
            \end{figure}
        \end{minipage}
    \end{center}
\end{lemma}
\end{frame}

\end{document}

参考文献はhttps://alg-d.com/math/tikz.pdfこのPDFの30ページあたりを参考にし、texliveを用いてtexstudio上で上記のコードを書きました。

書きたいこととしましては、上記のコードで出力される図の矢印全ての上にうまい具合に斜線を引きたいのですが、環境もしくはコードの書き方が良くないのか上手く出力されません(実際にはズレて出力されます)。

よろしければご教授よろしくお願いします。

\NewPageStyleによるthumb indexの作成について

- 北川 直樹 の投稿

latexで添付したテキストのようなpagestyleを作りたいと思い,jlreqの\NewPageStyleを用いて,以下のようにpagestyleをカスタマイズしていました。

\NewPageStyle{thumbindexstyle}{%
    running_head_position={top-right},
    odd_running_head={_section},
    even_running_head={_chapter},
    mark_format={
        _section={\S \thesection\hspace{1\zw}#1},
        _chapter={第\thechapter 回\hspace{1\zw}#1}
    },
    odd_head_format={
        #1\hspace{3\zw}
        \begin{tikzpicture}
            \useasboundingbox (0,0) rectangle (0,0) ;
            \node[anchor=south west] at(1\zw,-0.35\zw) {\thepage} ;
            \fill[black] (0,-0.2) -- (-0.35,-0.2) -- (-0.35,2) -- (0,2) -- cycle ;
            % ツメ(奇数ページ)
            \pgfmathparse{mod(\thechapter,13) == 0 ? 1 : mod(\thechapter, 13)}
            \let\modchapter=\pgfmathresult
            % \textheight の 1/12 を計算
            \pgfmathparse{1/12*\textheight}
            \let\calcheight=\pgfmathresult
            % \calcheight × \modchapter の座標を計算
            \pgfmathparse{\calcheight*(\modchapter-1)+\headsep}
            \let\yt=\pgfmathresult
            % \calcheight × (\modchapter - 1) の座標を計算
            \pgfmathparse{\calcheight*\modchapter+\headsep}
            \let\yb=\pgfmathresult
            % 塗りつぶし
            \fill[black,rounded corners=5pt] (1,-\yt pt) -- (1,-\yb pt) -- (3,-\yb pt) -- (3,-\yt pt) -- cycle ;
        \end{tikzpicture}
    },
    even_head_format={
        \begin{tikzpicture}
            \useasboundingbox (0,0) rectangle (0,0) ;
            % ページ番号と見出しの境界線
            \node[anchor=south east] at(-1\zw,-0.35\zw) {\thepage} ;
            \fill[black] (0,-0.2) -- (0.35,-0.2) -- (0.35,2) -- (0,2) -- cycle ;
            % ツメ(偶数ページ)
            \pgfmathparse{mod(\thechapter,13) == 0 ? 1 : mod(\thechapter, 13)}
            \let\modchapter=\pgfmathresult
            % \textheight の 1/1 を計算
            \pgfmathparse{1/12*\textheight}
            \let\calcheight=\pgfmathresult
            % \calcheight × \modchapter の座標を計算
            \pgfmathparse{\calcheight*(\modchapter-1)+\headsep}
            \let\yt=\pgfmathresult
            % \calcheight × (\modchapter - 1) の座標を計算
            \pgfmathparse{\calcheight*\modchapter+\headsep}
            \let\yb=\pgfmathresult
            % 塗りつぶし
            \fill[black,rounded corners=5pt] (-1,-\yt pt) -- (-1,-\yb pt) -- (-3,-\yb pt) -- (-3,-\yt pt) -- cycle ;
        \end{tikzpicture}
        \hspace{3\zw}#1
    }
}
 
ここで,ツメはchapterが変わるごとにその位置をリセットしていき,ツメ一つの大きさは\textheightの1/12の大きさになるようにし,また,chapterが13に達すると,ツメの位置がchapter 1のときの位置に戻り,以後繰り返していくようにしました。

このコードでコンパイルすると,chapter 1からchapter 12までは期待通りに出力されました。しかし,chapter 13とchapter 14のときのツメが同じ高さに出力されてしまいます。

modに原因があると思うのですが,回避方法を見出すことができなかったので,ここで質問させていただきます。つまり,chapter 13とchapter 14のときのツメの位置がchapter 1とchapter 2のそれと同じようになる方法をお教えいただきたいです。

以下にコード全体を示しておきます。Lualatex+jlreqです。よろしくお願いします。

\documentclass[book,twoside]{jlreq}
\usepackage{tikz}
\usetikzlibrary{arrows.meta,positioning,shadows}
\usetikzlibrary{bending,decorations.shapes}
\usetikzlibrary{intersections,calc,through,automata}
\usetikzlibrary{decorations.pathmorphing}
\usetikzlibrary{cd}
\usepackage{pgfmath}
\usepackage{color}
\usepackage[top=20truemm,inner=20truemm,outer=18truemm,bottom=8truemm]{geometry}
\usepackage{lipsum}
\NewPageStyle{thumbindexstyle}{%
    running_head_position={top-right},
    odd_running_head={_section},
    even_running_head={_chapter},
    mark_format={
        _section={\S \thesection\hspace{1\zw}#1},
        _chapter={第\thechapter 回\hspace{1\zw}#1}
    },
    odd_head_format={
        #1\hspace{3\zw}
        \begin{tikzpicture}
            \useasboundingbox (0,0) rectangle (0,0) ;
            \node[anchor=south west] at(1\zw,-0.35\zw) {\thepage} ;
            \fill[black] (0,-0.2) -- (-0.35,-0.2) -- (-0.35,2) -- (0,2) -- cycle ;
            % ツメ(奇数ページ)
            \pgfmathparse{mod(\thechapter,13) == 0 ? 1 : mod(\thechapter, 13)}
            \let\modchapter=\pgfmathresult
            % \textheight の 1/12 を計算
            \pgfmathparse{1/12*\textheight}
            \let\calcheight=\pgfmathresult
            % \calcheight × \modchapter の座標を計算
            \pgfmathparse{\calcheight*(\modchapter-1)+\headsep}
            \let\yt=\pgfmathresult
            % \calcheight × (\modchapter - 1) の座標を計算
            \pgfmathparse{\calcheight*\modchapter+\headsep}
            \let\yb=\pgfmathresult
            % 塗りつぶし
            \fill[black,rounded corners=5pt] (1,-\yt pt) -- (1,-\yb pt) -- (3,-\yb pt) -- (3,-\yt pt) -- cycle ;
        \end{tikzpicture}
    },
    even_head_format={
        \begin{tikzpicture}[remember picture]
            \useasboundingbox (0,0) rectangle (0,0) ;
            % ページ番号と見出しの境界線
            \node[anchor=south east] at(-1\zw,-0.35\zw) {\thepage} ;
            \fill[black] (0,-0.2) -- (0.35,-0.2) -- (0.35,2) -- (0,2) -- cycle ;
            % ツメ(偶数ページ)
            \pgfmathparse{mod(\thechapter,13) == 0 ? 1 : mod(\thechapter, 13)}
            \let\modchapter=\pgfmathresult
            % \textheight の 1/1 を計算
            \pgfmathparse{1/12*\textheight}
            \let\calcheight=\pgfmathresult
            % \calcheight × \modchapter の座標を計算
            \pgfmathparse{\calcheight*(\modchapter-1)+\headsep}
            \let\yt=\pgfmathresult
            % \calcheight × (\modchapter - 1) の座標を計算
            \pgfmathparse{\calcheight*\modchapter+\headsep}
            \let\yb=\pgfmathresult
            % 塗りつぶし
            \fill[black,rounded corners=5pt] (-1,-\yt pt) -- (-1,-\yb pt) -- (-3,-\yb pt) -- (-3,-\yt pt) -- cycle ;
        \end{tikzpicture}
        \hspace{3\zw}#1
    }
}
\pagestyle{thumbindexstyle}

\begin{document}

\title{thumb index pagestyle}
\author{※ 偶数ページ・奇数ページ確認用タイトル}
\maketitle

\foreach \c in {1,...,24} {
    \chapter{Chapter \c}
   
    \section{Section 1}
    \lipsum[1-3]
   
    \section{Section 2}
    \lipsum[4-6]
   
    \section{Section 3}
    \lipsum[7-9]

    \section{Section 4}
    \lipsum[10-12]
}

\end{document}
添付 参考テキスト.JPG