LaTeX forum ⇒ Generalsort the numbers with latex Topic is solved

LaTeX specific issues not fitting into one of the other forums of this category.
pasbal
Posts: 12
Joined: Thu Jun 26, 2014 10:00 pm

sort the numbers with latex

Postby pasbal » Thu Jun 26, 2014 10:11 pm

First, forgive my faults in English. The text is translated by Google. Secondly, I am new on latex and i have no knowledge on programmation.
I use a free software to test my pupils. (here the link http://home.gna.org/auto-qcm/).

The author modified some instructions and created some news:
  1. \newcount\AMCid@etud\AMCid@etud=0

  1. \def\AMClabel#1{\expandafter\label{\the\AMCid@etud-#1}}

  1. \def\AMCref#1{\expandafter\ref{\the\AMCid@etud-#1}}

  1. \def\AMCpageref#1{\expandafter\pageref{\the\AMCid@etud-#1}}

  1. \newcommand{\AMCqlabel}[1]{%
  2. \protected@write\@auxout{}{\string\newlabel{\the\AMCid@etud-#1}{{\arabic{AMCquestionaff}}{\thepage}}}%


The software may create many exams sheets in random order.

When i want to label a question, i type
  1. \AMCqlabel{questa}, \AMCqlabel{questb}
and so on.
If i refer to many questions, i have to type
  1. \AMCref{questa},\AMCref{questb} or \AMCpageref{questa}


But, the question's number and page are not sorted in ascending order. The questions are shuffled.
I asked the author a solution and he advised me to load the package cleveref but it does not work.

So, do you have an idea to sort the numbers with latex.

Thanks et regards.

Tags:

pasbal
Posts: 12
Joined: Thu Jun 26, 2014 10:00 pm

Postby pasbal » Wed Aug 06, 2014 6:47 pm

Hello,

My first topic (http://latex-community.org/forum/viewtopic.php?f=5&t=24918) seems difficult to resolve (Is there a code, macro in latex language to sort the number ?).
So, I change my way of thinking and i will try something different.

I noticed the labels was writen in a file (*.aux). Is it possible to open this file and search some words or character then copy and paste them in the file *.tex (as the package xstring do it) ?

Thanks for help.

User avatar
Johannes_B
Site Moderator
Posts: 4044
Joined: Thu Nov 01, 2012 4:08 pm

Postby Johannes_B » Wed Aug 06, 2014 7:14 pm

One reason i didn't answer your previous post was a lack of time on the one hand and utter confusion on the other. Preparing a minimal working example helps us to understand the problem.

All files written and read are simple text files. You can open them with any texteditor (notepad, gedit, mousepad).
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.

pasbal
Posts: 12
Joined: Thu Jun 26, 2014 10:00 pm

Postby pasbal » Thu Aug 07, 2014 12:30 pm

automultiplechoice.sty
the package
(57.88 KiB) Downloaded 203 times
EMC.tex
example
(1.96 KiB) Downloaded 185 times
Hello,

Find an example.

Thanks for help.

i can't attach more one file, i will attach the AMC package file and the manual in other posts.
Last edited by pasbal on Thu Aug 07, 2014 12:35 pm, edited 1 time in total.

pasbal
Posts: 12
Joined: Thu Jun 26, 2014 10:00 pm

Postby pasbal » Thu Aug 07, 2014 12:34 pm

the manual file is too big. You can download here :

  1. http://email.wesend.com/wf/click?upn=cFm7F9dBPd176JMbFB1jVjvUlIn829yKvg1QnOy920ZNe0HBWTslZAfnSnT1mPUUdRi4RRL9aIgGbdoC75ho2w-3D-3D_VT7h1XVDCIPdQxtnAWzTH6bx-2Bro9gPjl4Cqsu4Z97SRmXT6b2LWdAxbMvlG0oSv7gC7ewtDECfz1grBYCldhWhQ6MJhoBgrDLR0v3BJOo3eL302Yf91KzBhvjwHI0y9cezoaT6XHIOEUf3VdYmzYMeLOhUDxQEdAhCYGwIxwfMFY5nbtB2XZwJNGIZffbpUtmtj-2FZJkyKIX33gf8GabLVyaNQNS-2FjCJ2Bf1UG0PgU4g1JwbRJz9iLM7wuKenA72aTSZ6mfafyvPoHY9h4tQn4azWCh-2FPpO6QnR9Goh8zf46kNzENzZRsanWgeEH-2F8WvHFvTG1Rjs9k1jjGInjzNnAfXJjf7gFUaLDSZf88d87jiUyt-2B9vjeNMO07CnIw04c3fZ00HXCRiSgPO79rzectB69t3Hfw4NmOQhnuduRR7EFZQtyyYiPgtAV0ytKVn8BAXL2g91curUXGujN72Mxy6Q-3D-3D

User avatar
Johannes_B
Site Moderator
Posts: 4044
Joined: Thu Nov 01, 2012 4:08 pm

Postby Johannes_B » Fri Aug 08, 2014 2:28 pm

Package cleveref can do that in general:
  1. \documentclass{article}
  2. \usepackage{cleveref}
  3.  
  4. \begin{document}
  5. \section{}
  6. \label{A}
  7. \section{}
  8. \label{B}
  9. \section{}
  10. \label{C}
  11. \cref{B,C,A}
  12. \end{document}
  13.  


With your package, a lot of commands are introduced because different shuffled worksheets are output. One would need to redefine the internals of the package and i think the maintainer should do so.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.

pasbal
Posts: 12
Joined: Thu Jun 26, 2014 10:00 pm

Postby pasbal » Sat Aug 09, 2014 9:06 pm

Hello,

I tried with the Package cleveref but as the sheets are shuffled some errors appeared.
I already asked to the maintener but he answered the same idea as yours.

Thank a lot for help.

pasbal
Posts: 12
Joined: Thu Jun 26, 2014 10:00 pm

Postby pasbal » Tue Aug 19, 2014 4:15 pm

The software's maintener modified the code and the problem is fixed.


Return to “General”

Who is online

Users browsing this forum: No registered users and 3 guests