zr-tex8r / bxjscls Goto Github PK
View Code? Open in Web Editor NEWLaTeX jsclasses document classes adapted to any engines
License: BSD 2-Clause "Simplified" License
LaTeX jsclasses document classes adapted to any engines
License: BSD 2-Clause "Simplified" License
Version 2.2のBXjscls
に収められているbxjsarticle
クラスを使い、pandocを経由してPDF作成を行っております。下記のようなtexファイルをコンパイルしているのですが、本文中に\texttt{}
があると、それ以後のローマン体のフォントが強制的にComputer Modernに変わり、ローマン体のフォントサイズも極めて小さくなってしまいます。article
クラスなど他のdocumentclass
では発生しない挙動ですので、おそらくbxjsarticle
に原因があるのではないかと思い、こちらにご連絡いたしました。改善のために、何か私の方で可能な設定などございましたら、ご教示いただけないでしょうか。何卒よろしくお願い申し上げます。
% Options for packages loaded elsewhere
\PassOptionsToPackage{unicode}{hyperref}
\PassOptionsToPackage{hyphens}{url}
\PassOptionsToPackage{space}{xeCJK}
%
\documentclass[
pandoc]{bxjsarticle}
\usepackage{lmodern}
\usepackage{amssymb,amsmath}
\usepackage{ifxetex,ifluatex}
\ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0 % if pdftex
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{textcomp} % provide euro and other symbols
\else % if luatex or xetex
\usepackage{unicode-math}
\defaultfontfeatures{Scale=MatchLowercase}
\defaultfontfeatures[\rmfamily]{Ligatures=TeX,Scale=1}
\setmainfont[]{Libertinus Serif}
\ifxetex
\usepackage{xeCJK}
\setCJKmainfont[]{SourceHanSerifJP-Light.otf}
\fi
\ifluatex
\usepackage[]{luatexja-fontspec}
\setmainjfont[]{SourceHanSerifJP-Light.otf}
\fi
\fi
% Use upquote if available, for straight quotes in verbatim environments
\IfFileExists{upquote.sty}{\usepackage{upquote}}{}
\IfFileExists{microtype.sty}{% use microtype if available
\usepackage[]{microtype}
\UseMicrotypeSet[protrusion]{basicmath} % disable protrusion for tt fonts
}{}
\makeatletter
\@ifundefined{KOMAClassName}{% if non-KOMA class
\IfFileExists{parskip.sty}{%
\usepackage{parskip}
}{% else
\setlength{\parindent}{0pt}
\setlength{\parskip}{6pt plus 2pt minus 1pt}}
}{% if KOMA class
\KOMAoptions{parskip=half}}
\makeatother
\usepackage{xcolor}
\IfFileExists{xurl.sty}{\usepackage{xurl}}{} % add URL line breaks if available
\IfFileExists{bookmark.sty}{\usepackage{bookmark}}{\usepackage{hyperref}}
\hypersetup{
pdftitle={Untitled},
hidelinks,
pdfcreator={LaTeX via pandoc}}
\urlstyle{same} % disable monospaced font for URLs
\usepackage{longtable,booktabs}
% Correct order of tables after \paragraph or \subparagraph
\usepackage{etoolbox}
\makeatletter
\patchcmd\longtable{\par}{\if@noskipsec\mbox{}\fi\par}{}{}
\makeatother
% Allow footnotes in longtable head/foot
\IfFileExists{footnotehyper.sty}{\usepackage{footnotehyper}}{\usepackage{footnote}}
\makesavenoteenv{longtable}
\usepackage{graphicx}
\makeatletter
\def\maxwidth{\ifdim\Gin@nat@width>\linewidth\linewidth\else\Gin@nat@width\fi}
\def\maxheight{\ifdim\Gin@nat@height>\textheight\textheight\else\Gin@nat@height\fi}
\makeatother
% Scale images if necessary, so that they will not overflow the page
% margins by default, and it is still possible to overwrite the defaults
% using explicit options in \includegraphics[width, height, ...]{}
\setkeys{Gin}{width=\maxwidth,height=\maxheight,keepaspectratio}
% Set default figure placement to htbp
\makeatletter
\def\fps@figure{htbp}
\makeatother
\setlength{\emergencystretch}{3em} % prevent overfull lines
\providecommand{\tightlist}{%
\setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}}
\setcounter{secnumdepth}{5}
\ifluatex
\usepackage{selnolig} % disable illegal ligatures
\fi
\title{Untitled}
\author{}
\date{\vspace{-2.5em}2020/9/12}
\begin{document}
\maketitle
{
\setcounter{tocdepth}{2}
\tableofcontents
}
% Comment out the following line, if you want to check whether the malfunction caused by \texttt environ. disappears.
\texttt{a} changes the font and font size of non-CJK rm characters.
\hypertarget{r-markdown}{%
\subsection{R Markdown}\label{r-markdown}}
This is an R Markdown document.
Markdown is a simple formatting syntax for authoring HTML, PDF, and MS Word documents.
For more details on using R Markdown see \url{http://rmarkdown.rstudio.com}.
When you click the \textbf{Knit} button a document will be generated that includes both content
as well as the output of any embedded R code chunks within the document.
\end{document}
558bb0a において bxjsbook, bxjsreport の \frontmatter の定義の先頭部分が欠落しています。
以下の文書をコンパイルするとコンパイルエラーになります。
\documentclass[autoditect-engine,dvi=dvipdfmx,ja=standard,a4paper,12Q]{bxjsarticle}
\begin{document}
吾輩は猫である。名前はまだ無い。
\end{document}
エラー:
! Undefined control sequence.
\ds@12Q ->\bxjs@setjbasefontsize
{3mm}
l.629 \ProcessOptions\relax
\bxjs@setjbasefontsize
は 65b544a で削除されているようです。
Line 5850 in 542f815
forum;2639#p15477 を見ると,ここはスペースを入れたほうが安全そうです。
macOS 10.12.6
LuaTeX 1.0.4 (TeX Live 2017)
bxjscls 1.5d
zxjatype 0.6b
以上の環境で次の文書をコンパイルするとエラーになります。
\documentclass[a4paper,ja=standard,lualatex]{bxjsarticle}
\begin{document}
\end{document}
エラー:
! Undefined control sequence.
<recently read> \patchcmd
l.31 ...ame TU\string\textasteriskcentered\endcsname
{\char}{\ltjalchar}{}{}
macOS 10.12.6
XeTeX 3.14159265-2.6-0.99998 (TeX Live 2017)
bxjscls 1.5d
以上の環境で、次の書類をコンパイルするとエラーになってしまいます。
\documentclass[xelatex,ja=standard]{bxjsarticle}
\begin{document}
\end{document}
エラー:
! Undefined control sequence.
<argument> \cs_if_eq:p:NN
l.371 ...eq:p:NN \inhibitglue \prg_do_nothing: ) }
\documentclass[ja=standard, xelatex]{bxjsarticle}
で以下のようなエラーが出ます。
! Too many }'s.
l.451 }
\bxjs@next
bxjsja-standard.defの450行目で読み込まれるzxjafontのバージョンを[2015/05/08]にしたところ発生しなくなります。
MacTex 2017 を現時点で最新の状態 (sudo tlmgr update --self --all
) で使っているのですが、xelatex
エンジンで -V classoption=jafont=ipaex
としてフォントを指定すると
! Too many }'s.
l.451 }
というエラーが出て pandoc が終了します。
jafont
の指定を外すと正常にPDFを出力します。
pandoc のバージョンは 1.19.2.1、bxjscls のバージョンは 1.5c です。
このエラーは、
# test
test markdown
という簡単な markdown ファイルを使い、pandoc test.md -o test.pdf --latex-engine=xelatex -V documentclass=bxjsarticle -V classoption=pandoc -V classoption=jafont=ipaex
を実行することで再現を確認しています。
また、pandoc
の --verbose
オプションをつけると、
...(略)...
(/usr/local/texlive/2017/texmf-dist/tex/latex/graphics-def/xetex.def)))))
(/usr/local/texlive/2017/texmf-dist/tex/xelatex/xunicode/xunicode.sty
*** Reloading Xunicode for encoding 'TU' ***
) (/usr/local/texlive/2017/texmf-dist/tex/xelatex/xecjk/xunicode-extra.def)
(/usr/local/texlive/2017/texmf-dist/tex/xelatex/xecjk/xeCJK.cfg)))
! Too many }'s.
l.451 }
\bxjs@next
No pages of output.
と出ます(抜粋)。
この出力を見る限り、xeCJK や zxjatype のほうに起因するのかもしれないので、こちらで報告するのは場違いかもしれませんが、ご報告申し上げます。
casesパッケージが3.0にアップデートされて以降、numcases, subnumcases環境を使うと数式の位置が右に寄ってしまう。
casesパッケージの作者に報告すべきかとも思いましたが、jsarticleでは発生しなかったので、こちらに報告しました。
%\documentclass[uplatex,a4paper]{jsarticle}
\documentclass[a4paper,uplatex,dvipdfmx,ja=standard]{bxjsarticle}
\usepackage{cases}
\begin{document}
\section{hoge}
fuga
\begin{numcases}{y= }
x^{10}+x^9+x^8+x^7+x^6+x^5+x^4+x^3+x^2+x+1& $0 < x < 10$ \\
0& otherwise
\end{numcases}
\end{document}
# ふと思い出して試してみたら、v1.2a でも状況が同じだったので。
twitter:697919431884713984 の話です。
\documentclass[twocolumn,platex,dvipdfmx,ja=standard]{bxjsarticle}
\setpagelayout*{margin=15truemm}
\setlength{\columnseprule}{0.5pt}
\begin{document}
あ
\end{document}
このレイアウトが、jsarticle で等価と思われる以下のソースと異なり、分割線とページ番号が重なってしまいます。これは意図どおりなのでしょうか。
\documentclass[twocolumn]{jsarticle}
\usepackage[dvipdfm,margin=15truemm]{geometry}
\setlength{\columnseprule}{0.5pt}
\begin{document}
あ
\end{document}
bxjsbook に関する残念な話とはまた別だ、と思っています。
XeLaTeX・Lua(JIT)LaTeXで以下のTeX文書をコンパイルすると数式が横長に出力されます。
\documentclass[autodetect-engine,dvipdfmx-if-dvi,ja=standard,nomag*,14pt]{bxjsarticle}
\usepackage{ifptex,iftex}
\usepackage{amsmath}
\ifptex
\usepackage{lmodern}
\else
\usepackage{unicode-math}
\fi
\title{テスト}
\author{テスト 太郎}
\begin{document}
\maketitle
\section{オイラーの公式}
オイラーの公式を式\ref{eq:eular}に示す。
\begin{equation}\label{eq:eular}
e^{i\theta} = \cos\theta + i\sin\theta
\end{equation}
これに$\theta = \pi$を代入すると式\ref{eq:eular2}を得る。
\begin{equation}\label{eq:eular2}
e^{-i\pi} = -1
\end{equation}
\end{document}
LuaTeX-jaの方にはすでにissueを立てています。
https://osdn.net/projects/luatex-ja/ticket/37828
It loaded here if it exists.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.