Skip to content

Commit

Permalink
closes #4
Browse files Browse the repository at this point in the history
  • Loading branch information
cysouw committed Feb 25, 2021
1 parent 95bf37e commit f49f012
Show file tree
Hide file tree
Showing 14 changed files with 37 additions and 19 deletions.
5 changes: 4 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# pandoc-ling 1.5

# pandoc-ling 1.4

- adding option to use bullet lists for example entry. Will still be transformed into labelled list.
Expand All @@ -6,13 +8,14 @@

- fixed gb4e error prevented by adding `\noautomath` to preamble
- fixed gb4e error with cross-referencing because of wrong placement of `\label` statement
- fixed latex error when using special symbols in judgements (closes #4, thx @CLRafaelR)

# pandoc-ling 1.3.1

## bugs

- fixed bug with not-appearing header of interlinear in HTML output
- fixed bug with judgements in single-line examples
- fixed bug with judgements in single-line examples (closes #3, thx @CLRafaelR)

# pandoc-ling 1.3

Expand Down
7 changes: 3 additions & 4 deletions pandoc-ling.lua
Original file line number Diff line number Diff line change
Expand Up @@ -910,7 +910,6 @@ end

--------------------------
-- make markup in Latex
-- using langsci-gb4e
--------------------------

-- convenience functions for Latex
Expand Down Expand Up @@ -991,7 +990,7 @@ function texMakeExpex (parsedDiv)
judgeMax = judgements[i]
end
end
local judgeOffset = "[*="..pandoc.utils.stringify(judgeMax).."]"
local judgeOffset = "[*="..string.gsub(pandoc.utils.stringify(judgeMax), "([#$%&_{}~^])", "\\%1").."]"

for i=1,#kind do
if judgements[i] == nil then
Expand Down Expand Up @@ -1186,7 +1185,7 @@ function texMakeGb4e (parsedDiv)
judgeMax = judgements[i]
end
end
local judgeOffset = "\\judgewidth{"..pandoc.utils.stringify(judgeMax).."}"
local judgeOffset = "\\judgewidth{"..string.gsub(pandoc.utils.stringify(judgeMax), "([#$%&_{}~^])", "\\%1").."}"

for i=1,#kind do
if judgements[i] == nil then
Expand Down Expand Up @@ -1287,7 +1286,7 @@ function texMakeLangsci (parsedDiv)
judgeMax = judgements[i]
end
end
local judgeOffset = "\\judgewidth{"..pandoc.utils.stringify(judgeMax).."}"
local judgeOffset = "\\judgewidth{"..string.gsub(pandoc.utils.stringify(judgeMax), "([#$%&_{}~^])", "\\%1").."}"

for i=1,#kind do
if judgements[i] == nil then
Expand Down
3 changes: 2 additions & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,8 @@ For the lazy writers among us, it is also possible to use a simple bullet list i
```
:::ex
- This is a lazy example.
- ^* It should return letters at the start just as before.
- ^# It should return letters at the start just as before.
- ^% Also testing some unusual judgements.
:::
```

Expand Down
Binary file modified tests/readme.docx
Binary file not shown.
Binary file modified tests/readme.epub
Binary file not shown.
11 changes: 9 additions & 2 deletions tests/readme.html
Original file line number Diff line number Diff line change
Expand Up @@ -667,7 +667,8 @@ <h2 data-number="4.2" id="interlinear-examples"><span class="header-section-numb
<p>For the lazy writers among us, it is also possible to use a simple bullet list instead of a labelled list. Note that the listed elements will still be formatted as a labelled list.</p>
<pre><code>:::ex
- This is a lazy example.
- ^* It should return letters at the start just as before.
- ^# It should return letters at the start just as before.
- ^% Also testing some unusual judgements.
:::</code></pre>
<div id="ex:4.12">
<table class="linguistic-example">
Expand All @@ -682,9 +683,15 @@ <h2 data-number="4.2" id="interlinear-examples"><span class="header-section-numb
<tr class="even">
<td></td>
<td style="text-align: left;" class="linguistic-example-label">b.</td>
<td style="text-align: right;" class="linguistic-example-judgement">*</td>
<td style="text-align: right;" class="linguistic-example-judgement">#</td>
<td style="text-align: left;" class="linguistic-example-content">It should return letters at the start just as before.</td>
</tr>
<tr class="odd">
<td></td>
<td style="text-align: left;" class="linguistic-example-label">c.</td>
<td style="text-align: right;" class="linguistic-example-judgement">%</td>
<td style="text-align: left;" class="linguistic-example-content">Also testing some unusual judgements.</td>
</tr>
</tbody>
</table>
</div>
Expand Down
Binary file modified tests/readme_expex.pdf
Binary file not shown.
8 changes: 5 additions & 3 deletions tests/readme_expex.tex
Original file line number Diff line number Diff line change
Expand Up @@ -594,14 +594,16 @@ \subsection{Interlinear examples}\label{interlinear-examples}}
\begin{verbatim}
:::ex
- This is a lazy example.
- ^* It should return letters at the start just as before.
- ^# It should return letters at the start just as before.
- ^% Also testing some unusual judgements.
:::
\end{verbatim}

\begin{samepage}
\pex[*=*]<ex:12>
\pex[*=\#]<ex:12>
\a This is a lazy example.
\a \ljudge{*}It should return letters at the start just as before.
\a \ljudge{\#}It should return letters at the start just as before.
\a \ljudge{\%}Also testing some unusual judgements.
\xe
\end{samepage}

Expand Down
Binary file modified tests/readme_gb4e.pdf
Binary file not shown.
8 changes: 5 additions & 3 deletions tests/readme_gb4e.tex
Original file line number Diff line number Diff line change
Expand Up @@ -608,16 +608,18 @@ \subsection{Interlinear examples}\label{interlinear-examples}}
\begin{verbatim}
:::ex
- This is a lazy example.
- ^* It should return letters at the start just as before.
- ^# It should return letters at the start just as before.
- ^% Also testing some unusual judgements.
:::
\end{verbatim}

\begin{samepage}
\begin{exe} \judgewidth{*}
\begin{exe} \judgewidth{\#}
\ex
\begin{xlist}
\ex [] { This is a lazy example. }
\ex [*] { It should return letters at the start just as before. }
\ex [\#] { It should return letters at the start just as before. }
\ex [\%] { Also testing some unusual judgements. }
\end{xlist}
\label{ex:4.12}
\end{exe}
Expand Down
Binary file modified tests/readme_langsci-gb4e.pdf
Binary file not shown.
8 changes: 5 additions & 3 deletions tests/readme_langsci-gb4e.tex
Original file line number Diff line number Diff line change
Expand Up @@ -586,14 +586,16 @@ \subsection{Interlinear examples}\label{interlinear-examples}}
\begin{verbatim}
:::ex
- This is a lazy example.
- ^* It should return letters at the start just as before.
- ^# It should return letters at the start just as before.
- ^% Also testing some unusual judgements.
:::
\end{verbatim}

\begin{samepage}
\ea \judgewidth{*} \label{ex:4.12}
\ea \judgewidth{\#} \label{ex:4.12}
\ea [] { This is a lazy example. }
\ex [*] { It should return letters at the start just as before. }
\ex [\#] { It should return letters at the start just as before. }
\ex [\%] { Also testing some unusual judgements. }
\z
\z
\end{samepage}
Expand Down
Binary file modified tests/readme_linguex.pdf
Binary file not shown.
6 changes: 4 additions & 2 deletions tests/readme_linguex.tex
Original file line number Diff line number Diff line change
Expand Up @@ -593,15 +593,17 @@ \subsection{Interlinear examples}\label{interlinear-examples}}
\begin{verbatim}
:::ex
- This is a lazy example.
- ^* It should return letters at the start just as before.
- ^# It should return letters at the start just as before.
- ^% Also testing some unusual judgements.
:::
\end{verbatim}

\begin{samepage}

\ex. \label{ex:4.12}
\a. This is a lazy example.
\b. *It should return letters at the start just as before.
\b. \#It should return letters at the start just as before.
\b. \%Also testing some unusual judgements.

\end{samepage}

Expand Down

0 comments on commit f49f012

Please sign in to comment.