\documentclass{article}
\usepackage{polyglossia}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\setdefaultlanguage{german}
\setotherlanguage{hindi}
\setotherlanguage{tibetan}
\newfontfamily\devanagarifont[Script=Devanagari,Mapping=harvardkyoto]{Sanskrit 2003}
\newfontfamily\tibetanfont{TibetanMachineUni.ttf}
\usepackage{xeCJK}
\setCJKmainfont[BoldFont=SimHei]{SimSun}
\usepackage{ctib}
\font\tibfont="Tibetan Machine Uni" at 11 pt
\usepackage[series={},nocritical,noend,noeledsec,nofamiliar,noledgroup]{reledmac}
\usepackage[nomaxlines]{reledpar}
% this are counter-macros for the parallel stuff
\newcounter{paral}
\setcounter{paral}{0}
\newcounter{parar}
\setcounter{parar}{0}
\newcommand{\sect}[1]{\pstart\centering{{\Large #1}} \\\pend}
\newcommand{\pdl}[2]{\expandafter\def\csname pul#1\endcsname{\addtocounter{paral}{1}\pstart\arabic{paral} #2 \\ \pend}}
\newcommand{\pdr}[2]{\expandafter\def\csname pur#1\endcsname{\addtocounter{parar}{1}\pstart\arabic{parar} #2 \\ \pend}}
% "d" for "define", "u" for "use".
\pdr{b}{\begin{tabular}{ p{7cm} p{7cm} } \textbf{Skt: }\foreignlanguage{hindi}{tatra bhagavAn AyuSmantam AnandaM Amantrayate AgamayAnanda yena vaizAlI}\\ \textbf{Tib:} {\large \foreignlanguage{tibetan}{དེ་ནས་བཅོམ་ལྡན་འདས་ཀྱིས་ཚེ་དང་ལྡན་པ་ཀུན་དགའ་བོ་གྲོང་ཁྱེར་ཡངས་པ་ཅན་གང་ན་བར་འདོང་ངོ་ཞེས་བཀའ་སྩལ་པ་དང་།}} & \textbf{T06:} 佛請賢者阿難,\\ \textbf{T05:} 佛從竹芳聚\footnote{Hier fehlt warscheinlich ein 出, siehe Parallel TODO: Parallel einfuegen} ,呼阿難:「且復還至維耶梨國。」 \\ \end{tabular}}
\pdl{b}{\begin{tabular}{ p{7cm} p{7cm} } \textbf{DN 16:} \emph{}& \textbf{D\={A}2:} \\ \textbf{T07:} 如是我聞: 一時,佛在毘耶離大林中重閣講堂,與大比丘眾千二百五十人俱。\\ \end{tabular}}
\pdr{c}{\begin{tabular}{ p{7cm} p{7cm} } \textbf{Skt: }\foreignlanguage{hindi}{evaM bhadantety AyuSmAn Anando bhagavataH pratyazrauSIt atha bhagavAn vRjiSu janapadeSu caryAM caran vaizAlyAM viharati markkaTahradatIre kUTAgArazAlAyAM}\\ \textbf{Tib:} {\large \foreignlanguage{tibetan}{བཙུན་པ་དེ་བཞིན་བགྱིའོ་ཞེས་ཆེ་དང་ལྡན་པ་ཀུན་དགའ་བོས་བཅོམ་ལྡན་འདས་ལས་མཉན་ཏེ། དེ་ནས་བཅོམ་ལྡན་འདས་ཡུལ་བྲྀ་ཛི་ནས་ལྗོངས་རྒྱུ་ཞིང་གྲོང་ཁྱེར་ཡངས་པ་ཅན་དུ་བྱོན་ཏེ་ཡངས་པ་ཅན་གྱི་སྤྲེའུ་རྫིང་གི་འགྲམ་ཁང་བཟངས་བརྩེགས་པའི་གནས་ན་བཞུགས་སོ། །}} & \textbf{T06:} 受教即行。既到止猿猴館,\\ \textbf{T05:} 阿難言:「受教。」佛還維耶梨國, \\ \end{tabular}}
\pdl{c}{\begin{tabular}{ p{7cm} p{7cm} } \textbf{DN 16:} \emph{atha kho bhagav\={a} pubba\d nhasamaya\d m niv\={a}setv\={a} pattac\={\i}varam \={a}d\={a}ya ves\={a}li\d m pi\d n\d d\={a}ya p\={a}visi}& \textbf{D\={A}2:} \\ \textbf{T07:} 爾時,世尊而與阿難,於晨朝時,著衣持缽,入城乞食,\\ \end{tabular}}
\pdr{d}{\begin{tabular}{ p{7cm} p{7cm} } \textbf{Skt: }\foreignlanguage{hindi}{atha bhagavAn pUrvAhNe niyasya pAtracIvaraM AdAya vaizAlIM piNDAya prAvizad AyuSmatAnandena pazcAt zramaNena}\\ \textbf{Tib:} {\large \foreignlanguage{tibetan}{དེ་ནས་བཅོམ་ལྡན་འདས་སྔ་དྲོ་ཤམ་ཐབས་དང་། ཆོས་གོས་མན་བས་ལྷུང་བཟེད་བསྣམས་ཏེ། ཡངས་པ་ཅན་དུ་ཞབས་འབྲིང་བའི་དགེ་སྦྱོང་ཀུན་དགའ་བོ་དང་བསོད་སྙོམས་ལ་ཞུགས་སོ། །}} & \textbf{T06:} 行乞食畢,滌缽澡洗,\\ \textbf{T05:} 入城持缽行分衛, \\ \end{tabular}}
\pdl{d}{\begin{tabular}{ p{7cm} p{7cm} } \textbf{DN 16:} \emph{ves\={a}liya\d m pi\d n\d d\={a}ya caritv\={a} pacch\={a}bhatta\d m pi\d n\d dap\={a}tapa\d tikkhanto}& \textbf{D\={A}2:} \\ \textbf{T07:} 還歸所止,食竟洗漱,收攝衣缽,\\ \end{tabular}}
\begin{document}
\begin{pages} \begin{Leftside}\beginnumbering \pulb \pulc \puld \endnumbering\end{Leftside} \begin{Rightside}\beginnumbering \purb \purc \purd \endnumbering\end{Rightside} \end{pages} \Pages
\end{document}
The aim is to have four columns of text facing over two pages with synched paragraphs.
So far I get the behavior that I want, but the paragraphs on the two pages are out of sync. The tables themselves look nice though. So I assume that the tables somehow block the linecounter from working in the correct way, as the lineation on both sides is also not increased in the way it should be.
Here you can see the problem:
Related
This code takes 10 seconds to compile to a pdf. If I enable in the code the additional lines it takes 2 minutes to compile for the 5 lines. And this happens everytime.
Why does it take so long, and how can I prevent it?
The system is texlive on windows with latest packages:
This is LuaHBTeX, Version 1.15.0 (TeX Live 2022) (format=lualatex 2022.12.10) 17 DEC 2022 20:53
restricted system commands enabled.
LaTeX2e <2022-11-01> patch level 1
Lua module: luaotfload 2022-10-03 3.23 Lua based OpenType font support
This is the code
% !TeX encoding=utf8
% !TeX program = lualatex
\documentclass{article}
\usepackage{fontspec}
\usepackage{amsmath}
\usepackage{unicode-math}
\usepackage{tabularray}
\usepackage{xcolor}
\begin{document}
\newcommand{\fontstring}{Sphinx of black quartz, judge my vow.}
\newcommand{\mathstring}{$f(u,v) = \iiint \left[u\nabla^{2}v+\left(\nabla u,\nabla v\right)\right]\mathrm{d}^{3}V$}
\colorlet{tablerowcolor}{gray!10}
\colorlet{tablesubheadcolor}{azure3!30}
{ % start a group
\small\renewcommand{\arraystretch}{1.4}\sffamily
% the table
\begin{longtblr}[
caption = {Font examples},
label = {tab:doc:Font:Gallery}]
{
colspec = {X[1,l]>{\ttfamily}X[2,l]},
width = 1.0\textwidth,
row{odd} = {bg=tablerowcolor},
row{1} = {bg=azure3, fg=white, font=\sffamily\upshape},
rowhead = 1,
rowfoot = 0,
}
\hline % Table Header
Font & Example \\
\hline %
%
\SetCell[c=2]{l,bg=tablesubheadcolor} Latin Modern Family \\
Latin Modern Roman & \setmainfont{Latin Modern Roman} \rmfamily \fontstring \\
Latin Modern Sans & \setsansfont{Latin Modern Sans} \sffamily\fontstring \\
Latin Modern Mono & \setmonofont{Latin Modern Mono} \ttfamily \fontstring \\
%
\SetCell[c=2]{l,bg=tablesubheadcolor} Math Fonts \\
%
Latin Modern Math & \setmathfont{Latin Modern Math} \rmfamily \mathstring \\
% TeX Gyre Termes Math & \setmathfont{TeX Gyre Termes Math} \rmfamily \mathstring \\
% TeX Gyre Pagella Math & \setmathfont{TeX Gyre Pagella Math} \rmfamily \mathstring \\
% Charter - math version & \setmathfont{XCharter-Math.otf} \rmfamily \mathstring \\
% Garamond math version & \setmathfont{Garamond-Math} \rmfamily \mathstring \\
% Cambria Math & \setmathfont{Cambria Math} \rmfamily \mathstring \\
% %
\hline
%
\end{longtblr}
} % close the group
\end{document}
I am currently writing a report with many labels. All of them are working very well (section, figure, equations, ...) but not the labels of tables. Indeed, as I refer to any table, the pdf shows the label of the first table I defined...
I thought it may be due to one package I am using but I did not find out how to fix my issue.
\documentclass[a4paper,12pt,twoside,openright]{report}
\usepackage{array}
\usepackage{babel}
\usepackage{datatool}
\usepackage{environ}
\usepackage[T1]{fontenc}
\usepackage{fancyhdr}
\usepackage[top=0.5cm, bottom=0.5cm, left=2cm, right=2cm]{geometry}
\usepackage{graphicx}
\usepackage{enumitem}
\usepackage[
bookmarks = true,% % Signets
bookmarksnumbered = true,% % Signets numérotés%
bookmarksopen = true,% % Signets ouverts
colorlinks = true,% % Liens en couleur : true ou false
urlcolor = blue,% % Couleur des liens externes
linkcolor = black,% % Couleur des liens internes
citecolor = black,% % Couleur des citations
]{hyperref}%
\usepackage{ifthen}
\usepackage{indentfirst}
\usepackage[utf8]{inputenc}
\usepackage{lmodern}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{bm}
\usepackage{makeidx}
\usepackage{stmaryrd}
\usepackage{tocbibind}
\usepackage{url}
\usepackage{pstricks}
\usepackage{xcolor}
\usepackage{placeins}
\begin{document}
\chapter{Table chapter}
\label{ch:table}
\section{Table section}
\label{sec:table}
\paragraph{}
Let's begin with Chapter~\ref{ch:table} and Section~\ref{sec:table}.
\paragraph{}
Here is Table~\ref{tab:success}.
\begin{table}[ht] \label{tab:success}
\centering
\begin{tabular}{|c|c|}
\hline
State & Success ? \\
\hline
Good & $\checkmark$ \\
\hline
\end{tabular}
\caption{Table of success.}
\end{table}
\begin{table}[ht] \label{tab:defeat}
\centering
\begin{tabular}{|c|c|}
\hline
State & Success ? \\
\hline
Bad & $\times$ \\
\hline
\end{tabular}
\caption{Table of defeat.}
\end{table}
\paragraph{}
But there is also Table~\ref{tab:defeat}.
\end{document}
The output is :
The output of the previous code
As you can see the second label is "1.1" and should be "1.2"...
What am I doing wrong?
Labels must never be before the caption -- they must be either after the caption or within the caption.
Unrelated to your problem, but hyperref should be loaded after the other packages (there are only a handful exceptions of packages which go after hyperref, e.g. cleveref)
\documentclass[a4paper,12pt,twoside,openright]{report}
\usepackage{array}
\usepackage{babel}
\usepackage{datatool}
\usepackage{environ}
\usepackage[T1]{fontenc}
\usepackage[top=0.5cm, bottom=0.5cm, left=2cm, right=2cm]{geometry}
\usepackage{fancyhdr}
\usepackage{graphicx}
\usepackage{enumitem}
\usepackage{ifthen}
\usepackage{indentfirst}
\usepackage[utf8]{inputenc}
\usepackage{lmodern}
\usepackage{amsmath}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{bm}
\usepackage{makeidx}
\usepackage{stmaryrd}
\usepackage{tocbibind}
\usepackage{url}
\usepackage{pstricks}
\usepackage{xcolor}
\usepackage{placeins}
\usepackage[
bookmarks = true,% % Signets
bookmarksnumbered = true,% % Signets numérotés%
bookmarksopen = true,% % Signets ouverts
colorlinks = true,% % Liens en couleur : true ou false
urlcolor = blue,% % Couleur des liens externes
linkcolor = black,% % Couleur des liens internes
citecolor = black,% % Couleur des citations
]{hyperref}%
\begin{document}
\chapter{Table chapter}
\label{ch:table}
\section{Table section}
\label{sec:table}
\paragraph{}
Let's begin with Chapter~\ref{ch:table} and Section~\ref{sec:table}.
\paragraph{}
Here is Table~\ref{tab:success}.
\begin{table}[ht]
\centering
\begin{tabular}{|c|c|}
\hline
State & Success ? \\
\hline
Good & $\checkmark$ \\
\hline
\end{tabular}
\caption{Table of success.}
\label{tab:success}
\end{table}
\begin{table}[ht]
\centering
\begin{tabular}{|c|c|}
\hline
State & Success ? \\
\hline
Bad & $\times$ \\
\hline
\end{tabular}
\caption{Table of defeat.}
\label{tab:defeat}
\end{table}
\paragraph{}
But there is also Table~\ref{tab:defeat}.
\end{document}
I am trying to insert vertical and horizontal lines inside a matrix to divide it into 4 sections. I would like my matrix to look matrix 4.7 in Matrix Population Models by Dr. Caswell.
Please see my try below. How do I improve the code? Thanks a lot in advance.
$$A_{m,4} =
\begin{pmatrix}
a_{1,1} & a_{1,2} | & a_{1,3} & a_{1,n} \\
a_{2,1} & a_{2,2} | & a_{2,3} & a_{2,4} \\
----- | ----\\
a_{m,1} & a_{m,2} & a_{m,3} & a_{m,4}
\end{pmatrix}$$
You can use the following latex code in your RMD file:
$$A_{m,4} =
\left(
\begin{array}{cc|cc}
a_{1,1} & a_{1,2} & a_{1,3} & a_{1,n} \\
a_{2,1} & a_{2,2} & a_{2,3} & a_{2,4} \\
\hline
a_{m,1} & a_{m,2} & a_{m,3} & a_{m,4}
\end{array} \right)$$
The result:
Here is the LaTeX code for my table:
\begin{table}{| c || c | c | c || c | c | c | }
\caption{Examples of the concepts. \label{tab:conceptsimgs}}\\
\hline
\backslashbox{Concept}{Class} &\multicolumn{3}{|c||}{Negative Class} & \multicolumn{3}{|c|}{Positive Class} \\
\hline
\forloop{themenumber}{1}{\value{themenumber} < 4}{
%\hline
\arabic{themenumber}
\forloop{classnumber}{0}{\value{classnumber} < 2}{
\forloop{imagenumber}{1}{\value{imagenumber} < 4}{
& 0
}
}
\\
\hline
}
\end{table}
Something is wrong in the result however. There is some extra thing at the end of the table, as shown in here:
http://www. freeimagehosting. net/image.php?c702bfc838.png
How can I fix it?
That's a nasty one. I've created a minimal example that demonstrates the problem, see below. Try to compile this and take a look at the results.
The point is, you seem to be out of luck — tabular does not like the output of forloop, it cannot disregard the last \addtocounter command. Maybe you can find some other package for loops.
You should be able to figure out the rest from the code below, if not, write a comment.
\documentclass{article}
\usepackage{forloop}
\newcounter{themenumber}
\newcounter{test}
\begin{document}
% this is your table (minimal example)
\begin{tabular}{| c |}
\forloop{themenumber}{1}{\value{themenumber} < 2}{x\\ \hline}
\end{tabular}
\vspace{2cm}
% this is what you wanted to have
\begin{tabular}{| c |}
x \\ \hline
\end{tabular}
\vspace{2cm}
% this is what forloop produces
\begin{tabular}{| c |}
x \\ \hline \addtocounter{test}{1}
\end{tabular}
\end{document}
Any table I define with "sidewaystable" appears at the last page of created pdf file. How can I solve this?
\begin{sidewaystable}[h]
\caption{Blah Measurements}
\centering % centering table
\begin{tabular}{c c c c c c c c c c}
\hline\hline % inserting double-line
A & B & \multicolumn{3}{c}{C} & C Time + & D & \multicolumn{3}{c}{D Signal} \\
ID & ID & \multicolumn{3}{c}{Coordinates} & Time Diff. & Time & \multicolumn{3}{c}{Parameters} \\ [0.5ex]
\hline % inserts single-line
1 & 1 & 4415633.126837 & 482211.909079 & 939.450000 & 06:07:40 & 06:07:40 & -85 dBm & 6 dB & 5 dBm \\
\hline
\end{tabular}
\label{tab:combined}
\end{sidewaystable}
Have you tried the something like htbp for the placement of the float object?
\begin{sidewaystable}[htbp]
...
\end{sidewaystable}
Just use \clearpage \newpage before \begin{sidewaystable} and \clearpage after the \end{sidewaystable}..
It works without any floats like H, h!, htpb, etc.
you can try and use \begin{table}[h!] -- the ! will try and tell latex to force your table into the exact spot. I've had hit or miss results.
Also, with the float package, you can use a capital H \begin{table}[H] to keep your table from floating.